/* ============================================================
   CORVUS — Master Stylesheet
   Design system, layout, components, utilities
   ============================================================ */

/* ── Local Fonts ─────────────────────────────────────────── */
@font-face { font-family: 'Blauer Nue'; src: url('Blauer Nue/BlauerNue-Thin.otf') format('opentype'); font-weight: 100; font-style: normal; }
@font-face { font-family: 'Blauer Nue'; src: url('Blauer Nue/BlauerNue-Thin_Italic.otf') format('opentype'); font-weight: 100; font-style: italic; }
@font-face { font-family: 'Blauer Nue'; src: url('Blauer Nue/BlauerNue-ExtraLight.otf') format('opentype'); font-weight: 200; font-style: normal; }
@font-face { font-family: 'Blauer Nue'; src: url('Blauer Nue/BlauerNue-ExtraLight_Italic.otf') format('opentype'); font-weight: 200; font-style: italic; }
@font-face { font-family: 'Blauer Nue'; src: url('Blauer Nue/BlauerNue-Light.otf') format('opentype'); font-weight: 300; font-style: normal; }
@font-face { font-family: 'Blauer Nue'; src: url('Blauer Nue/BlauerNue-Light_Italic.otf') format('opentype'); font-weight: 300; font-style: italic; }
@font-face { font-family: 'Blauer Nue'; src: url('Blauer Nue/BlauerNue-Regular.otf') format('opentype'); font-weight: 400; font-style: normal; }
@font-face { font-family: 'Blauer Nue'; src: url('Blauer Nue/BlauerNue-Regular_Italic.otf') format('opentype'); font-weight: 400; font-style: italic; }
@font-face { font-family: 'Blauer Nue'; src: url('Blauer Nue/BlauerNue-Medium.otf') format('opentype'); font-weight: 500; font-style: normal; }
@font-face { font-family: 'Blauer Nue'; src: url('Blauer Nue/BlauerNue-Medium_Italic.otf') format('opentype'); font-weight: 500; font-style: italic; }
@font-face { font-family: 'Blauer Nue'; src: url('Blauer Nue/BlauerNue-SemiBold.otf') format('opentype'); font-weight: 600; font-style: normal; }
@font-face { font-family: 'Blauer Nue'; src: url('Blauer Nue/BlauerNue-SemiBold_Italic.otf') format('opentype'); font-weight: 600; font-style: italic; }
@font-face { font-family: 'Blauer Nue'; src: url('Blauer Nue/BlauerNue-Bold.otf') format('opentype'); font-weight: 700; font-style: normal; }
@font-face { font-family: 'Blauer Nue'; src: url('Blauer Nue/BlauerNue-Bold_Italic.otf') format('opentype'); font-weight: 700; font-style: italic; }
@font-face { font-family: 'Blauer Nue'; src: url('Blauer Nue/BlauerNue-ExtraBold.otf') format('opentype'); font-weight: 800; font-style: normal; }
@font-face { font-family: 'Blauer Nue'; src: url('Blauer Nue/BlauerNue-ExtraBold_Italic.otf') format('opentype'); font-weight: 800; font-style: italic; }
@font-face { font-family: 'Blauer Nue'; src: url('Blauer Nue/BlauerNue-Heavy.otf') format('opentype'); font-weight: 900; font-style: normal; }
@font-face { font-family: 'Blauer Nue'; src: url('Blauer Nue/BlauerNue-Heavy_Italic.otf') format('opentype'); font-weight: 900; font-style: italic; }

