@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;0,14..32,800;0,14..32,900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

/* ─────────────────────────────────────────
   DESIGN TOKENS — Cinematic AI Studio
───────────────────────────────────────── */
:root {
  /* Brand — Primary: Fire Orange */
  --gold:        #FF6B35;
  --gold-bright: #FF8A5C;
  --gold-dim:    rgba(255, 107, 53, 0.08);
  --gold-glow:   rgba(255, 107, 53, 0.25);
  --gold-line:   rgba(255, 107, 53, 0.18);

  /* Brand — Secondary: Electric Violet */
  --purple: #8B5CF6;
  --purple-glow: rgba(139, 92, 246, 0.25);
  --purple-dim:  rgba(139, 92, 246, 0.08);

  /* Brand — Tertiary: Cyan Glow */
  --cyan:      #06B6D4;
  --cyan-glow: rgba(6, 182, 212, 0.25);
  --cyan-dim:  rgba(6, 182, 212, 0.08);

  /* Gradients */
  --grad-hero:    linear-gradient(135deg, #FF6B35, #8B5CF6);
  --grad-glow:    linear-gradient(135deg, #8B5CF6, #06B6D4);
  --grad-text:    linear-gradient(135deg, #FF6B35, #8B5CF6);
  --grad-ai:      linear-gradient(135deg, #8B5CF6, #06B6D4);

  /* Surface — Deep Cinematic */
  --bg:  #0A0A12;
  --bg2: #12121E;
  --bg3: #1A1A2E;
  --bg4: #22223A;

  /* Border */
  --b1: #2A2A40;
  --b2: #333350;
  --b3: #44446A;

  /* Text */
  --t1: #F0F0FF;
  --t2: #C8C8E0;
  --t3: #6B6B8A;
  --t4: #55557A;

  /* Semantic */
  --green:  #10B981;
  --blue:   #3B82F6;
  --red:    #EF4444;
  --warning: #F59E0B;

  /* Radius */
  --r:    8px;
  --r2:   12px;
  --r3:   16px;
  --r4:   20px;

  /* Shadow */
  --shadow-xs: 0 1px 3px rgba(0,0,0,0.5);
  --shadow:    0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.7);
  --shadow-xl: 0 24px 80px rgba(0,0,0,0.8);

  /* Motion */
  --ease: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);

  /* Glassmorphism */
  --glass-bg: rgba(255,255,255,0.03);
  --glass-border: rgba(255,255,255,0.08);
  --glass-blur: blur(12px);

  /* Monospace */
  --mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --display: 'Syne', 'Inter', sans-serif;

  /* Design spec aliases (--color-* naming convention) */
  --color-base: var(--bg);
  --color-surface: var(--bg2);
  --color-elevated: var(--bg3);
  --color-border: var(--b1);
  --color-muted: var(--t3);
  --color-body: var(--t2);
  --color-heading: var(--t1);
  --color-orange: var(--gold);
  --color-violet: var(--purple);
  --color-cyan: var(--cyan);
  --color-success: var(--green);
  --color-warning: var(--warning);
  --color-danger: var(--red);
}

/* ─────────────────────────────────────────
   RESET & BASE
───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

/* Display font — Syne for all headings */
h1, h2, h3, .page-title, .modal-title, .login-logo, .login-hero-logo, .dash-hero-greeting, .ptitle {
  font-family: var(--display) !important;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--t1);
  min-height: 100vh;
  font-size: 13px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
#app {
  transition: opacity 0.08s ease-out;
  will-change: opacity;
  background-image:
    radial-gradient(ellipse 80% 40% at 50% -10%, rgba(255,107,53,0.05) 0%, transparent 55%),
    radial-gradient(ellipse 50% 35% at 80% 90%, rgba(139,92,246,0.04) 0%, transparent 50%),
    radial-gradient(ellipse 40% 30% at 10% 60%, rgba(6,182,212,0.03) 0%, transparent 50%);
  background-attachment: fixed;
}

/* Noise texture overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* Page entrance animation */
@keyframes pageIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page { animation: pageIn 0.3s ease-out; }

/* ─────────────────────────────────────────
   BUTTONS
───────────────────────────────────────── */
.btn {
  padding: 8px 16px;
  border-radius: var(--r);
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--ease);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.01em;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.15s;
}
.btn:hover::after { background: rgba(255,255,255,0.04); }
.btn:active::after { background: rgba(0,0,0,0.1); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }

.btn-gold {
  background: var(--grad-hero);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,0.1) inset, 0 2px 12px rgba(255,107,53,0.3);
}
.btn-gold:hover:not(:disabled) {
  box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, 0 4px 24px rgba(255,107,53,0.45);
  transform: translateY(-1px);
  filter: brightness(1.1);
}

/* AI / Violet accent button */
.btn-ai {
  background: var(--grad-ai);
  color: #fff;
  box-shadow: 0 2px 12px rgba(139,92,246,0.3);
}
.btn-ai:hover:not(:disabled) {
  box-shadow: 0 4px 24px rgba(139,92,246,0.45);
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold-line);
}
.btn-outline:hover:not(:disabled) {
  background: var(--gold-dim);
  border-color: rgba(255,107,53,0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--t3);
  border: 1px solid var(--b2);
}
.btn-ghost:hover:not(:disabled) {
  color: var(--t2);
  border-color: var(--b3);
  background: var(--bg3);
}

