/* ============================================================
   SIANOR ERP Platform — Material Design 3 (Material You)
   Brand: SIANOR — Madagascar's Digital Marketplace
   Primary: Gold/Orange #F5A014 | Secondary: Deep Green #1B5E20
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&family=Roboto+Flex:wght@300;400;500;600;700;800&family=Google+Sans:wght@400;500;700&display=swap');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons+Round');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap');

/* ══════════════════════════════════════════════════════════════
   MD3 COLOR SYSTEM — SIANOR TONAL PALETTES
   ══════════════════════════════════════════════════════════════ */
:root {
  /* ── Primary: Gold/Orange (Sun rays from logo) */
  --md-primary:           #C77B00;
  --md-on-primary:        #FFFFFF;
  --md-primary-container: #FFDEA8;
  --md-on-primary-container: #271900;

  /* ── Secondary: Deep Green (Palm trees from logo) */
  --md-secondary:           #426938;
  --md-on-secondary:        #FFFFFF;
  --md-secondary-container: #C3EEAF;
  --md-on-secondary-container: #062100;

  /* ── Tertiary: Madagascar Red */
  --md-tertiary:           #8C4351;
  --md-on-tertiary:        #FFFFFF;
  --md-tertiary-container: #FFD9DE;
  --md-on-tertiary-container: #3A0714;

  /* ── Error */
  --md-error:           #BA1A1A;
  --md-on-error:        #FFFFFF;
  --md-error-container: #FFDAD6;
  --md-on-error-container: #410002;

  /* ── Surface & Background */
  --md-background:          #FFFBFF;
  --md-on-background:       #1C1B1F;
  --md-surface:             #FFFBFF;
  --md-on-surface:          #1C1B1F;
  --md-surface-variant:     #F5DEB3;
  --md-on-surface-variant:  #504538;
  --md-surface-1:           #FEF7EE;  /* tonal surface elevation 1 */
  --md-surface-2:           #FDF3E3;  /* tonal surface elevation 2 */
  --md-surface-3:           #FCF0DA;  /* tonal surface elevation 3 */
  --md-surface-4:           #F8E8C8;
  --md-surface-5:           #F5E3BD;

  /* ── Outline */
  --md-outline:             #837568;
  --md-outline-variant:     #D7C4B0;

  /* ── Inverse */
  --md-inverse-surface:     #332F27;
  --md-inverse-on-surface:  #F8EFE6;
  --md-inverse-primary:     #F8BB4D;

  /* ── Shadow & Scrim */
  --md-shadow:              #000000;
  --md-scrim:               #000000;

  /* ── Semantic aliases */
  --brand-1:      #C77B00;
  --brand-2:      #F8BB4D;
  --brand-grad:   linear-gradient(135deg, #C77B00 0%, #F5A014 60%, #F8BB4D 100%);
  --brand-soft:   rgba(199,123,0,.08);
  --brand-border: rgba(199,123,0,.25);
  --brand-shadow: 0 4px 16px rgba(199,123,0,.35);

  --surface:      var(--md-surface);
  --surface-2:    var(--md-surface-1);
  --surface-3:    var(--md-surface-2);
  --surface-4:    var(--md-surface-3);

  --text-primary:   var(--md-on-background);
  --text-secondary: var(--md-on-surface-variant);
  --text-muted:     #847769;
  --text-placeholder: #BFB4A8;

  --border:        var(--md-outline-variant);
  --border-strong: var(--md-outline);
  --border-focus:  var(--md-primary);

  --success:       #386A20;
  --success-bg:    #C3EEAF;
  --success-border:#78B862;
  --warning:       #7D5700;
  --warning-bg:    #FFE0A1;
  --warning-border:#E8B835;
  --danger:        #BA1A1A;
  --danger-bg:     #FFDAD6;
  --danger-border: #FF897D;
  --info:          #1D5FA5;
  --info-bg:       #D6E4FF;
  --info-border:   #7DABF8;

  /* ── Layout */
  --sidebar-w:    260px;
  --topbar-h:     64px;
  --sidebar-bg:        #FFFBFF;
  --sidebar-border:    var(--md-outline-variant);
  --sidebar-text:      #504538;
  --sidebar-text-hover:#1C1B1F;
  --sidebar-active-bg: var(--md-primary-container);
  --sidebar-active-color: var(--md-on-primary-container);
  --sidebar-section-label: #837568;

  /* ── MD3 Shape System */
  --shape-xs:    4px;
  --shape-sm:    8px;
  --shape-md:    12px;
  --shape-lg:    16px;
  --shape-xl:    28px;
  --shape-full:  9999px;
  /* Legacy aliases */
  --radius:      var(--shape-md);
  --radius-sm:   var(--shape-sm);
  --radius-lg:   var(--shape-lg);
  --radius-xl:   var(--shape-xl);

  /* ── MD3 Elevation Shadows */
  --md-elev-0: none;
  --md-elev-1: 0px 1px 2px rgba(0,0,0,0.30), 0px 1px 3px 1px rgba(0,0,0,0.15);
  --md-elev-2: 0px 1px 2px rgba(0,0,0,0.30), 0px 2px 6px 2px rgba(0,0,0,0.15);
  --md-elev-3: 0px 1px 3px rgba(0,0,0,0.30), 0px 4px 8px 3px rgba(0,0,0,0.15);
  --md-elev-4: 0px 2px 3px rgba(0,0,0,0.30), 0px 6px 10px 4px rgba(0,0,0,0.15);
  --md-elev-5: 0px 4px 4px rgba(0,0,0,0.30), 0px 8px 12px 6px rgba(0,0,0,0.15);
  /* Legacy aliases */
  --shadow-xs:  var(--md-elev-0);
  --shadow-sm:  var(--md-elev-1);
  --shadow:     var(--md-elev-2);
  --shadow-md:  var(--md-elev-3);
  --shadow-lg:  var(--md-elev-4);
  --shadow-brand: var(--brand-shadow);

  /* ── MD3 Motion */
  --md-duration-short1:   50ms;
  --md-duration-short2:   100ms;
  --md-duration-short3:   150ms;
  --md-duration-short4:   200ms;
  --md-duration-medium1:  250ms;
  --md-duration-medium2:  300ms;
  --md-duration-medium3:  350ms;
  --md-duration-medium4:  400ms;
  --md-easing-standard:   cubic-bezier(0.2, 0, 0, 1);
  --md-easing-emphasize:  cubic-bezier(0.2, 0, 0, 1);
  --md-easing-decelerate: cubic-bezier(0, 0, 0, 1);
  --md-easing-accelerate: cubic-bezier(0.3, 0, 1, 1);

  --transition:      var(--md-duration-medium1) var(--md-easing-standard);
  --transition-slow: var(--md-duration-medium3) var(--md-easing-standard);

  /* ── Typography */
  --font-main:    'Roboto', system-ui, sans-serif;
  --font-display: 'Google Sans', 'Roboto Flex', system-ui, sans-serif;
  --font-mono:    'Roboto Mono', 'Courier New', monospace;
}

/* ══════════════════════════════════════════════════════════════
   BASE RESET & TYPOGRAPHY
   ══════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background: var(--md-background);
  color: var(--md-on-background);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a {
  color: var(--md-primary);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--brand-2); }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

/* MD3 Material Symbols icon sizing */
.material-symbols-rounded {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  font-size: 20px;
  line-height: 1;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.material-symbols-rounded.filled {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.ms-sm { font-size: 16px; }
.ms-md { font-size: 20px; }
.ms-lg { font-size: 24px; }
.ms-xl { font-size: 32px; }

/* ══════════════════════════════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════════════════════════════ */
.app-layout { display: flex; min-height: 100vh; }

/* ══════════════════════════════════════════════════════════════
   MD3 NAVIGATION DRAWER
   ══════════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 200;
  transition: transform var(--transition-slow), width var(--transition-slow);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Sidebar Logo / Brand Header */
.sidebar-logo {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  min-height: 72px;
}
.sidebar-logo img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: var(--shape-sm);
  flex-shrink: 0;
}
.sidebar-logo-text { display: flex; flex-direction: column; }
.sidebar-logo-text .brand {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--md-on-background);
  letter-spacing: 0;
  line-height: 1.2;
}
.sidebar-logo-text .tagline {
  font-size: .65rem;
  color: var(--text-muted);
  letter-spacing: .04em;
  margin-top: 1px;
  font-weight: 500;
}

/* Navigation Sections */
.sidebar-section { padding: 8px 12px 2px; }
.sidebar-section-label {
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sidebar-section-label);
  padding: 8px 16px 4px;
}