@font-face { font-family: 'Stage Grotesk'; src: url('Stage Groestk/StageGrotesk-Thin.otf') format('opentype'); font-weight: 100; font-style: normal; }
@font-face { font-family: 'Stage Grotesk'; src: url('Stage Groestk/StageGrotesk-ThinItalic.otf') format('opentype'); font-weight: 100; font-style: italic; }
@font-face { font-family: 'Stage Grotesk'; src: url('Stage Groestk/StageGrotesk-Light.otf') format('opentype'); font-weight: 300; font-style: normal; }
@font-face { font-family: 'Stage Grotesk'; src: url('Stage Groestk/StageGrotesk-LightItalic.otf') format('opentype'); font-weight: 300; font-style: italic; }
@font-face { font-family: 'Stage Grotesk'; src: url('Stage Groestk/StageGrotesk-Regular.otf') format('opentype'); font-weight: 400; font-style: normal; }
@font-face { font-family: 'Stage Grotesk'; src: url('Stage Groestk/StageGrotesk-Italic.otf') format('opentype'); font-weight: 400; font-style: italic; }
@font-face { font-family: 'Stage Grotesk'; src: url('Stage Groestk/StageGrotesk-Medium.otf') format('opentype'); font-weight: 500; font-style: normal; }
@font-face { font-family: 'Stage Grotesk'; src: url('Stage Groestk/StageGrotesk-MediumItalic.otf') format('opentype'); font-weight: 500; font-style: italic; }
@font-face { font-family: 'Stage Grotesk'; src: url('Stage Groestk/StageGrotesk-Bold.otf') format('opentype'); font-weight: 700; font-style: normal; }
@font-face { font-family: 'Stage Grotesk'; src: url('Stage Groestk/StageGrotesk-BoldItalic.otf') format('opentype'); font-weight: 700; font-style: italic; }
@font-face { font-family: 'Stage Grotesk'; src: url('Stage Groestk/StageGrotesk-ExtraBold.otf') format('opentype'); font-weight: 800; font-style: normal; }
@font-face { font-family: 'Stage Grotesk'; src: url('Stage Groestk/StageGrotesk-ExtraBoldItalic.otf') format('opentype'); font-weight: 800; font-style: italic; }
@font-face { font-family: 'Stage Grotesk'; src: url('Stage Groestk/StageGrotesk-Black.otf') format('opentype'); font-weight: 900; font-style: normal; }
@font-face { font-family: 'Stage Grotesk'; src: url('Stage Groestk/StageGrotesk-BlackItalic.otf') format('opentype'); font-weight: 900; font-style: italic; }

/* ── Design Tokens ───────────────────────────────────────── */
:root {
  --bg:            #0a0a0a;
  --bg-2:          #111111;
  --card:          #141414;
  --card-hover:    #1a1a1a;
  --border:        #242424;
  --border-light:  #2e2e2e;
  --fg:            #ffffff;
  --fg-2:          #e0e0e0;
  --muted:         #a0a0a0;
  --muted-2:       #6b6b6b;

  --jade:          #00ae52;
  --jade-dim:      #00843e;
  --jade-glow:     rgba(0,174,82,0.15);
  --jade-subtle:   rgba(0,174,82,0.08);

  --amber:         #f59e0b;
  --amber-subtle:  rgba(245,158,11,0.12);
  --red:           #ef4444;
  --red-subtle:    rgba(239,68,68,0.12);
  --blue:          #3b82f6;
  --blue-subtle:   rgba(59,130,246,0.12);

  --sidebar-w:     260px;
  --sidebar-w-col: 68px;
  --header-h:      60px;

  --radius:        8px;
  --radius-lg:     12px;
  --radius-sm:     5px;

  --shadow:        0 1px 3px rgba(0,0,0,0.4);
  --shadow-lg:     0 8px 32px rgba(0,0,0,0.6);

  --font:          'Stage Grotesk', sans-serif;
  --font-heading:  'Blauer Nue', sans-serif;
  --mono:          'JetBrains Mono', monospace;

  --transition:    all 0.18s ease;
}

/* ── Light Theme ─────────────────────────────────────────── */
[data-theme="light"] {
  --bg:            #f5f7fa;
  --bg-2:          #edf0f4;
  --card:          #ffffff;
  --card-hover:    #f8fafc;
  --border:        #e2e8f0;
  --border-light:  #cbd5e1;
  --fg:            #0f172a;
  --fg-2:          #1e293b;
  --muted:         #64748b;
  --muted-2:       #94a3b8;
  --shadow:        0 1px 3px rgba(0,0,0,0.08);
  --shadow-lg:     0 8px 32px rgba(0,0,0,0.12);
}
[data-theme="light"] body                    { background: var(--bg); color: var(--fg); }
[data-theme="light"] .nav-item:hover         { background: rgba(0,0,0,0.04); }
[data-theme="light"] tbody tr:hover          { background: rgba(0,0,0,0.02); }
[data-theme="light"] .btn-ghost:hover:not(:disabled) { background: rgba(0,0,0,0.05); color: var(--fg); }
[data-theme="light"] .dropdown-item:hover    { background: rgba(0,0,0,0.04); }
[data-theme="light"] .modal-close:hover      { background: rgba(0,0,0,0.06); }
[data-theme="light"] .modal-overlay         { background: rgba(0,0,0,0.45); }
[data-theme="light"] .form-select           { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }
[data-theme="light"] .form-select option    { background: #ffffff; color: #0f172a; }
[data-theme="light"] .step-circle           { background: var(--bg); }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: var(--border-light); }

