/* ================================================================
   Smart Archive — Merged Common Stylesheet
   smart-archive-common.css

   Merged from:
     · common.css        (base design tokens, forms, utilities)
     · sa-nav.css        (topbar nav, search overlay, sidebar,
                          user dropdown, page shell helpers)

   MERGE NOTES — resolved clashes (sa-nav.css values kept):
     1. :root --sidebar-w   310px → 240px
     2. .topbar  gap         16px  → 14px;  z-index 1000 → 200
     3. .logo-icon           added  flex-shrink: 0
     4. .logo-title          removed redundant font-family declaration
     5. .bc-sep              added  display:flex; align-items:center
     6. .topbar-btn:hover    color: white → color: var(--white)
     7. :root extras kept from common.css only:
           --green-pale, --green-mid, --shadow-xl, --radius-xl
        (sa-nav.css didn't define them; they are NOT clashes)

   Usage:
     <link rel="stylesheet" href="smart-archive-common.css" />
================================================================ */


/* ════════════════════════════════════════════
   1. DESIGN TOKENS
════════════════════════════════════════════ */
:root {
  /* Brand */
  --navy:        #1E293B;
  --navy-light:  #2D3F56;
  --blue:        #2563EB;
  --blue-light:  #3B82F6;
  --blue-pale:   #EFF6FF;
  --blue-mid:    #DBEAFE;

  /* Slate palette */
  --slate-50:    #F8FAFC;
  --slate-100:   #F1F5F9;
  --slate-200:   #E2E8F0;
  --slate-300:   #CBD5E1;
  --slate-400:   #94A3B8;
  --slate-500:   #64748B;
  --slate-600:   #475569;
  --slate-700:   #334155;

  --white:       #FFFFFF;

  /* Accent colours */
  --green:       #10B981;
  --green-pale:  #ECFDF5;    /* from common.css — not in sa-nav */
  --green-mid:   #A7F3D0;    /* from common.css — not in sa-nav */
  --amber:       #F59E0B;
  --rose:        #F43F5E;
  --purple:      #8B5CF6;
  --teal:        #0EA5E9;

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:   0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.05);
  --shadow-lg:   0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
  --shadow-xl:   0 20px 25px -5px rgba(0,0,0,.08), 0 10px 10px -5px rgba(0,0,0,.04); /* from common.css */

  /* Border radii */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   20px;      /* from common.css — not in sa-nav */

  /* Layout                 ↓ sa-nav value (240px) wins over common (310px) */
  --topbar-h:    64px;
  --sidebar-w:   240px;

  /* Typography */
  --font-body:   'DM Sans', sans-serif;
  --font-serif:  'DM Serif Display', serif;
  --font-mono:   'DM Mono', monospace;
}


/* ════════════════════════════════════════════
   2. BASE RESET & GLOBAL
════════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;   /* from common.css */
}

body {
  font-family: var(--font-body);
  background: var(--slate-50);
  color: var(--navy);
  line-height: 1.6;          /* from common.css */
  min-height: 100vh;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar               { width: 5px; height: 5px; }
::-webkit-scrollbar-track         { background: transparent; }
::-webkit-scrollbar-thumb         { background: var(--slate-300); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover   { background: var(--slate-400); }


/* ════════════════════════════════════════════
   3. TOPBAR
   CLASH RESOLVED: gap 14px, z-index 200  (sa-nav wins)
════════════════════════════════════════════ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--navy);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 14px;        /* sa-nav: 14px  |  common had 16px */
  z-index: 200;     /* sa-nav: 200   |  common had 1000  */
  box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 2px 12px rgba(0,0,0,.25);
}

/* Logo */
.topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

/* CLASH RESOLVED: added flex-shrink:0 from sa-nav */
.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--blue) 0%, #1D4ED8 100%);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(37,99,235,.4);
  flex-shrink: 0;   /* sa-nav addition */
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

/* CLASH RESOLVED: removed redundant font-family (sa-nav omits it; inherits from body) */
.logo-title {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .12em;
  color: var(--white);
  text-transform: uppercase;
}

