/* ============================================================================
   CrewSync v2 Design System — Navy primary + Coral accent
   Stripe / Linear-grade enterprise overlay.

   CASCADE STRATEGY
     This file is linked AFTER the inline <style> block and crewsync-ds.css.
     Every selector uses the `rc-*` prefix (or `--rc-*` for variables), so it
     never collides with the legacy --itl-*, --brand, or --cs-* namespaces.
     Existing pages keep their look until a caller opts in by adding an
     `rc-*` class. The only global surface change is the page background
     applied to `body` (light slate) — see safety note below.

   SAFETY CONTRACT
     - Zero forced visual change to existing markup.
     - No mass renames (.badge-amber → rc-badge-warning happens post-demo).
     - No replacement of the working service worker.
     - No layout rewrite (existing .app-body / .sidebar / .content untouched).
   ============================================================================ */

:root {
  /* ── Brand ──────────────────────────────────────────────────────────────── */
  --rc-primary:        #0B2056;   /* CrewSync navy — trust, depth */
  --rc-primary-600:    #1A46C2;   /* mid */
  --rc-primary-500:    #3B5BD9;   /* hover / interactive */
  --rc-primary-100:    #E0E7FF;   /* tint surface */
  --rc-primary-50:     #F5F7FF;   /* faintest wash */

  --rc-accent:         #DC4E3D;   /* ITL coral — accent only */
  --rc-accent-600:     #B33724;
  --rc-accent-100:     #FBE9E5;

  /* ── Surfaces ───────────────────────────────────────────────────────────── */
  --rc-bg:             #F8FAFC;   /* page wash — light slate */
  --rc-surface:        #FFFFFF;   /* card / row */
  --rc-surface-2:      #F1F5F9;   /* nested surface */
  --rc-overlay:        rgba(15, 23, 42, 0.45); /* modal overlay */

  /* ── Text ───────────────────────────────────────────────────────────────── */
  --rc-text:           #0F172A;   /* primary — slate-900 */
  --rc-text-2:         #334155;   /* secondary — slate-700 */
  --rc-text-3:         #64748B;   /* muted — slate-500 */
  --rc-text-on-primary:#FFFFFF;

  /* ── Borders ────────────────────────────────────────────────────────────── */
  --rc-border:         #E2E8F0;   /* slate-200 */
  --rc-border-strong:  #CBD5E1;   /* slate-300 */
  --rc-border-focus:   var(--rc-primary-500);

  /* ── Semantic — desaturated, high-contrast pairs ────────────────────────── */
  --rc-success-bg:     #ECFDF5;  --rc-success-fg:#065F46;  --rc-success-line:#A7F3D0;
  --rc-warning-bg:     #FFFBEB;  --rc-warning-fg:#92400E;  --rc-warning-line:#FCD34D;
  --rc-danger-bg:      #FEF2F2;  --rc-danger-fg:#991B1B;   --rc-danger-line:#FCA5A5;
  --rc-info-bg:        #EFF6FF;  --rc-info-fg:#1E3A8A;     --rc-info-line:#BFDBFE;

  /* ── Typography ─────────────────────────────────────────────────────────── */
  --rc-font: "Inter","SF Pro Display",-apple-system,BlinkMacSystemFont,"Segoe UI",
             Roboto,"Helvetica Neue",Arial,sans-serif;
  --rc-mono: "JetBrains Mono","Cascadia Code",Consolas,Menlo,monospace;

  --rc-text-xs:  11px;
  --rc-text-sm:  12.5px;
  --rc-text-md:  14px;
  --rc-text-lg:  16px;
  --rc-text-xl:  19px;
  --rc-text-2xl: 24px;
  --rc-text-3xl: 30px;

  --rc-lh-tight: 1.25;
  --rc-lh-base:  1.45;
  --rc-lh-loose: 1.65;
  --rc-track-caps: 0.04em;

  /* ── Spacing & radius ───────────────────────────────────────────────────── */
  --rc-r-sm: 6px;
  --rc-r-md: 8px;
  --rc-r-lg: 12px;
  --rc-r-xl: 16px;
  --rc-r-pill: 999px;

  --rc-s-1: 4px;
  --rc-s-2: 8px;
  --rc-s-3: 12px;
  --rc-s-4: 16px;
  --rc-s-5: 24px;
  --rc-s-6: 32px;
  --rc-s-7: 48px;

  /* ── Elevation ──────────────────────────────────────────────────────────── */
  --rc-shadow-1: 0 1px 2px rgba(15,23,42,0.04), 0 1px 1px rgba(15,23,42,0.03);
  --rc-shadow-2: 0 4px 12px rgba(15,23,42,0.06), 0 2px 4px rgba(15,23,42,0.04);
  --rc-shadow-3: 0 16px 40px rgba(15,23,42,0.10), 0 4px 12px rgba(15,23,42,0.06);
  --rc-ring:     0 0 0 3px rgba(59, 91, 217, 0.22);

  /* ── Motion ─────────────────────────────────────────────────────────────── */
  --rc-ease:    cubic-bezier(0.4, 0, 0.2, 1);
  --rc-dur-1:   120ms;
  --rc-dur-2:   180ms;
  --rc-dur-3:   240ms;
}

