/* ==========================================================================
   Landmark Finance Hub — Design System
   Direction: premium fintech-ops SaaS (Stripe/Linear/Vercel-inspired),
   glassmorphism, dark+light themes.

   Palette
     --brand-signal   #3355FF  primary action / focus / links
     --brand-landmark #C9A227  "certified / stamped" accent — ties to the
                                Landmark name, used sparingly for success
                                seals and highlighted totals only
     --bg-void        #0B0E1A  dark-mode canvas
     --bg-canvas      #F4F5FA  light-mode canvas
   Type
     Display: 'Space Grotesk' (geometric, technical — headings, big stats)
     Body:    'Inter' (UI text)
     Mono:    'JetBrains Mono' (filenames, counters, job ids)
   Signature element: the "certification seal" — a circular stamp motif
   used on success states, echoing a notarized finance document.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --brand-signal: #3355ff;
  --brand-signal-soft: rgba(51, 85, 255, 0.14);
  --brand-landmark: #c9a227;
  --brand-landmark-soft: rgba(201, 162, 39, 0.16);
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.14);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.14);

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 9px;

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --shadow-float: 0 20px 45px -18px rgba(10, 14, 30, 0.35);
  --shadow-soft: 0 8px 24px -12px rgba(10, 14, 30, 0.25);

  --transition-fast: 160ms cubic-bezier(.4,0,.2,1);
}

/* ---------- Theme: Dark (default) ---------- */
[data-theme="dark"] {
  --bg-canvas: #0b0e1a;
  --bg-canvas-2: #0f1326;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-solid: #131730;
  --panel-border: rgba(255, 255, 255, 0.08);
  --text-primary: #eef0fb;
  --text-secondary: #9aa0c0;
  --text-muted: #6b7194;
  --sidebar-bg: rgba(12, 15, 30, 0.72);
  --input-bg: rgba(255, 255, 255, 0.05);
  --divider: rgba(255, 255, 255, 0.07);
  --gradient-bg:
    radial-gradient(1100px 600px at 10% -10%, rgba(51, 85, 255, 0.20), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(201, 162, 39, 0.12), transparent 55%),
    var(--bg-canvas);
}

/* ---------- Theme: Light ---------- */
[data-theme="light"] {
  --bg-canvas: #f4f5fa;
  --bg-canvas-2: #ffffff;
  --panel: rgba(255, 255, 255, 0.65);
  --panel-solid: #ffffff;
  --panel-border: rgba(20, 24, 48, 0.08);
  --text-primary: #171b2e;
  --text-secondary: #565c78;
  --text-muted: #8a90a6;
  --sidebar-bg: rgba(255, 255, 255, 0.75);
  --input-bg: rgba(20, 24, 48, 0.035);
  --divider: rgba(20, 24, 48, 0.08);
  --gradient-bg:
    radial-gradient(1100px 600px at 10% -10%, rgba(51, 85, 255, 0.08), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(201, 162, 39, 0.10), transparent 55%),
    var(--bg-canvas);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: var(--font-body);
  background: var(--gradient-bg);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background var(--transition-fast), color var(--transition-fast);
}

h1, h2, h3, h4, .font-display { font-family: var(--font-display); letter-spacing: -0.01em; }
.font-mono { font-family: var(--font-mono); }
a { color: inherit; text-decoration: none; }

/* ---------- Layout shell ---------- */
.lfh-shell { display: flex; min-height: 100vh; }

.lfh-sidebar {
  width: 264px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--panel-border);
  padding: 20px 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  transition: width var(--transition-fast);
  z-index: 20;
}
.lfh-shell.collapsed .lfh-sidebar { width: 76px; }
.lfh-shell.collapsed .lfh-nav-label,
.lfh-shell.collapsed .brand-word,
.lfh-shell.collapsed .brand-tagline { display: none; }