/* ── Language Switcher ────────────────────────────────────── */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
}
.lang-btn {
  background: none;
  border: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 3px;
  transition: var(--transition);
  font-family: var(--font);
  line-height: 1;
}
.lang-btn.active        { color: var(--jade); }
.lang-btn:hover:not(.active) { color: var(--fg); }
.lang-divider {
  color: var(--border-light);
  font-size: 10px;
  line-height: 1;
  user-select: none;
}

/* ── Theme Toggle ─────────────────────────────────────────── */
.theme-toggle-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.theme-toggle-btn:hover { color: var(--fg); border-color: var(--border-light); }

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }

/* ─────────────────────────────────────────────────────────
   APP LAYOUT
   ───────────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ─────────────────────────────────────────────────────────
   SIDEBAR
   ───────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0;
  z-index: 100;
  transition: width 0.22s ease;
  overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-w-col); }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
  min-height: var(--header-h);
}
.sidebar-logo-icon {
  width: 32px; height: 32px;
  background: var(--jade);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
}
.sidebar-logo-text {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.15s ease;
}
.sidebar.collapsed .sidebar-logo-text { opacity: 0; width: 0; }

.sidebar-nav {
  flex: 1;
  padding: 10px 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  text-transform: uppercase;
  padding: 10px 16px 4px;
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.15s;
}
.sidebar.collapsed .nav-section-label { opacity: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: var(--muted);
  border-radius: 0;
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
}
.nav-item:hover { color: var(--fg); background: rgba(255,255,255,0.04); }
.nav-item.active {
  color: var(--jade);
  background: var(--jade-subtle);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--jade);
  border-radius: 0 2px 2px 0;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-label {
  opacity: 1;
  transition: opacity 0.15s;
  overflow: hidden;
}
.sidebar.collapsed .nav-label { opacity: 0; width: 0; overflow: hidden; }

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--jade);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
  transition: opacity 0.15s;
}
.sidebar.collapsed .nav-badge { opacity: 0; }

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 10px 0;
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 6px 12px;
}
.sidebar-toggle-btn {
  width: 28px; height: 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  transition: var(--transition);
  cursor: pointer;
}
.sidebar-toggle-btn:hover { color: var(--fg); border-color: var(--border-light); }
.sidebar-toggle-btn svg { width: 13px; height: 13px; }

/* ─────────────────────────────────────────────────────────
   MAIN WRAPPER
   ───────────────────────────────────────────────────────── */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-w);
  transition: margin-left 0.22s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.main-wrapper.sidebar-collapsed { margin-left: var(--sidebar-w-col); }

/* ─────────────────────────────────────────────────────────
   HEADER
   ───────────────────────────────────────────────────────── */
.app-header {
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-date {
  font-size: 12.5px;
  color: var(--muted);
}
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.header-user:hover { background: var(--card); }
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--jade);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.header-user-name {
  font-size: 13px;
  font-weight: 500;
}
.header-user-role {
  font-size: 11px;
  color: var(--muted);
}
.user-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  min-width: 180px;
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 200;
}
.user-dropdown.open { display: block; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--fg-2);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}
.dropdown-item:hover { background: rgba(255,255,255,0.05); color: var(--fg); }
.dropdown-item.danger { color: var(--red); }
.dropdown-item.danger:hover { background: var(--red-subtle); }
.dropdown-item svg { width: 14px; height: 14px; }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ─────────────────────────────────────────────────────────
   MAIN CONTENT
   ───────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  padding: 28px 28px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* ─────────────────────────────────────────────────────────
   PAGE HEADER
   ───────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title { font-size: 22px; font-weight: 700; font-family: var(--font-heading); }
.page-subtitle { font-size: 13px; color: var(--muted); margin-top: 2px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ─────────────────────────────────────────────────────────
   CARDS
   ───────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-heading);
}
.card-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}
.card-body { padding: 20px; }

