/* ================================================================
   FAMS — Single application stylesheet
   ----------------------------------------------------------------
   This is the only stylesheet the application loads (after
   bootstrap.css). It has two layers, in this order:

     0. LEGACY BASE — the pre-existing rules, kept verbatim so the
        cascade is unchanged. It defines no colours, sizes or radii
        of its own: every legacy token name is an alias for a design
        token declared in section 1 below.
     1+. DESIGN SYSTEM — the single source of truth. Palette, type
        scale, spacing scale, radii, elevation and every component.

   Rules for adding CSS:
     - Put new work in the design-system layer, never in layer 0.
     - No !important, except the badge/text-colour aliases (section 10)
       and the status chips (section 23), which must beat Bootstrap's
       !important utilities.
     - Spacing uses the 4 px scale (--app-1 .. --app-10); type uses
       --app-text-11/12/13/14/16/20/24. Never write a bare px padding
       or font size.
   ================================================================ */

/* ================================================================
   0. LEGACY BASE LAYER
   ----------------------------------------------------------------
   Loaded first so the design system can override it. Its :root block
   aliases legacy token names (--primary, --gray-300, ...) to the
   --app-* tokens declared in section 1. CSS custom properties resolve
   at computed-value time, so the alias block may appear before the
   tokens it points at.
   ================================================================ */

/* ============================================
   TOKEN ALIASES — every legacy name maps to a design token
   ============================================ */

:root {
  /* Brand → the single app accent */
  --primary-subtle: var(--app-accent-soft);
  --primary-50: var(--app-accent-soft);
  --primary-100: var(--app-accent-soft);
  --primary-200: var(--app-accent-border);
  --primary: var(--app-accent);
  --primary-dark: var(--app-accent-hover);
  --primary-darker: var(--app-accent-hover);
  --primary-light: var(--app-accent);

  /* Semantic → app semantic set */
  --success: var(--app-success);
  --success-light: var(--app-success-soft);
  --success-dark: var(--app-success);
  --warning: var(--app-warning);
  --warning-light: var(--app-warning-soft);
  --warning-dark: var(--app-warning);
  --danger: var(--app-danger);
  --danger-light: var(--app-danger-soft);
  --danger-dark: var(--app-danger);
  --info: var(--app-info);
  --info-light: var(--app-info-soft);
  --info-dark: var(--app-info);

  /* Neutrals → the app surface / line / text ramp.
     The 25–950 scale collapses onto the eight app neutrals: legacy
     rules keep their intent (a border is a border, muted text is
     muted text) without inventing shades the design system lacks. */
  --gray-25: var(--app-surface);
  --gray-50: var(--app-bg);
  --gray-100: var(--app-surface-3);
  --gray-150: var(--app-border);
  --gray-200: var(--app-border);
  --gray-300: var(--app-border-strong);
  --gray-400: var(--app-text-3);
  --gray-500: var(--app-text-3);
  --gray-600: var(--app-text-3);
  --gray-700: var(--app-text-2);
  --gray-800: var(--app-text);
  --gray-900: var(--app-text);
  --gray-950: var(--app-text);

  /* Layout → the shell dimensions app.css actually renders.
     These previously disagreed (280/80/64 vs 260/64/56), which left
     the collapsed rail and the content offset on different widths. */
  --sidebar-width: var(--app-sidebar);
  --sidebar-collapsed: var(--app-sidebar-collapsed);
  --header-height: var(--app-header);

  /* Radius → one 6/8/10 scale. Every legacy large radius resolves to
     the card radius so no surface is rounder than a card. */
  --radius-xs: var(--app-r-xs);
  --radius-sm: var(--app-r-sm);
  --radius: var(--app-r-md);
  --radius-lg: var(--app-r-md);
  --radius-xl: var(--app-r-md);
  --radius-2xl: var(--app-r-md);
  --radius-full: 999px;

  /* Type → the app type scale */
  --text-xs: var(--app-text-12);
  --text-sm: var(--app-text-14);
  --text-base: var(--app-text-14);
  --text-lg: var(--app-text-16);
  --text-xl: var(--app-text-20);
  --text-2xl: var(--app-text-24);
  --text-3xl: var(--app-text-24);

  /* Elevation → flat surfaces, shadow only for floating layers
     (dropdowns, popovers, toasts, modals). */
  --shadow-xs: none;
  --shadow-sm: none;
  --shadow: none;
  --shadow-md: var(--app-shadow-pop);
  --shadow-lg: var(--app-shadow-pop);
  --shadow-xl: var(--app-shadow-pop);
  --shadow-2xl: var(--app-shadow-pop);

  /* Motion */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Focus */
  --focus-ring: 0 0 0 3px var(--app-accent-soft);
  --focus-ring-color: var(--app-accent-border);
}

* {
  font-family: 'Inter', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

::selection {
  background: var(--app-accent-soft);
  color: var(--app-text);
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  font-size: var(--text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  transition: background-color var(--transition-base), color var(--transition-base);
}

/* Smooth page entrance */
.page-content {
  animation: pageIn 0.35s ease-out;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 0.5em;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-base); font-weight: 600; }
h6 { font-size: var(--text-sm); font-weight: 600; }

p {
  color: var(--gray-600);
  line-height: 1.7;
  margin-bottom: 1em;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-15px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.12); }
  50% { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-right: 1px solid var(--gray-200);
  z-index: 1000;
  transition: all var(--transition-slow);
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: var(--shadow-sm);
}

.sidebar::-webkit-scrollbar {
  width: 5px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: var(--app-r-md);
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

.sidebar-brand {
  padding: var(--app-5);
  display: flex;
  align-items: center;
  gap: var(--app-4);
  border-bottom: 1px solid var(--gray-100);
  text-decoration: none;
  transition: all var(--transition-fast);
  min-height: var(--header-height);
}

.sidebar-brand:hover {
  background: var(--gray-50);
}

.sidebar-brand-icon {
  width: 40px;
  height: 40px;
  background: var(--app-accent);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: var(--app-text-16);
  flex-shrink: 0;
  box-shadow: 0 8px 16px -4px rgba(99, 102, 241, 0.35);
}

.sidebar-brand-text {
  color: var(--gray-900);
  font-size: var(--app-text-20);
  font-weight: 700;
  letter-spacing: -0.5px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.menu-link {
  display: flex;
  align-items: center;
  gap: var(--app-3);
  padding: var(--app-3) var(--app-4);
  color: var(--gray-600);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  font-weight: 500;
  font-size: var(--app-text-14);
  position: relative;
}

.menu-link:hover {
  color: var(--primary);
  background: var(--primary-50);
  transform: translateX(2px);
}

.menu-link i {
  width: 20px;
  text-align: center;
  font-size: var(--app-text-16);
  flex-shrink: 0;
}

.menu-link .badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: var(--app-text-11);
  padding: var(--app-1) var(--app-2);
  border-radius: var(--radius-full);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.menu-link .arrow.rotate {
  transform: rotate(90deg);
  color: var(--gray-600);
}

/* Submenu */

.submenu.show {
  max-height: 500px;
}

.submenu .menu-link {
  padding-left: 46px;
  font-size: var(--app-text-13);
  font-weight: 400;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left var(--transition-slow);
  display: flex;
  flex-direction: column;
}

/* ============================================
   TOP HEADER
   ============================================ */

.top-header {
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--app-6);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-xs);
  transition: background-color var(--transition-base), border-color var(--transition-base);
}

.sidebar-toggle {
  background: none;
  border: none;
  font-size: var(--app-text-20);
  color: var(--gray-500);
  cursor: pointer;
  padding: var(--app-2);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.header-search-wrapper {
  position: relative;
  flex: 1;
  max-width: 420px;
  margin: 0 28px;
}

.header-search-wrapper i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: var(--app-text-14);
}

.header-search input {
  width: 100%;
  padding: var(--app-2) 84px var(--app-2) 42px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: var(--app-text-14);
  background: var(--gray-50);
  transition: all var(--transition-fast);
  color: var(--gray-800);
}

.header-search input:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: var(--focus-ring);
}

.header-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  color: var(--gray-500);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.header-btn:hover {
  background: var(--gray-100);
  color: var(--primary);
  transform: translateY(-1px);
}

.header-btn .notification-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: var(--app-3);
  padding: var(--app-1) var(--app-3) var(--app-1) var(--app-1);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  color: inherit;
  margin-left: 4px;
}

.user-info {
  text-align: left;
}

.user-name {
  font-weight: 600;
  font-size: var(--app-text-14);
  color: var(--gray-900);
  line-height: 1.3;
}

.user-role {
  font-size: var(--app-text-12);
  color: var(--gray-500);
  line-height: 1.3;
}

/* ============================================
   PAGE CONTENT
   ============================================ */

.page-content {
  padding: var(--app-6);
  animation: pageIn 0.35s ease-out;
  flex: 1;
}

/* ============================================
   REPORT HERO SECTION
   ============================================ */

.report-hero {
  background: var(--app-accent);
  border-radius: var(--radius-2xl);
  padding: var(--app-8) var(--app-8);
  margin-bottom: var(--app-6);
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.report-hero h2 {
  color: white;
  font-size: var(--app-text-24);
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.report-hero .subtitle {
  color: rgba(255, 255, 255, 0.75);
  font-size: var(--text-base);
  position: relative;
  z-index: 1;
}

.report-back-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--app-2);
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: var(--app-text-13);
  font-weight: 500;
  padding: var(--app-1) var(--app-4);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all var(--transition-fast);
  position: relative;
  z-index: 1;
  margin-bottom: var(--app-3);
}

/* ============================================
   STATS GRID (Report Summary Cards)
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--app-4);
  margin-top: 20px;
  position: relative;
  z-index: 1;
}

.stat-box {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: var(--app-4) var(--app-5);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--app-accent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.stat-box:hover::before {
  opacity: 1;
}

/* ============================================
   REPORT SELECT CARD
   ============================================ */

.report-select-card {
  background: white;
  border-radius: var(--radius-2xl);
  padding: var(--app-8);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  animation: scaleIn 0.4s ease-out;
}

.report-select-card .card-icon {
  width: 72px;
  height: 72px;
  background: var(--app-accent-soft);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: var(--app-text-24);
  color: var(--primary);
  box-shadow: 0 8px 20px -8px rgba(99, 102, 241, 0.25);
}

.report-select-card h2 {
  font-size: var(--app-text-20);
  margin-bottom: var(--app-2);
}

.report-select-card .form-label {
  font-weight: 600;
  font-size: var(--app-text-13);
  color: var(--gray-700);
  margin-bottom: var(--app-1);
  display: flex;
  align-items: center;
  gap: var(--app-1);
}

.report-select-card .form-label i {
  color: var(--primary);
  font-size: var(--app-text-14);
}

.report-select-card .form-select,
.report-select-card .form-control {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: var(--app-3) var(--app-4);
  font-size: var(--app-text-14);
  background: var(--gray-50);
  transition: all var(--transition-fast);
}

.report-select-card .form-select:focus,
.report-select-card .form-control:focus {
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
  background: white;
}

.btn-generate {
  background: var(--app-accent);
  color: white;
  border: none;
  padding: var(--app-4) var(--app-8);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: var(--app-text-14);
  transition: all var(--transition-base);
  box-shadow: 0 8px 20px -6px rgba(99, 102, 241, 0.4);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--app-2);
  letter-spacing: 0.2px;
}

.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -8px rgba(99, 102, 241, 0.5);
  color: white;
}

.btn-generate:active {
  transform: translateY(0);
}

/* ============================================
   REPORT CONTAINER & TABLE
   ============================================ */

.report-container {
  background: white;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  animation: scaleIn 0.4s ease-out;
}

/* ============================================
   MODERN TABLE (Quarterly & Annual)
   ============================================ */

.rpt-table {
  width: 100%;
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.rpt-table thead th {
  background: var(--gray-900);
  color: white;
  font-weight: 600;
  font-size: var(--app-text-12);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: var(--app-4) var(--app-4);
  border: none;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}

.rpt-table thead th:first-child {
  border-radius: 0;
}

.rpt-table tbody td {
  padding: var(--app-3) var(--app-4);
  border-bottom: 1px solid var(--gray-100);
  font-size: var(--app-text-13);
  color: var(--gray-700);
  vertical-align: middle;
  transition: background var(--transition-fast);
}

.rpt-table tbody tr:last-child td {
  border-bottom: none;
}

.rpt-table .section-header td {
  font-weight: 700;
  font-size: var(--app-text-13);
  color: var(--primary-dark);
  padding: var(--app-3) var(--app-4);
  border-bottom: 2px solid var(--primary-light);
  letter-spacing: 0.3px;
}

.rpt-table .section-header td i {
  margin-right: 8px;
  font-size: var(--app-text-14);
}

.rpt-table .row-total td {
  font-weight: 700;
  color: var(--gray-800);
  background: var(--gray-50);
  border-top: 2px solid var(--gray-200);
}

.rpt-table .row-nbv td {
  font-weight: 800;
  color: var(--primary-dark);
  background: var(--app-accent-soft);
  border-top: 2px solid var(--primary-light);
  font-size: var(--app-text-14);
}

.report-actions .btn {
  padding: var(--app-2) var(--app-4);
  font-size: var(--app-text-13);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
  transition: all var(--transition-fast);
}

/* Badge in hero */

/* ============================================
   DEPRECIATION RUN PAGE
   ============================================ */

.form-card {
  background: white;
  border-radius: var(--radius-2xl);
  padding: var(--app-8);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  max-width: 700px;
  margin: 0 auto;
  animation: scaleIn 0.4s ease-out;
}

.form-card .form-label {
  font-weight: 600;
  font-size: var(--app-text-13);
  color: var(--gray-700);
  margin-bottom: var(--app-1);
  display: flex;
  align-items: center;
  gap: var(--app-1);
}

.form-card .form-label i {
  color: var(--primary);
}

.form-card .form-select,
.form-card .form-control {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: var(--app-3) var(--app-4);
  font-size: var(--app-text-14);
  background: var(--gray-50);
  transition: all var(--transition-fast);
}

.form-card .form-select:focus,
.form-card .form-control:focus {
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
  background: white;
}

.formula-box {
  background: var(--app-accent-soft);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius);
  padding: var(--app-5) var(--app-6);
  position: relative;
  overflow: hidden;
}

.formula-box::before {
  content: '\f51e';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  right: -10px;
  bottom: -10px;
  font-size: 60px;
  color: rgba(99, 102, 241, 0.06);
  pointer-events: none;
}

.btn-run {
  background: var(--app-success);
  color: white;
  border: none;
  padding: var(--app-4) var(--app-8);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: var(--app-text-14);
  transition: all var(--transition-base);
  box-shadow: 0 8px 20px -6px rgba(16, 185, 129, 0.4);
  display: inline-flex;
  align-items: center;
  gap: var(--app-2);
}

.btn-run:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -8px rgba(16, 185, 129, 0.5);
  color: white;
}

/* ============================================
   CARDS
   ============================================ */

.card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  margin-bottom: var(--app-5);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--gray-300);
}

.card-header {
  background: var(--app-accent-soft);
  border-bottom: 1px solid var(--gray-100);
  padding: var(--app-5) var(--app-6);
  font-weight: 600;
  font-size: var(--app-text-16);
  color: var(--gray-900);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  display: flex;
  align-items: center;
  gap: var(--app-2);
}