/* MD3 Navigation Items */
.sidebar-nav { list-style: none; }
.sidebar-nav li { margin-bottom: 2px; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 48px;
  border-radius: var(--shape-full);
  color: var(--sidebar-text);
  font-size: .875rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
/* MD3 State Layer */
.sidebar-nav a::before {
  content: '';
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0;
  border-radius: inherit;
  transition: opacity var(--transition);
}
.sidebar-nav a:hover::before { opacity: 0.08; }
.sidebar-nav a:hover { color: var(--sidebar-text-hover); }
.sidebar-nav a.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-color);
  font-weight: 700;
}
.sidebar-nav a.active::before { opacity: 0; }
.sidebar-nav a .nav-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  transition: color var(--transition);
}
.sidebar-nav a .nav-label { flex: 1; }
.sidebar-nav a .nav-badge {
  margin-left: auto;
  background: var(--md-error);
  color: var(--md-on-error);
  font-size: .62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--shape-full);
  line-height: 1.4;
}

/* Sidebar Bottom User Area */
.sidebar-bottom {
  margin-top: auto;
  padding: 8px 12px 16px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--shape-full);
  transition: background var(--transition);
  cursor: pointer;
}
.sidebar-user:hover { background: rgba(0,0,0,.05); }
.sidebar-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--md-on-primary);
  font-weight: 700;
  font-size: .9rem;
  flex-shrink: 0;
  border: 2px solid var(--md-primary-container);
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: .7rem;
  color: var(--text-muted);
  margin-top: 1px;
}
.sidebar-user-logout {
  padding: 8px;
  border-radius: 50%;
  background: none;
  color: var(--text-muted);
  font-size: 1rem;
  display: flex;
  align-items: center;
  transition: all var(--transition);
  text-decoration: none;
}
.sidebar-user-logout:hover {
  color: var(--md-error);
  background: var(--md-error-container);
}