.btn-green  { background: rgba(16,185,129,.1); color: #34D399; border: 1px solid rgba(16,185,129,.2); }
.btn-green:hover:not(:disabled) { background: rgba(16,185,129,.16); }
.btn-blue   { background: rgba(59,130,246,.1); color: #60A5FA; border: 1px solid rgba(59,130,246,.2); }
.btn-blue:hover:not(:disabled) { background: rgba(59,130,246,.16); }
.btn-red    { background: rgba(239,68,68,.08); color: #F87171; border: 1px solid rgba(239,68,68,.18); }
.btn-red:hover:not(:disabled) { background: rgba(239,68,68,.14); }
.btn-purple { background: rgba(139,92,246,.08); color: #A78BFA; border: 1px solid rgba(139,92,246,.18); }
.btn-purple:hover:not(:disabled) { background: rgba(139,92,246,.14); }

.btn-sm  { padding: 5px 11px; font-size: 11px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }

/* ─────────────────────────────────────────
   FORMS
───────────────────────────────────────── */
.fg { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.fg label {
  font-size: 10px;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.fg input,
.fg select,
.fg textarea {
  background: var(--bg3);
  border: 1px solid var(--b2);
  color: var(--t1);
  padding: 10px 13px;
  border-radius: var(--r);
  font-size: 13px;
  font-family: inherit;
  transition: var(--ease);
  outline: none;
}
.fg input:hover, .fg select:hover, .fg textarea:hover { border-color: var(--b3); }
.fg input:focus, .fg select:focus, .fg textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.12);
}
.fg textarea { resize: vertical; min-height: 80px; line-height: 1.65; }
.fg select { cursor: pointer; }

.form2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.full  { grid-column: 1 / -1; }

/* ─────────────────────────────────────────
   CARDS
───────────────────────────────────────── */
.card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--r2);
  overflow: hidden;
  margin-bottom: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  border-color: rgba(255,255,255,0.12);
}
.card-head {
  padding: 12px 18px;
  background: var(--bg3);
  border-bottom: 1px solid var(--b1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.card-body { padding: 18px; }

/* ─────────────────────────────────────────
   INFO BOXES
───────────────────────────────────────── */
.ib {
  border-radius: var(--r);
  padding: 13px 16px;
  font-size: 12px;
  line-height: 1.75;
  margin-bottom: 14px;
  border: 1px solid;
}
.ib-gold   { background: rgba(255,107,53,.04); border-color: rgba(255,107,53,.15); color: var(--t3); }
.ib-gold strong { color: var(--gold); }
.ib-blue   { background: rgba(59,130,246,.04); border-color: rgba(59,130,246,.15); color: var(--t3); }
.ib-blue strong { color: var(--blue); }
.ib-green  { background: rgba(16,185,129,.04); border-color: rgba(16,185,129,.15); color: var(--t3); }
.ib-green strong { color: var(--green); }
.ib-red    { background: rgba(239,68,68,.04); border-color: rgba(239,68,68,.15); color: var(--t3); }
.ib-red strong { color: var(--red); }

.section-lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--t4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
  margin-top: 20px;
}

/* ─────────────────────────────────────────
   SPINNER & LOADING
───────────────────────────────────────── */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--b2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  flex-shrink: 0;
}
.spinner.blue  { border-top-color: var(--blue); }
.spinner.green { border-top-color: var(--green); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes aiPulse {
  0%, 100% { opacity: 0.6; box-shadow: 0 0 4px var(--cyan); }
  50% { opacity: 1; box-shadow: 0 0 10px var(--cyan), 0 0 20px var(--cyan-glow); }
}
.ai-indicator {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cyan) !important;
  box-shadow: 0 0 6px var(--cyan-glow);
  flex-shrink: 0;
  animation: aiPulse 2s ease-in-out infinite;
}
.ai-indicator.generating {
  background: var(--cyan) !important;
  box-shadow: 0 0 12px var(--cyan), 0 0 24px var(--cyan-glow);
  animation: aiPulse 1s ease-in-out infinite;
}

.ai-load { display: none; align-items: center; gap: 10px; color: var(--t4); font-size: 12px; padding: 14px 0; }
.ai-load.show { display: flex; }

/* ─────────────────────────────────────────
   BADGES
───────────────────────────────────────── */
.badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  display: inline-block;
  letter-spacing: 0.02em;
}
.badge-gold   { background: rgba(255,107,53,.12); color: var(--gold);   border: 1px solid rgba(255,107,53,.22); }
.badge-green  { background: rgba(16,185,129,.1);  color: var(--green);  border: 1px solid rgba(16,185,129,.18); }
.badge-blue   { background: rgba(59,130,246,.1);  color: var(--blue);   border: 1px solid rgba(59,130,246,.18); }
.badge-red    { background: rgba(239,68,68,.08);  color: var(--red);    border: 1px solid rgba(239,68,68,.16); }
.badge-gray   { background: var(--bg4); color: var(--t3); border: 1px solid var(--b1); }
.badge-purple { background: rgba(139,92,246,.1);  color: #A78BFA; border: 1px solid rgba(139,92,246,.18); }
.badge-cyan   { background: rgba(6,182,212,.1);   color: var(--cyan);   border: 1px solid rgba(6,182,212,.18); }

/* ─────────────────────────────────────────
   TOAST
───────────────────────────────────────── */
.toast {
  position: fixed;
  top: 20px; right: 20px;
  background: var(--bg3);
  border: 1px solid var(--b2);
  border-radius: var(--r);
  padding: 13px 18px;
  font-size: 12px;
  z-index: 9999;
  animation: toastIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 320px;
  line-height: 1.55;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
}
.toast.ok   { border-color: rgba(16,185,129,.3);  color: #34D399; }
.toast.err  { border-color: rgba(239,68,68,.3);   color: #F87171; }
.toast.info { border-color: rgba(59,130,246,.3);   color: #60A5FA; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─────────────────────────────────────────
   LOGIN — Cinematic Split Layout
───────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 55% 45%;
  position: relative;
}
@media (max-width: 768px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { display: none; }
}

/* Left: Cinematic Hero Panel */
.login-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}
.login-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 30% 20%, rgba(255,107,53,0.15) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 70% 80%, rgba(139,92,246,0.12) 0%, transparent 50%),
    radial-gradient(ellipse 40% 40% at 50% 50%, rgba(6,182,212,0.06) 0%, transparent 50%);
  animation: heroShift 8s ease-in-out infinite alternate;
}
@keyframes heroShift {
  0%   { opacity: 0.7; transform: scale(1); }
  100% { opacity: 1;   transform: scale(1.05); }
}
.login-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 460px;
}
.login-hero-logo {
  font-family: var(--display);
  font-size: 52px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  line-height: 1.1;
}
.login-hero-logo span {
  background: var(--grad-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-hero-tagline {
  font-size: 16px;
  color: var(--t3);
  line-height: 1.6;
  margin-bottom: 32px;
}
.login-hero-features {
  display: flex;
  gap: 24px;
  justify-content: center;
}
.login-hero-feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--t3);
}
.login-hero-feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.login-hero-feature-icon.orange { background: rgba(255,107,53,0.12); border: 1px solid rgba(255,107,53,0.2); }
.login-hero-feature-icon.violet { background: rgba(139,92,246,0.12); border: 1px solid rgba(139,92,246,0.2); }
.login-hero-feature-icon.cyan   { background: rgba(6,182,212,0.12); border: 1px solid rgba(6,182,212,0.2); }