.card-header i {
  color: var(--primary);
  font-size: var(--app-text-16);
}

.card-body {
  padding: var(--app-6);
}

.card-footer {
  background: var(--gray-50);
  border-top: 1px solid var(--gray-100);
  padding: var(--app-4) var(--app-6);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  font-weight: 500;
  border-radius: var(--radius-sm);
  padding: var(--app-2) var(--app-5);
  transition: all var(--transition-fast);
  border: none;
  font-size: var(--app-text-14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--app-2);
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.01em;
  cursor: pointer;
}

.btn-primary:hover {
  box-shadow: 0 8px 20px -4px rgba(99, 102, 241, 0.5);
  background: var(--app-accent);
  color: white;
}

.btn-success {
  background: var(--app-success);
  color: white;
  box-shadow: 0 4px 12px -2px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
  box-shadow: 0 8px 20px -4px rgba(16, 185, 129, 0.5);
  color: white;
}

.btn-danger {
  background: var(--app-danger);
  color: white;
  box-shadow: 0 4px 12px -2px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
  box-shadow: 0 8px 20px -4px rgba(239, 68, 68, 0.5);
  color: white;
}

.btn-warning {
  background: var(--app-warning);
  color: white;
  box-shadow: 0 4px 12px -2px rgba(245, 158, 11, 0.4);
}

.btn-warning:hover {
  box-shadow: 0 8px 20px -4px rgba(245, 158, 11, 0.5);
  color: white;
}

.btn-info {
  background: var(--app-info);
  color: white;
  box-shadow: 0 4px 12px -2px rgba(59, 130, 246, 0.4);
}

.btn-info:hover {
  box-shadow: 0 8px 20px -4px rgba(59, 130, 246, 0.5);
  color: white;
}

.btn-outline-primary {
  border: 1.5px solid var(--primary);
  color: var(--primary);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px -2px rgba(99, 102, 241, 0.4);
}

/* ============================================
   FORMS
   ============================================ */

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
  outline: none;
  background: white;
}

.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23475569' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}

.input-group-text {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  color: var(--gray-500);
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.form-check-input:checked {
  background: var(--app-accent);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* ============================================
   MODERN TABLE (General Purpose)
   ============================================ */

.table-modern {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table-modern thead th {
  background: var(--gray-900);
  color: white;
  font-weight: 600;
  font-size: var(--app-text-12);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: var(--app-4) var(--app-4);
  border: none;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}

.table-modern tbody td {
  padding: var(--app-4) var(--app-4);
  border-bottom: 1px solid var(--gray-100);
  font-size: var(--app-text-13);
  color: var(--gray-700);
  vertical-align: middle;
  transition: background var(--transition-fast);
}

.table-modern tbody tr:hover td {
  background: var(--gray-50);
}

.table-modern tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================
   TABLES (Bootstrap Overrides - General)
   ============================================ */

.table thead th {
  background: var(--gray-50);
  color: var(--gray-600);
  font-weight: 600;
  font-size: var(--app-text-12);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border: none;
  padding: var(--app-4) var(--app-4);
  white-space: nowrap;
}

.table tbody td {
  padding: var(--app-4);
  vertical-align: middle;
  border-color: var(--gray-100);
  font-size: var(--app-text-14);
}

.table tbody tr {
  transition: all var(--transition-fast);
}

.table-hover tbody tr:hover {
  background: var(--gray-50);
}

.table-bordered {
  border: 1px solid var(--gray-200);
}

.table-bordered th,
.table-bordered td {
  border: 1px solid var(--gray-200);
}

/* ============================================
   BADGES
   ============================================ */

.badge {
  font-weight: 600;
  padding: var(--app-1) var(--app-3);
  border-radius: var(--radius-sm);
  font-size: var(--app-text-12);
  display: inline-flex;
  align-items: center;
  gap: var(--app-1);
  transition: all var(--transition-fast);
  letter-spacing: 0.01em;
}

.badge:hover {
  transform: scale(1.05);
}

.bg-primary {
  background: var(--app-accent) !important;
  color: white !important;
}

.bg-purple {
  background: var(--app-accent) !important;
  color: white !important;
}

.bg-success {
  background: var(--app-success) !important;
  color: white !important;
}

.bg-danger {
  background: var(--app-danger) !important;
  color: white !important;
}

.bg-warning {
  background: var(--app-warning) !important;
  color: white !important;
}

.bg-info {
  background: var(--app-info) !important;
  color: white !important;
}

.bg-light {
  background: var(--gray-100) !important;
  color: var(--gray-700) !important;
}

/* ============================================
   ALERTS - Enhanced
   ============================================ */

.alert {
  border: none;
  border-radius: var(--radius);
  padding: var(--app-4) var(--app-5);
  margin-bottom: var(--app-5);
  border-left: 4px solid;
  animation: slideIn 0.3s ease-out;
  background: white;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: var(--app-3);
  position: relative;
  overflow: hidden;
}

.alert i {
  font-size: var(--app-text-16);
  flex-shrink: 0;
}

.alert-success {
  background: var(--success-light);
  color: var(--success-dark);
  border-left-color: var(--success);
}

.alert-danger {
  background: var(--danger-light);
  color: var(--danger-dark);
  border-left-color: var(--danger);
}

.alert-info {
  background: var(--info-light);
  color: var(--info-dark);
  border-left-color: var(--info);
}

.alert-warning {
  background: var(--warning-light);
  color: var(--warning-dark);
  border-left-color: var(--warning);
}

/* ============================================
   DROPDOWNS
   ============================================ */

.dropdown-menu {
  animation: scaleIn 0.2s ease-out;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  padding: var(--app-2);
  background: white;
  backdrop-filter: blur(20px);
}

.dropdown-menu .dropdown-item {
  padding: var(--app-2) var(--app-4);
  color: var(--gray-700);
  transition: all var(--transition-fast);
  border-radius: var(--radius-sm);
  margin: 2px 0;
  font-size: var(--app-text-14);
  font-weight: 500;
}

.dropdown-menu .dropdown-item:hover {
  background: var(--gray-50);
  color: var(--primary);
}

.dropdown-menu .dropdown-item.active {
  background: var(--primary);
  color: white;
}

.btn-group .dropdown-menu {
  min-width: 180px;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-xl);
}

.btn-group .dropdown-menu a {
  padding: var(--app-2) var(--app-4);
  display: flex;
  align-items: center;
  gap: var(--app-2);
  color: var(--gray-600);
  text-decoration: none;
  border-radius: var(--radius-sm);
  margin: 2px 0;
  transition: all var(--transition-fast);
  font-size: var(--app-text-14);
  font-weight: 500;
}

.btn-group .dropdown-menu a:hover {
  background: var(--gray-50);
  color: var(--primary);
}

.btn-group .dropdown-menu a i {
  margin-right: 0;
  width: 18px;
  color: var(--primary);
  font-size: var(--app-text-14);
}

/* ============================================
   PROGRESS BAR
   ============================================ */

.progress {
  height: 8px;
  border-radius: var(--app-r-md);
  background: var(--gray-200);
  overflow: hidden;
}

.progress-bar {
  background: var(--app-accent);
  transition: width 0.6s ease;
  border-radius: var(--app-r-md);
}

/* ============================================
   MODALS
   ============================================ */

.modal-header {
  background: var(--app-accent);
  color: white;
  border: none;
  padding: var(--app-5) var(--app-6);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* ============================================
   NAVIGATION TABS
   ============================================ */

.nav-tabs {
  border-bottom: 2px solid var(--gray-200);
  gap: var(--app-2);
  margin-bottom: var(--app-5);
}

.nav-tabs .nav-link {
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--gray-500);
  font-weight: 500;
  padding: var(--app-3) var(--app-5);
  transition: all var(--transition-base);
  font-size: var(--app-text-14);
  position: relative;
  top: 2px;
}

.nav-tabs .nav-link:hover {
  color: var(--primary);
  border-bottom-color: var(--gray-300);
  background: transparent;
}

.nav-tabs .nav-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: transparent;
  font-weight: 600;
}

/* ============================================
   BREADCRUMBS
   ============================================ */

.breadcrumb {
  background: transparent;
  padding: 0;
  margin-bottom: var(--app-4);
  font-size: var(--app-text-13);
}

.breadcrumb-item a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb-item a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.breadcrumb-item + .breadcrumb-item::before {
  color: var(--gray-400);
  content: "/";
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
  gap: var(--app-1);
}

.page-link {
  border: 1px solid var(--gray-200);
  color: var(--gray-600);
  border-radius: var(--radius-sm) !important;
  padding: var(--app-2) var(--app-4);
  font-weight: 500;
  font-size: var(--app-text-14);
  transition: all var(--transition-fast);
}

.page-link:hover {
  background: var(--gray-50);
  color: var(--primary);
  border-color: var(--primary);
}

.page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 4px 10px -2px rgba(99, 102, 241, 0.3);
  color: white;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 991px) {
  .sidebar {
    margin-left: calc(-1 * var(--sidebar-width));
  }
  
  .sidebar.show {
    margin-left: 0;
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
  }
  
  .sidebar-overlay.show {
    display: block;
  }
  
  .header-search {
    display: none;
  }
}

@media (max-width: 768px) {
  .report-hero {
    padding: var(--app-6);
  }
  
  .report-hero h2 {
    font-size: var(--app-text-20);
  }
  
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--app-2);
  }
  
  .stat-box .value {
    font-size: var(--app-text-16);
  }
  
  .report-select-card {
    padding: var(--app-6) var(--app-5);
  }
  
  .form-card {
    padding: var(--app-6) var(--app-5);
  }
  
  .rpt-table thead th,
  .rpt-table tbody td {
    padding: var(--app-2) var(--app-3);
    font-size: var(--app-text-12);
  }

  .page-content {
    padding: var(--app-5);
  }

  .alert-banner {
    flex-direction: column;
    text-align: center;
    padding: var(--app-4);
  }

  .alert-banner__btn {
    width: 100%;
    justify-content: center;
  }

  .fin-bar {
    padding: var(--app-3) var(--app-4);
    gap: var(--app-3);
  }

  .fin-bar__value {
    font-size: var(--app-text-16);
  }

  .kpi-card {
    padding: var(--app-4);
  }

  .kpi-icon {
    width: 44px;
    height: 44px;
    font-size: var(--app-text-16);
  }
}

@media (max-width: 576px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .report-hero {
    padding: var(--app-5);
  }
  
  .page-content {
    padding: var(--app-4);
  }

  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .toast-container .toast {
    min-width: auto;
    max-width: none;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-info { color: var(--info) !important; }
.text-muted { color: var(--gray-500) !important; }

.shadow-lg {
  box-shadow: var(--shadow-lg) !important;
}

/* Fade in animation utility */

/* DataTables alignment helper */

.dataTables_wrapper > .row {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 0;
}

.dataTables_wrapper > .row > .col-sm-12.col-md-6 {
  flex: 0 0 auto;
  width: auto;
  padding: 0 var(--app-1);
}

.dataTables_wrapper > .row > .col-sm-12.col-md-6:first-child {
  display: flex;
  align-items: center;
  gap: var(--app-2);
}

.dataTables_wrapper > .row > .col-sm-12.col-md-6:last-child {
  margin-left: auto;
  text-align: right;
}

.dataTables_wrapper .dataTables_length {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.dataTables_wrapper .dataTables_length select {
  margin: 0 5px;
  padding: var(--app-1) var(--app-2);
  border-radius: var(--app-r-xs);
  border: 1px solid #dee2e6;
  min-width: 70px;
}

.dataTables_wrapper .dt-buttons {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--app-1);
}

.dataTables_wrapper .dataTables_filter {
  margin: 0;
  text-align: right;
}

.dataTables_wrapper .dataTables_filter label {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

/* ============================================
   DASHBOARD COMPONENTS
   ============================================ */

/* Dashboard Welcome Banner */
.dash-welcome {
  background: var(--app-accent);
  color: #fff;
  border-radius: var(--radius-2xl);
  padding: var(--app-8) var(--app-10);
  margin-bottom: var(--app-6);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: var(--shadow-xl);
}

.dash-welcome h2 {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-weight: 700;
  font-size: var(--app-text-24);
  margin-bottom: var(--app-1);
  position: relative;
  z-index: 1;
}

.dash-welcome p {
  font-size: var(--app-text-14);
  opacity: 0.85;
  margin: 0;
  position: relative;
  z-index: 1;
}

.dash-welcome__icon {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 80px;
  opacity: 0.08;
  z-index: 0;
}

.dash-welcome__date {
  background: rgba(255, 255, 255, 0.12);
  padding: var(--app-1) var(--app-4);
  border-radius: var(--radius-full);
  font-size: var(--app-text-13);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: var(--app-1);
  margin-top: 12px;
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* KPI Cards */
.kpi-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: var(--app-6);
  border: 1px solid var(--gray-200);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  position: relative;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--app-text-20);
  color: #fff;
  margin-bottom: var(--app-4);
}

.kpi-value {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: var(--app-text-24);
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1;
  margin-bottom: var(--app-1);
}

.kpi-label {
  font-size: var(--app-text-13);
  color: var(--gray-500);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: var(--app-1);
  font-size: var(--app-text-12);
  font-weight: 600;
  padding: var(--app-1) var(--app-2);
  border-radius: var(--radius-full);
  margin-top: 8px;
  text-decoration: none;
  background: var(--success-light);
  color: var(--success-dark);
  transition: background var(--transition-fast);
}

.kpi-trend:hover {
  background: #a7f3d0;
  color: #065f46;
}

/* Dashboard Cards */
.dash-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: box-shadow var(--transition-base);
  height: 100%;
}

.dash-card__title {
  margin: 0;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: var(--app-text-14);
  font-weight: 700;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: var(--app-2);
}

.dash-card__title i {
  font-size: var(--app-text-16);
  opacity: 0.8;
  color: var(--primary);
}

.dash-card__link {
  font-size: var(--app-text-12);
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.dash-card__link:hover {
  color: var(--primary-dark);
}

.dash-card__body {
  padding: var(--app-6);
}

.dash-card__body--compact {
  padding: 0;
}

/* Dashboard Layout Grids */
.dash-grid {
  display: grid;
  gap: var(--app-6);
  margin-bottom: var(--app-6);
}

.dash-grid--6-4 { grid-template-columns: 6fr 4fr; }
.dash-grid--2 { grid-template-columns: 1fr 1fr; }

/* Financial Bars */
.fin-bar {
  display: flex;
  align-items: center;
  gap: var(--app-4);
  padding: var(--app-4) var(--app-5);
  background: var(--gray-50);
  border-radius: var(--radius);
  margin-bottom: var(--app-3);
  transition: all var(--transition-fast);
  border: 1px solid var(--gray-100);
}

.fin-bar:hover {
  background: #fff;
  border-color: var(--gray-300);
  transform: translateX(4px);
}

.fin-bar__icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--app-text-16);
  color: #fff;
  flex-shrink: 0;
}

.fin-bar__label {
  font-size: var(--app-text-13);
  color: var(--gray-500);
  font-weight: 500;
}

.fin-bar__value {
  font-size: var(--app-text-20);
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  color: var(--gray-900);
  margin-left: auto;
  white-space: nowrap;
}