.logo-sub {
  font-size: 9px;
  letter-spacing: .08em;
  color: var(--slate-400);
  text-transform: uppercase;
}

/* Thin vertical rule */
.topbar-divider {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,.1);
  flex-shrink: 0;
}

/* Optional page-context label */
.topbar-badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--slate-400);
  letter-spacing: .04em;
  flex-shrink: 0;
}

/* ── Topbar nav buttons (Home, Upload, Search, …) ── */
/* unique to sa-nav — no clash */
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
}

.topbar-nav-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 9px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--slate-300);
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.topbar-nav-btn svg {
  flex-shrink: 0;
  transition: color .2s;
}

.topbar-nav-btn:hover {
  background: rgba(255,255,255,.12);
  color: var(--white);
  border-color: rgba(255,255,255,.2);
}

.topbar-nav-btn.active {
  background: rgba(37,99,235,.28);
  border-color: rgba(37,99,235,.55);
  color: #93C5FD;
}

.topbar-nav-btn.active svg { color: #93C5FD; }

.topbar-nav-sep {
  width: 1px;
  height: 22px;
  background: rgba(255,255,255,.1);
  flex-shrink: 0;
  margin: 0 4px;
}

/* Right-side icon cluster */
.topbar-right,
.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Global search bar (common.css) ── */
.global-search {
  flex: 1;
  max-width: 520px;
  position: relative;
}

.global-search input {
  width: 100%;
  height: 38px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 9px;
  padding: 0 16px 0 40px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: background .2s, border-color .2s;
}

.global-search input::placeholder { color: var(--slate-400); }
.global-search input:focus { background: rgba(255,255,255,.12); border-color: rgba(37,99,235,.7); }

.global-search .search-icon,
.search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--slate-400);
  pointer-events: none;
}

.search-kbd {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--slate-400);
  pointer-events: none;
}

/* ── Topbar icon buttons ── */
.topbar-btn {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--slate-300);
  transition: background .2s, color .2s;
  position: relative;
  text-decoration: none;
}

/* CLASH RESOLVED: color: var(--white) from sa-nav (equivalent to 'white') */
.topbar-btn:hover { background: rgba(255,255,255,.12); color: var(--white); }
.topbar-btn.active { background: rgba(37,99,235,.3); border-color: rgba(37,99,235,.5); color: #93C5FD; }

/* Notification dot */
.notif-badge,
.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 7px; height: 7px;
  background: var(--rose);
  border-radius: 50%;
  border: 1.5px solid var(--navy);
}


/* ════════════════════════════════════════════
   4. SEARCH OVERLAY
   (unique to sa-nav — no clash)
════════════════════════════════════════════ */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 96px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.search-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.search-box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 48px rgba(0,0,0,.22), 0 8px 16px rgba(0,0,0,.1);
  overflow: hidden;
  transform: translateY(-12px) scale(.98);
  transition: transform .22s cubic-bezier(.175,.885,.32,1.275);
}

.search-overlay.open .search-box {
  transform: translateY(0) scale(1);
}

.search-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--slate-100);
}

.search-input-icon {
  color: var(--slate-400);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.search-input-row input {
  flex: 1;
  height: 36px;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--navy);
  background: transparent;
}

.search-input-row input::placeholder { color: var(--slate-300); }

.search-close-btn {
  background: var(--slate-100);
  border: none;
  border-radius: var(--radius-sm);
  padding: 4px 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--slate-400);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s;
}

.search-close-btn:hover { background: var(--slate-200); }

.search-hints { padding: 14px 18px 18px; }

.search-hints-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--slate-400);
  margin-bottom: 8px;
}

.search-hint-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--slate-600);
  cursor: pointer;
  transition: background .14s, color .14s;
  text-decoration: none;
}

.search-hint:hover { background: var(--slate-50); color: var(--navy); }

