/* ============================================================================
   SLH SalesFlow Pro — Design System
   Palette derived from brand mark: deep royal blue monogram on white.
   Signature element: the "ledger rule" — a thin gold baseline that anchors
   every card and panel header, echoing a signed contract/ledger line —
   fitting for a licensing & deal-closing product.
   ============================================================================ */

:root {
  /* Core palette — pulled from the SLH logo + two supporting tones */
  --slh-blue-900: #16213F;   /* near-black navy, page background (dark mode) */
  --slh-blue-800: #1B2B57;   /* deep navy, sidebar / headers */
  --slh-blue-600: #3151A0;   /* brand blue, primary actions (from logo) */
  --slh-blue-400: #6B87C9;   /* mid blue, secondary accents */
  --slh-blue-100: #E9EDF8;   /* pale blue tint, backgrounds */
  --slh-gold-500: #C99A2E;   /* ledger-line gold accent */
  --slh-gold-100: #F7ECD3;

  --slh-ink: #1C2333;
  --slh-ink-soft: #545B6E;
  --slh-paper: #FBFAF7;      /* warm off-white, not stark white */
  --slh-line: #E3E1D9;

  --slh-success: #1E8E5A;
  --slh-warning: #C97B0E;
  --slh-danger: #C4402D;

  --font-display: 'Fraunces', 'Georgia', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-card: 0 1px 2px rgba(22,33,63,0.06), 0 8px 24px -8px rgba(22,33,63,0.12);
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--slh-paper);
  color: var(--slh-ink);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--slh-blue-800);
  letter-spacing: -0.01em;
}

a { color: var(--slh-blue-600); text-decoration: none; }

/* ---------------------------------------------------------------------------
   Ledger rule — signature element. A thin gold baseline under headers,
   card titles, and section dividers, echoing a signed ledger/contract line.
   --------------------------------------------------------------------------- */
.ledger-rule {
  position: relative;
  padding-bottom: 14px;
  margin-bottom: 20px;
}
.ledger-rule::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 48px;
  height: 3px;
  background: var(--slh-gold-500);
  border-radius: 2px;
}

/* ---------------------------------------------------------------------------
   Login screen
   --------------------------------------------------------------------------- */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
}

.auth-visual {
  background: linear-gradient(160deg, var(--slh-blue-800) 0%, var(--slh-blue-900) 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px;
  color: #EFF2FA;
}
.auth-visual::before {
  /* faint oversized monogram watermark, echoing the brand mark */
  content: "SLH";
  position: absolute;
  right: -40px; bottom: -60px;
  font-family: var(--font-display);
  font-size: 340px;
  font-weight: 700;
  color: rgba(255,255,255,0.035);
  line-height: 1;
  pointer-events: none;
}
.auth-visual .brand-row { display: flex; align-items: center; gap: 14px; }
.auth-visual .brand-row img { height: 42px; filter: brightness(0) invert(1); }
.auth-visual .headline {
  font-family: var(--font-display);
  font-size: 2.4rem;
  line-height: 1.15;
  color: #fff;
  max-width: 460px;
  margin-top: 40px;
}
.auth-visual .headline em { color: var(--slh-gold-500); font-style: normal; }
.auth-visual .subcopy { color: #B7C1DE; margin-top: 18px; max-width: 420px; line-height: 1.6; }
.auth-visual .stat-row { display: flex; gap: 36px; margin-top: auto; padding-top: 40px; border-top: 1px solid rgba(255,255,255,0.12); }
.auth-visual .stat-row .stat-num { font-family: var(--font-display); font-size: 1.6rem; color: #fff; }
.auth-visual .stat-row .stat-label { font-size: 0.78rem; color: #9AA6C6; text-transform: uppercase; letter-spacing: 0.06em; }

.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--slh-paper);
}
.auth-form-card { width: 100%; max-width: 400px; }
.auth-form-card .logo-row { display: flex; align-items: center; gap: 12px; margin-bottom: 36px; }
.auth-form-card .logo-row img { height: 40px; }
.auth-form-card h1 { font-size: 1.6rem; margin: 0 0 6px; }
.auth-form-card .lead { color: var(--slh-ink-soft); margin: 0 0 32px; font-size: 0.95rem; }

.field-group { margin-bottom: 18px; }
.field-group label {
  display: block; font-size: 0.82rem; font-weight: 600;
  color: var(--slh-blue-800); margin-bottom: 6px; letter-spacing: 0.01em;
}
.field-input {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--slh-line); font-family: var(--font-body);
  font-size: 0.95rem; background: #fff; color: var(--slh-ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field-input:focus {
  outline: none; border-color: var(--slh-blue-600);
  box-shadow: 0 0 0 3px rgba(49,81,160,0.15);
}
.field-with-icon { position: relative; }
.field-with-icon .field-input { padding-right: 42px; }
.field-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--slh-ink-soft);
  font-size: 0.82rem; font-weight: 600;
}