/* Floating particles */
.login-hero .particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.3;
  animation: float 6s ease-in-out infinite;
}
.login-hero .particle:nth-child(1) { width: 4px; height: 4px; background: var(--gold); top: 20%; left: 15%; animation-delay: 0s; }
.login-hero .particle:nth-child(2) { width: 3px; height: 3px; background: var(--purple); top: 60%; left: 80%; animation-delay: 2s; }
.login-hero .particle:nth-child(3) { width: 5px; height: 5px; background: var(--cyan); top: 80%; left: 30%; animation-delay: 4s; }
.login-hero .particle:nth-child(4) { width: 3px; height: 3px; background: var(--gold); top: 35%; left: 70%; animation-delay: 1s; }
.login-hero .particle:nth-child(5) { width: 4px; height: 4px; background: var(--purple); top: 10%; left: 55%; animation-delay: 3s; }
@keyframes float {
  0%, 100% { transform: translateY(0px) scale(1); opacity: 0.3; }
  50% { transform: translateY(-20px) scale(1.5); opacity: 0.6; }
}

/* Right: Login Form Panel */
.login-wrap::before { display: none; }
.login-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--bg2);
  border-left: 1px solid var(--b1);
}
.login-box {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--r3);
  padding: 44px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,0.03) inset;
  position: relative;
}
.login-box::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,107,53,0.4), rgba(139,92,246,0.4), transparent);
}
.login-logo {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  text-align: center;
  margin-bottom: 6px;
  letter-spacing: -0.03em;
}
.login-logo span {
  background: var(--grad-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-sub {
  text-align: center;
  font-size: 12px;
  color: var(--t4);
  margin-bottom: 32px;
  letter-spacing: 0.01em;
}
.login-err {
  background: rgba(239,68,68,0.07);
  border: 1px solid rgba(239,68,68,0.22);
  color: #F87171;
  font-size: 12px;
  padding: 10px 13px;
  border-radius: var(--r);
  margin-bottom: 14px;
  display: none;
}

/* ─────────────────────────────────────────
   ADMIN IMPERSONATION BAR
───────────────────────────────────────── */
.admin-impersonation-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 20px;
  background: linear-gradient(90deg, rgba(255,107,53,0.12) 0%, rgba(139,92,246,0.10) 100%);
  border-bottom: 1px solid rgba(255,107,53,0.25);
  position: sticky;
  top: 0;
  z-index: 201;
  gap: 12px;
}
.admin-imp-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--t2);
}
.admin-imp-left svg { color: var(--gold); flex-shrink: 0; }
.admin-imp-left strong { color: #fff; }
.btn-return-admin {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--grad-hero);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.btn-return-admin:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(255,107,53,0.35);
}
.btn-return-admin svg { flex-shrink: 0; }

/* ─────────────────────────────────────────
   NOTIFICATION PANEL ITEMS
───────────────────────────────────────── */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--b1);
  cursor: pointer;
  transition: background 0.15s ease;
}
.notif-item:hover { background: rgba(255,255,255,0.03); }
.notif-unread { background: rgba(139,92,246,0.05); }
.notif-read { background: transparent; opacity: 0.65; }
.notif-dot-wrap { padding-top: 5px; flex-shrink: 0; }
.notif-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--b3);
  transition: background 0.2s;
}
.notif-dot.active {
  background: var(--gold);
  box-shadow: 0 0 6px rgba(255,107,53,0.4);
}
.notif-icon { font-size: 14px; flex-shrink: 0; line-height: 1; padding-top: 1px; }
.notif-content { flex: 1; min-width: 0; }
.notif-title { font-size: 10px; font-weight: 700; color: var(--t1); line-height: 1.3; }
.notif-read .notif-title { color: var(--t3); }
.notif-body { font-size: 9px; color: var(--t4); margin-top: 2px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-time { font-size: 8px; color: var(--t4); margin-top: 3px; }

/* ─────────────────────────────────────────
   DELIVERY SHOWCASE
───────────────────────────────────────── */
.delivery-showcase {
  background: var(--bg2);
  border: 1px solid var(--b1);
  border-radius: 12px;
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.delivery-showcase::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad-hero);
}
.delivery-hero { margin-bottom: 12px; }
.delivery-hero video,
.delivery-hero img { box-shadow: 0 4px 24px rgba(0,0,0,0.4); }
.delivery-hero-actions { margin-top: 10px; display: flex; gap: 8px; }
.delivery-extras { margin-top: 12px; }
.badge-cyan { background: rgba(6,182,212,0.12); color: var(--cyan); border: 1px solid rgba(6,182,212,0.25); }
.btn-cyan {
  background: rgba(6,182,212,0.12);
  color: var(--cyan);
  border: 1px solid rgba(6,182,212,0.25);
}
.btn-cyan:hover {
  background: rgba(6,182,212,0.2);
  box-shadow: 0 0 12px rgba(6,182,212,0.25);
}