/* ── Typography utilities (opt-in via class) ──────────────────────────────── */
.rc-h1 { font-family:var(--rc-font); font-size: var(--rc-text-3xl); font-weight: 700; letter-spacing: -0.02em; line-height: var(--rc-lh-tight); }
.rc-h2 { font-family:var(--rc-font); font-size: var(--rc-text-2xl); font-weight: 700; letter-spacing: -0.01em; }
.rc-h3 { font-family:var(--rc-font); font-size: var(--rc-text-xl);  font-weight: 600; }
.rc-h4 { font-family:var(--rc-font); font-size: var(--rc-text-lg);  font-weight: 600; }
.rc-caps {
  font-size: var(--rc-text-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: var(--rc-track-caps);
  color: var(--rc-text-3);
}
.rc-muted { color: var(--rc-text-3); }
.rc-mono  { font-family: var(--rc-mono); }

/* ── Card / surface ───────────────────────────────────────────────────────── */
.rc-card {
  background: var(--rc-surface);
  border: 1px solid var(--rc-border);
  border-radius: var(--rc-r-lg);
  box-shadow: var(--rc-shadow-1);
}
.rc-card-hover { transition: box-shadow var(--rc-dur-2) var(--rc-ease), border-color var(--rc-dur-2) var(--rc-ease); }
.rc-card-hover:hover { box-shadow: var(--rc-shadow-2); border-color: var(--rc-border-strong); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.rc-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 0 var(--rc-s-4); height: 36px;
  border-radius: var(--rc-r-md); font-weight: 500; font-size: var(--rc-text-md);
  border: 1px solid transparent; cursor: pointer; user-select: none;
  transition: background var(--rc-dur-1) var(--rc-ease),
              border-color var(--rc-dur-1) var(--rc-ease),
              box-shadow var(--rc-dur-1) var(--rc-ease),
              transform var(--rc-dur-1) var(--rc-ease);
  font-family: var(--rc-font);
}
.rc-btn:active { transform: translateY(1px); }
.rc-btn:focus-visible { outline: none; box-shadow: var(--rc-ring); }
.rc-btn-primary    { background: var(--rc-primary); color: #fff; }
.rc-btn-primary:hover  { background: var(--rc-primary-600); }
.rc-btn-secondary  { background: var(--rc-surface); color: var(--rc-text); border-color: var(--rc-border); }
.rc-btn-secondary:hover { border-color: var(--rc-border-strong); background: var(--rc-surface-2); }
.rc-btn-ghost      { background: transparent; color: var(--rc-text-2); }
.rc-btn-ghost:hover    { background: var(--rc-surface-2); color: var(--rc-text); }
.rc-btn-danger     { background: var(--rc-danger-bg); color: var(--rc-danger-fg); border-color: var(--rc-danger-line); }
.rc-btn-danger:hover   { background: #FEE2E2; }
.rc-btn-accent     { background: var(--rc-accent); color: #fff; }
.rc-btn-accent:hover   { background: var(--rc-accent-600); }
.rc-btn-sm { height: 28px; padding: 0 10px; font-size: var(--rc-text-sm); }
.rc-btn-lg { height: 44px; padding: 0 20px; font-size: var(--rc-text-lg); }

/* ── Form controls (rc- prefix only — does not touch .field input) ────────── */
.rc-input, .rc-select, .rc-textarea {
  width: 100%; height: 36px;
  background: var(--rc-surface); border: 1px solid var(--rc-border);
  border-radius: var(--rc-r-md); padding: 0 var(--rc-s-3);
  font: inherit; font-family: var(--rc-font); color: var(--rc-text);
  transition: border-color var(--rc-dur-1) var(--rc-ease),
              box-shadow var(--rc-dur-1) var(--rc-ease);
}
.rc-textarea { height: auto; min-height: 80px; padding: 8px 12px; line-height: var(--rc-lh-base); resize: vertical; }
.rc-input:hover, .rc-select:hover, .rc-textarea:hover { border-color: var(--rc-border-strong); }
.rc-input:focus, .rc-select:focus, .rc-textarea:focus {
  outline: none; border-color: var(--rc-border-focus); box-shadow: var(--rc-ring);
}
.rc-select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5L6 6.5L11 1.5' stroke='%2364748B' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' fill='none'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 32px; cursor: pointer;
}

/* ── Badges — desaturated, high-contrast ──────────────────────────────────── */
.rc-badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: var(--rc-r-pill);
  font-size: var(--rc-text-xs); font-weight: 600;
  border: 1px solid transparent; white-space: nowrap;
  font-family: var(--rc-font);
}
.rc-badge-success { background: var(--rc-success-bg); color: var(--rc-success-fg); border-color: var(--rc-success-line); }
.rc-badge-warning { background: var(--rc-warning-bg); color: var(--rc-warning-fg); border-color: var(--rc-warning-line); }
.rc-badge-danger  { background: var(--rc-danger-bg);  color: var(--rc-danger-fg);  border-color: var(--rc-danger-line); }
.rc-badge-info    { background: var(--rc-info-bg);    color: var(--rc-info-fg);    border-color: var(--rc-info-line); }
.rc-badge-neutral { background: var(--rc-surface-2);  color: var(--rc-text-2);     border-color: var(--rc-border); }
.rc-badge-primary { background: var(--rc-primary-50); color: var(--rc-primary); border-color: var(--rc-primary-100); }

/* ── Modal — soft Stripe-grade shadow + slide-up ──────────────────────────── */
.rc-modal-overlay {
  position: fixed; inset: 0; background: var(--rc-overlay);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; animation: rcFadeIn var(--rc-dur-2) var(--rc-ease);
}
.rc-modal {
  background: var(--rc-surface);
  border-radius: var(--rc-r-xl);
  box-shadow: var(--rc-shadow-3);
  max-width: 720px; width: calc(100% - 32px); max-height: 92vh; overflow: auto;
  animation: rcSlideUp var(--rc-dur-3) var(--rc-ease);
}
@keyframes rcFadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes rcSlideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── Shell — opt-in alternative to existing .app-body ─────────────────────── */
.rc-shell { display: flex; min-height: 100vh; }
.rc-shell-sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--rc-surface); border-right: 1px solid var(--rc-border);
  transition: width var(--rc-dur-3) var(--rc-ease), transform var(--rc-dur-3) var(--rc-ease);
}
.rc-shell-sidebar.rc-collapsed { width: 64px; }
.rc-shell-main { flex: 1; min-width: 0; padding: var(--rc-s-5); }