.sh-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.shi-blue   { background: var(--blue-pale); color: var(--blue); }
.shi-green  { background: #ECFDF5;          color: #10B981; }
.shi-amber  { background: #FFFBEB;          color: var(--amber); }
.shi-purple { background: #F5F3FF;          color: var(--purple); }


/* ════════════════════════════════════════════
   5. USER CHIP & DROPDOWN
   (merged from both; sa-nav extends common)
════════════════════════════════════════════ */
.user-profile,
.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 9px;
  padding: 5px 10px 5px 6px;
  cursor: pointer;
  transition: background .2s;
  text-decoration: none;
  position: relative;
}

.user-profile:hover,
.user-chip:hover { background: rgba(255,255,255,.12); }

.user-avatar {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--purple) 100%);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
  letter-spacing: .02em;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-100);
}

.user-role {
  font-size: 10px;
  color: var(--slate-400);
  line-height: 1;
}

/* Caret arrow */
.chip-caret {
  color: var(--slate-400);
  transition: transform .22s ease;
  display: flex;
  align-items: center;
  margin-left: 2px;
}

.user-chip.active .chip-caret { transform: rotate(180deg); }

/* ── User Dropdown Panel (unique to sa-nav) ── */
.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 256px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0,0,0,.13), 0 4px 12px rgba(0,0,0,.07);
  z-index: 500;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px) scale(.97);
  pointer-events: none;
  transform-origin: top right;
  transition: opacity .2s ease, transform .2s ease;
}

.user-dropdown.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.user-dropdown::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 20px;
  width: 11px;
  height: 11px;
  background: var(--white);
  border-left: 1px solid var(--slate-200);
  border-top: 1px solid var(--slate-200);
  transform: rotate(45deg);
  border-radius: 2px 0 0 0;
}

.ud-header {
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--slate-100);
  display: flex;
  align-items: center;
  gap: 12px;
}

.ud-avatar {
  width: 40px; height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue) 0%, var(--purple) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
}

.ud-name  { font-size: 13px; font-weight: 700; color: var(--navy); line-height: 1.25; }
.ud-email { font-size: 11px; color: var(--slate-400); margin-top: 1px; }

.ud-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: var(--blue-mid);
  color: var(--blue);
  border-radius: 99px;
  padding: 2px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.ud-section {
  padding: 6px 0;
  border-bottom: 1px solid var(--slate-100);
}

.ud-section:last-child { border-bottom: none; }

.ud-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--slate-400);
  padding: 6px 16px 3px;
}

.ud-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 16px;
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-600);
  transition: background .14s, color .14s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
}

.ud-item:hover              { background: var(--slate-50); color: var(--navy); }
.ud-item:hover .ud-item-icon { color: var(--blue); }

.ud-item-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color .14s;
}