/* Depreciation Rate Section */
.depreciation-rate {
  margin-top: 16px;
  padding: var(--app-4);
  background: var(--gray-50);
  border-radius: var(--radius);
  border: 1px solid var(--gray-100);
}

.depreciation-rate__header {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--app-1);
}

.depreciation-rate__label {
  font-size: var(--app-text-12);
  color: var(--gray-500);
  font-weight: 500;
}

.depreciation-rate__value {
  font-size: var(--app-text-12);
  color: var(--gray-800);
  font-weight: 700;
}

/* Progress Bars (Dashboard) */
.progress-bar {
  height: 6px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 1s ease;
  background: var(--primary);
}

/* Centre List */
.centre-item {
  padding: var(--app-4) 0;
  border-bottom: 1px solid var(--gray-100);
}

.centre-item:last-child {
  border-bottom: none;
}

.centre-item__header {
  font-size: var(--app-text-13);
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: var(--app-1);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.centre-item__count {
  font-size: var(--app-text-12);
  color: var(--gray-500);
  font-weight: 500;
}

/* Quick Actions (Dashboard) */
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--app-2);
}

.quick-action {
  display: flex;
  align-items: center;
  gap: var(--app-3);
  padding: var(--app-3) var(--app-4);
  border-radius: var(--radius);
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  text-decoration: none;
  color: var(--gray-700);
  transition: all var(--transition-base);
}

.quick-action:hover {
  background: #fff;
  border-color: var(--primary-light);
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.quick-action__icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--app-text-16);
  color: #fff;
  flex-shrink: 0;
  transition: transform var(--transition-base);
}

.quick-action:hover .quick-action__icon {
  transform: scale(1.08);
}
.qa-icon--purple { background: #8b5cf6; }
.qa-icon--cyan { background: #06b6d4; }

/* ============================================
   DASHBOARD TABLES
   ============================================ */

.dash-table {
  margin-bottom: 0;
  font-size: var(--app-text-13);
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.dash-table thead th {
  background: var(--gray-50);
  color: var(--gray-500);
  font-weight: 600;
  font-size: var(--app-text-11);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border: none;
  padding: var(--app-3) var(--app-4);
  white-space: nowrap;
}

.dash-table tbody td {
  padding: var(--app-3) var(--app-4);
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
  color: var(--gray-700);
  transition: background var(--transition-fast);
}

.dash-table tbody tr {
  transition: background var(--transition-fast);
}

.dash-table tbody tr:hover {
  background: var(--gray-50);
}

.dash-table tbody tr:last-child td {
  border-bottom: none;
}

.dash-table .text-center { text-align: center; }
.dash-table .text-end { text-align: end; }
.dash-table .text-muted { color: var(--gray-500); }
.dash-table .py-4 { padding-top: var(--app-4); padding-bottom: var(--app-4); }

.currency {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-weight: 600;
}

/* Asset Cell (Table Row) */
.asset-cell {
  display: flex;
  align-items: center;
  gap: var(--app-3);
}

.asset-cell__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: var(--app-text-14);
  flex-shrink: 0;
}

.asset-cell__info {
  min-width: 0;
}

.asset-cell__name {
  font-weight: 600;
  font-size: var(--app-text-13);
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.asset-cell__category {
  font-size: var(--app-text-11);
  color: var(--gray-500);
}

/* Status Badges */

.status-badge--info { background: var(--gray-100); color: var(--primary); border-color: var(--gray-200); }
.status-badge--active { background: var(--success-light); color: var(--success-dark); border-color: #a7f3d0; }
.status-badge--pending { background: var(--warning-light); color: var(--warning-dark); border-color: #fde68a; }
.status-badge--warning { background: #fef2f2; color: var(--danger-dark); border-color: #fecaca; }

/* Activity Feed */

.activity-item {
  display: flex;
  gap: var(--app-3);
  padding: var(--app-3) 0;
  border-bottom: 1px solid var(--gray-100);
  align-items: flex-start;
}

.activity-item__icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  font-size: var(--app-text-12);
}

/* Empty State */

.empty-state--full {
  height: 100%;
}

.empty-state__icon {
  font-size: var(--app-text-24);
  margin-bottom: var(--app-2);
  opacity: 0.4;
}

/* Chart Container */
.chart-container {
  position: relative;
  width: 100%;
}

/* Chart + Table Row */

.chart-table-row__chart {
  flex-shrink: 0;
  width: 260px;
  height: 260px;
}

.chart-table-row__table {
  flex: 1;
  min-width: 0;
}

/* Scrollable Body */
.scrollable-body {
  max-height: 380px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}

.scrollable-body::-webkit-scrollbar {
  width: 4px;
}

.scrollable-body::-webkit-scrollbar-track {
  background: transparent;
}

.scrollable-body::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 2px;
}

/* Alert Banners */
.alert-banner {
  border-radius: var(--radius-lg);
  padding: var(--app-5) var(--app-6);
  display: flex;
  align-items: center;
  gap: var(--app-4);
  border: 1px solid var(--gray-200);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.alert-banner__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  font-size: var(--app-text-20);
}

.alert-banner__title {
  font-weight: 700;
  font-size: var(--app-text-14);
  color: var(--gray-800);
  margin-bottom: 2px;
}

.alert-banner__btn {
  background: var(--primary);
  color: #fff;
  padding: var(--app-2) var(--app-6);
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--app-text-14);
  white-space: nowrap;
  border: none;
  transition: all var(--transition-base);
  display: inline-flex;
  align-items: center;
  gap: var(--app-1);
}

.alert-banner__btn:hover {
  background: var(--primary-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -4px rgba(99, 102, 241, 0.4);
}

/* ============================================
   SMART INSIGHTS
   ============================================ */

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--app-4);
  margin-bottom: var(--app-6);
}

.insight-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--app-text-16);
  color: #fff;
  flex-shrink: 0;
}

/* ============================================
   FORM ENHANCEMENTS
   ============================================ */

.form-section {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: var(--app-6);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--app-5);
  transition: all var(--transition-base);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--app-5);
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--app-5);
}

.form-group-icon {
  display: flex;
  align-items: flex-start;
  gap: var(--app-3);
  background: var(--gray-50);
  padding: var(--app-4);
  border-radius: var(--radius);
  border: 1px solid var(--gray-100);
  transition: all var(--transition-fast);
}

.form-icon {
  width: 36px;
  height: 36px;
  background: var(--app-accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: var(--app-text-14);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.form-label-required::after {
  content: ' *';
  color: var(--danger);
}

.form-label-hint {
  display: block;
  font-size: var(--app-text-12);
  color: var(--gray-500);
  margin-top: 4px;
  font-weight: 400;
}

/* Form Validation States */
.form-control.is-invalid,
.form-select.is-invalid {
  border-color: var(--danger) !important;
  background: #fef2f2 !important;
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.form-control.is-valid,
.form-select.is-valid {
  border-color: var(--success) !important;
  background: #f0fdf4 !important;
}

.form-control.is-valid:focus,
.form-select.is-valid:focus {
  border-color: var(--success) !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

.invalid-feedback {
  display: block;
  font-size: var(--app-text-12);
  color: var(--danger-dark);
  margin-top: 6px;
  font-weight: 500;
}

.valid-feedback {
  display: block;
  font-size: var(--app-text-12);
  color: var(--success-dark);
  margin-top: 6px;
  font-weight: 500;
}

/* ============================================
   BREADCRUMBS
   ============================================ */

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: var(--app-2);
  padding: var(--app-3) 0;
  margin-bottom: var(--app-4);
  font-size: var(--app-text-13);
  flex-wrap: wrap;
}

.breadcrumb-nav a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.breadcrumb-nav a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.breadcrumb-nav .breadcrumb-item {
  display: flex;
  align-items: center;
  gap: var(--app-2);
  color: var(--gray-500);
}

.breadcrumb-nav .breadcrumb-item.active {
  color: var(--gray-800);
  font-weight: 600;
}

.breadcrumb-nav .breadcrumb-separator {
  color: var(--gray-300);
  font-size: var(--app-text-11);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--app-3);
  pointer-events: none;
}

.toast-container .toast {
  pointer-events: auto;
  min-width: 320px;
  max-width: 420px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--gray-200);
  padding: var(--app-4) var(--app-5);
  display: flex;
  align-items: flex-start;
  gap: var(--app-3);
  animation: slideInRight 0.3s ease-out;
  transition: all 0.3s ease;
}

.toast.toast-hiding {
  opacity: 0;
  transform: translateX(100%);
}

.toast__icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--app-text-12);
  color: #fff;
  flex-shrink: 0;
}

.toast__icon--success { background: var(--success); }
.toast__icon--danger { background: var(--danger); }
.toast__icon--warning { background: var(--warning); }
.toast__icon--info { background: var(--info); }

.toast__body {
  flex: 1;
  min-width: 0;
}

.toast__title {
  font-size: var(--app-text-14);
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 2px;
}

.toast__message {
  font-size: var(--app-text-13);
  color: var(--gray-500);
  line-height: 1.4;
}

.toast__close {
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: var(--app-1);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.toast__close:hover {
  background: var(--gray-100);
  color: var(--gray-600);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ============================================
   LOADING STATES
   ============================================ */

.loading-overlay.show {
  display: flex;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
   SIDEBAR ENHANCEMENTS
   ============================================ */

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .menu-category,
.sidebar.collapsed .menu-link span,
.sidebar.collapsed .submenu{
  display: none;
}

.sidebar.collapsed .menu-link {
  justify-content: center;
  padding: var(--app-3);
}

.sidebar.collapsed .menu-link i {
  margin: 0;
  font-size: var(--app-text-16);
}
/* When sidebar collapses via body.sidebar-collapsed (toggled in JS),
   shrink the main content margin so no empty gap appears next to the icon rail. */
body.sidebar-collapsed .main-content {
  margin-left: var(--sidebar-collapsed);
}

@media (max-width: 991px) {
  body.sidebar-collapsed .main-content {
    margin-left: 0;
  }
}

/* Sidebar tooltip for collapsed state */
.sidebar.collapsed .menu-link[title] {
  position: relative;
}

/* ============================================
   SMART SEARCH
   ============================================ */

.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  margin-top: 8px;
  max-height: 360px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.search-suggestions.show {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

.search-suggestion-group {
  padding: var(--app-2) 0;
  border-bottom: 1px solid var(--gray-100);
}

.search-suggestion-group:last-child {
  border-bottom: none;
}

.search-suggestion-group__title {
  padding: var(--app-1) var(--app-4);
  font-size: var(--app-text-11);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gray-500);
}

.search-suggestion-item {
  display: flex;
  align-items: center;
  gap: var(--app-3);
  padding: var(--app-2) var(--app-4);
  cursor: pointer;
  transition: background 0.15s ease;
  text-decoration: none;
  color: var(--gray-700);
}

.search-suggestion-item:hover,
.search-suggestion-item.active {
  background: var(--primary-subtle);
  color: var(--primary);
}

.search-suggestion-item i {
  width: 20px;
  text-align: center;
  color: var(--gray-400);
  font-size: var(--app-text-14);
}

.search-suggestion-item:hover i,
.search-suggestion-item.active i {
  color: var(--primary);
}

.search-suggestion-item__text {
  flex: 1;
  min-width: 0;
}

.search-suggestion-item__title {
  font-size: var(--app-text-13);
  font-weight: 600;
  color: var(--gray-800);
}

.search-suggestion-item__desc {
  font-size: var(--app-text-11);
  color: var(--gray-500);
}

.search-shortcut {
  display: inline-flex;
  align-items: center;
  gap: var(--app-1);
  font-size: var(--app-text-11);
  color: var(--gray-500);
  font-weight: 500;
}

/* Position the shortcut inside the search input on the right */
.header-search-wrapper > .search-shortcut {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 1;
}

/* Hide the shortcut hint while the user is typing */
.header-search-wrapper > .search-shortcut.hide-hint {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.header-search-wrapper > .search-shortcut kbd {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--app-r-xs);
  padding: 2px var(--app-1);
  font-family: inherit;
  font-size: var(--app-text-11);
  font-weight: 600;
  color: var(--gray-500);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.search-shortcut kbd {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--app-r-xs);
  padding: 2px var(--app-1);
  font-family: inherit;
  font-size: var(--app-text-11);
  font-weight: 600;
  color: var(--gray-500);
}

.search-no-results {
  padding: var(--app-6) var(--app-4);
  text-align: center;
  color: var(--gray-500);
}

.search-no-results i {
  font-size: var(--app-text-24);
  margin-bottom: var(--app-2);
  display: block;
}

/* ============================================
   RESPONSIVE ENHANCEMENTS
   ============================================ */

@media (max-width: 992px) {
  .dash-grid--6-4,
  .dash-grid--4-6,
  .dash-grid--2 {
    grid-template-columns: 1fr;
  }

  .dash-welcome {
    padding: var(--app-6);
  }

  .dash-welcome h2 {
    font-size: var(--app-text-20);
  }

  .dash-welcome__icon {
    display: none;
  }

  .kpi-value {
    font-size: var(--app-text-24);
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .chart-table-row {
    flex-direction: column;
  }

  .chart-table-row__chart {
    width: 100%;
    max-width: 260px;
    margin: 0 auto;
  }

  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }

  .insights-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .page-content {
    padding: var(--app-5);
  }

  .alert-banner {
    flex-direction: column;
    text-align: center;
    padding: var(--app-4);
  }

  .alert-banner__btn {
    width: 100%;
    justify-content: center;
  }

  .fin-bar {
    padding: var(--app-3) var(--app-4);
    gap: var(--app-3);
  }

  .fin-bar__value {
    font-size: var(--app-text-16);
  }

  .kpi-card {
    padding: var(--app-4);
  }

  .kpi-icon {
    width: 44px;
    height: 44px;
    font-size: var(--app-text-16);
  }
}

@media (max-width: 576px) {
  .dash-welcome {
    padding: var(--app-5);
  }

  .dash-welcome h2 {
    font-size: var(--app-text-16);
  }

  .kpi-value {
    font-size: var(--app-text-20);
  }

  .page-content {
    padding: var(--app-4);
  }

  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .toast-container .toast {
    min-width: auto;
    max-width: none;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

/* Theme toggle */
#themeToggle {
  position: relative;
  overflow: hidden;
}

#themeToggle:hover::after {
  opacity: 1;
}

/* ============================================
   QUICK ACTIONS FAB (Floating Action Button)
   ============================================ */

.quick-actions-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
}

.quick-actions-panel {
  position: absolute;
  bottom: 100%;
  right: 0;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--gray-200);
  padding: var(--app-2);
  display: flex;
  flex-direction: column;
  gap: var(--app-1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.92);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 200px;
}

.quick-actions-panel a {
  display: flex;
  align-items: center;
  gap: var(--app-2);
  padding: var(--app-2) var(--app-4);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--gray-700);
  font-size: var(--app-text-14);
  font-weight: 500;
  transition: all 0.2s ease;
}

.quick-actions-panel a i {
  width: 18px;
  text-align: center;
  font-size: var(--app-text-14);
  color: var(--gray-500);
}