/* ─────────────────────────────────────────
   STUDIO BRIEF AI HELP
───────────────────────────────────────── */
.btn-brief-ai-help {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 5px;
  padding: 3px 9px;
  font-size: 9px;
  font-weight: 600;
  font-family: inherit;
  color: var(--gold);
  background: rgba(255,107,53,0.06);
  border: 1px solid rgba(255,107,53,0.15);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-brief-ai-help:hover {
  background: rgba(255,107,53,0.12);
  border-color: rgba(255,107,53,0.3);
  box-shadow: 0 0 8px rgba(255,107,53,0.15);
}
.btn-brief-ai-help:disabled {
  opacity: 0.5;
  cursor: wait;
}
.brief-ai-panel {
  margin-top: 6px;
  background: #0e0a18;
  border: 1px solid rgba(255,107,53,0.18);
  border-radius: 7px;
  padding: 10px 12px;
}

/* ─────────────────────────────────────────
   APP BAR
───────────────────────────────────────── */
.app-bar {
  background: rgba(10, 10, 18, 0.9);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--b1);
  padding: 0 20px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 6px;
  position: sticky;
  top: 0;
  z-index: 100;
  overflow: visible;
}
.app-bar::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,107,53,0.12) 20%,
    rgba(139,92,246,0.18) 50%,
    rgba(6,182,212,0.12) 80%,
    transparent 100%
  );
  pointer-events: none;
}

.logo {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  flex-shrink: 0;
  white-space: nowrap;
}
.logo span {
  background: var(--grad-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sb-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--b3);
  flex-shrink: 0;
  cursor: pointer;
  transition: var(--ease);
}
.sb-status-dot:hover { background: var(--gold); }

.app-bar-name {
  font-size: 11px;
  color: var(--t3);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Nav group — centered, takes up remaining space */
.app-bar-nav {
  display: flex;
  align-items: center;
  gap: 1px;
  margin-left: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
}
.app-bar-nav::-webkit-scrollbar { display: none; }

/* Right-side actions */
.app-bar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.rb-admin   { font-size: 9px; font-weight: 700; padding: 3px 9px; border-radius: 20px; background: rgba(255,107,53,.1);  color: var(--gold);   border: 1px solid rgba(255,107,53,.22); letter-spacing: .05em; flex-shrink: 0; white-space: nowrap; }
.rb-creator { font-size: 9px; font-weight: 700; padding: 3px 9px; border-radius: 20px; background: rgba(59,130,246,.08); color: var(--blue);  border: 1px solid rgba(59,130,246,.2);  letter-spacing: .05em; flex-shrink: 0; white-space: nowrap; }
.rb-client  { font-size: 9px; font-weight: 700; padding: 3px 9px; border-radius: 20px; background: rgba(139,92,246,.08);  color: #A78BFA;     border: 1px solid rgba(139,92,246,.2);  letter-spacing: .05em; flex-shrink: 0; white-space: nowrap; }

.nav-btn {
  background: transparent;
  border: none;
  color: var(--t3);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 11px;
  border-radius: var(--r);
  cursor: pointer;
  transition: var(--ease);
  position: relative;
  font-family: inherit;
  white-space: nowrap;
  height: 34px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.nav-btn svg { opacity: 0.6; flex-shrink: 0; }
.nav-btn:hover svg { opacity: 0.9; }
.nav-btn.active svg { opacity: 1; }
.nav-btn:hover  { color: var(--t1); background: rgba(255,255,255,0.05); }
.nav-btn.active {
  color: var(--gold);
  background: rgba(255,107,53,0.1);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--gold);
}

.nav-badge {
  font-size: 9px;
  background: var(--red);
  color: #fff;
  border-radius: 20px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: middle;
  font-weight: 700;
}

/* Notification button */
.notif-btn {
  background: none;
  border: 1px solid var(--b2);
  border-radius: var(--r);
  color: var(--t3);
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  position: relative;
  transition: var(--ease);
}
.notif-btn:hover { color: var(--t1); border-color: var(--b3); background: var(--bg3); }
.notif-count {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: #fff;
  font-size: 8px; font-weight: 700;
  border-radius: 50%; width: 16px; height: 16px;
  align-items: center; justify-content: center;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--bg);
}

/* API keys compact button */
.app-bar-keys-btn { height: 34px; }

.notif-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--red);
  position: absolute;
  top: 5px; right: 5px;
  box-shadow: 0 0 6px rgba(239,68,68,0.6);
}

/* Legacy kf (used in settings page) */
.kf { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--t4); }
.kf input {
  background: var(--bg4);
  border: 1px solid var(--b2);
  color: #fff;
  padding: 5px 10px;
  border-radius: var(--r);
  font-size: 11px;
  width: 155px;
  font-family: inherit;
  outline: none;
  transition: var(--ease);
}
.kf input:focus { border-color: var(--gold); }
.kdot     { width: 6px; height: 6px; border-radius: 50%; background: var(--b3); flex-shrink: 0; }
.kdot.ok  { background: var(--green); box-shadow: 0 0 6px rgba(16,185,129,0.5); }