.brand-row { display: flex; align-items: center; gap: 10px; padding: 8px 8px 20px; }
.brand-mark { width: 34px; height: 34px; flex-shrink: 0; }
.brand-word { font-family: var(--font-display); font-weight: 700; font-size: 16px; line-height: 1.1; }
.brand-tagline { font-size: 10.5px; color: var(--text-muted); margin-top: 1px; }

.lfh-nav-group { margin-bottom: 6px; }
.lfh-nav-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); padding: 14px 12px 6px; }
.lfh-nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 13.5px; font-weight: 500;
  cursor: pointer; transition: background var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
}
.lfh-nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.lfh-nav-item:hover { background: var(--panel); color: var(--text-primary); }
.lfh-nav-item.active { background: var(--brand-signal-soft); color: var(--brand-signal); }

.lfh-main { flex: 1; min-width: 0; }

.lfh-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; border-bottom: 1px solid var(--panel-border);
  position: sticky; top: 0; background: color-mix(in srgb, var(--bg-canvas) 75%, transparent);
  backdrop-filter: blur(14px); z-index: 15;
}
.lfh-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--input-bg); border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm); padding: 8px 12px; width: 360px; max-width: 40vw;
  color: var(--text-muted); font-size: 13px;
}
.lfh-search kbd {
  margin-left: auto; font-family: var(--font-mono); font-size: 10.5px;
  background: var(--panel); border: 1px solid var(--panel-border);
  padding: 2px 6px; border-radius: 5px; color: var(--text-muted);
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: var(--radius-sm); border: 1px solid var(--panel-border);
  background: var(--panel); cursor: pointer; color: var(--text-secondary);
  transition: all var(--transition-fast);
}
.icon-btn:hover { color: var(--text-primary); border-color: var(--brand-signal); }
.icon-btn svg { width: 17px; height: 17px; }

.lfh-content { padding: 26px 28px 60px; max-width: 1400px; }

/* ---------- Glass cards ---------- */
.glass-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-soft);
}
.glass-card.floating { box-shadow: var(--shadow-float); }
.card-pad { padding: 22px; }

/* ---------- Stat tiles ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1100px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-tile { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.stat-tile .stat-icon {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: var(--brand-signal-soft); color: var(--brand-signal);
}
.stat-tile .stat-value { font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.stat-tile .stat-label { font-size: 12.5px; color: var(--text-muted); }

/* ---------- Quick actions grid ---------- */
.action-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
@media (max-width: 1200px) { .action-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .action-grid { grid-template-columns: repeat(2, 1fr); } }