.quick-actions-btn {
  width: auto;
  min-width: 56px;
  height: 52px;
  padding: 0 var(--app-5);
  border-radius: var(--radius-full);
  border: none;
  background: var(--app-accent);
  color: white;
  font-size: var(--app-text-14);
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px -4px rgba(99, 102, 241, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--app-2);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

/* ============================================
   STAGGERED ANIMATION (animate-in)
   ============================================ */

/* Apply staggered delays based on element position within the page content */
.page-content .row.animate-in:nth-child(1) { animation-delay: 0.05s; }
.page-content .row.animate-in:nth-child(2) { animation-delay: 0.10s; }
.page-content .row.animate-in:nth-child(3) { animation-delay: 0.15s; }
.page-content .row.animate-in:nth-child(4) { animation-delay: 0.20s; }
.page-content .row.animate-in:nth-child(5) { animation-delay: 0.25s; }
.page-content .row.animate-in:nth-child(6) { animation-delay: 0.30s; }
.page-content .row.animate-in:nth-child(7) { animation-delay: 0.35s; }
.page-content .row.animate-in:nth-child(8) { animation-delay: 0.40s; }
.page-content .dash-welcome.animate-in { animation-delay: 0.05s; }
.page-content .animate-in:nth-of-type(2) { animation-delay: 0.10s; }
.page-content .animate-in:nth-of-type(3) { animation-delay: 0.15s; }
.page-content .animate-in:nth-of-type(4) { animation-delay: 0.20s; }
.page-content .animate-in:nth-of-type(5) { animation-delay: 0.25s; }
.page-content .animate-in:nth-of-type(6) { animation-delay: 0.30s; }
.page-content .animate-in:nth-of-type(7) { animation-delay: 0.35s; }
.page-content .animate-in:nth-of-type(8) { animation-delay: 0.40s; }

/* ============================================
   TOAST CLOSE BUTTON
   ============================================ */

.toast .toast__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ================================================================
   DESIGN SYSTEM
   ----------------------------------------------------------------
   Everything below owns a value. Change a token in section 1 and it
   changes everywhere.
   ================================================================ */

/* ================================================================
   1. TOKENS
   ================================================================ */
:root {
  /* Surfaces */
  --app-bg: #f7f8fa;
  --app-surface: #ffffff;
  --app-surface-2: #fbfcfd;
  --app-surface-3: #f2f4f7;

  /* Lines */
  --app-border: #e4e7ec;
  --app-border-strong: #d0d5dd;

  /* Text — all pass WCAG AA on --app-surface */
  --app-text: #101828;        /* 16.1:1 */
  --app-text-2: #475467;      /* 8.2:1  */
  --app-text-3: #667085;      /* 5.3:1  */
  --app-text-inverse: #ffffff;

  /* Accent — single brand colour */
  --app-accent: #4f46e5;
  --app-accent-hover: #4338ca;
  --app-accent-soft: #eef2ff;
  --app-accent-border: #c7d2fe;

  /* Semantic — text-safe on white */
  --app-success: #047857;
  --app-success-soft: #ecfdf3;
  --app-success-border: #abefc6;

  --app-warning: #b45309;
  --app-warning-soft: #fffaeb;
  --app-warning-border: #fedf89;

  --app-danger: #b42318;
  --app-danger-soft: #fef3f2;
  --app-danger-border: #fecdca;

  --app-info: #175cd3;
  --app-info-soft: #eff8ff;
  --app-info-border: #b2ddff;

  /* Type */
  --app-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --app-font-num: 'Inter', ui-monospace, 'SF Mono', Menlo, monospace;

  --app-text-11: 11px;
  --app-text-12: 12px;
  --app-text-13: 13px;
  --app-text-14: 14px;
  --app-text-16: 16px;
  --app-text-20: 20px;
  --app-text-24: 24px;

  /* Space */
  --app-1: 4px;
  --app-2: 8px;
  --app-3: 12px;
  --app-4: 16px;
  --app-5: 20px;
  --app-6: 24px;
  --app-8: 32px;
  --app-10: 40px;

  /* Radius */
  --app-r-xs: 6px;
  --app-r-sm: 8px;
  --app-r-md: 10px;
  --app-r-lg: 12px;

  /* Shadow — only for floating layers */
  --app-shadow-pop: 0 8px 24px -6px rgba(16, 24, 40, 0.14),
                    0 2px 6px -2px rgba(16, 24, 40, 0.06);

  /* Shell */
  --app-sidebar: 260px;
  --app-sidebar-collapsed: 64px;
  --app-header: 56px;
}

/* ================================================================
   2. BASE
   ================================================================ */
body {
  background: var(--app-bg);
  color: var(--app-text);
  font-family: var(--app-font);
  font-size: var(--app-text-14);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--app-text);
  font-family: var(--app-font);
  letter-spacing: -0.01em;
}

h1 { font-size: var(--app-text-24); font-weight: 600; }
h2 { font-size: var(--app-text-20); font-weight: 600; }
h3 { font-size: var(--app-text-16); font-weight: 600; }
h4 { font-size: var(--app-text-14); font-weight: 600; }
h5 { font-size: var(--app-text-14); font-weight: 600; }
h6 { font-size: var(--app-text-13); font-weight: 600; }

p { margin-bottom: var(--app-3); }

a { color: var(--app-accent); text-decoration: none; }
a:hover { color: var(--app-accent-hover); }

hr {
  border: 0;
  border-top: 1px solid var(--app-border);
  margin: var(--app-6) 0;
}

small, .small { font-size: var(--app-text-12); }

code, kbd, pre {
  font-family: var(--app-font-num);
  font-size: 0.92em;
}

:focus-visible {
  outline: 2px solid var(--app-accent);
  outline-offset: 2px;
  border-radius: var(--app-r-xs);
}

/* ================================================================
   3. SHELL — sidebar
   ================================================================ */
.sidebar {
  width: var(--app-sidebar);
  background: var(--app-surface);
  border-right: 1px solid var(--app-border);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-brand {
  height: var(--app-header);
  min-height: var(--app-header);
  padding: 0 var(--app-4);
  border-bottom: 1px solid var(--app-border);
  display: flex;
  align-items: center;
  gap: var(--app-3);
  color: var(--app-text);
  font-size: var(--app-text-14);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sidebar-brand:hover { color: var(--app-text); }

.sidebar-brand-icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: var(--app-r-sm);
  background: var(--app-accent);
  color: var(--app-text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--app-text-13);
  box-shadow: none;
}

.sidebar-brand-text {
  font-size: var(--app-text-14);
  font-weight: 600;
  white-space: nowrap;
}

.sidebar-menu {
  padding: var(--app-3) var(--app-2);
  overflow-y: auto;
  flex: 1;
}

.menu-item { margin: 0 0 1px; }

/* The three collapsible groups are separated by space rather than by section
   headings, which duplicated their own labels. */
.menu-item--group { margin-top: var(--app-3); }

.menu-link {
  display: flex;
  align-items: center;
  gap: var(--app-3);
  height: 34px;
  padding: 0 var(--app-2);
  border-radius: var(--app-r-sm);
  color: var(--app-text-2);
  font-size: var(--app-text-13);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color 120ms ease, color 120ms ease;
}

.menu-link i {
  width: 16px;
  min-width: 16px;
  font-size: var(--app-text-13);
  color: var(--app-text-3);
  text-align: center;
}

.menu-link:hover {
  background: var(--app-surface-3);
  color: var(--app-text);
  /* The base stylesheet nudges links 2px to the right on hover, which reads as
     a layout jump at this density. */
  transform: none;
}

.menu-link:hover i { color: var(--app-text-2); }

.menu-link.active {
  background: var(--app-accent-soft);
  color: var(--app-accent);
  font-weight: 600;
  box-shadow: none;
}

.menu-link.active i { color: var(--app-accent); }

/* Parent of the current page. Keeps the trail visible when the group is shut. */
.menu-link.has-active {
  color: var(--app-text);
  font-weight: 600;
}

.menu-link.has-active i { color: var(--app-text-2); }

/* Open group: enough emphasis to read as expanded without a second fill. */
.menu-link[aria-expanded="true"] { color: var(--app-text); }
.menu-link[aria-expanded="true"] i { color: var(--app-text-2); }

.menu-link .arrow {
  margin-left: auto;
  font-size: var(--app-text-11);
  color: var(--app-text-3);
  transition: transform 150ms ease;
}

.menu-link[aria-expanded="true"] .arrow {
  transform: rotate(90deg);
  color: var(--app-text-2);
}

.submenu {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding-left: var(--app-5);
  margin-top: 2px;
  transition: max-height 180ms ease, opacity 180ms ease;
}

.submenu.show { opacity: 1; }

.submenu .menu-link {
  height: 32px;
  padding: 0 var(--app-2);
  font-size: var(--app-text-13);
  color: var(--app-text-2);
}

/* Neutralises the 46px→50px hover shift inherited from the base stylesheet. */
.submenu .menu-link:hover { padding-left: var(--app-2); }

.submenu .menu-link i { font-size: var(--app-text-12); }

.menu-link .badge {
  margin-left: auto;
  background: var(--app-accent);
  color: var(--app-text-inverse);
  font-size: var(--app-text-11);
  font-weight: 600;
  padding: 1px var(--app-1);
  border-radius: 999px;
}

/* Collapsed rail */
.sidebar.collapsed { width: var(--app-sidebar-collapsed); }
.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .menu-link span,
.sidebar.collapsed .menu-link .arrow,
.sidebar.collapsed .menu-link .badge { display: none; }
.sidebar.collapsed .sidebar-brand { justify-content: center; padding: 0; }
.sidebar.collapsed .menu-link { justify-content: center; padding: 0; }
.sidebar.collapsed .submenu { display: none; }

.sidebar-overlay {
  background: rgba(16, 24, 40, 0.4);
  backdrop-filter: none;
}

/* ================================================================
   4. SHELL — header
   ================================================================ */
.main-content { margin-left: var(--app-sidebar); }

.main-content.collapsed,
body.sidebar-collapsed .main-content {
  margin-left: var(--app-sidebar-collapsed);
}

.top-header {
  height: var(--app-header);
  padding: 0 var(--app-6);
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-border);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  gap: var(--app-4);
}

.sidebar-toggle {
  width: 32px;
  height: 32px;
  border-radius: var(--app-r-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--app-text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--app-text-14);
  transition: background-color 120ms ease;
}

.sidebar-toggle:hover {
  background: var(--app-surface-3);
  color: var(--app-text);
}

.header-search { flex: 1; max-width: 420px; }

.header-search-wrapper {
  height: 32px;
  background: var(--app-surface-3);
  border: 1px solid transparent;
  border-radius: var(--app-r-sm);
  padding: 0 var(--app-3);
  display: flex;
  align-items: center;
  gap: var(--app-2);
  transition: border-color 120ms ease, background-color 120ms ease;
}

.header-search-wrapper:focus-within {
  background: var(--app-surface);
  border-color: var(--app-accent);
  box-shadow: 0 0 0 3px var(--app-accent-soft);
}

.header-search-wrapper i {
  /* The legacy layer absolutely positions this icon at left:14px with a translateY
     for the old absolutely-positioned layout. The wrapper is now a flex row,
     so the icon must participate in normal flow or it sits on the placeholder
     text. */
  position: static;
  left: auto;
  top: auto;
  transform: none;
  flex: 0 0 auto;
  font-size: var(--app-text-12);
  color: var(--app-text-3);
}

.header-search input {
  background: transparent;
  border: none;
  outline: none;
  font-size: var(--app-text-13);
  color: var(--app-text);
  width: 100%;
  padding: 0;
}

.header-search input::placeholder { color: var(--app-text-3); }

.search-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: var(--app-text-11);
  color: var(--app-text-3);
  white-space: nowrap;
}

.search-shortcut kbd {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 4px;
  padding: 0 var(--app-1);
  font-size: var(--app-text-11);
  line-height: 16px;
  color: var(--app-text-2);
  box-shadow: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--app-1);
}

.header-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--app-r-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--app-text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--app-text-14);
  position: relative;
  transition: background-color 120ms ease;
}

.header-btn:hover {
  background: var(--app-surface-3);
  color: var(--app-text);
}

/* Logout is a POST form; keep it inline in the header action row. */
.logout-form { display: inline-flex; }
.logout-form .header-btn { cursor: pointer; }

.notification-dot {
  position: absolute;
  top: 5px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--app-danger);
  border: 1.5px solid var(--app-surface);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: var(--app-2);
  padding: var(--app-1) var(--app-2) var(--app-1) var(--app-1);
  border-radius: var(--app-r-sm);
  border: 1px solid transparent;
  transition: background-color 120ms ease;
}

.user-profile:hover { background: var(--app-surface-3); }

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--app-accent-soft);
  color: var(--app-accent);
  font-size: var(--app-text-11);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.user-info { line-height: 1.25; }

.user-name {
  font-size: var(--app-text-12);
  font-weight: 600;
  color: var(--app-text);
}

.user-role {
  font-size: var(--app-text-11);
  color: var(--app-text-3);
  text-transform: capitalize;
}

/* ================================================================
   5. PAGE FRAME
   ================================================================ */
.page-content {
  padding: var(--app-6);
  width: 100%;
}

/* Views were written with three different page containers: `container-fluid
   page-content` (which double-pads, 24px + 24px), `container-fluid` alone
   (12px gutter) and `container` (centred and capped at 1320px, so its left
   edge sat 24px further in than every other page). The layout already wraps
   each view in `.page-content`, which owns the frame — 24px padding, capped
   at 1440px — so the view's own container is neutralised here instead of in
   twenty-two view files. Rows inside it still align correctly: Bootstrap's
   -12px row margin is cancelled by the 12px column padding, which lands
   content exactly on the frame edge. */
.page-content > .container,
.page-content > .container-fluid {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: var(--app-1);
  font-size: var(--app-text-12);
  margin-bottom: var(--app-4);
  color: var(--app-text-3);
}

.breadcrumb-item { color: var(--app-text-3); }
.breadcrumb-item a { color: var(--app-text-3); }
.breadcrumb-item a:hover { color: var(--app-text); }
.breadcrumb-item.active { color: var(--app-text-2); font-weight: 500; }
.breadcrumb-separator { color: var(--app-border-strong); font-size: 9px; }

/* Page header — replaces the gradient hero.
   Same class name so no view markup has to change. */
.page-hero,
.report-hero {
  background: transparent;
  color: var(--app-text);
  border: 0;
  border-bottom: 1px solid var(--app-border);
  border-radius: 0;
  box-shadow: none;
  padding: 0 0 var(--app-4);
  margin-bottom: var(--app-6);
  position: static;
  overflow: visible;
}

.page-hero::before,
.page-hero::after,
.report-hero::before,
.report-hero::after {
  display: none;
  content: none;
}

.page-hero h1,
.page-hero h2,
.report-hero h1,
.report-hero h2 {
  color: var(--app-text);
  font-size: var(--app-text-20);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--app-1);
  display: flex;
  align-items: center;
  gap: var(--app-2);
}

.page-hero h1 i,
.page-hero h2 i,
.report-hero h1 i,
.report-hero h2 i {
  font-size: var(--app-text-16);
  color: var(--app-text-3);
}

.page-hero p,
.page-hero .subtitle,
.report-hero p,
.report-hero .subtitle {
  color: var(--app-text-3);
  font-size: var(--app-text-13);
  opacity: 1;
  margin: 0;
}

.page-hero .opacity-75,
.report-hero .opacity-75 { opacity: 1; }

.page-hero .btn-light,
.report-hero .btn-light {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  color: var(--app-text-2);
}