/* ── Metric Cards ─────────────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.metric-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: var(--transition);
}
.metric-card:hover { border-color: var(--border-light); }
.metric-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 8px;
}
.metric-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  font-family: var(--font-heading);
}
.metric-value.jade { color: var(--jade); }
.metric-value.amber { color: var(--amber); }
.metric-value.red { color: var(--red); }
.metric-value.blue { color: var(--blue); }
.metric-change {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.metric-change.up { color: var(--jade); }
.metric-change.down { color: var(--red); }

/* ─────────────────────────────────────────────────────────
   BUTTONS
   ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
}
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--jade);
  color: #fff;
  border-color: var(--jade);
}
.btn-primary:hover:not(:disabled) { background: var(--jade-dim); border-color: var(--jade-dim); }

.btn-secondary {
  background: var(--card);
  color: var(--fg-2);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--card-hover); border-color: var(--border-light); color: var(--fg); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,0.05); color: var(--fg); }

.btn-danger {
  background: transparent;
  color: var(--red);
  border-color: var(--red);
}
.btn-danger:hover:not(:disabled) { background: var(--red-subtle); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 14.5px; }
.btn-icon { padding: 7px; }

/* ─────────────────────────────────────────────────────────
   BADGES
   ───────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge svg { width: 10px; height: 10px; }
.badge-jade    { background: var(--jade-subtle); color: var(--jade); border: 1px solid rgba(0,174,82,0.2); }
.badge-amber   { background: var(--amber-subtle); color: var(--amber); border: 1px solid rgba(245,158,11,0.2); }
.badge-red     { background: var(--red-subtle); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }
.badge-blue    { background: var(--blue-subtle); color: var(--blue); border: 1px solid rgba(59,130,246,0.2); }
.badge-muted   { background: rgba(160,160,160,0.1); color: var(--muted); border: 1px solid rgba(160,160,160,0.15); }

/* ─────────────────────────────────────────────────────────
   FORM ELEMENTS
   ───────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg-2);
  margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg);
  font-size: 13.5px;
  padding: 9px 12px;
  transition: var(--transition);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--jade);
  box-shadow: 0 0 0 2px var(--jade-glow);
}
.form-input::placeholder { color: var(--muted-2); }
.form-select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23a0a0a0' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.form-select option { background: var(--card); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.form-error { font-size: 11.5px; color: var(--red); margin-top: 4px; }

.input-group { position: relative; }
.input-group .input-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  width: 15px; height: 15px;
  pointer-events: none;
}
.input-group .form-input { padding-left: 34px; }

/* ─────────────────────────────────────────────────────────
   TABLE
   ───────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.02); }
tbody td {
  padding: 12px 14px;
  color: var(--fg-2);
  vertical-align: middle;
}
tbody td.mono { font-family: var(--mono); font-size: 12px; }

/* ─────────────────────────────────────────────────────────
   MODAL
   ───────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.18s ease;
}
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 1000px; }
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 15px; font-weight: 600; font-family: var(--font-heading); }
.modal-close {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}
.modal-close:hover { background: rgba(255,255,255,0.06); color: var(--fg); }
.modal-close svg { width: 15px; height: 15px; }
.modal-body { padding: 22px; }
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ─────────────────────────────────────────────────────────
   TOAST NOTIFICATIONS
   ───────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.2s ease;
}
.toast.success { border-left: 3px solid var(--jade); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.warning { border-left: 3px solid var(--amber); }
.toast.info    { border-left: 3px solid var(--blue); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast-icon { flex-shrink: 0; width: 16px; height: 16px; margin-top: 1px; }
.toast.success .toast-icon { color: var(--jade); }
.toast.error   .toast-icon { color: var(--red); }
.toast.warning .toast-icon { color: var(--amber); }
.toast.info    .toast-icon { color: var(--blue); }
.toast-title   { font-size: 13px; font-weight: 600; }
.toast-message { font-size: 12px; color: var(--muted); margin-top: 2px; }
.toast-dismiss {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  font-size: 16px;
  line-height: 1;
}

/* ─────────────────────────────────────────────────────────
   UPLOAD ZONE
   ───────────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}
.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--jade);
  background: var(--jade-subtle);
}
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.upload-icon {
  width: 44px; height: 44px;
  margin: 0 auto 12px;
  background: var(--jade-subtle);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--jade);
}
.upload-icon svg { width: 22px; height: 22px; }
.upload-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; font-family: var(--font-heading); }
.upload-hint  { font-size: 12px; color: var(--muted); }

.file-list { margin-top: 14px; }
.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 6px;
}
.file-item-icon { color: var(--jade); flex-shrink: 0; }
.file-item-icon svg { width: 16px; height: 16px; }
.file-item-name { font-size: 13px; font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item-size { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.file-item-remove {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.file-item-remove:hover { color: var(--red); background: var(--red-subtle); }
.file-item-remove svg { width: 12px; height: 12px; }

/* ─────────────────────────────────────────────────────────
   PROGRESS
   ───────────────────────────────────────────────────────── */