/* ══════════════════════════════════════════════════════════════
   MD3 TOP APP BAR
   ══════════════════════════════════════════════════════════════ */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: var(--md-surface);
  border-bottom: 1px solid var(--md-outline-variant);
  display: flex;
  align-items: center;
  padding: 0 16px 0 24px;
  gap: 12px;
  z-index: 100;
  transition: left var(--transition-slow);
}
.topbar-toggle {
  display: flex;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.25rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.topbar-toggle:hover { background: rgba(0,0,0,.08); }
.topbar-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--md-on-surface);
  letter-spacing: 0;
}
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 4px; }
.topbar-btn {
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1.1rem;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
}
.topbar-btn:hover { background: rgba(0,0,0,.08); color: var(--text-primary); }

/* ── Main Content ─────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  flex: 1;
  transition: margin-left var(--transition-slow);
}

/* Collapsed state rules on desktop */
@media (min-width: 769px) {
  .sidebar-collapsed {
    --sidebar-w: 72px;
  }
  .sidebar-collapsed .sidebar-logo-text,
  .sidebar-collapsed .sidebar-section-label,
  .sidebar-collapsed .nav-label,
  .sidebar-collapsed .nav-badge,
  .sidebar-collapsed .sidebar-user-info,
  .sidebar-collapsed .sidebar-user-logout {
    display: none !important;
  }
  .sidebar-collapsed .sidebar-logo {
    justify-content: center;
    padding: 16px 8px;
  }
  .sidebar-collapsed .sidebar-logo img {
    margin: 0;
  }
  .sidebar-collapsed .sidebar-nav a {
    padding: 0;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 0 auto;
  }
  .sidebar-collapsed .sidebar-user {
    justify-content: center;
    padding: 8px 0;
  }
}
.page-body { padding: 24px; flex: 1; }

/* ── Page Header ─────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header-left h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--md-on-surface);
  letter-spacing: 0;
  line-height: 1.3;
}
.page-header-left p {
  font-size: .875rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.page-header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ══════════════════════════════════════════════════════════════
   MD3 CARDS
   ══════════════════════════════════════════════════════════════ */