/* The legacy layer used to style this link for the old dark gradient hero:
   translucent white fill with `color: white`. The hero is light now, so on
   hover the label disappeared (white on near-white). Restate the light-mode
   hover here, inside .page-hero so it keeps winning on specificity. */
.page-hero .btn-light:hover,
.report-hero .btn-light:hover {
  background: var(--app-surface-3);
  border-color: var(--app-border-strong);
  color: var(--app-text);
}

/* ================================================================
   6. BUTTONS
   ================================================================ */
.btn {
  height: 34px;
  padding: 0 var(--app-3);
  border-radius: var(--app-r-sm);
  border: 1px solid transparent;
  font-family: var(--app-font);
  font-size: var(--app-text-13);
  font-weight: 500;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--app-2);
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
  box-shadow: none;
  transform: none;
  white-space: nowrap;
}

.btn:hover,
.btn:active { transform: none; box-shadow: none; }

.btn i { font-size: var(--app-text-12); }

.btn:disabled,
.btn.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

/* Primary — accent */
.btn-primary,
.btn-save,
.btn-add,
.btn-add-user,
.btn-submit,
.btn-upload,
.btn-generate,
.btn-run,
.btn-transfer {
  background: var(--app-accent);
  border-color: var(--app-accent);
  color: var(--app-text-inverse);
  box-shadow: none;
}

.btn-primary:hover,
.btn-save:hover,
.btn-add:hover,
.btn-add-user:hover,
.btn-submit:hover,
.btn-upload:hover,
.btn-generate:hover,
.btn-run:hover,
.btn-transfer:hover {
  background: var(--app-accent-hover);
  border-color: var(--app-accent-hover);
  color: var(--app-text-inverse);
}

/* Secondary — neutral */
.btn-secondary,
.btn-light {
  background: var(--app-surface);
  border-color: var(--app-border-strong);
  color: var(--app-text-2);
}

.btn-secondary:hover,
.btn-light:hover {
  background: var(--app-surface-3);
  border-color: var(--app-border-strong);
  color: var(--app-text);
}

/* Success */
.btn-success,
.btn-export {
  background: var(--app-success);
  border-color: var(--app-success);
  color: var(--app-text-inverse);
}

.btn-success:hover,
.btn-export:hover {
  background: #065f46;
  border-color: #065f46;
  color: var(--app-text-inverse);
}

/* Danger */
.btn-danger {
  background: var(--app-danger);
  border-color: var(--app-danger);
  color: var(--app-text-inverse);
}

.btn-danger:hover {
  background: #912018;
  border-color: #912018;
  color: var(--app-text-inverse);
}

/* Warning */
.btn-warning {
  background: var(--app-warning);
  border-color: var(--app-warning);
  color: var(--app-text-inverse);
}

.btn-warning:hover {
  background: #92400e;
  border-color: #92400e;
  color: var(--app-text-inverse);
}

/* Info */
.btn-info {
  background: var(--app-info);
  border-color: var(--app-info);
  color: var(--app-text-inverse);
}

.btn-info:hover {
  background: #124bb0;
  border-color: #124bb0;
  color: var(--app-text-inverse);
}

/* Outline variants */
.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-success,
.btn-outline-danger,
.btn-outline-warning,
.btn-outline-info {
  background: var(--app-surface);
  color: var(--app-text-2);
  border-color: var(--app-border-strong);
}

.btn-outline-primary:hover,
.btn-outline-secondary:hover,
.btn-outline-success:hover,
.btn-outline-danger:hover,
.btn-outline-warning:hover,
.btn-outline-info:hover {
  background: var(--app-surface-3);
  border-color: var(--app-border-strong);
  color: var(--app-text);
}

.btn-outline-danger { color: var(--app-danger); }
.btn-outline-danger:hover { background: var(--app-danger-soft); border-color: var(--app-danger-border); color: var(--app-danger); }
.btn-outline-success { color: var(--app-success); }
.btn-outline-success:hover { background: var(--app-success-soft); border-color: var(--app-success-border); color: var(--app-success); }

/* Sizes */
.btn-sm {
  height: 28px;
  padding: 0 var(--app-2);
  font-size: var(--app-text-12);
  gap: var(--app-1);
}

.btn-lg {
  height: 40px;
  padding: 0 var(--app-4);
  font-size: var(--app-text-14);
}

.btn-group { display: inline-flex; gap: var(--app-1); }

/* Upload page: Browse/Import are the primary actions inside a tall centred drop
   zone, so a 34px toolbar button is too small a target. The icons also carried
   `me-2`, which stacked on `.btn`'s 8px flex gap (16px between icon and label)
   and made the label sit off-centre against 12px side padding. Spacing now
   comes from the gap alone, with even 16px padding either side. */
.btn-upload {
  height: 38px;
  padding: 0 var(--app-4);
}

/* ================================================================
   7. FORMS
   ================================================================ */
.form-label {
  font-size: var(--app-text-12);
  font-weight: 500;
  color: var(--app-text-2);
  margin-bottom: var(--app-1);
  display: block;
}

.form-label .text-danger,
.form-label-required::after {
  color: var(--app-danger);
}

.form-control,
.form-select {
  height: 36px;
  padding: 0 var(--app-3);
  border: 1px solid var(--app-border-strong);
  border-radius: var(--app-r-sm);
  background: var(--app-surface);
  color: var(--app-text);
  font-family: var(--app-font);
  font-size: var(--app-text-13);
  box-shadow: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

textarea.form-control {
  height: auto;
  min-height: 80px;
  padding: var(--app-2) var(--app-3);
  line-height: 1.5;
}

/* The legacy layer declares `.form-card .form-select, .form-card .form-control`
   with `padding: 12px 16px` (specificity 0,2,0), which beats the component
   rule above (0,1,0) and stuffs 24px of vertical padding into a 36px control,
   clipping the placeholder. Re-assert the component padding at the same
   specificity — the design-system layer comes after the legacy layer, so this wins. */
.form-card .form-control,
.form-card .form-select {
  padding: 0 var(--app-3);
}
.form-card textarea.form-control {
  padding: var(--app-2) var(--app-3);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--app-accent);
  box-shadow: 0 0 0 3px var(--app-accent-soft);
  outline: none;
}

.form-control::placeholder { color: var(--app-text-3); }

.form-control:disabled,
.form-select:disabled {
  background: var(--app-surface-3);
  color: var(--app-text-3);
  cursor: not-allowed;
}

.form-text,
.form-label-hint {
  font-size: var(--app-text-12);
  color: var(--app-text-3);
  margin-top: var(--app-1);
  display: block;
}

.form-check-input {
  width: 15px;
  height: 15px;
  border: 1px solid var(--app-border-strong);
  border-radius: 4px;
  margin-top: 0.2em;
  box-shadow: none;
}

.form-check-input:checked {
  background-color: var(--app-accent);
  border-color: var(--app-accent);
}

.form-check-input:focus {
  border-color: var(--app-accent);
  box-shadow: 0 0 0 3px var(--app-accent-soft);
}

.form-check-label {
  font-size: var(--app-text-13);
  color: var(--app-text-2);
}

.invalid-feedback,
.validation-error-message {
  font-size: var(--app-text-12);
  color: var(--app-danger);
  margin-top: var(--app-1);
}

.valid-feedback {
  font-size: var(--app-text-12);
  color: var(--app-success);
  margin-top: var(--app-1);
}

.input-group-text {
  background: var(--app-surface-3);
  border: 1px solid var(--app-border-strong);
  color: var(--app-text-3);
  font-size: var(--app-text-12);
  border-radius: var(--app-r-sm);
}

/* ================================================================
   8. CARDS
   ================================================================ */
.card,
.form-card,
.report-select-card,
.dash-card,
.table-modern,
.info-card,
.profile-card,
.user-table-card,
.stats-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-r-md);
  box-shadow: none;
}

.card:hover,
.form-card:hover,
.report-select-card:hover,
.dash-card:hover,
.table-modern:hover,
.info-card:hover,
.profile-card:hover {
  box-shadow: none;
  transform: none;
}

.card-body { padding: var(--app-5); }

.card-header,
.dash-card__header {
  background: transparent;
  border-bottom: 1px solid var(--app-border);
  padding: var(--app-3) var(--app-5);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--app-3);
}

.dash-card__title {
  font-size: var(--app-text-13);
  font-weight: 600;
  color: var(--app-text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--app-2);
}

.dash-card__title i {
  font-size: var(--app-text-12);
  color: var(--app-text-3);
}

.dash-card__body { padding: var(--app-5); }

/* .form-card is a card: header + .card-body, exactly like every other card in
   the app. It used to add its own 32px padding and cap itself at 720px while
   sitting in a col-md-10, so the form rendered as a narrow strip with uneven
   side margins and 52px of padding before the first field. Let the card and
   .card-body own the framing and fill the column. */
.form-card {
  padding: 0;
  max-width: none;
  margin: 0;
}

/* Some legacy forms place their <form> or .row straight inside .form-card with
   no .card-body, so they inherited the zero padding above and the fields sat
   flush against the card border. Give those cards the same interior padding a
   .card-body would; cards already using the header + .card-body pattern are
   left untouched. */
.form-card:not(:has(> .card-body)):not(:has(> .card-header)) {
  padding: var(--app-5);
}

.report-select-card {
  padding: var(--app-6);
  max-width: 880px;
  margin: 0;
  text-align: left;
}

/* ================================================================
   9. TABLES
   ================================================================ */
.table {
  font-size: var(--app-text-13);
  color: var(--app-text);
  margin-bottom: 0;
  border-color: var(--app-border);
  --bs-table-bg: transparent;
  --bs-table-hover-bg: var(--app-surface-2);
}

.table > thead th {
  font-size: var(--app-text-11);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--app-text-3);
  background: var(--app-surface-2);
  border-bottom: 1px solid var(--app-border);
  padding: var(--app-2) var(--app-3);
  height: 38px;
  vertical-align: middle;
  white-space: nowrap;
}

.table > tbody td {
  padding: var(--app-2) var(--app-3);
  height: 40px;
  vertical-align: middle;
  border-bottom: 1px solid var(--app-border);
  color: var(--app-text-2);
}

.table > tbody td strong,
.table > tbody td .fw-semibold {
  color: var(--app-text);
  font-weight: 500;
}

.table > tbody tr:last-child td { border-bottom: 0; }

.table-hover > tbody > tr:hover > * {
  background: var(--app-surface-2);
  color: var(--app-text);
}

.table-responsive { border-radius: var(--app-r-md); }

/* Money and counts align right and use tabular figures */
.table .text-end,
.table .currency,
.currency,
.kpi-value {
  font-variant-numeric: tabular-nums;
}

.currency { font-family: var(--app-font-num); }

/* DataTables chrome
   The wrapper carried 15px of padding inside the card and the toolbar was
   unstyled Bootstrap: four differently coloured export buttons, a 4px-radius
   select and a search field of a different height from every other control. */
.dataTables_wrapper { padding: 0; }

.dataTables_wrapper .dt-buttons { gap: var(--app-1); }

.dataTables_wrapper .dt-buttons .btn {
  height: 30px;
  padding: 0 var(--app-3);
  border: 1px solid var(--app-border-strong);
  border-radius: var(--app-r-sm);
  background: var(--app-surface);
  color: var(--app-text-2);
  font-size: var(--app-text-12);
  font-weight: 500;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
}

.dataTables_wrapper .dt-buttons .btn:hover {
  background: var(--app-surface-3);
  border-color: var(--app-border-strong);
  color: var(--app-text);
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  font-size: var(--app-text-12);
  color: var(--app-text-2);
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  height: 30px;
  padding: 0 var(--app-2);
  border: 1px solid var(--app-border-strong);
  border-radius: var(--app-r-sm);
  background: var(--app-surface);
  color: var(--app-text);
  font-size: var(--app-text-12);
  min-width: 0;
}

.dataTables_wrapper .dataTables_filter input {
  min-width: 180px;
  margin-left: var(--app-2);
}

.dataTables_wrapper .dataTables_info {
  font-size: var(--app-text-12);
  color: var(--app-text-3);
  padding-top: var(--app-3);
}

.dataTables_wrapper .pagination { margin: 0; gap: 2px; }

.dataTables_wrapper .page-link {
  height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 var(--app-2);
  border: 1px solid var(--app-border);
  border-radius: var(--app-r-xs);
  background: var(--app-surface);
  color: var(--app-text-2);
  font-size: var(--app-text-12);
}

.dataTables_wrapper .page-item.active .page-link {
  background: var(--app-accent);
  border-color: var(--app-accent);
  color: var(--app-text-inverse);
}

.dataTables_wrapper .page-item.disabled .page-link {
  background: var(--app-surface-3);
  color: var(--app-text-3);
}

/* Asset register
   Ten columns must fit the frame without a sideways scroll. The DataTables
   responsive extension is configured in main.js but its script is not loaded,
   so it cannot collapse columns; left on auto layout the table grows to ~1048px
   inside a ~935px frame and scrolls. A fixed layout with proportional widths
   makes the browser honour them: short values stay on one line below, while
   the long text columns (Name, Category, Cost Centre, Department) wrap. */
#assetTable { width: 100%; table-layout: fixed; }
#assetTable th,
#assetTable td { overflow-wrap: break-word; }

#assetTable th:nth-child(1),
#assetTable td:nth-child(1) { width: 4%; padding-right: 0; }
#assetTable th:nth-child(2),
#assetTable td:nth-child(2) { width: 10%; }
#assetTable th:nth-child(3),
#assetTable td:nth-child(3) { width: 15%; }
#assetTable th:nth-child(4),
#assetTable td:nth-child(4) { width: 7%; }
#assetTable th:nth-child(5),
#assetTable td:nth-child(5) { width: 8%; }
#assetTable th:nth-child(6),
#assetTable td:nth-child(6) { width: 14%; }
#assetTable th:nth-child(7),
#assetTable td:nth-child(7) { width: 10%; }
#assetTable th:nth-child(8),
#assetTable td:nth-child(8) { width: 12%; }
#assetTable th:nth-child(9),
#assetTable td:nth-child(9) { width: 9%; }
#assetTable th:nth-child(10),
#assetTable td:nth-child(10) { width: 12%; }

/* Values on one line; headers may wrap so labels like "Purchase Date" are
   not truncated in their narrower fixed-width column. DataTables' Bootstrap
   integration sets `thead th { white-space: nowrap }`, so this is restated
   for the header cells specifically. */
#assetTable thead th { white-space: normal; }
#assetTable td:nth-child(2),
#assetTable td:nth-child(7),
#assetTable td:nth-child(8),
#assetTable td:nth-child(9),
#assetTable td:nth-child(10) { white-space: nowrap; }

#assetTable .btn-group > .btn {
  height: 28px;
  padding: 0 var(--app-1);
}

/* ================================================================
   10. BADGES
   ----------------------------------------------------------------
   Bootstrap declares its colour utilities (.bg-success, .bg-info, …)
   !important and sets .badge text to white. A badge carrying one of them
   therefore renders as a Bootstrap chip with an inherited text colour —
   grey with indigo text on the dashboard counts, cyan with white text on
   asset pages. The declarations below exist solely to beat that
   third-party utility and are scoped to badge components and the three
   Bootstrap text-colour utilities; do not copy the pattern elsewhere.
   ================================================================ */
.badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--app-1);
  padding: 2px var(--app-2);
  border-radius: var(--app-r-xs);
  border: 1px solid var(--app-border);
  background-color: var(--app-surface-3) !important;
  color: var(--app-text-2) !important;
  font-size: var(--app-text-11);
  font-weight: 500;
  line-height: 18px;
  white-space: nowrap;
}

/* Status words arrive lowercase from the database; barcodes must not be
   touched, so capitalisation is scoped to the status component. */
.status-badge { text-transform: capitalize; }

.badge--success,
.badge.bg-success,
.status-badge--active,
.status-badge--approved,
.status-badge.active {
  background-color: var(--app-success-soft) !important;
  color: var(--app-success) !important;
  border-color: var(--app-success-border);
}

.badge--neutral,
.badge.bg-secondary,
.badge.bg-light,
.status-badge--inactive {
  background-color: var(--app-surface-3) !important;
  color: var(--app-text-2) !important;
  border-color: var(--app-border);
}

.badge--warning,
.badge.bg-warning,
.status-badge--pending,
.status-badge.pending {
  background-color: var(--app-warning-soft) !important;
  color: var(--app-warning) !important;
  border-color: var(--app-warning-border);
}

.badge--danger,
.badge.bg-danger,
.status-badge--rejected,
.status-badge--disposed {
  background-color: var(--app-danger-soft) !important;
  color: var(--app-danger) !important;
  border-color: var(--app-danger-border);
}

.badge--info,
.badge.bg-info,
.badge.bg-primary,
.status-badge--info,
.status-badge.info {
  background-color: var(--app-info-soft) !important;
  color: var(--app-info) !important;
  border-color: var(--app-info-border);
}

/* Bootstrap's text colour utilities are `!important` too, and their defaults
   are the saturated Bootstrap palette: `.text-danger` #dc3545 and
   `.text-success` #198754 are both about 4.0:1 on white, which fails AA for
   the 13px table figures they are used for on the asset and disposal screens.
   They are aliased to the darker semantic tokens here, which is also why this
   rule needs `!important` — same reason as the badge rules above. */
.text-danger { color: var(--app-danger) !important; }
.text-success { color: var(--app-success) !important; }
.text-primary { color: var(--app-accent) !important; }

/* ================================================================
   11. ALERTS
   ================================================================ */
.alert {
  border-radius: var(--app-r-sm);
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  color: var(--app-text-2);
  font-size: var(--app-text-13);
  padding: var(--app-3) var(--app-4);
  display: flex;
  align-items: center;
  gap: var(--app-2);
}

.alert-success {
  background: var(--app-success-soft);
  border-color: var(--app-success-border);
  color: var(--app-success);
}

.alert-danger {
  background: var(--app-danger-soft);
  border-color: var(--app-danger-border);
  color: var(--app-danger);
}

.alert-warning {
  background: var(--app-warning-soft);
  border-color: var(--app-warning-border);
  color: var(--app-warning);
}

.alert-info {
  background: var(--app-info-soft);
  border-color: var(--app-info-border);
  color: var(--app-info);
}

.alert i { font-size: var(--app-text-13); }

.alert-dismissible .btn-close {
  padding: var(--app-3);
  font-size: var(--app-text-11);
  opacity: 0.6;
}

/* ================================================================
   12. EMPTY STATES
   ================================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--app-10) var(--app-5);
  color: var(--app-text-3);
  gap: var(--app-2);
}

.empty-state__icon,
.empty-state i {
  font-size: var(--app-text-20);
  color: var(--app-border-strong);
  margin-bottom: var(--app-1);
}

.empty-state__text {
  font-size: var(--app-text-13);
  color: var(--app-text-3);
  margin: 0;
}

.empty-state--full { min-height: 180px; }

/* ================================================================
   13. DROPDOWNS
   ================================================================ */
.dropdown-menu {
  border: 1px solid var(--app-border);
  border-radius: var(--app-r-sm);
  box-shadow: var(--app-shadow-pop);
  padding: var(--app-1);
  font-size: var(--app-text-13);
  min-width: 168px;
}

.dropdown-item {
  border-radius: var(--app-r-xs);
  padding: var(--app-2) var(--app-3);
  color: var(--app-text-2);
  font-size: var(--app-text-13);
  display: flex;
  align-items: center;
  gap: var(--app-2);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--app-surface-3);
  color: var(--app-text);
}

.dropdown-item i { font-size: var(--app-text-12); color: var(--app-text-3); width: 14px; }

.dropdown-divider { border-color: var(--app-border); margin: var(--app-1) 0; }

/* ================================================================
   14. TOASTS
   ================================================================ */
.toast-container { z-index: 1090; }

.toast {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-r-sm);
  box-shadow: var(--app-shadow-pop);
  font-size: var(--app-text-13);
}

.toast__message { font-size: var(--app-text-13); color: var(--app-text-2); }

/* ================================================================
   15. DASHBOARD
   ================================================================ */
/* Welcome block: drop the decorative icon and the gradient */
.dash-welcome {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--app-border);
  border-radius: 0;
  box-shadow: none;
  padding: 0 0 var(--app-4);
  margin-bottom: var(--app-6);
  color: var(--app-text);
  position: static;
}

.dash-welcome__icon { display: none; }

/* Greeting and date share one baseline; the subtitle sits beneath both. */
.dash-welcome__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--app-4);
  flex-wrap: wrap;
}

.dash-welcome h2 {
  font-size: var(--app-text-20);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--app-1);
  color: var(--app-text);
}

.dash-welcome__head h2 { margin-bottom: 0; }

.dash-welcome p {
  font-size: var(--app-text-13);
  color: var(--app-text-3);
  margin: 0;
}

.dash-welcome__date {
  display: inline-flex;
  align-items: center;
  gap: var(--app-2);
  font-size: var(--app-text-12);
  color: var(--app-text-3);
  margin-top: 0;
  white-space: nowrap;
}

/* KPI card — label first, value second, no coloured tile */
.kpi-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-r-md);
  padding: var(--app-4) var(--app-5);
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: var(--app-1);
  position: relative;
  overflow: hidden;
  transition: border-color 120ms ease;
}

.kpi-card:hover { border-color: var(--app-border-strong); }

.kpi-icon {
  position: absolute;
  top: var(--app-4);
  right: var(--app-4);
  width: 24px;
  height: 24px;
  border-radius: var(--app-r-xs);
  background: var(--app-surface-3);
  color: var(--app-text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--app-text-11);
}

/* Neutralise the per-metric colour tiles */
.kpi-icon--blue,
.kpi-icon--green,
.kpi-icon--purple,
.kpi-icon--amber,
.kpi-icon--red,
.kpi-icon--cyan,
.kpi-icon--slate {
  background: var(--app-surface-3);
  color: var(--app-text-3);
}

.kpi-value {
  font-size: var(--app-text-24);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--app-text);
  line-height: 1.2;
}

.kpi-label {
  font-size: var(--app-text-12);
  color: var(--app-text-3);
  font-weight: 500;
  order: -1;
}

.kpi-trend {
  font-size: var(--app-text-12);
  color: var(--app-accent);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: var(--app-1);
  margin-top: var(--app-1);
}

.kpi-trend i { font-size: var(--app-text-11); }

/* Alert banner */
.alert-banner {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-r-md);
  padding: var(--app-3) var(--app-4);
  display: flex;
  align-items: center;
  gap: var(--app-3);
  box-shadow: none;
}

.alert-banner__icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: var(--app-r-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--app-text-12);
}

.alert-banner__icon--amber { background: var(--app-warning-soft); color: var(--app-warning); }
.alert-banner__icon--red { background: var(--app-danger-soft); color: var(--app-danger); }
.alert-banner__icon--blue { background: var(--app-info-soft); color: var(--app-info); }

.alert-banner__body { flex: 1; min-width: 0; }

.alert-banner__title {
  font-size: var(--app-text-13);
  font-weight: 600;
  color: var(--app-text);
}

.alert-banner__sub {
  font-size: var(--app-text-12);
  color: var(--app-text-3);
  margin-top: 1px;
}

.alert-banner__btn {
  font-size: var(--app-text-12);
  font-weight: 500;
  color: var(--app-accent);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: var(--app-1);
}

.alert-banner__btn i { font-size: var(--app-text-11); }

/* Quick actions */
.quick-action {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-r-md);
  padding: var(--app-3) var(--app-4);
  display: flex;
  align-items: center;
  gap: var(--app-3);
  box-shadow: none;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.quick-action:hover {
  border-color: var(--app-border-strong);
  background: var(--app-surface-2);
  transform: none;
  box-shadow: none;
}

.quick-action__icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: var(--app-r-xs);
  background: var(--app-surface-3);
  color: var(--app-text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--app-text-12);
}

.qa-icon--blue,
.qa-icon--red,
.qa-icon--violet,
.qa-icon--slate,
.qa-icon--green,
.qa-icon--amber {
  background: var(--app-surface-3);
  color: var(--app-text-2);
}

.quick-action__text {
  font-size: var(--app-text-13);
  font-weight: 500;
  color: var(--app-text);
  line-height: 1.3;
}

.quick-action__sub {
  font-size: var(--app-text-11);
  color: var(--app-text-3);
}

/* Activity feed */
.activity-list { list-style: none; padding: 0; margin: 0; }

.activity-item {
  display: flex;
  gap: var(--app-3);
  padding: var(--app-3) 0;
  border-bottom: 1px solid var(--app-border);
}

.activity-item:last-child { border-bottom: 0; padding-bottom: 0; }
.activity-item:first-child { padding-top: 0; }

.activity-item__icon {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 50%;
  background: var(--app-surface-3);
  color: var(--app-text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--app-text-11);
}

.activity-item__content { min-width: 0; flex: 1; }

.activity-item__text {
  font-size: var(--app-text-13);
  color: var(--app-text-2);
  line-height: 1.4;
}

.activity-item__text strong {
  color: var(--app-text);
  font-weight: 500;
}

.activity-item__details {
  display: block;
  font-size: var(--app-text-12);
  color: var(--app-text-3);
  margin-top: 1px;
}

.activity-item__time {
  display: flex;
  align-items: center;
  gap: var(--app-1);
  font-size: var(--app-text-11);
  color: var(--app-text-3);
  margin-top: 2px;
}

/* Chart + table card
   The donut held a fixed 260px inside a card that is only 60% of the page,
   leaving the four-column table roughly 190px and forcing a horizontal
   scrollbar that hid the NBV column. The table is the data, so it takes the
   full width and the donut sits above it. */
.chart-table-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--app-5);
}

.chart-table-row__chart {
  width: 100%;
  max-width: 220px;
  height: 220px;
  margin: 0 auto;
}

.chart-table-row__table {
  width: 100%;
  min-width: 0;
}

/* Summary strip — report, register and user pages
   These boxes were built for the old dark gradient hero: translucent white
   on colour, with white text. The hero is now flat and light, so the label
   and the value were both white on near-white (~1.05:1) and effectively
   invisible. Rebuilt as flat cards on the standard surface. */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--app-3);
  margin-top: var(--app-5);
}

.stat-box {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-r-md);
  padding: var(--app-3) var(--app-4);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: none;
}

.stat-box::before { content: none; display: none; }

.stat-box:hover {
  background: var(--app-surface);
  border-color: var(--app-border);
  transform: none;
}

.stat-box .label {
  font-size: var(--app-text-11);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--app-text-3);
  margin-bottom: 2px;
}

.stat-box .value {
  font-size: var(--app-text-20);
  font-weight: 600;
  font-family: var(--app-font-num);
  font-variant-numeric: tabular-nums;
  color: var(--app-text);
  letter-spacing: -0.01em;
}

/* Report centre — the index of every report */
.report-group { margin-bottom: var(--app-6); }

.report-group__head { margin-bottom: var(--app-3); }

.report-group__title {
  font-size: var(--app-text-11);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--app-text-3);
  margin: 0;
}

.report-group__hint {
  font-size: var(--app-text-12);
  color: var(--app-text-3);
  margin: 2px 0 0;
}

.report-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--app-3);
}

.report-item {
  display: flex;
  align-items: flex-start;
  gap: var(--app-3);
  padding: var(--app-4);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-r-md);
  color: var(--app-text);
  text-decoration: none;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.report-item:hover,
.report-item:focus-visible {
  border-color: var(--app-accent-border);
  background: var(--app-accent-soft);
  color: var(--app-text);
}

.report-item__icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--app-border);
  border-radius: var(--app-r-sm);
  background: var(--app-surface-2);
  color: var(--app-text-2);
  font-size: var(--app-text-13);
}

.report-item:hover .report-item__icon {
  border-color: var(--app-accent-border);
  background: var(--app-surface);
  color: var(--app-accent);
}

.report-item__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.report-item__title { font-size: var(--app-text-13); font-weight: 600; }

.report-item__desc {
  font-size: var(--app-text-12);
  color: var(--app-text-3);
  line-height: 1.45;
}

.report-item__chevron {
  font-size: var(--app-text-11);
  color: var(--app-border-strong);
  margin-top: 8px;
}

.report-item:hover .report-item__chevron { color: var(--app-accent); }

/* Report parameter card
   Was a centred 760px block with a 72px gradient icon tile, a 22px
   "Select Report Parameters" heading and a subtitle: three layers of
   chrome above a three-field form. */
.report-select-card .card-icon { display: none; }

.report-select-card > h2 {
  font-size: var(--app-text-13);
  font-weight: 600;
  margin-bottom: var(--app-1);
}

.report-select-card .card-subtitle {
  font-size: var(--app-text-12);
  color: var(--app-text-3);
  margin-bottom: var(--app-4);
}

.report-select-card form {
  max-width: none;
  margin: 0;
  text-align: left;
}

.report-select-card .form-select,
.report-select-card .form-control {
  height: 36px;
  padding: 0 var(--app-3);
  border: 1px solid var(--app-border-strong);
  border-radius: var(--app-r-sm);
  background: var(--app-surface);
  font-size: var(--app-text-13);
}

/* ================================================================
   16. UPLOAD / TRANSFER / REPORT BLOCKS
   ================================================================ */
.upload-container {
  max-width: 640px;
  margin: 0 auto;
}

.upload-zone {
  border: 1.5px dashed var(--app-border-strong);
  border-radius: var(--app-r-md);
  background: var(--app-surface-2);
  padding: var(--app-10) var(--app-6);
  text-align: center;
  transition: border-color 120ms ease, background-color 120ms ease;
}

/* The drag state used to be Bootstrap's `.bg-light`, which the legacy layer declares
   `!important`, so the accent tint below never applied. The view now toggles
   `.is-dragover` instead. */
.upload-zone:hover,
.upload-zone.is-dragover {
  border-color: var(--app-accent);
  background: var(--app-accent-soft);
}

.upload-zone i {
  font-size: var(--app-text-24);
  color: var(--app-text-3);
  margin-bottom: var(--app-3);
  display: block;
}

.upload-zone h4 {
  font-size: var(--app-text-14);
  font-weight: 600;
  color: var(--app-text);
  margin-bottom: var(--app-1);
}

.download-template {
  text-align: center;
  padding: var(--app-5);
  border: 1px solid var(--app-border);
  border-radius: var(--app-r-md);
  background: var(--app-surface);
}

.report-container {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  color: var(--app-text);
}

