/* ═══ STUDIOHAUS PORTAL — Core Styles ═══ */

    *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

    /* Custom scrollbar */
    ::-webkit-scrollbar { width: 6px; height: 6px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
    ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }
    [data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); }
    [data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }

    :root {
      --bg: #0a0a0a;
      --bg-elevated: #111111;
      --bg-card: rgba(255,255,255,0.03);
      --bg-card-hover: rgba(255,255,255,0.06);
      --bg-input: rgba(255,255,255,0.04);
      --bg-glass: rgba(255,255,255,0.02);
      --text: #f0f0f0;
      --text-60: rgba(255,255,255,0.6);
      --text-45: rgba(255,255,255,0.42);
      --text-40: rgba(255,255,255,0.35);
      --text-20: rgba(255,255,255,0.18);
      --text-10: rgba(255,255,255,0.08);
      --accent: #f0f0f0;
      --success: #7aab8a;
      --success-rgb: 122,171,138;
      --warning: #d4a547;
      --warning-rgb: 212,165,71;
      --error: rgba(205,85,75,0.7);
      --error-rgb: 205,85,75;
      --border: rgba(255,255,255,0.06);
      --border-hover: rgba(255,255,255,0.12);
      /* Brand accent — Velvia red. Reserved for active sidebar bar,
         brand chrome, and focus rings. NOT used for success/paid
         semantics — those use --success (green) regardless. */
      --brand-accent: #cc3d2e;
      --brand-accent-rgb: 204,61,46;
      --focus: rgba(204,61,46,0.55);
      /* Priority — use these for any priority/severity badge */
      --priority-urgent: #c25a56;
      --priority-urgent-rgb: 194,90,86;
      --priority-high: #d49441;
      --priority-high-rgb: 212,148,65;
      --priority-medium: #c2a849;
      --priority-medium-rgb: 194,168,73;
      --priority-low: #6b7280;
      --priority-low-rgb: 107,114,128;
      /* Info — neutral state for "in review", "pending", etc. — distinct from warning */
      --info: #6a8fb8;
      --info-rgb: 106,143,184;
      --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', Helvetica, Arial, sans-serif;

      /* Type scale — pick from these, do not invent new sizes */
      --fs-xs: 11px;
      --fs-sm: 13px;
      --fs-base: 14px;
      --fs-md: 15px;
      --fs-lg: 18px;
      --fs-xl: 22px;
      --fs-2xl: 28px;
      --fs-3xl: 36px;
      /* Weights */
      --fw-regular: 400;
      --fw-medium: 500;
      --fw-semi: 600;
      /* Spacing — 4-point scale */
      --s-1: 4px;
      --s-2: 8px;
      --s-3: 12px;
      --s-4: 16px;
      --s-5: 20px;
      --s-6: 24px;
      --s-8: 32px;
      --s-10: 40px;
      --s-12: 48px;
      --s-16: 64px;

      --radius: 12px;
      --radius-sm: 8px;
      --radius-lg: 16px;
    }

    [data-theme="light"] {
      --bg: #f2f1ef;
      --bg-elevated: #e8e7e4;
      --bg-card: rgba(0,0,0,0.03);
      --bg-card-hover: rgba(0,0,0,0.06);
      --bg-input: rgba(0,0,0,0.03);
      --bg-glass: rgba(0,0,0,0.02);
      --text: #1a1a1a;
      --text-60: rgba(0,0,0,0.7);
      --text-45: rgba(0,0,0,0.6);
      --text-40: rgba(0,0,0,0.55);
      --text-20: rgba(0,0,0,0.28);
      --text-10: rgba(0,0,0,0.08);
      --accent: #1a1a1a;
      --success: #3d6b4f;
      --success-rgb: 61,107,79;
      --warning: #a67c1a;
      --warning-rgb: 166,124,26;
      --error: rgba(185,50,45,0.85);
      --error-rgb: 185,50,45;
      --border: rgba(0,0,0,0.08);
      --border-hover: rgba(0,0,0,0.15);
      --brand-accent: #a8302a;
      --brand-accent-rgb: 168,48,42;
      --focus: rgba(168,48,42,0.6);
      --priority-urgent: #a8413d;
      --priority-urgent-rgb: 168,65,61;
      --priority-high: #b67a26;
      --priority-high-rgb: 182,122,38;
      --priority-medium: #a08628;
      --priority-medium-rgb: 160,134,40;
      --priority-low: #4d525c;
      --priority-low-rgb: 77,82,92;
      --info: #3f6f99;
      --info-rgb: 63,111,153;
    }

    html { scroll-behavior: smooth; }

    /* ─── Focus ring (keyboard only) ─────────────────────────────
       Mouse clicks won't show this — :focus-visible only fires on
       keyboard navigation. Inputs that already restyle their
       border on focus override this where useful. */
    :focus { outline: none; }
    :focus-visible {
      outline: 2px solid var(--focus);
      outline-offset: 2px;
      border-radius: 4px;
    }

    body {
      font-family: var(--font);
      background: var(--bg);
      color: var(--text);
      line-height: 1.6;
      -webkit-font-smoothing: antialiased;
      min-height: 100vh;
      transition: background 0.4s ease, color 0.4s ease;
    }

    .app {
      min-height: 100vh;
      display: flex;
      flex-direction: column;
    }

    /* ─── LAYOUT ─── */

    .header {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 100;
      padding: 16px 32px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: rgba(10,10,10,0.8);
      backdrop-filter: blur(24px) saturate(1.2);
      -webkit-backdrop-filter: blur(24px) saturate(1.2);
      border-bottom: 1px solid var(--border);
      transition: background 0.4s ease, border-color 0.4s ease;
    }
    .header::after {
      content: '';
      position: absolute;
      bottom: -1px;
      left: 0;
      right: 0;
      height: 1px;
      background: linear-gradient(90deg, transparent, var(--border-hover), transparent);
      opacity: 0.6;
    }

    [data-theme="light"] .header {
      background: rgba(242,241,239,0.8);
    }

    .header-left {
      display: flex;
      align-items: baseline;
      gap: 16px;
    }

    .header-logo {
      font-size: 18px;
      font-weight: 500;
      letter-spacing: 0.5px;
    }

    .header-right {
      display: flex;
      align-items: center;
      gap: 24px;
    }

    .header-client {
      font-size: 11px;
      letter-spacing: 3px;
      text-transform: uppercase;
      color: var(--text-40);
    }

    .header-btn {
      background: var(--bg-card);
      border: 1px solid var(--border);
      color: var(--text-45);
      padding: 7px 16px;
      font-size: 11px;
      letter-spacing: 1.5px;
      text-transform: uppercase;
      font-family: var(--font);
      cursor: pointer;
      transition: all 0.2s;
      border-radius: 100px;
    }

    .header-btn:hover {
      border-color: var(--border-hover);
      color: var(--text-60);
      background: var(--bg-card-hover);
    }

    .main {
      flex: 1;
      padding: 96px 40px 60px;
      max-width: 1200px;
      margin: 0 auto;
      width: 100%;
      position: relative;
      z-index: 1;
    }

    .footer {
      padding: 24px 40px;
      display: flex;
      justify-content: space-between;
      font-size: 11px;
      letter-spacing: 2px;
      text-transform: uppercase;
      color: var(--text-40);
      border-top: 1px solid var(--border);
      position: relative;
      z-index: 1;
    }

    /* ─── THEME TOGGLE ─── */
    .theme-toggle {
      background: transparent;
      border: 1px solid var(--border);
      border-radius: 50px;
      display: flex;
      align-items: center;
      padding: 2px;
      cursor: pointer;
      gap: 0;
      position: relative;
      height: 28px;
      width: 130px;
      transition: border-color 0.4s ease;
    }

    .theme-toggle-option {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
      padding: 3px 10px;
      border-radius: 50px;
      font-size: 8px;
      font-weight: 500;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      z-index: 1;
      transition: color 0.3s ease;
      white-space: nowrap;
      flex: 1;
      font-family: var(--font);
    }

    .theme-toggle-option svg {
      width: 10px;
      height: 10px;
      fill: none;
      stroke: currentColor;
      stroke-width: 1.5;
    }

    /* Dark mode: DARK is active (white pill, black text) */
    .theme-toggle-option.dark-opt {
      color: #000;
    }

    .theme-toggle-option.light-opt {
      color: var(--text-40);
    }

    /* Active pill background */
    .theme-toggle::before {
      content: '';
      position: absolute;
      top: 2px;
      left: 2px;
      width: calc(50% - 2px);
      height: calc(100% - 4px);
      background: var(--text);
      border-radius: 50px;
      transition: transform 0.3s ease, background 0.4s ease;
    }

    /* Light mode: pill slides right */
    [data-theme="light"] .theme-toggle::before {
      transform: translateX(100%);
    }

    [data-theme="light"] .theme-toggle-option.dark-opt {
      color: var(--text-40);
    }

    [data-theme="light"] .theme-toggle-option.light-opt {
      color: #f5f5f5;
    }

    /* ─── LOGIN ─── */
    .login-screen {
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      padding: 40px;
      position: relative;
      overflow: hidden;
    }

    .login-screen::before {
      content: '';
      position: absolute;
      top: -50%;
      left: -50%;
      width: 200%;
      height: 200%;
      /* Velvia-warmed atmosphere — large, low-contrast, grounded
         in the brand red without ever crossing into "stoplight". */
      background:
        radial-gradient(ellipse at 25% 30%, rgba(var(--brand-accent-rgb), 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 70%, rgba(var(--brand-accent-rgb), 0.06) 0%, transparent 55%),
        radial-gradient(ellipse at 50% 50%, rgba(255,255,255,0.015) 0%, transparent 60%);
      pointer-events: none;
    }

    .login-logo-img {
      height: 40px;
      width: auto;
      margin-bottom: 14px;
      position: relative;
      object-fit: contain;
    }
    .login-logo-light { display: none; }
    [data-theme="light"] .login-logo-dark { display: none; }
    [data-theme="light"] .login-logo-light { display: block; }

    .login-subtitle {
      font-size: var(--fs-xs);
      letter-spacing: 3px;
      text-transform: uppercase;
      color: var(--text-40);
      margin-bottom: 56px;
      position: relative;
    }

    .login-form {
      width: 100%;
      max-width: 380px;
      position: relative;
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 36px;
    }

    .login-field {
      position: relative;
      margin-bottom: 20px;
    }

    .login-field input {
      width: 100%;
      background: var(--bg-input);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      color: var(--text);
      font-family: var(--font);
      font-size: 15px;
      font-weight: 400;
      padding: 14px 48px 14px 16px;
      outline: none;
      transition: all 0.3s;
    }

    .login-field input::placeholder {
      color: var(--text-40);
    }

    .login-field input:focus {
      border-color: var(--border-hover);
      background: var(--bg-card-hover);
    }

    .login-submit {
      position: absolute;
      right: 6px;
      top: 50%;
      transform: translateY(-50%);
      background: var(--text);
      color: var(--bg);
      border: none;
      cursor: pointer;
      padding: 8px 12px;
      font-size: 16px;
      transition: all 0.2s;
      border-radius: 6px;
      font-weight: 500;
    }

    .login-submit:hover { opacity: 0.85; }

    .login-error {
      font-size: 13px;
      color: var(--error);
      margin-top: 16px;
      text-align: center;
      min-height: 20px;
    }

    .login-footer {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      padding: 20px 40px;
      display: flex;
      justify-content: space-between;
      font-size: 11px;
      letter-spacing: 2px;
      text-transform: uppercase;
      color: var(--text-40);
    }

    /* ─── DASHBOARD ─── */