.card {
  background: var(--md-surface);
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--shape-lg);
  box-shadow: var(--md-elev-1);
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--md-elev-2); }
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--md-outline-variant);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-title {
  font-family: var(--font-display);
  font-size: .9375rem;
  font-weight: 500;
  color: var(--md-on-surface);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-body { padding: 20px; }

/* Filled card variant */
.card-filled {
  background: var(--md-surface-1);
  border: none;
  box-shadow: var(--md-elev-0);
}

/* Outlined card variant */
.card-outlined {
  background: var(--md-surface);
  border: 1px solid var(--md-outline-variant);
  box-shadow: none;
}

/* ══════════════════════════════════════════════════════════════
   MD3 KPI / SUMMARY CARDS
   ══════════════════════════════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--md-surface);
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--shape-lg);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  box-shadow: var(--md-elev-1);
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  cursor: default;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--md-elev-3); }
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--brand-grad);
  opacity: 0;
  transition: opacity var(--transition);
}
.kpi-card:hover::before { opacity: 1; }
.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--shape-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.kpi-icon.primary  { background: var(--md-primary-container);   color: var(--md-on-primary-container); }
.kpi-icon.blue     { background: #DBEAFE;  color: #1D4ED8; }
.kpi-icon.green    { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.kpi-icon.orange   { background: var(--md-primary-container);   color: var(--md-on-primary-container); }
.kpi-icon.red      { background: var(--md-error-container);     color: var(--md-on-error-container); }
.kpi-icon.purple   { background: #EDE9FE;  color: #6D28D9; }
.kpi-icon.teal     { background: #CCFBF1;  color: #0D9488; }
.kpi-icon.tertiary { background: var(--md-tertiary-container);  color: var(--md-on-tertiary-container); }
.kpi-data { flex: 1; min-width: 0; }
.kpi-label {
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
}
.kpi-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--md-on-surface);
  letter-spacing: -.5px;
  line-height: 1.15;
  margin-top: 4px;
}
.kpi-sub   { font-size: .75rem; color: var(--text-muted); margin-top: 6px; }

/* ══════════════════════════════════════════════════════════════
   MD3 BUTTONS
   ══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px;
  height: 40px;
  border-radius: var(--shape-full);
  font-family: var(--font-main);
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .00625em;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
/* MD3 State layer on buttons */
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0;
  transition: opacity var(--transition);
  border-radius: inherit;
}
.btn:hover::before { opacity: 0.08; }
.btn:active::before { opacity: 0.12; }

/* Filled button (primary action) */
.btn-primary {
  background: var(--md-primary);
  color: var(--md-on-primary);
  box-shadow: var(--md-elev-1);
}
.btn-primary:hover { box-shadow: var(--md-elev-2); color: var(--md-on-primary); }
.btn-primary:active { box-shadow: var(--md-elev-0); }

/* Filled Tonal button (secondary action) */
.btn-tonal {
  background: var(--md-secondary-container);
  color: var(--md-on-secondary-container);
  box-shadow: none;
}
.btn-tonal:hover { box-shadow: var(--md-elev-1); }

/* Outlined button */
.btn-secondary {
  background: transparent;
  color: var(--md-primary);
  border: 1px solid var(--md-outline);
}
.btn-secondary:hover { background: var(--brand-soft); }

/* Text button */
.btn-ghost {
  background: transparent;
  color: var(--md-primary);
  border: none;
  padding: 0 12px;
}
.btn-ghost:hover { background: var(--brand-soft); }