/* The transfer forms live inside equal-width col-lg-6 cards, so they fill
   their card rather than stopping at the report selector's 760px cap. */
.report-select-card { max-width: 760px; }

/* Report tables: denser than data tables */
.rpt-table { font-size: var(--app-text-12); }
.rpt-table th { font-size: var(--app-text-11); }
.rpt-table .zero-val { color: var(--app-text-3); font-style: normal; }

/* Search bar above a report table */
.report-filter {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: var(--app-3);
  padding: var(--app-4) var(--app-4) 0;
}
.report-filter__field { flex: 1 1 320px; min-width: 0; }
.report-filter__field .form-label {
  font-size: var(--app-text-11);
  color: var(--app-text-3);
  margin-bottom: var(--app-1);
}
.report-filter__actions {
  display: flex;
  gap: var(--app-2);
  flex: 0 0 auto;
}

/* Pager below a report table */
.report-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--app-3);
  padding: var(--app-3) var(--app-4);
  border-top: 1px solid var(--app-border);
}
.report-pager--single { justify-content: flex-end; }
.report-pager__summary { font-size: var(--app-text-12); color: var(--app-text-3); }
.report-pager__links { display: flex; align-items: center; gap: var(--app-3); }
.report-pager__page { font-size: var(--app-text-12); color: var(--app-text-3); }
.report-pager .btn.disabled {
  pointer-events: none;
  opacity: 0.45;
}

/* ================================================================
   17. UTILITIES
   ================================================================ */
.text-muted { color: var(--app-text-3); }
.text-dark { color: var(--app-text); }
.fw-semibold { font-weight: 600; }
.font-monospace { font-family: var(--app-font-num); }

/* ================================================================
   18. MOTION
   ================================================================ */
/* Remove the staggered entrance animation across the app */
.animate-in {
  animation: none;
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms;
    animation-iteration-count: 1;
    transition-duration: 0.001ms;
    scroll-behavior: auto;
  }
}

/* ================================================================
   19. RESPONSIVE
   ================================================================ */
@media (max-width: 1199px) {
  .page-content { padding: var(--app-5); }
}

@media (max-width: 991px) {
  /* Off-canvas uses the same mechanism as the base stylesheet (negative
     margin) so the two do not fight each other. */
  .sidebar {
    margin-left: calc(-1 * var(--app-sidebar));
    transform: none;
  }
  .sidebar.show { margin-left: 0; }
  .sidebar.collapsed { width: var(--app-sidebar); margin-left: calc(-1 * var(--app-sidebar)); }
  .sidebar.collapsed.show { margin-left: 0; }
  .sidebar.collapsed .sidebar-brand-text,
  .sidebar.collapsed .menu-link span,
  .sidebar.collapsed .menu-link .arrow { display: initial; }
  .sidebar.collapsed .menu-link { justify-content: flex-start; padding: 0 var(--app-2); }
  .sidebar.collapsed .submenu { display: block; }

  .main-content { margin-left: 0; }
  body.sidebar-collapsed .main-content { margin-left: 0; }
  .top-header { padding: 0 var(--app-4); }
  .page-content { padding: var(--app-4); }
  .header-search { max-width: none; }
  .user-info { display: none; }
  .form-card,
  .report-select-card { padding: var(--app-6); }
}

@media (max-width: 767px) {
  .page-content { padding: var(--app-3); }
  .top-header { padding: 0 var(--app-3); gap: var(--app-2); }
  .search-shortcut { display: none; }
  .page-hero,
  .report-hero,
  .dash-welcome { padding-bottom: var(--app-3); margin-bottom: var(--app-4); }
  .page-hero h2,
  .dash-welcome h2 { font-size: var(--app-text-16); }
  .kpi-value { font-size: var(--app-text-20); }
  .form-card,
  .report-select-card { padding: var(--app-5); }
  .card-body,
  .dash-card__body { padding: var(--app-4); }
  .alert-banner { flex-wrap: wrap; }
  .alert-banner__btn { width: 100%; justify-content: flex-end; }
  .table > thead th,
  .table > tbody td { padding: var(--app-2) var(--app-3); }
  .btn { height: 32px; }
}

@media (max-width: 575px) {
  .page-content { padding: var(--app-2); }
  .breadcrumb-nav { display: none; }
  .kpi-card { padding: var(--app-3) var(--app-4); }
  .btn-group { flex-wrap: wrap; }

  /* The frame padding is now 8px, smaller than Bootstrap's 12px row gutter,
     so a .row's -12px margin escapes the frame and creates a 4px horizontal
     scroll. Every column is md/lg/xl (or col-12), so below 575px they are all
     full width and the horizontal gutter does nothing anyway. Zeroing the
     gutter variable collapses both the negative row margin and the matching
     column padding, which lands grid content flush with the frame edge like
     every other element on the page. */
  .page-content .row {
    --bs-gutter-x: 0;
  }
}

/* ================================================================
   20. PRINT
   ================================================================ */
@media print {
  .sidebar,
  .top-header,
  .sidebar-overlay,
  .breadcrumb-nav,
  .toast-container,
  .no-print { display: none; }

  .main-content { margin-left: 0; }
  .page-content { padding: 0; max-width: none; }

  .card,
  .dash-card,
  .table-modern,
  .report-select-card,
  .form-card {
    border: 1px solid #d0d5dd;
    box-shadow: none;
    break-inside: avoid;
  }

  body { background: #ffffff; }
}

/* ================================================================
   21. MODULE-SPECIFIC BLOCKS
   These class names existed in the views but were defined in no
   stylesheet, so they rendered unstyled. Defined here so every
   screen has a deliberate appearance.
   ================================================================ */
.quick-btn {
  height: 30px;
  padding: 0 var(--app-3);
  border: 1px solid var(--app-border-strong);
  border-radius: var(--app-r-sm);
  background: var(--app-surface);
  color: var(--app-text-2);
  font-size: var(--app-text-12);
  font-weight: 500;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.quick-btn:hover {
  background: var(--app-surface-3);
  border-color: var(--app-border-strong);
  color: var(--app-text);
}

.quick-buttons {
  display: flex;
  gap: var(--app-2);
  flex-wrap: wrap;
  margin-bottom: var(--app-4);
}

.filter-section {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-r-md);
  padding: var(--app-4);
  margin-bottom: var(--app-4);
}
/* Between the md and xl breakpoints the two toolbar columns are still side
   by side but too narrow for the three action buttons, which overflowed the
   frame. Let both rows wrap and drop the forced right alignment so they reflow
   onto a second line instead of escaping. */
.filter-section .btn-group { flex-wrap: wrap; }
.filter-section > .row > [class*="col-"] { min-width: 0; }
@media (min-width: 768px) and (max-width: 1199px) {
  .filter-section > .row > .col-md-7,
  .filter-section > .row > .col-md-5 {
    flex: 0 0 100%;
    max-width: 100%;
    text-align: left;
  }
  .filter-section > .row > .col-md-5 { margin-top: var(--app-3); }
}

.export-btn {
  height: 30px;
  padding: 0 var(--app-3);
  border: 1px solid var(--app-border-strong);
  border-radius: var(--app-r-sm);
  background: var(--app-surface);
  color: var(--app-text-2);
  font-size: var(--app-text-12);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: var(--app-1);
}

.export-btn:hover { background: var(--app-surface-3); color: var(--app-text); }

.action-btn {
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: var(--app-r-xs);
  background: transparent;
  color: var(--app-text-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--app-text-12);
}

.action-btn:hover { background: var(--app-surface-3); color: var(--app-text); }

/* `overflow: hidden` clipped the table instead of scrolling it, so the
   disposal list was cut off on narrow screens with no way to reach the last
   columns. The wrapper also carries `.table-responsive` in the view. */
.asset-table { border-radius: var(--app-r-md); overflow-x: auto; }

.asset-checkbox { width: 15px; height: 15px; accent-color: var(--app-accent); }

.asset-row { transition: background-color 120ms ease; }
.asset-row:hover { background: var(--app-surface-2); }

.badge-rate {
  font-size: var(--app-text-11);
  font-weight: 500;
  color: var(--app-text-2);
  background: var(--app-surface-3);
  border-radius: var(--app-r-xs);
  padding: 1px var(--app-1);
}

.avatar-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--app-accent-soft);
  color: var(--app-accent);
  font-size: var(--app-text-12);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.form-group { margin-bottom: var(--app-4); }

/* Transfer */
/* The transfer view toggles `.show` on asset selection, but the base class had
   no hidden state and `.show` had no rule, so an empty panel with three "-"
   placeholders was always on screen. Collapse it until an asset is chosen. */
.asset-preview {
  display: none;
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  border-radius: var(--app-r-md);
  padding: var(--app-4);
}
.asset-preview.show {
  display: block;
}

.asset-preview-item {
  display: flex;
  justify-content: space-between;
  gap: var(--app-4);
  padding: var(--app-2) 0;
  border-bottom: 1px solid var(--app-border);
  font-size: var(--app-text-13);
}

.asset-preview-item:last-child { border-bottom: 0; }

.asset-preview-label { color: var(--app-text-3); font-size: var(--app-text-12); }
.asset-preview-value { color: var(--app-text); font-weight: 500; }

.transfer-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--app-text-3);
  font-size: var(--app-text-16);
  padding: var(--app-2) 0;
}

/* Quick Assign modal asset summary. This was a Bootstrap .alert, which the
   global alert-to-toast converter turned into an "Info / Asset: -" toast on
   page load even while the modal was hidden. It is static modal content, not
   a notification, so it gets its own panel style and is left out of the
   converter. */
.modal-asset-summary {
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  border-radius: var(--app-r-md);
  padding: var(--app-3) var(--app-4);
  color: var(--app-text-2);
  font-size: var(--app-text-13);
}

/* Transfer page refinements. Scoped to .transfer-page so no other screen is
   affected. Fixes the icon/title header split, oversized actions, low-contrast
   disabled button and oversized empty panels measured in the UI pass. */
.card-header--title { justify-content: flex-start; }

/* Both form cards are h-100 in a flex row. Make the form a flex column so the
   action button sits at the bottom of each card instead of leaving dead space
   under the shorter one.

   The views use .transfer-form as the card body, not .card-body, so without an
   explicit padding the fields sat flush against the card border and the header
   divider. Match .card-body padding so both cards inset their content by the
   same amount as every other card in the app. */
.transfer-page .transfer-form {
  padding: var(--app-5);
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}
.transfer-page .transfer-form form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}
.transfer-page .transfer-form .d-grid,
.transfer-page .transfer-form .d-grid.gap-2 { margin-top: auto; }

.transfer-page .btn-transfer,
.transfer-page .btn-success { min-height: 38px; }

/* The legacy layer gives every .card a 20px bottom margin. On this page the rows
   already carry mt-4 (24px), so sections were separated by 44px while the
   stats row used 24px. Let the row utilities own the vertical rhythm. */
.transfer-page .card { margin-bottom: 0; }

/* A disabled success button kept white text on green at 0.55 opacity — hard
   to read. Use a neutral surface with a muted label instead. */
.transfer-page .btn:disabled {
  opacity: 1;
  background: var(--app-surface-3);
  border-color: var(--app-border);
  color: var(--app-text-3);
}

.asset-checklist {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--app-border);
  border-radius: var(--app-r-md);
  background: var(--app-surface-2);
  padding: var(--app-3);
}

.inline-empty {
  display: flex;
  align-items: center;
  gap: var(--app-2);
  padding: var(--app-4);
  border: 1px solid var(--app-success-border);
  border-radius: var(--app-r-md);
  background: var(--app-success-soft);
  color: var(--app-success);
  font-size: var(--app-text-13);
}

.empty-state--compact { padding: var(--app-6) var(--app-5); }
.empty-state--compact i { font-size: var(--app-text-24); color: var(--app-success); }
.empty-state--compact h5 {
  font-size: var(--app-text-14);
  font-weight: 600;
  color: var(--app-text);
  margin: 0;
}

.approval-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-r-md);
  padding: var(--app-4);
  margin-bottom: var(--app-3);
}

/* Depreciation summary blocks */
.dep-summary {
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  border-radius: var(--app-r-md);
  padding: var(--app-4);
}

.dep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--app-3);
}

/* Stats */
.stats-card { padding: var(--app-4) var(--app-5); }
.stats-number {
  font-size: var(--app-text-20);
  font-weight: 600;
  color: var(--app-text);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.stats-label { font-size: var(--app-text-12); color: var(--app-text-3); }
.stats-icon { font-size: var(--app-text-14); color: var(--app-text-3); }

/* Profile */
.profile-card { padding: var(--app-6); }
.info-card { padding: var(--app-4) var(--app-5); }
.user-table-card { padding: 0; overflow: hidden; }

@media (max-width: 767px) {
  .filter-section { padding: var(--app-3); }
  .asset-preview-item { flex-direction: column; gap: 2px; }
  .dep-grid { grid-template-columns: 1fr; }
}

/* ================================================================
   22. QUICK ACTIONS
   ----------------------------------------------------------------
   The legacy layer renders this as a gradient pill with a
   scale-on-hover and a 24px coloured glow. Re-declared here so the
   popover belongs to the flat system: solid accent, one hairline, one
   shadow, and no transform on hover.
   ================================================================ */
.quick-actions-fab {
  position: fixed;
  right: var(--app-6);
  bottom: var(--app-6);
  /* Below the sidebar (1000) so the mobile drawer covers it. */
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--app-2);
}

.quick-actions-btn {
  height: 40px;
  min-width: 0;
  padding: 0 var(--app-3) 0 var(--app-4);
  border: 1px solid var(--app-accent);
  border-radius: var(--app-r-sm);
  background: var(--app-accent);
  color: var(--app-text-inverse);
  font-family: var(--app-font);
  font-size: var(--app-text-13);
  font-weight: 500;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: var(--app-2);
  box-shadow: var(--app-shadow-pop);
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.quick-actions-btn:hover,
.quick-actions-btn:focus {
  background: var(--app-accent-hover);
  border-color: var(--app-accent-hover);
  color: var(--app-text-inverse);
  transform: none;
  box-shadow: var(--app-shadow-pop);
}

.quick-actions-btn:active { transform: none; }

.quick-actions-btn i:first-child { font-size: var(--app-text-12); }

.quick-actions-btn__chevron {
  font-size: 9px;
  opacity: 0.75;
  transition: transform 150ms ease;
}

.quick-actions-btn[aria-expanded="true"] .quick-actions-btn__chevron {
  transform: rotate(180deg);
}

.quick-actions-panel {
  /* Absolutely positioned so the container stays the size of the button: a
     hidden panel in normal flow would still hit-test and swallow clicks on
     whatever sits underneath it. */
  position: absolute;
  right: 0;
  bottom: calc(100% + var(--app-2));
  width: 268px;
  padding: var(--app-1);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-r-md);
  box-shadow: var(--app-shadow-pop);
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms;
}

