/* ============================================================================
   Light Launch — Shared Theme
   ============================================================================
   Drop this file into your Boss_Lighting folder. Each HTML page links to it
   with: <link rel="stylesheet" href="light_launch.css">

   What's in here:
   - Design tokens (CSS variables) — single source of truth for all colors,
     fonts, spacing, radii, shadows.
   - Body + reset
   - .page  → standard page wrapper (max-width, padding, room for sidebar)
   - .card  → standard card container
   - .field, .form-row → form layout + inputs
   - .btn variants (default, gold, danger, primary, sm)
   - .alert variants (error, success, info)
   - .role-pill variants (owner, admin, rep)
   - .toast, .spinner
   - table styles
   - mobile breakpoint

   What's NOT in here (stays in individual pages):
   - Login's .auth-wrap, .tabs, .tease  — only used on login + accept-invite
   - Render Agent's panel, map canvas, drawing tools — page-specific
   - Database's grid, photo tiles — page-specific
   - CRM's kanban board, lane styling — page-specific
   - Side nav HTML — extracted in light_launch_shell.js next session

   Last updated: April 30, 2026 — Phase 3 Step 1 (shared theme extraction)
============================================================================ */

:root {
  /* Surface palette — near-black backgrounds, layered surfaces for cards/inputs */
  --bg:        #070709;
  --surface:   #0f0f12;
  --surface2:  #161619;
  --surface3:  #1c1c21;

  /* Borders */
  --border:    #1e1e24;
  --border2:   #28282f;

  /* Text */
  --text:      #f0f0f0;
  --muted:     #44444f;
  --muted2:    #6b6b7a;

  /* Brand gold */
  --gold:      #f5c842;
  --gold2:     #d4a520;
  --gold-dim:  rgba(245,200,66,.08);
  /* Legacy alias — Render Agent + Database used --accent. Both map to gold now. */
  --accent:    #f5c842;
  --accent2:   #d4a520;

  /* Semantic colors */
  --green:      #4ade80;
  --green-dim:  rgba(74,222,128,.1);
  --red:        #f87171;
  --red-dim:    rgba(248,113,113,.1);
  --blue:       #60a5fa;
  --blue-dim:   rgba(96,165,250,.1);
  --purple:     #a78bfa;
  --purple-dim: rgba(167,139,250,.1);
  --orange:     #fb923c;

  /* Layout */
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0,0,0,.6);

  /* Sidebar width — see light_launch_shell.js for the markup. The body
     padding-left below matches this. Was 56px in the icon-only version. */
  --sidebar-w: 220px;
}

/* ─── Light mode override ───────────────────────────────────────────────
   Applied when <html data-theme="light"> is set (toggle in sidebar).
   We override only the variables that change — gold and semantic colors
   stay the same so brand consistency is preserved across themes.
─────────────────────────────────────────────────────────────────────── */
html[data-theme="light"] {
  --bg:        #f7f7f5;
  --surface:   #ffffff;
  --surface2:  #f1f1ee;
  --surface3:  #e8e8e3;

  --border:    #e0e0d8;
  --border2:   #c8c8be;

  --text:      #1a1a1a;
  --muted:     #6b6b6b;
  --muted2:    #888888;

  --gold-dim:  rgba(245,200,66,.18);
  --green-dim:  rgba(74,222,128,.16);
  --red-dim:    rgba(248,113,113,.16);
  --blue-dim:   rgba(96,165,250,.16);
  --purple-dim: rgba(167,139,250,.16);

  --shadow: 0 4px 14px rgba(0,0,0,.08);
}
html[data-theme="light"] body {
  background-image: radial-gradient(ellipse at top, rgba(245,200,66,0.05), transparent 60%);
}

/* ─── Reset ────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  min-height: 100vh;
  /* Subtle gold gradient at top — gives the dark theme some warmth */
  background-image: radial-gradient(ellipse at top, rgba(245,200,66,0.04), transparent 60%);
}

/* Most pages sit next to the fixed sidebar. Pages that DON'T have the
   sidebar (login, accept-invite) override this with `body.no-sidebar`. */
body { padding-left: var(--sidebar-w); }
body.no-sidebar {
  padding-left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background-image:
    radial-gradient(ellipse at top, rgba(245,200,66,0.05), transparent 60%),
    radial-gradient(ellipse at bottom, rgba(96,165,250,0.03), transparent 60%);
}