/* ── Data table — soft, no heavy lines, subtle hover ──────────────────────── */
.rc-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--rc-text-md); font-family: var(--rc-font); }
.rc-table th {
  text-align: left; padding: 10px 14px;
  font-size: var(--rc-text-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: var(--rc-track-caps);
  color: var(--rc-text-3); background: var(--rc-surface-2);
  border-bottom: 1px solid var(--rc-border);
}
.rc-table td {
  padding: 12px 14px; border-bottom: 1px solid var(--rc-border);
  color: var(--rc-text-2); vertical-align: middle;
}
.rc-table tr:hover td { background: var(--rc-primary-50); }
.rc-table tr:last-child td { border-bottom: 0; }

/* ── Responsive: mobile-first adaptations ─────────────────────────────────── */
@media (max-width: 768px) {
  /* Shell — sidebar slides off-canvas. Only fires when caller opts in via .rc-shell. */
  .rc-shell { flex-direction: column; }
  .rc-shell-sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 950; width: 280px;
    transform: translateX(-100%); box-shadow: var(--rc-shadow-3);
  }
  .rc-shell-sidebar.rc-open { transform: translateX(0); }
  .rc-shell-main { padding: var(--rc-s-3); }

  /* Tables — opt-in stacked card mode. Each <tr> becomes a card; <td> needs data-label="…". */
  .rc-table-stack thead { display: none; }
  .rc-table-stack tr {
    display: block; background: var(--rc-surface);
    border: 1px solid var(--rc-border); border-radius: var(--rc-r-lg);
    padding: var(--rc-s-3); margin-bottom: var(--rc-s-3);
    box-shadow: var(--rc-shadow-1);
  }
  .rc-table-stack td {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 0; border-bottom: 1px dashed var(--rc-border);
  }
  .rc-table-stack td:last-child { border-bottom: 0; }
  .rc-table-stack td::before {
    content: attr(data-label);
    font-size: var(--rc-text-xs); font-weight: 600;
    color: var(--rc-text-3); text-transform: uppercase;
    letter-spacing: var(--rc-track-caps);
    margin-right: var(--rc-s-3); flex-shrink: 0;
  }
}