.action-tile {
  padding: 18px 16px; display: flex; flex-direction: column; gap: 12px;
  cursor: pointer; transition: transform var(--transition-fast), border-color var(--transition-fast);
}
.action-tile:hover { transform: translateY(-3px); border-color: var(--brand-signal); }
.action-tile .action-icon {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--panel-solid); border: 1px solid var(--panel-border); color: var(--brand-signal);
}
.action-tile .action-name { font-size: 13px; font-weight: 600; }
.action-tile .action-desc { font-size: 11.5px; color: var(--text-muted); }
.action-tile.disabled { opacity: .5; cursor: not-allowed; }
.action-tile.disabled:hover { transform: none; border-color: var(--panel-border); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 13.5px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  padding: 10px 18px; cursor: pointer; transition: all var(--transition-fast);
}
.btn-primary { background: var(--brand-signal); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 10px 24px -10px rgba(51,85,255,.55); }
.btn-ghost { background: var(--panel); border-color: var(--panel-border); color: var(--text-primary); }
.btn-ghost:hover { border-color: var(--brand-signal); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Dropzone ---------- */
.dropzone {
  border: 1.5px dashed var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 40px 20px; text-align: center; cursor: pointer;
  transition: all var(--transition-fast); background: var(--panel);
}
.dropzone.dragover { border-color: var(--brand-signal); background: var(--brand-signal-soft); }
.dropzone .dz-icon { width: 44px; height: 44px; margin: 0 auto 12px; color: var(--brand-signal); }
.dropzone .dz-title { font-weight: 600; font-size: 14.5px; }
.dropzone .dz-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ---------- File list / queue ---------- */
.file-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--panel-border); margin-bottom: 8px; background: var(--panel);
}
.file-row .file-name { font-family: var(--font-mono); font-size: 12.5px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .file-meta { font-size: 11px; color: var(--text-muted); }
.file-row .file-tag {
  font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 20px;
  background: var(--brand-landmark-soft); color: var(--brand-landmark);
}

/* ---------- Progress ---------- */
.progress-track { height: 8px; border-radius: 20px; background: var(--input-bg); overflow: hidden; }
.progress-fill {
  height: 100%; border-radius: 20px;
  background: linear-gradient(90deg, var(--brand-signal), var(--brand-landmark));
  width: 0%; transition: width .25s ease;
}

/* ---------- Certification seal (signature element) ---------- */
.seal {
  width: 64px; height: 64px; border-radius: 50%;
  border: 2.5px solid var(--success);
  display: grid; place-items: center; color: var(--success);
  position: relative; animation: seal-in .4s cubic-bezier(.34,1.56,.64,1);
}
.seal::before {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 1px dashed var(--success); opacity: .5;
}
.seal svg { width: 28px; height: 28px; }
@keyframes seal-in { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.error-badge {
  width: 64px; height: 64px; border-radius: 50%; border: 2.5px solid var(--danger);
  display: grid; place-items: center; color: var(--danger); animation: seal-in .4s cubic-bezier(.34,1.56,.64,1);
}
.error-badge svg { width: 26px; height: 26px; }

/* ---------- Toasts ---------- */
.toast-stack {
  position: fixed; bottom: 22px; right: 22px; z-index: 100;
  display: flex; flex-direction: column; gap: 10px; width: 340px;
}
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px;
  border-radius: var(--radius-md); background: var(--panel-solid);
  border: 1px solid var(--panel-border); box-shadow: var(--shadow-float);
  animation: toast-in .25s cubic-bezier(.34,1.56,.64,1);
  font-size: 13px;
}
.toast .toast-icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.info .toast-icon { color: var(--brand-signal); }
.toast .toast-close { margin-left: auto; cursor: pointer; color: var(--text-muted); }
@keyframes toast-in { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---------- Forms ---------- */
.form-label { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; display: block; }
.form-control, select.form-control {
  width: 100%; background: var(--input-bg); border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm); padding: 10px 12px; color: var(--text-primary);
  font-family: var(--font-body); font-size: 13.5px;
}
.form-control:focus, select.form-control:focus { outline: 2px solid var(--brand-signal); outline-offset: 1px; }
.form-row { margin-bottom: 16px; }
.chip-toggle { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 8px 14px; border-radius: 20px; border: 1px solid var(--panel-border);
  background: var(--panel); font-size: 12.5px; cursor: pointer; transition: all var(--transition-fast);
}
.chip.active { background: var(--brand-signal); color: #fff; border-color: var(--brand-signal); }

/* ---------- Utility ---------- */
.flex { display: flex; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mb-16 { margin-bottom: 16px; }
.muted { color: var(--text-muted); }
.section-title { font-family: var(--font-display); font-weight: 600; font-size: 15px; margin-bottom: 14px; }
.badge-soon {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  background: var(--panel-solid); border: 1px solid var(--panel-border); color: var(--text-muted);
  padding: 2px 7px; border-radius: 20px;
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--panel-border); border-radius: 20px; }

@media (max-width: 860px) {
  .lfh-sidebar { position: fixed; left: -280px; transition: left var(--transition-fast); }
  .lfh-shell.collapsed .lfh-sidebar { left: 0; width: 264px; }
  .lfh-shell.collapsed .lfh-nav-label,
  .lfh-shell.collapsed .brand-word,
  .lfh-shell.collapsed .brand-tagline { display: inline; }
  .lfh-search { display: none; }
}