.row-between { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; color: var(--slh-ink-soft); }
.checkbox-row input { accent-color: var(--slh-blue-600); }

.btn-primary {
  width: 100%; padding: 13px; border: none; border-radius: var(--radius-sm);
  background: var(--slh-blue-600); color: #fff; font-weight: 600;
  font-size: 0.98rem; cursor: pointer; transition: background 0.15s, transform 0.1s;
  font-family: var(--font-body);
}
.btn-primary:hover { background: var(--slh-blue-800); }
.btn-primary:active { transform: scale(0.99); }

.alert {
  padding: 12px 14px; border-radius: var(--radius-sm); font-size: 0.88rem;
  margin-bottom: 20px; border: 1px solid transparent;
}
.alert-danger { background: #FBEAE6; color: var(--slh-danger); border-color: #F1CBC1; }
.alert-success { background: #E7F5EE; color: var(--slh-success); border-color: #BFE3CE; }

.form-footer-link { text-align: center; margin-top: 24px; font-size: 0.88rem; color: var(--slh-ink-soft); }

/* ---------------------------------------------------------------------------
   App shell (post-login) — sidebar + topbar + content
   --------------------------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
  width: 248px; background: var(--slh-blue-800); color: #E7EBF7;
  display: flex; flex-direction: column; flex-shrink: 0;
}
.app-sidebar .brand { display: flex; align-items: center; gap: 12px; padding: 22px 22px 20px; }
.app-sidebar .brand img { height: 34px; filter: brightness(0) invert(1); }
.app-sidebar .brand span { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: #fff; }
.app-sidebar nav { flex: 1; padding: 12px; }
.app-sidebar .nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border-radius: var(--radius-sm); color: #C2CAE6; font-size: 0.9rem;
  margin-bottom: 2px; cursor: pointer; transition: background 0.15s;
}
.app-sidebar .nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.app-sidebar .nav-item.active { background: var(--slh-blue-600); color: #fff; }
.app-sidebar .nav-section-label {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: #7C89AE; padding: 18px 14px 6px;
}

.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.app-topbar {
  height: 64px; background: #fff; border-bottom: 1px solid var(--slh-line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
}
.app-topbar .search-box {
  flex: 1; max-width: 420px; position: relative;
}
.app-topbar .search-box input {
  width: 100%; padding: 9px 14px 9px 36px; border-radius: 999px;
  border: 1.5px solid var(--slh-line); background: var(--slh-blue-100);
  font-size: 0.88rem;
}
.app-content { padding: 28px; flex: 1; }

.stat-card {
  background: #fff; border: 1px solid var(--slh-line); border-radius: var(--radius-md);
  padding: 20px 22px; box-shadow: var(--shadow-card);
}
.stat-card .stat-value { font-family: var(--font-display); font-size: 1.9rem; color: var(--slh-blue-800); }
.stat-card .stat-label { font-size: 0.82rem; color: var(--slh-ink-soft); margin-top: 4px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