.quick-actions-panel.show {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.quick-actions-panel a {
  display: flex;
  align-items: center;
  gap: var(--app-3);
  padding: var(--app-2) var(--app-2);
  border-radius: var(--app-r-xs);
  color: var(--app-text);
  text-decoration: none;
  transition: background-color 120ms ease;
}

.quick-actions-panel a:hover,
.quick-actions-panel a:focus-visible {
  background: var(--app-surface-3);
  color: var(--app-text);
}

.quick-actions-panel a i {
  width: 28px;
  height: 28px;
  min-width: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--app-border);
  border-radius: var(--app-r-xs);
  background: var(--app-surface-2);
  color: var(--app-text-2);
  font-size: var(--app-text-12);
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.quick-actions-panel a:hover i {
  background: var(--app-accent-soft);
  border-color: var(--app-accent-border);
  color: var(--app-accent);
}

.quick-actions-item__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.quick-actions-item__label {
  font-size: var(--app-text-13);
  font-weight: 500;
  color: var(--app-text);
  line-height: 1.3;
}

.quick-actions-item__meta {
  font-size: var(--app-text-11);
  color: var(--app-text-3);
  line-height: 1.3;
}

@media (max-width: 575px) {
  .quick-actions-fab {
    right: var(--app-3);
    bottom: var(--app-3);
  }
  .quick-actions-panel { width: calc(100vw - var(--app-6)); max-width: 268px; }
  .quick-actions-btn { height: 36px; }
}

@media print {
  .quick-actions-fab { display: none; }
}

/* ================================================================
   23. REMAINING MODULES
   ----------------------------------------------------------------
   Components that are still served only by the legacy layer. Each block here
   replaces a treatment that either no longer renders — white text left
   over from the dark gradient hero — or predates the flat system.
   ================================================================ */

/* Page footer — had no rules at all, so it was unstyled block text.
   The footer partial is rendered after `.page-content` closes, so the footer
   is a sibling of the page frame and does not inherit its padding. It needs
   its own 24px, both to line the copyright up with the content column and
   because the Bootstrap row inside carries -12px margins: without it the
   row pushes 12px past the right edge and the whole document gains a
   horizontal scrollbar. */
.footer {
  border-top: 1px solid var(--app-border);
  background: transparent;
  padding: var(--app-4) var(--app-6);
  margin-top: var(--app-6);
  font-size: var(--app-text-12);
  color: var(--app-text-3);
}

.footer .container-fluid { padding: 0; }

/* Error page — its header used `.bg-danger`, which the legacy layer turns into a
   gradient with `color: white !important`. That was the last gradient in the
   app. The view now carries its own classes so the component can be styled
   without an `!important` of its own. */
.error-page {
  max-width: 720px;
  margin: var(--app-8) auto;
}

.error-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-r-md);
  overflow: hidden;
}

.error-card__header {
  display: flex;
  align-items: center;
  gap: var(--app-2);
  padding: var(--app-3) var(--app-5);
  background: var(--app-danger-soft);
  border-bottom: 1px solid var(--app-danger-border);
}

.error-card__header h4 {
  margin: 0;
  font-size: var(--app-text-16);
  font-weight: 600;
  color: var(--app-danger);
  display: flex;
  align-items: center;
  gap: var(--app-2);
}

.error-card__body { padding: var(--app-5); }

.error-card__message {
  font-size: var(--app-text-14);
  color: var(--app-text-2);
  margin-bottom: var(--app-4);
}

.error-card__details {
  list-style: none;
  margin: 0 0 var(--app-4);
  padding: 0;
  display: grid;
  gap: var(--app-2);
}

.error-card__details li {
  display: flex;
  align-items: flex-start;
  gap: var(--app-2);
  font-size: var(--app-text-13);
  color: var(--app-text-2);
}

.error-card__details li i {
  color: var(--app-success);
  margin-top: 3px;
  flex-shrink: 0;
}

.error-card__actions {
  display: flex;
  gap: var(--app-2);
  padding-top: var(--app-4);
  border-top: 1px solid var(--app-border);
}

/* Dashboard insight cards — the last component still carrying the old
   treatment: 16px radius, `--gray-*` colours and a hover lift. They are the
   only elements in the app that move on hover, so they are flattened here. */
.insight-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-r-md);
  padding: var(--app-5) var(--app-6);
  display: flex;
  align-items: flex-start;
  gap: var(--app-4);
  transition: none;
}

.insight-card:hover {
  box-shadow: none;
  border-color: var(--app-border);
  transform: none;
}

.insight-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--app-r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--app-text-16);
  flex-shrink: 0;
}

.insight-card__icon--info { background: var(--app-info-soft); color: var(--app-info); }
.insight-card__icon--warning { background: var(--app-warning-soft); color: var(--app-warning); }
.insight-card__icon--success { background: var(--app-success-soft); color: var(--app-success); }
.insight-card__icon--danger { background: var(--app-danger-soft); color: var(--app-danger); }
.insight-card__icon--purple { background: var(--app-accent-soft); color: var(--app-accent); }

.insight-card__body { flex: 1; min-width: 0; }

.insight-card__title {
  font-size: var(--app-text-13);
  font-weight: 600;
  color: var(--app-text);
  margin-bottom: var(--app-1);
}

.insight-card__text {
  font-size: var(--app-text-13);
  color: var(--app-text-2);
  line-height: 1.5;
  margin-bottom: var(--app-2);
}

.insight-card__link {
  font-size: var(--app-text-12);
  font-weight: 600;
  color: var(--app-accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--app-1);
}

.insight-card__link:hover { color: var(--app-accent-hover); }

/* Report hero chrome
   Both were white-on-translucent-white, which only worked while the hero
   was a dark gradient. On the flat hero they were invisible. */
.report-back-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--app-2);
  margin-bottom: var(--app-2);
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--app-text-3);
  font-size: var(--app-text-12);
  font-weight: 500;
}

.report-back-btn:hover {
  background: transparent;
  border-color: transparent;
  color: var(--app-text);
  transform: none;
}

.quarter-badge,
.expense-badge,
.year-badge,
.badge-section {
  display: inline-flex;
  align-items: center;
  gap: var(--app-1);
  padding: 2px var(--app-2);
  background: var(--app-surface-3);
  border: 1px solid var(--app-border);
  border-radius: var(--app-r-xs);
  color: var(--app-text-2);
  font-size: var(--app-text-11);
  font-weight: 500;
  letter-spacing: 0;
}

/* Status chips that had no rule at all */
.badge-status-approved,
.badge-status-pending,
.badge-status-rejected {
  display: inline-flex;
  align-items: center;
  gap: var(--app-1);
  padding: 2px var(--app-2);
  border: 1px solid var(--app-border);
  border-radius: var(--app-r-xs);
  font-size: var(--app-text-11);
  font-weight: 500;
  text-transform: capitalize;
}

.status-active,
.badge-status-approved {
  background-color: var(--app-success-soft) !important;
  border-color: var(--app-success-border);
  color: var(--app-success) !important;
}

.badge-status-pending {
  background-color: var(--app-warning-soft) !important;
  border-color: var(--app-warning-border);
  color: var(--app-warning) !important;
}

.badge-status-rejected {
  background-color: var(--app-danger-soft) !important;
  border-color: var(--app-danger-border);
  color: var(--app-danger) !important;
}

.status-inactive {
  background-color: var(--app-surface-3) !important;
  border-color: var(--app-border);
  color: var(--app-text-2) !important;
}

/* Report result pages */
.report-header {
  display: flex;
  align-items: center;
  gap: var(--app-3);
  padding: var(--app-3) var(--app-4);
  background: var(--app-surface-2);
  border-bottom: 1px solid var(--app-border);
}

.report-header h5 {
  margin: 0;
  font-size: var(--app-text-14);
  font-weight: 600;
  color: var(--app-text);
}

.report-header h5 i {
  margin-right: var(--app-2);
  color: var(--app-text-3);
}

.report-actions .btn {
  height: 34px;
  padding: 0 var(--app-3);
  background: var(--app-surface);
  border: 1px solid var(--app-border-strong);
  border-radius: var(--app-r-sm);
  color: var(--app-text-2);
  font-size: var(--app-text-13);
}

.report-actions .btn:hover {
  background: var(--app-surface-3);
  border-color: var(--app-border-strong);
  color: var(--app-text);
  transform: none;
}

.report-actions .btn-primary,
.report-actions .btn-success {
  background: var(--app-accent);
  border-color: var(--app-accent);
  color: var(--app-text-inverse);
}

.report-actions .btn-primary:hover,
.report-actions .btn-success:hover {
  background: var(--app-accent-hover);
  border-color: var(--app-accent-hover);
  color: var(--app-text-inverse);
}

/* Report tables — the dark header and violet tints belonged to the old hero */
.rpt-table thead th {
  background: var(--app-surface-2);
  border-bottom: 1px solid var(--app-border);
  color: var(--app-text-3);
  font-size: var(--app-text-11);
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: var(--app-2) var(--app-3);
}

.rpt-table thead th.total-header {
  background: var(--app-surface-3);
  color: var(--app-text-2);
}

.rpt-table tbody td {
  padding: var(--app-2) var(--app-3);
  border-bottom: 1px solid var(--app-border);
  color: var(--app-text-2);
  font-size: var(--app-text-13);
}

.rpt-table tbody tr:hover td { background: var(--app-surface-2); }

.rpt-table .section-header,
.rpt-table .section-header td {
  background: var(--app-surface-3);
  border-bottom: 1px solid var(--app-border-strong);
  color: var(--app-text);
  font-weight: 600;
}

.rpt-table .row-total td {
  background: var(--app-surface-3);
  border-top: 1px solid var(--app-border-strong);
  color: var(--app-text);
}

.rpt-table .row-nbv td {
  background: var(--app-accent-soft);
  border-top: 1px solid var(--app-accent-border);
  color: var(--app-text);
}

.rpt-table .total-col {
  background: var(--app-surface-2);
  border-left: 1px solid var(--app-border);
  font-weight: 600;
}

.rpt-table .zero-val { color: var(--app-text-3); }

.rpt-table tfoot td,
.table-modern tfoot .total-row td {
  background: var(--app-surface-3);
  border-top: 1px solid var(--app-border-strong);
  color: var(--app-text);
  font-weight: 600;
  padding: var(--app-2) var(--app-3);
  font-size: var(--app-text-13);
}

.total-row td {
  background: var(--app-surface-3);
  color: var(--app-text);
  font-weight: 600;
}

/* Asset form */
.form-section {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-r-md);
  padding: var(--app-5);
  box-shadow: none;
  margin-bottom: var(--app-4);
}

.form-section:hover { box-shadow: none; }

.form-section-title {
  display: flex;
  align-items: center;
  gap: var(--app-2);
  margin-bottom: var(--app-4);
  padding-bottom: var(--app-3);
  border-bottom: 1px solid var(--app-border);
  font-size: var(--app-text-13);
  font-weight: 600;
  color: var(--app-text);
}

.form-section-title i {
  font-size: var(--app-text-13);
  color: var(--app-text-3);
}

.form-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--app-r-sm);
  background: var(--app-accent-soft);
  color: var(--app-accent);
  font-size: var(--app-text-13);
  box-shadow: none;
}

.form-group-icon {
  display: flex;
  align-items: flex-start;
  gap: var(--app-3);
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  border-radius: var(--app-r-sm);
  padding: var(--app-3);
}

/* The label + input wrapper must take the remaining width. Without this it
   shrinks to the input's intrinsic size and leaves dead space in the tile. */
.form-group-icon > div {
  flex: 1 1 auto;
  min-width: 0;
}

.form-group-icon:focus-within {
  background: var(--app-surface);
  border-color: var(--app-accent);
  box-shadow: 0 0 0 3px var(--app-accent-soft);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--app-2);
  margin-top: var(--app-4);
  padding-top: var(--app-4);
  border-top: 1px solid var(--app-border);
}

/* Formula callout on the depreciation run screen */
.formula-box {
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  border-radius: var(--app-r-md);
  padding: var(--app-4);
}

.formula-box::before { content: none; display: none; }

.formula-box h5 {
  font-size: var(--app-text-13);
  font-weight: 600;
  color: var(--app-text);
  margin-bottom: var(--app-3);
}

.formula-box h5 i { color: var(--app-text-3); }

.formula-box p {
  font-size: var(--app-text-12);
  color: var(--app-text-2);
  margin-bottom: var(--app-1);
  padding-left: var(--app-2);
  border-left: 2px solid var(--app-border-strong);
}

/* Modals — the header was a gradient with white text and an inverted close icon */
.modal-content {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-r-md);
  box-shadow: var(--app-shadow-pop);
}

.modal-header {
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-border);
  border-radius: var(--app-r-md) var(--app-r-md) 0 0;
  padding: var(--app-3) var(--app-4);
  color: var(--app-text);
}

.modal-header .btn-close { filter: none; opacity: 0.55; }
.modal-header .btn-close:hover { opacity: 1; }

.modal-title {
  font-size: var(--app-text-14);
  font-weight: 600;
  color: var(--app-text);
}

.modal-body { padding: var(--app-4); }

.modal-footer {
  background: var(--app-surface-2);
  border-top: 1px solid var(--app-border);
  border-radius: 0 0 var(--app-r-md) var(--app-r-md);
  padding: var(--app-3) var(--app-4);
}

/* Secondary action on a page header. Bootstrap's outline-light is white on
   white once the hero is flat. */
.btn-outline-light {
  background: var(--app-surface);
  border-color: var(--app-border-strong);
  color: var(--app-text-2);
}

.btn-outline-light:hover {
  background: var(--app-surface-3);
  border-color: var(--app-border-strong);
  color: var(--app-text);
}

/* Depreciation breakdown cells on the asset view — .item had no rule at all */
.dep-grid .item {
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  border-radius: var(--app-r-sm);
  padding: var(--app-3);
}

.dep-grid .item h5 {
  font-size: var(--app-text-11);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--app-text-3);
  margin: 0 0 2px;
}

.dep-grid .item .value {
  font-size: var(--app-text-16);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--app-text);
}


/* ================================================================
   24. AUTHENTICATION
   ----------------------------------------------------------------
   The login page is a standalone document, so it carries no sidebar or
   header chrome. It is still part of the same design system: flat
   surfaces, hairline borders, one accent, no gradients or glass.
   ================================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--app-6);
  background: var(--app-bg);
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-r-lg);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.auth-head {
  padding: var(--app-6) var(--app-6) var(--app-5);
  border-bottom: 1px solid var(--app-border);
}

.auth-mark {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--app-accent-soft);
  border: 1px solid var(--app-accent-border);
  border-radius: var(--app-r-sm);
  color: var(--app-accent);
  font-size: var(--app-text-14);
  margin-bottom: var(--app-4);
}

.auth-title {
  font-size: var(--app-text-20);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--app-text);
  margin: 0 0 var(--app-1);
}

.auth-subtitle {
  font-size: var(--app-text-13);
  color: var(--app-text-3);
  margin: 0;
}

.auth-body { padding: var(--app-6); }

/* A login form is the one place where a taller control is worth the
   density loss: two fields only, and they are the whole page. */
.auth-body .form-control { height: 38px; }

.auth-submit {
  width: 100%;
  height: 38px;
  margin-top: var(--app-2);
}

.auth-foot {
  padding: 0 var(--app-6) var(--app-6);
  text-align: center;
  font-size: var(--app-text-12);
  color: var(--app-text-3);
}

.auth-foot p { margin: 0; }

@media (max-width: 480px) {
  .auth-page { padding: var(--app-4); }
  .auth-head { padding: var(--app-5) var(--app-5) var(--app-4); }
  .auth-body { padding: var(--app-5); }
  .auth-foot { padding: 0 var(--app-5) var(--app-5); }
}