.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--jade);
  border-radius: 99px;
  transition: width 0.3s ease;
}
.progress-fill.amber { background: var(--amber); }
.progress-fill.red   { background: var(--red); }

/* ─────────────────────────────────────────────────────────
   TABS
   ───────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tab-btn {
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.tab-btn:hover { color: var(--fg); }
.tab-btn.active { color: var(--jade); border-bottom-color: var(--jade); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ─────────────────────────────────────────────────────────
   SEARCH & FILTERS
   ───────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-bar .form-input,
.filter-bar .form-select {
  width: auto;
}

/* ─────────────────────────────────────────────────────────
   STATUS STEPS
   ───────────────────────────────────────────────────────── */
.steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 28px;
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.step:last-child { flex: 0; }
.step-circle {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: var(--bg);
  flex-shrink: 0;
  z-index: 1;
  position: relative;
}
.step.done .step-circle    { border-color: var(--jade); background: var(--jade); color: #fff; }
.step.active .step-circle  { border-color: var(--jade); color: var(--jade); }
.step-label {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}
.step.done .step-label,
.step.active .step-label { color: var(--fg); font-weight: 500; }
.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 8px;
}
.step.done + .step-line { background: var(--jade); }
.step-line:last-child { display: none; }

/* ─────────────────────────────────────────────────────────
   EMPTY STATE
   ───────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}
.empty-state-icon {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  background: var(--jade-subtle);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--jade);
}
.empty-state-icon svg { width: 28px; height: 28px; }
.empty-state-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.empty-state-desc  { font-size: 13px; color: var(--muted); max-width: 360px; margin: 0 auto 20px; }

/* ─────────────────────────────────────────────────────────
   SPINNER
   ───────────────────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--jade);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
.spinner-lg { width: 36px; height: 36px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─────────────────────────────────────────────────────────
   BANNER
   ───────────────────────────────────────────────────────── */
.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid;
}
.banner svg { width: 15px; height: 15px; flex-shrink: 0; }
.banner-success { background: var(--jade-subtle); border-color: rgba(0,174,82,0.25); color: var(--jade); }
.banner-warning { background: var(--amber-subtle); border-color: rgba(245,158,11,0.25); color: var(--amber); }
.banner-error   { background: var(--red-subtle); border-color: rgba(239,68,68,0.25); color: var(--red); }
.banner-info    { background: var(--blue-subtle); border-color: rgba(59,130,246,0.25); color: var(--blue); }

/* ─────────────────────────────────────────────────────────
   GRID LAYOUTS
   ───────────────────────────────────────────────────────── */