/* Semantic */
.btn-success  { background: var(--md-secondary); color: #fff; }
.btn-success:hover { background: #305727; color: #fff; }
.btn-danger   { background: var(--md-error);     color: var(--md-on-error); }
.btn-danger:hover  { background: #8C0009; color: #fff; }
.btn-warning  { background: var(--warning);  color: #fff; }
.btn-warning:hover { background: #5C3E00; color: #fff; }
.btn-info     { background: var(--info);     color: #fff; }

/* Sizes */
.btn-sm   { height: 32px; padding: 0 16px; font-size: .8125rem; }
.btn-xs   { height: 28px; padding: 0 12px; font-size: .75rem; }
.btn-lg   { height: 48px; padding: 0 32px; font-size: .9375rem; }
.btn-icon { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 50%; }
.btn-icon.btn-sm { width: 32px; height: 32px; }

/* FAB — Floating Action Button */
.fab {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
  border-radius: var(--shape-lg);
  border: none;
  box-shadow: var(--md-elev-3);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  font-family: var(--font-main);
}
.fab:hover { box-shadow: var(--md-elev-4); background: color-mix(in srgb, var(--md-primary-container) 92%, black); }

/* ══════════════════════════════════════════════════════════════
   MD3 CHIPS / BADGES
   ══════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--shape-full);
  font-size: .75rem;
  font-weight: 500;
  white-space: nowrap;
}
.badge-success   { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.badge-warning   { background: #FFE0A1;  color: #7D5700; }
.badge-danger    { background: var(--md-error-container);    color: var(--md-on-error-container); }
.badge-info      { background: #D6E4FF;  color: #1D5FA5; }
.badge-secondary { background: var(--md-surface-2); color: var(--md-on-surface-variant); }
.badge-blue      { background: #DBEAFE;  color: #1D4ED8; }
.badge-purple    { background: #EDE9FE;  color: #6D28D9; }
.badge-primary   { background: var(--md-primary-container); color: var(--md-on-primary-container); }

/* MD3 Assist Chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: var(--shape-sm);
  border: 1px solid var(--md-outline-variant);
  background: transparent;
  color: var(--md-on-surface);
  font-size: .875rem;
  font-weight: 400;
  cursor: pointer;
  transition: all var(--transition);
}
.chip:hover { background: var(--md-surface-2); border-color: var(--md-outline); }
.chip.selected { background: var(--md-secondary-container); color: var(--md-on-secondary-container); border-color: transparent; }

/* ══════════════════════════════════════════════════════════════
   MD3 DATA TABLES
   ══════════════════════════════════════════════════════════════ */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.table thead tr { background: var(--md-surface-2); }
.table th {
  padding: 12px 16px;
  text-align: left;
  font-size: .75rem;
  font-weight: 500;
  color: var(--md-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom: 1px solid var(--md-outline-variant);
  white-space: nowrap;
}
.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--md-outline-variant);
  color: var(--md-on-surface);
  vertical-align: middle;
}
.table tbody tr {
  transition: background var(--transition);
  position: relative;
}
.table tbody tr:hover { background: var(--brand-soft); }
.table tbody tr:last-child td { border-bottom: none; }

/* ══════════════════════════════════════════════════════════════
   MD3 FORMS / TEXT FIELDS
   ══════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--md-on-surface);
  letter-spacing: .01em;
}
.form-label .req { color: var(--md-error); margin-left: 2px; }
.form-control {
  width: 100%;
  padding: 10px 16px;
  background: var(--md-surface);
  border: 1px solid var(--md-outline);
  border-radius: var(--shape-xs);
  border-top-left-radius: var(--shape-xs);
  border-top-right-radius: var(--shape-xs);
  color: var(--md-on-surface);
  font-family: inherit;
  font-size: .875rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--md-primary);
  border-width: 2px;
  box-shadow: none;
  padding: 9px 15px; /* compensate for border width */
}
.form-control::placeholder { color: var(--text-placeholder); }
.form-control:disabled { background: var(--md-surface-2); cursor: not-allowed; color: var(--text-muted); opacity: .6; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-hint { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* Quill editor */
.quill-wrapper .ql-toolbar {
  border-radius: var(--shape-xs) var(--shape-xs) 0 0;
  border-color: var(--md-outline);
  background: var(--md-surface-1);
}
.quill-wrapper .ql-container {
  border-radius: 0 0 var(--shape-xs) var(--shape-xs);
  border-color: var(--md-outline);
  min-height: 140px;
  font-family: inherit;
  font-size: .875rem;
}
.quill-wrapper .ql-container:focus-within {
  border-color: var(--md-primary);
  border-width: 2px;
}

/* ══════════════════════════════════════════════════════════════
   MD3 SNACKBAR / FLASH MESSAGES
   ══════════════════════════════════════════════════════════════ */
.flash {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--shape-xs);
  margin-bottom: 20px;
  animation: slideDown .25s var(--md-easing-decelerate);
  font-size: .875rem;
  font-weight: 400;
  box-shadow: var(--md-elev-3);
}
.flash-success { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.flash-error   { background: var(--md-error-container);    color: var(--md-on-error-container); }
.flash-warning { background: #FFE0A1; color: #7D5700; }
.flash i { font-size: 1.1rem; flex-shrink: 0; }
.flash span { flex: 1; }
.flash-close {
  margin-left: auto;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
  opacity: .7;
  font-size: 1.1rem;
  padding: 4px;
  border-radius: 50%;
  transition: opacity var(--transition), background var(--transition);
  display: flex;
  align-items: center;
}
.flash-close:hover { opacity: 1; background: rgba(0,0,0,.08); }
@keyframes slideDown { from { opacity:0; transform: translateY(-10px); } to { opacity:1; transform: translateY(0); } }

/* ══════════════════════════════════════════════════════════════
   MD3 PAGINATION
   ══════════════════════════════════════════════════════════════ */
.pagination { display: flex; align-items: center; gap: 4px; margin-top: 16px; }
.pagination a, .pagination span {
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border-radius: var(--shape-full);
  font-size: .875rem;
  font-weight: 500;
  border: none;
  color: var(--md-on-surface);
  background: transparent;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pagination a:hover { background: var(--brand-soft); color: var(--md-primary); }
.pagination .active { background: var(--md-primary); color: var(--md-on-primary); }
.pagination .disabled { opacity: .38; pointer-events: none; }

/* ══════════════════════════════════════════════════════════════
   MD3 DIALOGS (Modals)
   ══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.32);
  backdrop-filter: blur(2px);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-slow);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal, .modal-card {
  background: var(--md-surface);
  border-radius: var(--shape-xl);
  box-shadow: var(--md-elev-5);
  width: 100%;
  max-width: 560px;
  transform: translateY(24px) scale(.96);
  transition: transform var(--transition-slow);
}
.modal-overlay.open .modal, .modal-overlay.open .modal-card { transform: translateY(0) scale(1); }
.modal-header {
  padding: 24px 24px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--md-on-surface);
  line-height: 1.3;
}
.modal-close {
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.modal-close:hover { color: var(--md-error); background: var(--md-error-container); }
.modal-body   { padding: 0 24px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--md-outline-variant);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Modal sizes */
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 960px; }

/* ══════════════════════════════════════════════════════════════
   CHARTS
   ══════════════════════════════════════════════════════════════ */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.chart-container { position: relative; height: 280px; }

/* ══════════════════════════════════════════════════════════════
   FILTER BAR / SEARCH
   ══════════════════════════════════════════════════════════════ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--md-surface);
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--shape-md);
  box-shadow: var(--md-elev-1);
}
.filter-bar .form-control { width: auto; flex: 1; min-width: 150px; }
.filter-bar label { font-size: .8rem; font-weight: 500; color: var(--text-muted); white-space: nowrap; }

/* Search field */
.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--md-surface-2);
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--shape-full);
  padding: 0 16px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-field:focus-within {
  border-color: var(--md-primary);
  box-shadow: 0 0 0 2px var(--md-primary-container);
}
.search-field input {
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: .875rem;
  color: var(--md-on-surface);
  height: 40px;
  width: 200px;
}
.search-field i { color: var(--text-muted); font-size: .9rem; }

/* ══════════════════════════════════════════════════════════════
   PRODUCT / MEDIA IMAGES
   ══════════════════════════════════════════════════════════════ */
.product-img {
  width: 44px;
  height: 44px;
  border-radius: var(--shape-sm);
  object-fit: cover;
  background: var(--md-surface-2);
  border: 1px solid var(--md-outline-variant);
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
}
.product-img:hover { opacity: .85; transform: scale(1.05); }
.product-img-placeholder {
  width: 44px;
  height: 44px;
  border-radius: var(--shape-sm);
  background: var(--md-surface-2);
  border: 1px solid var(--md-outline-variant);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-placeholder);
  font-size: .9rem;
}

/* ══════════════════════════════════════════════════════════════
   IMAGE LIGHTBOX
   ══════════════════════════════════════════════════════════════ */
.lightbox-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.88);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--md-easing-standard);
}
.lightbox-overlay.open { opacity: 1; pointer-events: all; }
.lightbox-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  transform: scale(.95);
  transition: transform .25s var(--md-easing-emphasize);
}
.lightbox-overlay.open .lightbox-inner { transform: scale(1); }
.lightbox-img {
  max-width: 80vw;
  max-height: 60vh;
  border-radius: var(--shape-lg);
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  object-fit: contain;
  display: block;
}
.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.6);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background var(--transition), transform var(--transition);
  z-index: 10;
}
.lightbox-arrow:hover { background: rgba(0,0,0,.8); transform: translateY(-50%) scale(1.1); }
.lightbox-arrow#lightboxPrev { left: 16px; }
.lightbox-arrow#lightboxNext { right: 16px; }