/* ─────────────────────────────────────────
   PAGE
───────────────────────────────────────── */
.page { padding: 32px 28px; max-width: 1260px; margin: 0 auto; }
.page-title {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 800;
  color: var(--t1);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.page-sub { font-size: 12px; color: var(--t4); margin-bottom: 24px; }

/* ─────────────────────────────────────────
   DASHBOARD HERO & TILES
───────────────────────────────────────── */
.dash-hero {
  position: relative;
  border-radius: var(--r3);
  padding: 28px 32px;
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
}
.dash-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 10% 0%, rgba(255,107,53,0.1) 0%, transparent 60%),
    radial-gradient(ellipse 50% 70% at 90% 100%, rgba(139,92,246,0.08) 0%, transparent 60%),
    var(--bg2);
  z-index: 0;
}
.dash-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.dash-hero-greeting {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 800;
  color: var(--t1);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.dash-hero-sub {
  font-size: 13px;
  color: var(--t3);
}

.dash-tiles {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
@media (max-width: 1024px) { .dash-tiles { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 640px)  { .dash-tiles { grid-template-columns: repeat(2, 1fr); } }
.dash-tile {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--r2);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.dash-tile:hover {
  border-color: rgba(255,255,255,0.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.dash-tile-glow {
  border-color: rgba(245,158,11,0.25);
  box-shadow: 0 0 16px rgba(245,158,11,0.08), inset 0 0 12px rgba(245,158,11,0.04);
}
.dash-tile-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  margin: 0 auto 10px;
}
.dash-tile-num {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 4px;
  font-family: var(--mono);
}
.dash-tile-label {
  font-size: 9px;
  color: var(--t4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.3;
}

/* ─────────────────────────────────────────
   TABLES
───────────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th {
  padding: 10px 14px;
  background: var(--bg3);
  color: var(--t3);
  font-weight: 600;
  text-align: left;
  border-bottom: 1px solid var(--b1);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--b1); color: var(--t2); vertical-align: middle; }
.tbl tr:hover td { background: rgba(255,255,255,0.025); }
.tbl tr:last-child td { border-bottom: none; }

/* ─────────────────────────────────────────
   USER / AVATAR
───────────────────────────────────────── */
.uav { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.uav-admin   { background: rgba(255,107,53,.15); color: var(--gold); }
.uav-creator { background: rgba(59,130,246,.1);  color: var(--blue); }
.uav-client  { background: rgba(139,92,246,.1);  color: #A78BFA; }

.urow { display: flex; align-items: center; gap: 10px; }
.uinfo .name { font-size: 13px; font-weight: 600; color: var(--t1); }
.uinfo .sub  { font-size: 11px; color: var(--t4); }

/* ─────────────────────────────────────────
   WORKFLOW BAR
───────────────────────────────────────── */
.wf-bar {
  display: flex;
  overflow-x: auto;
  border: 1px solid var(--b1);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 22px;
}
.wf-step {
  flex: 1;
  padding: 12px 14px;
  text-align: center;
  border-right: 1px solid var(--b1);
  min-width: 90px;
  transition: var(--ease);
}
.wf-step:last-child { border-right: none; }
.wf-step .wn { font-size: 9px; font-weight: 700; color: var(--t4); text-transform: uppercase; letter-spacing: .07em; display: block; }
.wf-step .wl { font-size: 11px; color: var(--t3); margin-top: 4px; display: block; }
.wf-step.done   { background: rgba(16,185,129,.04); }
.wf-step.done .wn { color: var(--green); }
.wf-step.done .wl { color: #34D399; }
.wf-step.active { background: rgba(255,107,53,.05); }
.wf-step.active .wn { color: var(--gold); }
.wf-step.active .wl { color: var(--gold-bright); }

/* ─────────────────────────────────────────
   CLIENT PORTAL / PROJECT PANELS
───────────────────────────────────────── */
.pp {
  background: var(--bg2);
  border: 1px solid var(--b1);
  border-radius: var(--r2);
  overflow: hidden;
  margin-bottom: 14px;
  cursor: pointer;
  transition: var(--ease);
}
.pp:hover {
  border-color: var(--b3);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.pp-top { padding: 16px 18px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--b1); }
.pp-info { flex: 1; min-width: 0; }
.pp-name { font-size: 14px; font-weight: 700; color: #fff; }
.pp-meta { font-size: 11px; color: var(--t4); margin-top: 3px; }
.pp-btm  { padding: 11px 18px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ─────────────────────────────────────────
   BRIEF WIZARD DOTS
───────────────────────────────────────── */
.bsi {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--b2);
  border: 1px solid var(--b3);
  transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
}
.bsi.done   { background: var(--green); border-color: var(--green); }
.bsi.active { background: var(--gold);  border-color: var(--gold-bright); box-shadow: 0 0 10px var(--gold-glow); }

/* ─────────────────────────────────────────
   SYNOPSIS
───────────────────────────────────────── */
.syn-block {
  background: rgba(255,107,53,.03);
  border: 1px solid rgba(255,107,53,.14);
  border-radius: var(--r2);
  padding: 22px;
  margin-bottom: 18px;
}
.syn-ver {
  font-size: 10px;
  color: var(--t4);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.syn-text { font-size: 14px; color: var(--t2); line-height: 1.95; white-space: pre-wrap; }

/* ─────────────────────────────────────────
   STORYBOARD CLIENT
───────────────────────────────────────── */
.sbc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); gap: 14px; }
.sbc-card {
  background: var(--bg2);
  border: 1px solid var(--b1);
  border-radius: var(--r);
  overflow: hidden;
  transition: var(--ease);
}
.sbc-card:hover { border-color: var(--b3); box-shadow: var(--shadow); }
.sbc-top { padding: 8px 12px; background: var(--bg3); display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--b1); }
.sbc-img { aspect-ratio: 16/9; background: var(--bg4); }
.sbc-img img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; transition: transform 0.3s ease; }
.sbc-img:hover img { transform: scale(1.03); }
.sbc-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--b3); font-size: 24px; }
.sbc-fb { padding: 9px 11px; border-top: 1px solid var(--b1); }
.sbc-fb textarea {
  width: 100%;
  background: var(--bg4);
  border: 1px solid var(--b2);
  color: var(--t1);
  padding: 7px 9px;
  border-radius: var(--r);
  font-size: 11px;
  line-height: 1.5;
  font-family: inherit;
  resize: none;
  min-height: 44px;
  transition: var(--ease);
  outline: none;
}
.sbc-fb textarea:focus { border-color: var(--gold); }

/* ─────────────────────────────────────────
   ASSETS
───────────────────────────────────────── */
.ag  { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 12px; }
.ac2 { background: var(--bg2); border: 1px solid var(--b1); border-radius: var(--r); overflow: hidden; transition: var(--ease); }
.ac2:hover { border-color: var(--b3); box-shadow: var(--shadow); }
.at  { aspect-ratio: 4/3; background: var(--bg4); overflow: hidden; cursor: pointer; }
.at img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.at:hover img { transform: scale(1.06); }
.at-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 26px; color: var(--b3); }
.ai2 { padding: 8px 10px; border-top: 1px solid var(--b1); }
.an  { font-size: 10px; font-weight: 600; color: var(--t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atp { font-size: 9px; color: var(--t4); margin-top: 2px; }

/* ─────────────────────────────────────────
   UPLOAD ZONE
───────────────────────────────────────── */
.upload-zone {
  border: 1px dashed var(--b2);
  border-radius: var(--r2);
  padding: 32px;
  text-align: center;
  color: var(--t4);
  cursor: pointer;
  background: var(--bg3);
  transition: var(--ease);
  margin-bottom: 14px;
}
.upload-zone:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(255,107,53,.03);
}

/* ─────────────────────────────────────────
   STUDIO TABS
───────────────────────────────────────── */
.studio-stages {
  background: var(--bg);
  border-bottom: 1px solid var(--b1);
  display: flex;
  overflow-x: auto;
  padding: 0 8px;
}
.sst {
  padding: 14px 18px;
  font-size: 12px;
  font-weight: 600;
  color: var(--t3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: var(--ease);
  font-family: inherit;
}
.sst:hover     { color: var(--t1); }
.sst.active    { color: var(--gold); border-bottom-color: var(--gold); }
.sst.off       { opacity: 0.28; cursor: not-allowed; }

.step-nav {
  background: var(--bg);
  border-bottom: 1px solid var(--b1);
  padding: 0 24px;
  display: flex;
  overflow-x: auto;
}
.sn {
  padding: 9px 13px;
  font-size: 11px;
  color: var(--t4);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: var(--ease);
  font-family: inherit;
}
.sn:hover  { color: var(--gold); }
.sn.active { color: var(--gold); border-bottom-color: var(--gold); }

.snum { width: 18px; height: 18px; border-radius: 50%; background: var(--bg4); font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sn.active .snum { background: var(--gold); color: #000; }

.sc { padding: 24px; max-width: 1100px; margin: 0 auto; }
.ptitle { font-size: 16px; font-weight: 700; color: var(--gold); margin-bottom: 6px; }
.psub   { font-size: 12px; color: var(--t3); margin-bottom: 18px; line-height: 1.65; }

/* Shot rows */
.shot-row { background: var(--bg4); border: 1px solid var(--b1); border-radius: var(--r); overflow: hidden; margin-bottom: 9px; }
.shot-hd  { padding: 7px 11px; background: var(--bg3); display: flex; align-items: center; gap: 7px; border-bottom: 1px solid var(--b1); }
.sn2  { background: var(--gold); color: #000; font-size: 9px; font-weight: 700; padding: 2px 7px; border-radius: 4px; }
.shot-bd { display: grid; grid-template-columns: 1fr 1fr; }
.sf  { padding: 9px 11px; }
.sf:first-child { border-right: 1px solid var(--b1); }
.sf label { font-size: 9px; color: var(--t4); text-transform: uppercase; letter-spacing: .05em; display: block; margin-bottom: 4px; font-weight: 600; }
.sf textarea { width: 100%; background: transparent; border: none; color: var(--t2); font-size: 11px; line-height: 1.55; font-family: inherit; resize: vertical; min-height: 52px; outline: none; }

/* Storyboard grid */
.sb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 11px; }
.sbc2 { background: var(--bg2); border: 1px solid var(--b1); border-radius: var(--r); overflow: hidden; transition: var(--ease); }
.sbt  { padding: 7px 11px; background: var(--bg3); display: flex; align-items: center; gap: 7px; border-bottom: 1px solid var(--b1); }
.sbnum { background: var(--gold); color: #000; font-size: 9px; font-weight: 700; padding: 2px 7px; border-radius: 4px; flex-shrink: 0; }
.sbst { font-size: 9px; padding: 2px 8px; border-radius: 20px; font-weight: 500; }
.sbst-idle  { background: var(--bg4);                    color: var(--t4); }
.sbst-gen   { background: rgba(255,107,53,.1);            color: var(--gold); }
.sbst-done  { background: rgba(16,185,129,.08);            color: var(--green); }
.sbst-error { background: rgba(239,68,68,.08);            color: var(--red); }
.sb-iw { aspect-ratio: 21/9; background: var(--bg4); overflow: hidden; }
.sb-iw img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.sb-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--b3); font-size: 20px; }
.sb-btns { padding: 5px 8px; border-top: 1px solid var(--b1); display: flex; gap: 5px; }
.sb-btns button {
  flex: 1; padding: 5px; border-radius: 4px; border: 1px solid var(--b1);
  background: transparent; color: var(--t4); font-size: 9px; cursor: pointer;
  transition: var(--ease); font-family: inherit;
}
.sb-btns button:hover { border-color: rgba(255,107,53,.3); color: var(--gold); }
.sb-btns button:disabled { opacity: 0.2; cursor: not-allowed; }

/* Bible grid */
.bible-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.bic { background: var(--bg4); border: 1px solid var(--b1); border-radius: var(--r); overflow: hidden; }
.bic-top { padding: 8px 13px; background: var(--bg3); display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--b1); }
.bic-title { font-size: 11px; font-weight: 700; color: var(--gold); }
.bic textarea { width: 100%; background: transparent; border: none; padding: 10px 13px; color: var(--t2); font-size: 12px; line-height: 1.65; font-family: inherit; resize: vertical; min-height: 76px; outline: none; }

/* Progress */
.prog-wrap { padding: 7px 24px; background: var(--bg); border-bottom: 1px solid var(--b1); display: none; }
.prog-wrap.show { display: block; }
.prog-info { display: flex; justify-content: space-between; font-size: 10px; color: var(--t4); margin-bottom: 5px; }
.prog-track { height: 2px; background: var(--bg4); border-radius: 1px; overflow: hidden; }
.prog-fill  { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); border-radius: 1px; transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1); }

/* Settings row */
.stg-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; padding: 12px 16px; background: var(--bg2); border: 1px solid var(--b1); border-radius: var(--r); margin-bottom: 16px; }
.si { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--t3); }
.si input[type=number] { width: 46px; background: var(--bg4); border: 1px solid var(--b2); color: #fff; padding: 4px 7px; border-radius: var(--r); font-size: 12px; text-align: center; font-family: inherit; outline: none; transition: var(--ease); }
.si input[type=number]:focus { border-color: var(--gold); }

/* Toggle switch */
.toggle {
  width: 32px; height: 18px;
  background: var(--b2);
  border-radius: 9px;
  position: relative;
  cursor: pointer;
  border: none;
  flex-shrink: 0;
  transition: background 0.22s ease;
}
.toggle.on { background: var(--gold); }
.toggle::after {
  content: '';
  width: 12px; height: 12px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 3px; left: 3px;
  transition: left 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.toggle.on::after { left: 17px; }

/* ─────────────────────────────────────────
   VIDEO / AUDIO
───────────────────────────────────────── */
.vpc { background: var(--bg4); border: 1px solid var(--b1); border-radius: var(--r); overflow: hidden; margin-bottom: 11px; }
.vph { padding: 8px 13px; background: var(--bg3); display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--b1); }
.vvid { aspect-ratio: 16/9; background: #040408; border-radius: 4px; overflow: hidden; margin-bottom: 7px; }
.vvid video, .vvid img { width: 100%; height: 100%; object-fit: cover; }
.vvph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--b3); font-size: 20px; }
.pb { background: var(--bg); border-radius: 5px; overflow: hidden; margin-bottom: 6px; }
.pbl { padding: 5px 10px; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.pbl.sc { color: var(--t3); background: var(--bg4); }
.pbl.vp { color: var(--gold); background: rgba(255,107,53,.08); }
.pbl.jl { color: var(--blue); background: rgba(59,130,246,.07); }
.pb textarea { width: 100%; background: transparent; border: none; padding: 6px 10px; color: var(--t3); font-size: 11px; line-height: 1.55; font-family: inherit; resize: none; min-height: 40px; outline: none; }

/* Model grid */
.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 16px; }
.mc {
  background: var(--bg2);
  border: 1px solid var(--b1);
  border-radius: var(--r2);
  padding: 14px;
  cursor: pointer;
  transition: var(--ease);
  position: relative;
}
.mc:hover { border-color: rgba(255,107,53,.3); }
.mc.sel   { border-color: var(--gold); background: rgba(255,107,53,.05); box-shadow: 0 0 0 1px rgba(255,107,53,.12) inset; }
.mc.rec::before {
  content: 'REC';
  position: absolute; top: -1px; right: -1px;
  background: var(--gold); color: #000;
  font-size: 8px; font-weight: 700;
  padding: 3px 7px;
  border-radius: 0 var(--r2) 0 5px;
}
.mn { font-size: 11px; font-weight: 700; color: var(--t1); margin-bottom: 4px; }
.ms { font-size: 10px; color: var(--t4); line-height: 1.55; margin-bottom: 7px; }
.mtag { font-size: 9px; background: var(--bg4); color: var(--t4); padding: 2px 6px; border-radius: 4px; }
.mc-cost { font-size: 10px; color: var(--gold); margin-top: 6px; }

/* Lock block */
.lock-block { background: rgba(255,107,53,.025); border: 1px solid rgba(255,107,53,.12); border-radius: var(--r2); padding: 16px; margin-bottom: 16px; }
.lock-block textarea {
  width: 100%; background: rgba(0,0,0,.35); border: 1px solid var(--b2); color: var(--t2);
  font-size: 11px; line-height: 1.75; font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  resize: vertical; min-height: 145px; padding: 11px; border-radius: var(--r);
  transition: var(--ease); outline: none;
}
.lock-block textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255,107,53,.1); }