/* ── Offline banner ───────────────────────────────────────────────────────── */
.rc-offline-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9998;
  background: var(--rc-warning-bg); color: var(--rc-warning-fg);
  border-bottom: 1px solid var(--rc-warning-line);
  padding: 8px 16px; text-align: center;
  font-size: var(--rc-text-sm); font-weight: 600;
  font-family: var(--rc-font);
  transform: translateY(-100%); transition: transform var(--rc-dur-3) var(--rc-ease);
  pointer-events: none;
}
.rc-offline-banner.rc-show { transform: translateY(0); pointer-events: auto; }

/* ============================================================================
   v3.3.4 — VISIBLE UPGRADE LAYER
   Surgical overrides on legacy --cs-* / --brand tokens + specific selectors so
   the existing markup (.btn, .modal, .topbar, .badge-*) picks up the v2 look
   WITHOUT any HTML changes. Cascade order guarantees these win.

   Backup before this layer: backups/FINAL_PROD-before-ui-v2-20260524-143459.zip
   Roll back: delete this section, save, hard-refresh.
   ============================================================================ */
:root {
    /* Deeper navy primary — shifts every .btn-primary, focus ring, link from
       mid-navy (#1A46C2) to deep enterprise navy (#0B2056). Matches the new
       theme_color in manifest.webmanifest and the CrewSync logo gradient. */
    --cs-brand-primary:        var(--cs-brand-900);
    --cs-brand-primary-hover:  var(--cs-brand-800);
    --cs-brand-primary-active: var(--cs-brand-900);

    /* Slate page wash — replaces the default light grey canvas with a cooler
       slate-50, matching the v2 token --rc-bg. Pure visual softening. */
    --cs-bg-canvas: #F8FAFC;

    /* Stripe-grade soft, wide-blur shadows. The original --cs-shadow-xl used a
       fairly tight 12px-radius drop shadow; this swap gives every modal,
       popover, and floating card the deeper sense of layering called for in
       the brief without changing any markup. */
    --cs-shadow-sm: 0 1px 2px rgba(15,23,42,0.04), 0 1px 1px rgba(15,23,42,0.03);
    --cs-shadow-md: 0 4px 12px rgba(15,23,42,0.06), 0 2px 4px rgba(15,23,42,0.04);
    --cs-shadow-lg: 0 12px 28px rgba(15,23,42,0.08), 0 4px 10px rgba(15,23,42,0.05);
    --cs-shadow-xl: 0 24px 56px rgba(15,23,42,0.12), 0 8px 20px rgba(15,23,42,0.07);
}