.udi-slate  { background: var(--slate-100); color: var(--slate-500); }
.udi-blue   { background: var(--blue-pale); color: var(--blue); }
.udi-green  { background: #ECFDF5;          color: var(--green); }
.udi-amber  { background: #FFFBEB;          color: var(--amber); }
.udi-rose   { background: #FFF1F2;          color: var(--rose); }

.ud-item-title { font-size: 13px; font-weight: 600; color: inherit; line-height: 1.2; }
.ud-item-sub   { font-size: 11px; color: var(--slate-400); margin-top: 1px; }

.ud-item.danger .ud-item-title         { color: var(--rose); }
.ud-item.danger:hover                  { background: #FFF1F2; color: var(--rose); }
.ud-item.danger:hover .ud-item-icon    { color: var(--rose); }

.ud-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(16,185,129,.2);
  flex-shrink: 0;
  margin-left: auto;
}


/* ════════════════════════════════════════════
   6. SIDEBAR
   (unique to sa-nav — no clash)
════════════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--slate-200);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-section { margin-bottom: 6px; }

.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--slate-400);
  padding: 0 16px;
  margin-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  cursor: pointer;
  text-decoration: none;
  color: var(--slate-500);
  font-size: 13px;
  font-weight: 500;
  transition: background .15s, color .15s;
  position: relative;
}

.nav-item:hover { background: var(--slate-50); color: var(--navy); }

.nav-item.active {
  background: var(--blue-pale);
  color: var(--blue);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--blue);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 600;
  background: var(--blue-mid);
  color: var(--blue);
  border-radius: 99px;
  padding: 1px 7px;
}

.sidebar-divider {
  height: 1px;
  background: var(--slate-100);
  margin: 10px 16px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--slate-100);
}

.storage-label {
  font-size: 11px;
  color: var(--slate-400);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

.storage-label span:last-child { font-weight: 600; color: var(--navy); }

.storage-track {
  height: 4px;
  background: var(--slate-100);
  border-radius: 99px;
  overflow: hidden;
}

.storage-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--blue-light));
  border-radius: 99px;
}


/* ════════════════════════════════════════════
   7. PAGE SHELL HELPERS
════════════════════════════════════════════ */
/* App-body layout (common.css) */
.app-body {
  display: flex;
  margin-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h));
}

.main-content {
  flex: 1;
  overflow-y: auto;
  position: relative;
  min-width: 0;
}

/* Content area with sidebar offset (sa-nav) */
.main {
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  min-height: 100vh;
}

.main-inner {
  padding: 32px 36px 60px;
}

/* CLASH RESOLVED: .breadcrumb margin differs (22px sa-nav vs 24px common); sa-nav wins */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--slate-400);
  margin-bottom: 22px;
}

.breadcrumb a {
  color: var(--slate-500);
  text-decoration: none;
  font-weight: 500;
  transition: color .15s;
}

.breadcrumb a:hover { color: var(--blue); }

/* CLASH RESOLVED: sa-nav adds display:flex; align-items:center */
.bc-sep { color: var(--slate-300); display: flex; align-items: center; }

.bc-cur,
.bc-current { color: var(--navy); font-weight: 600; }


/* ════════════════════════════════════════════
   8. BUTTONS  (from common.css — unique)
════════════════════════════════════════════ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 22px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 4px 12px rgba(37,99,235,.4);
  letter-spacing: .02em;
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--blue-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37,99,235,.45);
}

.btn-primary:active  { transform: translateY(0); }
.btn-primary:disabled { opacity: .55; pointer-events: none; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: white;
  color: var(--slate-600);
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.btn-ghost:hover {
  background: var(--slate-50);
  border-color: var(--slate-300);
  color: var(--navy);
}


/* ════════════════════════════════════════════
   9. FORM ELEMENTS  (from common.css — unique)
════════════════════════════════════════════ */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 7px;
  letter-spacing: .01em;
}

.form-label .required { color: var(--rose); margin-left: 2px; }

.form-sublabel {
  font-size: 11px;
  color: var(--slate-400);
  margin-top: -4px;
  margin-bottom: 7px;
  line-height: 1;
}

.input-wrap { position: relative; }

.input-icon {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--slate-400);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--white);
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--navy);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  box-shadow: var(--shadow-sm);
}

.form-input {
  height: 44px;
  padding: 0 16px 0 40px;
}

.form-select {
  height: 44px;
  padding: 0 16px 0 40px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2394A3B8' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.form-textarea {
  padding: 12px 14px;
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--slate-300); }

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.form-input.has-error,
.form-select.has-error {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(244,63,94,.08);
}

.form-input.is-valid {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(16,185,129,.08);
}

.pw-toggle,
.password-toggle {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--slate-400);
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 4px;
  transition: color .15s;
}

.pw-toggle:hover,
.password-toggle:hover { color: var(--slate-600); }

.form-error,
.field-msg,
.field-err {
  font-size: 11.5px;
  margin-top: 5px;
  display: none;
  align-items: center;
  gap: 5px;
  line-height: 1.4;
}

.form-error.visible,
.field-msg.visible { display: flex; }
.field-err.show { display: flex; }