.lightbox-thumb {
  width: 50px;
  height: 50px;
  border-radius: var(--shape-sm);
  object-fit: cover;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  opacity: .6;
  background: rgba(255,255,255,.1);
}
.lightbox-thumb:hover { opacity: 1; }
.lightbox-thumb.active { border-color: var(--md-primary); opacity: 1; transform: scale(1.05); }

@media (min-width: 900px) {
  .lightbox-arrow#lightboxPrev { left: -64px; }
  .lightbox-arrow#lightboxNext { right: -64px; }
}
.lightbox-actions { display: flex; gap: 10px; align-items: center; }
.lightbox-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--shape-full);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
  text-decoration: none;
  border: none;
}
.lightbox-btn-close { background: rgba(255,255,255,.12); color: #fff; }
.lightbox-btn-close:hover { background: rgba(255,255,255,.2); color: #fff; }
.lightbox-btn-download { background: var(--md-primary); color: var(--md-on-primary); box-shadow: var(--md-elev-2); }
.lightbox-btn-download:hover { opacity: .9; color: var(--md-on-primary); }
.lightbox-product-name { color: rgba(255,255,255,.7); font-size: .875rem; font-weight: 400; text-align: center; }

/* ══════════════════════════════════════════════════════════════
   LOGIN PAGE — MD3 Style
   ══════════════════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #FFF8EC 0%, #FFF3D6 40%, #FFFBEE 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  top: -20%; right: -10%;
  width: 55%; height: 75%;
  background: radial-gradient(ellipse, rgba(199,123,0,.12) 0%, transparent 65%);
  pointer-events: none;
}
.login-page::after {
  content: '';
  position: absolute;
  bottom: -20%; left: -10%;
  width: 55%; height: 75%;
  background: radial-gradient(ellipse, rgba(27,94,32,.08) 0%, transparent 65%);
  pointer-events: none;
}
.login-card {
  background: var(--md-surface);
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--shape-xl);
  padding: 40px 40px 32px;
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
  box-shadow: var(--md-elev-3);
  animation: fadeInUp .4s var(--md-easing-decelerate);
}
@keyframes fadeInUp { from { opacity:0; transform: translateY(24px); } to { opacity:1; transform:translateY(0); } }

.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo img { width: 80px; height: 80px; object-fit: contain; margin: 0 auto 16px; }
.login-logo h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--md-on-surface);
  letter-spacing: -.5px;
}
.login-logo p { font-size: .875rem; color: var(--text-muted); margin-top: 4px; }
.login-divider { text-align: center; font-size: .8rem; color: var(--text-muted); margin: 8px 0 20px; font-weight: 400; }

.login-btn {
  width: 100%;
  height: 48px;
  font-size: .9375rem;
  background: var(--md-primary);
  color: var(--md-on-primary);
  border: none;
  border-radius: var(--shape-full);
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  box-shadow: var(--md-elev-1);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: .00625em;
}
.login-btn:hover { box-shadow: var(--md-elev-2); }

.login-error {
  background: var(--md-error-container);
  color: var(--md-on-error-container);
  border-radius: var(--shape-xs);
  padding: 12px 16px;
  font-size: .875rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.login-footer { text-align: center; margin-top: 24px; font-size: .75rem; color: var(--text-muted); }
.pwd-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: .9rem; padding: 4px; border-radius: 50%;
  transition: color var(--transition), background var(--transition);
  display: flex; align-items: center;
}
.pwd-toggle:hover { color: var(--text-secondary); background: rgba(0,0,0,.06); }

/* ══════════════════════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-muted);
}
.empty-state i { font-size: 2.5rem; margin-bottom: 16px; opacity: .3; display: block; }
.empty-state .material-symbols-rounded { font-size: 48px; opacity: .3; margin-bottom: 16px; }
.empty-state h3 { font-family: var(--font-display); font-size: .9375rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: .875rem; }

/* ══════════════════════════════════════════════════════════════
   NOTIFICATION PANEL
   ══════════════════════════════════════════════════════════════ */
.notif-count {
  position: absolute;
  top: 2px; right: 2px;
  background: var(--md-error);
  color: var(--md-on-error);
  font-size: .6rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: var(--shape-full);
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--md-surface);
  line-height: 1;
}
.notif-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 340px;
  background: var(--md-surface);
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--shape-lg);
  box-shadow: var(--md-elev-4);
  z-index: 500;
  overflow: hidden;
}
.notif-panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--md-outline-variant);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: .875rem;
  background: var(--md-surface-1);
}
.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--md-outline-variant);
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.notif-item:hover { background: var(--md-surface-1); }
.notif-item.unread { background: var(--brand-soft); }
.notif-item:last-child { border-bottom: none; }
.notif-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--md-primary); margin-top: 5px; flex-shrink: 0;
}
.notif-dot.read { background: transparent; border: 1px solid var(--md-outline); }
.notif-text { flex: 1; min-width: 0; }
.notif-title { font-size: .8125rem; font-weight: 500; color: var(--md-on-surface); }
.notif-body  { font-size: .75rem; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time  { font-size: .6875rem; color: var(--text-muted); margin-top: 4px; }

/* ══════════════════════════════════════════════════════════════
   TIMELINE
   ══════════════════════════════════════════════════════════════ */
.timeline-list { position: relative; padding-left: 4px; }
.timeline-list::before {
  content: '';
  position: absolute;
  left: 4px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--md-outline-variant);
}