/* ── Topbar — restyle to navy gradient so the CrewSync product brand leads ──
   v3.4.1: gradient stops are now CSS variables on :root so per-tenant theming
   can override them at sign-in. Defaults preserve the CrewSync navy. The
   .topbar scope intentionally does NOT reset --topbar-bg-* so it inherits the
   tenant value from :root. Box-shadow uses a separate variable so it can
   tint to match the tenant primary.

   Redefine the legacy text/brand variables ONLY inside .topbar scope. Inline
   styles like style="color:var(--brand-dark)" now resolve to white because
   they read this scoped variable, not the :root default. No !important needed. */
.topbar {
    background: linear-gradient(135deg, var(--topbar-bg-from, #0B2056) 0%, var(--topbar-bg-to, #1A46C2) 100%) !important;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 2px 12px var(--topbar-shadow, rgba(11,32,86,0.18));
    color: #fff;

    /* Variable swaps so any descendant using these tokens picks up white-on-navy */
    --brand:               #FFFFFF;
    --brand-dark:          #FFFFFF;
    --text:                #FFFFFF;
    --text-light:          rgba(255,255,255,0.75);
    --cs-text-primary:     #FFFFFF;
    --cs-text-secondary:   rgba(255,255,255,0.78);
    --cs-text-tertiary:    rgba(255,255,255,0.62);
    --cs-text-on-brand:    #FFFFFF;
    --cs-border-subtle:    rgba(255,255,255,0.15);
    --cs-border-default:   rgba(255,255,255,0.22);
}
.topbar, .topbar a, .topbar .nav-link,
.topbar .brand-text, .topbar .brand-sub,
.topbar .sys-name,   .topbar .sys-sub,
.topbar .uname, .topbar .urole, .topbar .udrop-text,
.topbar .ucaret,
.topbar button { color: #fff; }
.topbar .nav-link:hover,
.topbar button:hover { background: rgba(255,255,255,0.12); }

/* Install / icon buttons sit on navy — keep them legible */
.topbar .btn.btn-outline,
.topbar .pwa-install-btn {
    background: rgba(255,255,255,0.12); color: #fff;
    border-color: rgba(255,255,255,0.30);
}
.topbar .btn.btn-outline:hover,
.topbar .pwa-install-btn:hover {
    background: rgba(255,255,255,0.22); border-color: rgba(255,255,255,0.45);
}
.topbar .notif-btn { color: #fff; background: rgba(255,255,255,0.08); }
.topbar .notif-btn:hover { background: rgba(255,255,255,0.18); }
.topbar .hamburger-btn { color: #fff; }

/* User-dropdown avatar — subtle white circle on navy */
.topbar .udrop-avatar {
    background: rgba(255,255,255,0.18) !important; color: #fff !important;
    border: 1px solid rgba(255,255,255,0.22);
}

/* User-dropdown trigger — hover/open backgrounds must stay translucent-white
   on the navy topbar (legacy CSS used --cs-bg-muted which is light grey, and
   combined with my white-text override gave white-on-white). */
.topbar .user-dropdown-btn:hover,
.topbar .user-dropdown-btn.open {
    background: rgba(255,255,255,0.14) !important;
    border-color: rgba(255,255,255,0.28) !important;
}
.topbar .user-dropdown-btn .uname,
.topbar .user-dropdown-btn .urole,
.topbar .user-dropdown-btn .ucaret { color: #fff !important; }
.topbar .user-dropdown-btn .urole,
.topbar .user-dropdown-btn .ucaret { color: rgba(255,255,255,0.78) !important; }

/* Client-logo placeholder square — restyle from dark text to white */
.topbar .logo-placeholder-box {
    background: rgba(255,255,255,0.10); color: rgba(255,255,255,0.85);
    border: 1px dashed rgba(255,255,255,0.30);
}

/* ── User dropdown menu — sits BELOW the topbar on a white surface, so
   reset the variables back to dark-on-light defaults inside the menu only. */
.topbar .user-dropdown-menu {
    --brand:               var(--cs-brand-600);
    --brand-dark:          var(--cs-brand-700);
    --text:                var(--cs-slate-900);
    --text-light:          var(--cs-slate-500);
    --cs-text-primary:     var(--cs-slate-900);
    --cs-text-secondary:   var(--cs-slate-500);
    --cs-text-tertiary:    var(--cs-slate-400);
    --cs-border-subtle:    var(--cs-slate-200);
    --cs-border-default:   var(--cs-slate-300);
    background: #fff; color: var(--cs-slate-900);
    box-shadow: var(--rc-shadow-3);
    border: 1px solid var(--rc-border);
}
.topbar .user-dropdown-menu .udm-item,
.topbar .user-dropdown-menu .udm-status-row,
.topbar .user-dropdown-menu .udm-header,
.topbar .user-dropdown-menu * { color: inherit; }
.topbar .user-dropdown-menu .udm-item:hover { background: var(--rc-surface-2); }
.topbar .user-dropdown-menu .udm-danger { color: var(--rc-danger-fg); }
.topbar .user-dropdown-menu .udm-danger:hover { background: var(--rc-danger-bg); }

/* ── Modals — softer overlay + deeper layered shadow ────────────────────── */
.modal-overlay {
    background: rgba(15,23,42,0.45);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.modal {
    box-shadow: 0 24px 56px rgba(15,23,42,0.18), 0 8px 20px rgba(15,23,42,0.10) !important;
    border: 1px solid rgba(15,23,42,0.06);
}

/* ── Cards / panels — Stripe-style layered surface ───────────────────────── */
.stat-card, .table-card, .card {
    border-color: var(--rc-border) !important;
    box-shadow: var(--rc-shadow-1);
    transition: box-shadow var(--rc-dur-2) var(--rc-ease), border-color var(--rc-dur-2) var(--rc-ease);
}
.stat-card[onclick]:hover, .card[onclick]:hover {
    box-shadow: var(--rc-shadow-2);
    border-color: var(--rc-border-strong) !important;
    transform: translateY(-1px);
}

/* ── Buttons — refined active state compression + crisper focus ring ────── */
.btn {
    transition: background var(--rc-dur-1) var(--rc-ease),
                border-color var(--rc-dur-1) var(--rc-ease),
                box-shadow var(--rc-dur-1) var(--rc-ease),
                transform var(--rc-dur-1) var(--rc-ease);
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--rc-ring); }

/* ── Search input + form input focus — navy ring instead of legacy ────── */
.search-input:focus, .field input:focus, .field select:focus, .field textarea:focus,
input[type="text"]:focus, input[type="number"]:focus, input[type="email"]:focus,
input[type="date"]:focus, input[type="datetime-local"]:focus, textarea:focus, select:focus {
    border-color: var(--rc-primary-500) !important;
    box-shadow: var(--rc-ring) !important;
}

/* ── Badges — gentle desaturation pass for the legacy --cs-* badge palette ── */
.badge { font-weight: 600; letter-spacing: 0.01em; }

/* ── Alerts — softer borders + subtle line accent on the left edge ──────── */
.alert {
    border-radius: var(--rc-r-md);
    border-left-width: 3px;
}

/* ── Section headers (h1/h2 inside page content) — tighter letter-spacing ─ */
.page-title, .section-title { letter-spacing: -0.01em; }

/* ── Login screen — navy hero gradient (preserves login coral if it's there) */
.login-hero, .login-side-panel {
    background: linear-gradient(135deg, #0B2056 0%, #1A46C2 100%);
}

/* ── Sidebar — slightly cooler slate wash, navy accent on active item ──── */
.sidebar {
    background: var(--rc-surface);
    border-right: 1px solid var(--rc-border);
}
.sidebar .nav-link.active,
.sidebar .nav-link[aria-current="page"] {
    background: var(--rc-primary-50);
    color: var(--rc-primary);
    border-left: 3px solid var(--rc-primary);
}
.sidebar .nav-link:hover { background: var(--rc-surface-2); }

/* ── Body background — slate page wash. Single global swap. ─────────────── */
body { background: var(--rc-bg); }
.app-body, .content { background: transparent; }

/* ── Login page — match the rest of the v2 system ─────────────────────────
   Left panel keeps its dark navy + ITL identity. Right panel + login-card
   get the Stripe-grade refinement (slate wash, soft shadow, navy primary
   button, navy focus ring). No HTML changes — only CSS overrides. */
.login-right {
    background: var(--rc-bg) !important;
}
.login-card {
    border: 1px solid var(--rc-border) !important;
    border-radius: var(--rc-r-xl) !important;
    box-shadow: var(--rc-shadow-3);
    padding: 44px 40px !important;
    max-width: 420px !important;
}
.login-card h2 {
    color: var(--rc-primary) !important;       /* deep navy */
    letter-spacing: -0.01em;
}
.login-card p {
    color: var(--rc-text-3) !important;
}
.login-card .field label {
    font-size: 12px; font-weight: 600;
    color: var(--rc-text-2);
    letter-spacing: 0.01em;
}
.login-card input[type="text"],
.login-card input[type="email"],
.login-card input[type="password"] {
    border: 1px solid var(--rc-border);
    border-radius: var(--rc-r-md);
    height: 40px;
    transition: border-color var(--rc-dur-1) var(--rc-ease),
                box-shadow var(--rc-dur-1) var(--rc-ease);
}
.login-card input[type="text"]:focus,
.login-card input[type="email"]:focus,
.login-card input[type="password"]:focus {
    border-color: var(--rc-primary-500);
    box-shadow: var(--rc-ring);
    outline: none;
}
.login-card .btn-primary {
    background: var(--rc-primary);
    border-color: var(--rc-primary);
    box-shadow: 0 4px 12px rgba(11,32,86,0.18);
    transition: background var(--rc-dur-1) var(--rc-ease),
                box-shadow var(--rc-dur-1) var(--rc-ease),
                transform var(--rc-dur-1) var(--rc-ease);
}
.login-card .btn-primary:hover:not(:disabled) {
    background: var(--rc-primary-600);
    box-shadow: 0 6px 18px rgba(11,32,86,0.28);
}
.login-card .btn-primary:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(11,32,86,0.20);
}

/* "Forgot password?" + "Remember me" — refined */
.login-card .forgot {
    color: var(--rc-primary-600);
    font-weight: 500;
    cursor: pointer;
}
.login-card .forgot:hover { color: var(--rc-primary); text-decoration: underline; }
.login-card .remember { color: var(--rc-text-2); font-size: 13px; }

/* Login-left dark navy panel — refine gradient stops + softer radial accents
   so the v2 deep-navy theme reads the same from login through to the app. */
.login-left {
    background:
      radial-gradient(circle at 20% 0%, rgba(59,91,217,.35), transparent 55%),
      radial-gradient(circle at 90% 100%, rgba(252,211,77,.14), transparent 50%),
      linear-gradient(180deg, #0B2056 0%, #061334 100%) !important;
}
.login-left .brand-headline h1 {
    letter-spacing: -0.02em;
    font-weight: 700;
}
.login-left .brand-headline .rule {
    background: var(--rc-accent);   /* coral kept as accent moment on dark navy */
}

/* Alert inside the login card uses softer modern semantics */
.login-card .alert-error {
    background: var(--rc-danger-bg);
    color: var(--rc-danger-fg);
    border: 1px solid var(--rc-danger-line);
    border-left: 3px solid var(--rc-danger-fg);
    border-radius: var(--rc-r-md);
}