.rules-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rc2 { background: var(--bg2); border: 1px solid var(--b1); border-radius: var(--r); padding: 13px; }
.ac3 { background: var(--bg2); border: 1px solid var(--b1); border-radius: var(--r); overflow: hidden; margin-bottom: 9px; }
.ach { padding: 8px 12px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--b1); }
.ast { font-size: 9px; padding: 2px 8px; border-radius: 20px; font-weight: 500; }
.ast-idle { background: var(--bg4);               color: var(--t4); }
.ast-gen  { background: rgba(255,107,53,.1);       color: var(--gold); }
.ast-done { background: rgba(16,185,129,.08);       color: var(--green); }
.ast-err  { background: rgba(239,68,68,.08);       color: var(--red); }
.acb { padding: 10px 12px; }
.acb select, .acb textarea, .acb input {
  width: 100%; background: var(--bg4); border: 1px solid var(--b2);
  color: var(--t1); padding: 6px 10px; border-radius: var(--r); font-size: 11px; font-family: inherit; outline: none;
}
.acb textarea { resize: vertical; min-height: 44px; line-height: 1.55; }
.aclbl { font-size: 9px; color: var(--t4); text-transform: uppercase; letter-spacing: .06em; display: block; margin-bottom: 4px; margin-top: 8px; font-weight: 600; }