/* ══════════════════════════════════════════════════════════════
   REPORT TABS / TAB BAR
   ══════════════════════════════════════════════════════════════ */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--md-outline-variant);
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
  white-space: nowrap;
  position: relative;
}
.tab-btn:hover { color: var(--md-primary); background: var(--brand-soft); }
.tab-btn.active {
  color: var(--md-primary);
  border-bottom-color: var(--md-primary);
}

/* ══════════════════════════════════════════════════════════════
   BREADCRUMB
   ══════════════════════════════════════════════════════════════ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--md-primary); font-weight: 500; }
.breadcrumb span { color: var(--text-muted); }
.breadcrumb .sep { opacity: .5; }

/* ══════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ══════════════════════════════════════════════════════════════ */
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-muted  { color: var(--text-muted); }
.text-success{ color: var(--success); }
.text-danger { color: var(--md-error); }
.text-warning{ color: var(--warning); }
.text-info   { color: var(--info); }
.text-primary-brand { color: var(--md-primary); }
.fw-bold     { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.fw-medium   { font-weight: 500; }
.font-display{ font-family: var(--font-display); }
.font-mono   { font-family: var(--font-mono); }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; } .mt-4 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 14px; } .mb-4 { margin-bottom: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 14px; } .gap-4 { gap: 20px; }
.flex-1 { flex: 1; }
.w-100 { width: 100%; }
.overflow-hidden { overflow: hidden; }