.grid-2  { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3  { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4  { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ─────────────────────────────────────────────────────────
   SPLIT LAYOUT
   ───────────────────────────────────────────────────────── */
.split-layout { display: flex; gap: 20px; align-items: flex-start; }
.split-main { flex: 1; min-width: 0; }
.split-aside { width: 300px; flex-shrink: 0; }
@media (max-width: 1100px) {
  .split-layout { flex-direction: column; }
  .split-aside { width: 100%; }
}

/* ─────────────────────────────────────────────────────────
   EDITABLE TABLE CELLS
   ───────────────────────────────────────────────────────── */
.editable-cell {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--fg-2);
  font-size: 13px;
  font-family: var(--font);
  padding: 4px 7px;
  width: 100%;
  transition: var(--transition);
  outline: none;
}
.editable-cell:hover { border-color: var(--border); }
.editable-cell:focus { border-color: var(--jade); background: var(--bg); color: var(--fg); }

/* ── Row status colors ───────────────────────────────────── */
tr.row-matched  td:first-child { border-left: 2px solid var(--jade); }
tr.row-unmatched td:first-child { border-left: 2px solid var(--red); }
tr.row-exception td:first-child { border-left: 2px solid var(--amber); }
tr.row-manual   td:first-child { border-left: 2px solid var(--blue); }

/* ─────────────────────────────────────────────────────────
   PAGINATION
   ───────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}
.pagination-info { font-size: 12.5px; color: var(--muted); }
.pagination-btns { display: flex; gap: 4px; }
.page-btn {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font);
  transition: var(--transition);
}
.page-btn:hover { color: var(--fg); border-color: var(--border-light); }
.page-btn.active { background: var(--jade); border-color: var(--jade); color: #fff; }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ─────────────────────────────────────────────────────────
   ACTIVITY FEED
   ───────────────────────────────────────────────────────── */
.activity-list { padding: 4px 0; }
.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  margin-top: 5px;
}
.activity-dot.jade  { background: var(--jade); }
.activity-dot.amber { background: var(--amber); }
.activity-dot.red   { background: var(--red); }
.activity-dot.blue  { background: var(--blue); }
.activity-text  { font-size: 13px; line-height: 1.4; }
.activity-time  { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ─────────────────────────────────────────────────────────
   SESSION CARD
   ───────────────────────────────────────────────────────── */
.session-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: var(--transition);
  cursor: pointer;
  display: block;
  text-decoration: none;
  color: inherit;
}
.session-card:hover { border-color: var(--border-light); background: var(--card-hover); }
.session-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}
.session-name { font-size: 14.5px; font-weight: 600; margin-bottom: 2px; }
.session-date { font-size: 12px; color: var(--muted); }
.session-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.session-stat-label { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.session-stat-value { font-size: 18px; font-weight: 700; font-family: var(--font-heading); }

/* ─────────────────────────────────────────────────────────
   LOGIN PAGE
   ───────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}
.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.auth-logo-icon {
  width: 36px; height: 36px;
  background: var(--jade);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
}
.auth-logo-name { font-size: 18px; font-weight: 700; font-family: var(--font-heading); }
.auth-title    { font-size: 22px; font-weight: 700; margin-bottom: 4px; font-family: var(--font-heading); }
.auth-subtitle { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.auth-footer { text-align: center; margin-top: 16px; font-size: 12.5px; color: var(--muted); }

/* ─────────────────────────────────────────────────────────
   CHART AREA
   ───────────────────────────────────────────────────────── */
.chart-container { position: relative; height: 200px; }

/* ─────────────────────────────────────────────────────────
   RECONCILIATION RESULTS
   ───────────────────────────────────────────────────────── */
.recon-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
@media (max-width: 800px) {
  .recon-summary-grid { grid-template-columns: repeat(2, 1fr); }
}
.recon-summary-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: center;
}
.recon-summary-card .value { font-size: 26px; font-weight: 700; font-family: var(--font-heading); }
.recon-summary-card .label { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ─────────────────────────────────────────────────────────
   PROCESSING OVERLAY
   ───────────────────────────────────────────────────────── */
.processing-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
}
.processing-overlay.active { display: flex; }
.processing-title { font-size: 18px; font-weight: 600; }
.processing-sub   { font-size: 13px; color: var(--muted); }
.processing-progress { width: 280px; }

/* ─────────────────────────────────────────────────────────
   CHECKBOX
   ───────────────────────────────────────────────────────── */
.checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.checkbox-wrap input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--jade);
  cursor: pointer;
}

/* ─────────────────────────────────────────────────────────
   TOGGLE SWITCH
   ───────────────────────────────────────────────────────── */
.toggle {
  position: relative;
  display: inline-block;
  width: 36px; height: 20px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border-light);
  border-radius: 99px;
  transition: var(--transition);
  cursor: pointer;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: var(--transition);
}
.toggle input:checked + .toggle-slider { background: var(--jade); }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); }

/* ─────────────────────────────────────────────────────────
   PROFILE
   ───────────────────────────────────────────────────────── */
.profile-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--jade);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  font-weight: 700;
  color: #fff;
}

/* ─────────────────────────────────────────────────────────
   MISC UTILITIES
   ───────────────────────────────────────────────────────── */
.text-muted  { color: var(--muted); }
.text-jade   { color: var(--jade); }
.text-amber  { color: var(--amber); }
.text-red    { color: var(--red); }
.text-blue   { color: var(--blue); }
.text-sm     { font-size: 12px; }
.text-xs     { font-size: 11px; }
.font-mono   { font-family: var(--mono); }
.font-bold   { font-weight: 700; }
.font-semi   { font-weight: 600; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.flex  { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