audio { width: 100%; height: 30px; margin-top: 7px; }

/* ─────────────────────────────────────────
   STATUS BAR
───────────────────────────────────────── */
.stat-bar {
  background: rgba(5,5,7,.92);
  border-top: 1px solid var(--b1);
  padding: 7px 24px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.stat { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--t4); }
.dot  { width: 6px; height: 6px; border-radius: 50%; }
.dg  { background: var(--gold); }
.dgr { background: var(--green); }
.db  { background: var(--blue); }
.dr  { background: var(--red); }
.dgy { background: var(--b3); }

/* ─────────────────────────────────────────
   MODAL
───────────────────────────────────────── */
.modal-wrap {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.75);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(8px);
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  background: var(--bg3);
  border: 1px solid rgba(255,107,53,.18);
  border-radius: var(--r3);
  padding: 28px;
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.22s cubic-bezier(0.34, 1.2, 0.64, 1);
  position: relative;
}
.modal-box::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,107,53,.35), transparent);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-close {
  float: right;
  background: none; border: none;
  color: var(--t3); font-size: 20px;
  cursor: pointer; margin-left: 12px;
  transition: var(--ease);
  line-height: 1;
}
.modal-close:hover { color: var(--t1); }
.modal-title {
  font-size: 17px; font-weight: 700;
  color: var(--gold); margin-bottom: 20px;
  letter-spacing: -0.01em;
}