/* ══════════════════════════════════════════════════════════════
   SKELETON LOADER
   ══════════════════════════════════════════════════════════════ */
.skeleton {
  background: linear-gradient(90deg, var(--md-surface-2) 25%, var(--md-surface-3) 50%, var(--md-surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--shape-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ══════════════════════════════════════════════════════════════
   SCROLLBAR
   ══════════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--md-outline-variant); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--md-outline); }

/* ══════════════════════════════════════════════════════════════
   MD3 LIST ITEMS
   ══════════════════════════════════════════════════════════════ */
.md-list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: var(--shape-xs);
  transition: background var(--transition);
  cursor: pointer;
  position: relative;
}
.md-list-item:hover { background: var(--md-surface-2); }
.md-list-item .leading { flex-shrink: 0; color: var(--md-on-surface-variant); }
.md-list-item .content { flex: 1; min-width: 0; }
.md-list-item .headline { font-size: .875rem; font-weight: 400; color: var(--md-on-surface); }
.md-list-item .supporting { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }
.md-list-item .trailing { flex-shrink: 0; color: var(--text-muted); font-size: .75rem; }
.md-divider { height: 1px; background: var(--md-outline-variant); margin: 4px 0; }

/* ══════════════════════════════════════════════════════════════
   SURFACE TONES — for section backgrounds
   ══════════════════════════════════════════════════════════════ */
.surface-primary { background: var(--md-primary-container); color: var(--md-on-primary-container); }
.surface-secondary { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.surface-error { background: var(--md-error-container); color: var(--md-on-error-container); }
.surface-neutral { background: var(--md-surface-2); color: var(--md-on-surface); }

/* ══════════════════════════════════════════════════════════════
   SECTION CARDS / FEATURE BLOCKS
   ══════════════════════════════════════════════════════════════ */
.section-card {
  background: var(--md-surface);
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--shape-lg);
  margin-bottom: 20px;
  overflow: hidden;
}
.section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--md-outline-variant);
  gap: 12px;
  background: var(--md-surface-1);
}
.section-card-title {
  font-family: var(--font-display);
  font-size: .9375rem;
  font-weight: 500;
  color: var(--md-on-surface);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ══════════════════════════════════════════════════════════════
   PRINT STYLES
   ══════════════════════════════════════════════════════════════ */
@media print {
  .sidebar, .topbar, .page-header-actions, .flash,
  .filter-bar, .btn, form[method="GET"], .notif-wrapper,
  .sidebar-backdrop { display: none !important; }
  .main-content { margin-left: 0 !important; padding-top: 0 !important; }
  .page-body { padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
  body { background: #fff !important; font-size: 12px; }
  .no-print { display: none !important; }
  .print-only { display: block !important; }
}
.print-only { display: none; }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — MD3 Adaptive Layout
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .chart-grid { grid-template-columns: 1fr; }
  .form-grid  { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 260px; }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--md-elev-5);
  }
  .sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.32);
    z-index: 199;
  }
  .sidebar-backdrop.open { display: block; }

  .topbar { left: 0; padding: 0 12px; }
  .topbar-toggle { display: flex; }
  .main-content { margin-left: 0; }
  .page-body { padding: 16px; }

  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .table th, .table td { padding: 10px 12px; font-size: .8125rem; }
  .notif-panel { width: 300px; right: -40px; }
  .modal { max-width: calc(100vw - 32px); }

  .table-mobile thead { display: none; }
  .table-mobile tbody tr {
    display: block;
    border: 1px solid var(--md-outline-variant);
    border-radius: var(--shape-md);
    margin-bottom: 10px;
    padding: 14px;
    background: var(--md-surface);
  }
  .table-mobile td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border: none;
    font-size: .85rem;
  }
  .table-mobile td::before {
    content: attr(data-label);
    font-weight: 500;
    color: var(--text-muted);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    flex-shrink: 0;
    margin-right: 10px;
  }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-value { font-size: 1.4rem; }
  .login-card { padding: 28px 20px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .notif-panel { width: calc(100vw - 24px); right: -60px; }
  .form-grid-3 { grid-template-columns: 1fr; }
}