.form-error,
.field-msg.error { color: var(--rose); }
.field-msg.success { color: var(--green); }
.field-msg.hint { color: var(--slate-400); }
.field-err { color: var(--rose); }


/* ════════════════════════════════════════════
   10. TOGGLE SWITCH  (from common.css — unique)
════════════════════════════════════════════ */
.toggle-switch {
  position: relative;
  width: 40px; height: 22px;
  flex-shrink: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--slate-300);
  border-radius: 99px;
  cursor: pointer;
  transition: background .2s;
}

.toggle-track::after {
  content: '';
  position: absolute;
  left: 3px; top: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .2s;
}

.toggle-switch input:checked + .toggle-track { background: var(--blue); }
.toggle-switch input:checked + .toggle-track::after { transform: translateX(18px); }


/* ════════════════════════════════════════════
   11. SECTION CARDS  (from common.css — unique)
════════════════════════════════════════════ */
.section-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 20px;
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--slate-100);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-header-icon {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chi-blue   { background: var(--blue-pale); }
.chi-amber  { background: #FFFBEB; }
.chi-green  { background: var(--green-pale); }
.chi-rose   { background: #FFF1F2; }
.chi-purple { background: #F5F3FF; }

.card-title { font-size: 13px; font-weight: 700; color: var(--navy); line-height: 1.2; }
.card-subtitle { font-size: 11.5px; color: var(--slate-400); line-height: 1.3; }
.card-body { padding: 24px; }


/* ════════════════════════════════════════════
   12. ALERT BOXES  (from common.css — unique)
════════════════════════════════════════════ */
.alert {
  display: none;
  gap: 10px;
  align-items: flex-start;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 12.5px;
  line-height: 1.55;
}

.alert.visible { display: flex; }

.alert-error   { background: #FFF1F2; border: 1px solid #FECDD3; color: #9F1239; }
.alert-success { background: var(--green-pale); border: 1px solid var(--green-mid); color: #065F46; }

.alert .al-icon,
.alert .alert-icon { flex-shrink: 0; margin-top: 1px; }

.alert-error  .al-icon,
.alert-error  .alert-icon { color: var(--rose); }
.alert-success .al-icon   { color: var(--green); }

.alert-text { font-size: 12.5px; line-height: 1.5; }


/* ════════════════════════════════════════════
   13. PAGE EYEBROW / SECTION LABEL  (from common.css — unique)
════════════════════════════════════════════ */
.page-eyebrow,
.ph-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.page-eyebrow::before,
.ph-eyebrow::before {
  content: '';
  width: 3px; height: 14px;
  background: var(--blue);
  border-radius: 2px;
  display: block;
}


/* ════════════════════════════════════════════
   14. PULSE DOT  (from common.css — unique)
════════════════════════════════════════════ */
.pulse-dot {
  width: 6px; height: 6px;
  background: var(--blue-light);
  border-radius: 50%;
  animation: pulse-anim 2s infinite;
}


/* ════════════════════════════════════════════
   15. ANIMATIONS
════════════════════════════════════════════ */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse-anim {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .5; transform: scale(.8); }
}

/* Merged: common used 'fade-in' keyframe name; sa-nav used 'sa-fade-in'.
   Both kept so existing pages referencing either name continue to work. */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes sa-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes pop-in {
  from { transform: scale(.35); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* .fade-in utility — works with both keyframe names via fade-in */
.fade-in {
  animation: fade-in .35s ease both;
}


/* ════════════════════════════════════════════
   16. RESPONSIVE
   (from sa-nav.css — unique)
════════════════════════════════════════════ */
@media (max-width: 860px) {
  .sidebar              { display: none; }
  .main                 { margin-left: 0; }
  .main-inner           { padding: 20px 16px 48px; }
  .logo-text            { display: none; }
  .topbar-nav-btn span  { display: none; }
  .topbar-nav-btn       { padding: 0 10px; }
}

@media (max-width: 480px) {
  .topbar-btn[title="Help"] { display: none; }
  .search-box               { max-width: calc(100vw - 24px); }
}