/* ─── Page shell ───────────────────────────────────────────────────────── */
.page {
  max-width: 920px;
  margin: 0 auto;
  padding: 36px 32px 64px;
}
.page-head { margin-bottom: 28px; }
.page-head h1 {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.page-head .subtitle {
  color: var(--muted2);
  font-size: 13px;
}

/* ─── Cards ────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.card h2 {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card h2 .badge-count {
  background: var(--surface3);
  color: var(--muted2);
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0;
}

/* ─── Forms ────────────────────────────────────────────────────────────── */
.form-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.field { flex: 1; min-width: 220px; margin-bottom: 14px; }
.field-narrow { flex: 0 0 140px; min-width: 140px; }
.field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 9px;
  padding: 11px 13px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: border-color .15s, background .15s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--surface3);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--muted); }
.field select { cursor: pointer; }

/* ─── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: 9px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover:not(:disabled) { border-color: var(--muted2); background: var(--surface3); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-gold {
  background: var(--gold);
  color: #000;
  border-color: var(--gold);
}
.btn-gold:hover:not(:disabled) {
  background: #ffd84d;
  border-color: #ffd84d;
  box-shadow: 0 4px 16px rgba(245,200,66,0.25);
}

/* btn-primary is for full-width primary actions (e.g. "Sign in", "Create") */
.btn-primary {
  width: 100%;
  background: var(--gold);
  color: #000;
  border: none;
  border-radius: 9px;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .1s, box-shadow .15s;
  margin-top: 6px;
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 4px 16px rgba(245,200,66,0.25); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-danger {
  color: var(--red);
  border-color: rgba(248,113,113,0.2);
}
.btn-danger:hover:not(:disabled) {
  background: var(--red-dim);
  border-color: rgba(248,113,113,0.4);
}

.btn-sm { padding: 6px 10px; font-size: 12px; }

/* ─── Alerts ───────────────────────────────────────────────────────────── */
.alert {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  margin-top: 12px;
  display: none;
}
.alert.show { display: block; }
.alert.error   { background: var(--red-dim);   color: var(--red);   border: 1px solid rgba(248,113,113,0.2); }
.alert.success { background: var(--green-dim); color: var(--green); border: 1px solid rgba(74,222,128,0.2); }
.alert.info    { background: var(--gold-dim);  color: var(--gold);  border: 1px solid rgba(245,200,66,0.2); }

/* ─── Tables ───────────────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
th {
  color: var(--muted2);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--surface2);
}
th:first-child { border-top-left-radius: 8px; }
th:last-child  { border-top-right-radius: 8px; text-align: right; }
td:last-child  { text-align: right; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface2); }

/* ─── Role pills ───────────────────────────────────────────────────────── */
.role-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: 'Manrope', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.role-pill.role-owner { background: var(--gold-dim);  color: var(--gold);  border: 1px solid rgba(245,200,66,0.25); }
.role-pill.role-admin { background: var(--blue-dim);  color: var(--blue);  border: 1px solid rgba(96,165,250,0.25); }
.role-pill.role-rep   { background: var(--green-dim); color: var(--green); border: 1px solid rgba(74,222,128,0.25); }

.you-tag {
  font-size: 10px;
  color: var(--muted);
  margin-left: 6px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

/* ─── Empty / loading states ───────────────────────────────────────────── */
.empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted2);
  font-size: 13px;
}
.empty-small { padding: 18px 12px; }

.readonly-note {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  color: var(--muted2);
  font-size: 13px;
  line-height: 1.55;
}
.readonly-note strong { color: var(--text); }

/* ─── Toast ────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  border: 1px solid var(--border2);
  padding: 10px 16px;
  border-radius: 9px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: all .25s ease;
  z-index: 99999;
  box-shadow: var(--shadow);
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ─── Spinner ──────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: -2px;
}
/* Variant for use on gold/light backgrounds */
.spinner-dark {
  border-color: rgba(0,0,0,0.25);
  border-top-color: #000;
  border-right-color: rgba(0,0,0,0.25);
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Utility helpers ──────────────────────────────────────────────────── */
.muted    { color: var(--muted2); }
.link {
  color: var(--blue);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 12px;
}
.link:hover { text-decoration: underline; }

.invite-link-box {
  margin-top: 14px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 9px;
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.invite-link-box code {
  flex: 1;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text);
  word-break: break-all;
  line-height: 1.5;
}

/* ─── Mobile ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  body { padding-left: 0; padding-bottom: 60px; }
  .page { padding: 24px 18px 80px; }
}