/* ─────────────────────────────────────────
   SCROLLBAR
───────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--b3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--t4); }

/* ─────────────────────────────────────────
   SCRIPT BOOK VIEW
───────────────────────────────────────── */
.book-view {
  perspective: 1400px;
  display: flex;
  justify-content: center;
  padding: 20px 0;
}
.book-pages {
  position: relative;
  width: 100%;
  max-width: 640px;
  min-height: 500px;
  transform-style: preserve-3d;
}
.book-page {
  position: absolute;
  inset: 0;
  background: #faf8f2;
  color: #1a1a1a;
  border-radius: 4px 12px 12px 4px;
  padding: 40px 36px;
  font-family: 'Georgia', serif;
  font-size: 13px;
  line-height: 1.85;
  box-shadow: 2px 4px 24px rgba(0,0,0,0.4), inset -2px 0 8px rgba(0,0,0,0.04);
  backface-visibility: hidden;
  transition: transform 0.6s cubic-bezier(0.645, 0.045, 0.355, 1), opacity 0.3s ease;
  transform-origin: left center;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.book-page.flipped {
  transform: rotateY(-180deg);
  opacity: 0;
  pointer-events: none;
}
.book-page.hidden { display: none; }
.book-page .page-num {
  position: absolute;
  bottom: 16px;
  right: 24px;
  font-size: 10px;
  color: #999;
  font-family: sans-serif;
}
.book-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 14px;
}
.book-nav button {
  background: var(--bg3);
  border: 1px solid var(--b2);
  color: var(--t2);
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.15s;
}
.book-nav button:hover { border-color: var(--gold); color: var(--gold); }
.book-nav span { font-size: 10px; color: var(--t4); }

.script-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: #0a0a0a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.script-fullscreen .book-pages { max-width: 720px; min-height: 70vh; }
.script-fullscreen .close-fs {
  position: absolute;
  top: 16px;
  right: 20px;
  background: var(--bg3);
  border: 1px solid var(--b2);
  color: var(--t2);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  z-index: 10;
}

/* ─────────────────────────────────────────
   BIBLE CAROUSEL
───────────────────────────────────────── */
.bible-carousel {
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}
.bible-track {
  display: flex;
  gap: 14px;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  padding: 4px 0;
}
.bible-card {
  flex: 0 0 280px;
  background: linear-gradient(135deg, var(--bg2) 0%, var(--bg3) 100%);
  border: 1px solid var(--b2);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.bible-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  border-color: var(--gold-line);
}
.bible-card-head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--b1);
  background: rgba(255,107,53,0.04);
}
.bible-card-head .card-icon {
  font-size: 20px;
  margin-bottom: 4px;
}
.bible-card-head h4 {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  margin: 0;
}
.bible-card-body {
  padding: 12px 16px;
}
.bible-card-body .field {
  margin-bottom: 10px;
}
.bible-card-body .field-label {
  font-size: 8px;
  color: var(--t4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 3px;
  font-weight: 600;
}
.bible-card-body .field-value {
  font-size: 10px;
  color: var(--t2);
  line-height: 1.5;
}
.bible-card-body textarea {
  width: 100%;
  background: var(--bg4);
  border: 1px solid var(--b1);
  color: var(--t2);
  font-size: 10px;
  line-height: 1.5;
  padding: 6px 8px;
  border-radius: 4px;
  font-family: inherit;
  resize: vertical;
  min-height: 36px;
  outline: none;
}
.bible-card-body textarea:focus { border-color: var(--gold-line); }
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg3);
  border: 1px solid var(--b2);
  color: var(--gold);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  font-size: 14px;
  transition: all 0.15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.carousel-nav:hover { background: var(--gold); color: #000; }
.carousel-nav.prev { left: 4px; }
.carousel-nav.next { right: 4px; }
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}
.carousel-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--b3);
  cursor: pointer;
  transition: all 0.2s;
}
.carousel-dots .dot.active { background: var(--gold); transform: scale(1.3); }

/* ─────────────────────────────────────────
   VOICE READER
───────────────────────────────────────── */
.voice-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg2);
  border: 1px solid var(--b1);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
}
.voice-btn {
  background: var(--bg4);
  border: 1px solid var(--b2);
  color: var(--t2);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}
.voice-btn:hover { border-color: var(--gold); color: var(--gold); }
.voice-btn.active { background: var(--gold); color: #000; border-color: var(--gold); }

/* ─────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────── */

/* Tablet */
@media (max-width: 1024px) {
  .page { padding: 24px 20px; }
  .model-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* Small tablet / large phone */
@media (max-width: 768px) {
  .app-bar { height: auto; min-height: 52px; flex-wrap: wrap; padding: 8px 16px; gap: 4px; }
  .app-bar-nav { order: 3; width: 100%; margin-left: 0; padding: 4px 0; }
  .app-bar-right { order: 2; }
  .modal-box { padding: 20px; max-width: 100%; border-radius: var(--r2); }
  .modal-wrap { padding: 10px; }
  .tbl { font-size: 11px; }
  .tbl th, .tbl td { padding: 8px 10px; }
  .page-title { font-size: 20px; }
  .dash-hero { padding: 20px; }
  .dash-hero-greeting { font-size: 18px; }
  .dash-hero-content { flex-direction: column; align-items: flex-start; }
}

/* Phone */
@media (max-width: 640px) {
  .form2, .bible-grid, .form3, .shot-bd, .rules-grid { grid-template-columns: 1fr; }
  .page { padding: 16px 12px; }
  .app-bar { padding: 6px 12px; }
  .sc { padding: 12px; }
  .nav-btn { font-size: 11px; padding: 5px 8px; height: 30px; }
  .nav-btn svg { display: none; }
  .btn { font-size: 11px; padding: 6px 12px; }
  .btn-sm { padding: 4px 8px; font-size: 10px; }
  .login-box { padding: 28px 20px; }
  .sb-grid, .sbc-grid, .ag { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* Small phone */
@media (max-width: 400px) {
  .app-bar-name { display: none; }
  .app-bar-keys-btn { display: none; }
  .dash-tiles { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .dash-tile { padding: 10px 8px; }
  .dash-tile-num { font-size: 22px; }
}
