/* ==========================================================================
   Field Notes — Cinematic Video Library & Ops Platform
   ========================================================================== */
:root {
  color-scheme: dark;
  --bg: #07090f;
  --bg-elevated: #0e1320;
  --bg-card: #121827;
  --bg-card-hover: #182136;
  --glass: rgba(14, 19, 32, 0.78);
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.26);

  --text: #f8fafc;
  --text-soft: #cbd5e1;
  --muted: #8b9bb4;

  --accent: #f59e0b;       /* Warm cinema spotlight amber */
  --accent-bright: #fbbf24;
  --accent-glow: rgba(245, 158, 11, 0.28);
  --cyan: #38bdf8;
  --cyan-glow: rgba(56, 189, 248, 0.22);
  --emerald: #10b981;
  --rose: #f43f5e;
  --violet: #a78bfa;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
  --font-sans: 'Plus Jakarta Sans', 'Noto Sans Thai', 'Noto Sans Myanmar', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Subtle ambient background glow */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 65% 45% at 15% -5%, rgba(245, 158, 11, 0.12), transparent 65%),
    radial-gradient(ellipse 55% 40% at 88% 8%, rgba(56, 189, 248, 0.11), transparent 60%),
    radial-gradient(ellipse 50% 45% at 50% 100%, rgba(167, 139, 250, 0.07), transparent 65%);
}

a { color: var(--accent-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Custom dark scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.44);
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:active {
  background: rgba(245, 158, 11, 0.65);
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-corner {
  background: transparent;
}
.steps-rail::-webkit-scrollbar,
.cat-strip::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
@supports not selector(::-webkit-scrollbar) {
  * {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  color: #0b0f19;
  box-shadow: 0 8px 24px var(--accent-glow);
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.4);
}

.btn-cyan {
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  color: #07101d;
  box-shadow: 0 8px 22px var(--cyan-glow);
}
.btn-cyan:hover:not(:disabled) { filter: brightness(1.08); }

.btn-glass {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-color: var(--border-strong);
  backdrop-filter: blur(10px);
}
.btn-glass:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.14);
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.35);
}
.btn-danger:hover:not(:disabled) { background: rgba(244, 63, 94, 0.25); }

.btn-emerald {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.35);
}
.btn-emerald:hover:not(:disabled) { background: rgba(16, 185, 129, 0.28); }

.btn-sm { padding: 7px 12px; font-size: 0.8rem; border-radius: 9px; }
.btn-xs { padding: 5px 9px; font-size: 0.75rem; border-radius: 8px; }
.btn-block { width: 100%; }

/* Form controls */
.field { margin-bottom: 14px; text-align: left; }
.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.input, .select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: rgba(7, 9, 15, 0.72);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}
.input:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.16);
}
.input::placeholder { color: #64748b; }

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.86rem;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-error { background: rgba(244, 63, 94, 0.13); border: 1px solid rgba(244, 63, 94, 0.35); color: #fecdd3; }
.alert-warn { background: rgba(245, 158, 11, 0.13); border: 1px solid rgba(245, 158, 11, 0.35); color: #fde68a; }
.alert-success { background: rgba(16, 185, 129, 0.14); border: 1px solid rgba(16, 185, 129, 0.35); color: #a7f3d0; }

/* ==========================================================================
   AUTH / LOGIN / INVITE PAGES
   ========================================================================== */
.auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, rgba(18, 24, 39, 0.92), rgba(11, 15, 25, 0.95));
  border: 1px solid var(--border-strong);
  border-radius: 26px;
  padding: 28px 26px 26px;
  box-shadow: var(--shadow-lg), 0 0 80px rgba(245, 158, 11, 0.07);
  backdrop-filter: blur(20px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  color: #090d16;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px var(--accent-glow);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-title { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.03em; margin: 0; }
.brand-sub { color: var(--muted); font-size: 0.86rem; margin: 0 0 20px 0; }

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(7, 9, 15, 0.7);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 5px;
  margin-bottom: 20px;
}
.mode-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}
.mode-tab svg { width: 16px; height: 16px; }
.mode-tab.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(234, 88, 12, 0.18));
  color: var(--accent-bright);
  border: 1px solid rgba(245, 158, 11, 0.38);
}

/* Touch PIN Keypad */
.pin-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 12px 0 16px;
}
.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: transparent;
  transition: all 0.14s ease;
}
.pin-dot.filled {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
  box-shadow: 0 0 12px var(--accent-glow);
  transform: scale(1.1);
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.key-btn {
  height: 54px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: inherit;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
  user-select: none;
}
.key-btn:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--border-strong); }
.key-btn:active { transform: scale(0.94); background: rgba(245, 158, 11, 0.22); }
.key-btn.key-action { font-size: 0.85rem; color: var(--muted); }

/* Anti-bot honeypot hidden offscreen */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.captcha-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.26);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.captcha-q {
  font-weight: 800;
  font-size: 1rem;
  color: var(--cyan);
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, monospace;
}
.captcha-box input { width: 90px; padding: 8px 10px; text-align: center; font-weight: 700; }

.lobby-screen {
  text-align: center;
  padding: 14px 6px;
}
.lobby-badge {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.15);
  border: 2px solid rgba(245, 158, 11, 0.45);
  color: var(--accent-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulseRing 2.2s infinite;
}
@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.35); }
  70% { box-shadow: 0 0 0 18px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.auth-footer {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ==========================================================================
   MAIN CINEMATIC VIDEO LIBRARY
   ========================================================================== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(7, 9, 15, 0.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.top-nav-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin-right: 6px;
}
.nav-brand .brand-mark { width: 36px; height: 36px; border-radius: 11px; }
.nav-brand span { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em; }

.nav-search {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 420px;
}
.nav-search svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}
.nav-search input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: all 0.16s;
}
.nav-search input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.lang-pills {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.lang-pill {
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.14s;
}
.lang-pill:hover { color: var(--text); }
.lang-pill.active {
  background: var(--accent);
  color: #090d16;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--rose);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  font-size: 0.82rem;
}
.role-tag {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 999px;
}
.role-superuser { background: rgba(167, 139, 250, 0.22); color: #c4b5fd; }
.role-admin { background: rgba(245, 158, 11, 0.2); color: var(--accent-bright); }
.role-manager { background: rgba(56, 189, 248, 0.2); color: var(--cyan); }
.role-employee { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }

.company-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.34);
  color: var(--accent-bright);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}
.company-pill svg { width: 14px; height: 14px; }

.su-company-select {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(167, 139, 250, 0.4);
  background: rgba(167, 139, 250, 0.12);
  color: #e9d5ff;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}
.su-company-select option { background: #0e1320; color: #f8fafc; }

/* Main container */
.main-wrap {
  position: relative;
  z-index: 1;
  max-width: 1360px;
  margin: 0 auto;
  padding: 22px 22px 64px;
}

/* Featured Cinema Hero Banner */
.hero-banner {
  position: relative;
  border-radius: 26px;
  overflow: hidden;
  min-height: 360px;
  display: flex;
  align-items: flex-end;
  margin-bottom: 28px;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, #131c31 0%, #0b101d 100%);
}
.hero-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.55) saturate(1.15);
  transform: scale(1.03);
  transition: transform 0.6s ease;
}
.hero-banner:hover .hero-backdrop { transform: scale(1.06); }
.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 9, 15, 0.94) 0%, rgba(7, 9, 15, 0.68) 52%, rgba(7, 9, 15, 0.2) 100%),
    linear-gradient(0deg, rgba(7, 9, 15, 0.96) 0%, transparent 55%);
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 36px 38px;
  max-width: 720px;
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-bright);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.hero-title {
  font-size: clamp(1.6rem, 3.2vw, 2.5rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 12px 0;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
  color: var(--text-soft);
  font-size: 0.88rem;
}
.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  padding: 5px 11px;
  border-radius: 8px;
}
.hero-meta svg { width: 14px; height: 14px; color: var(--accent-bright); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* Category Filter Strip */
.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.section-heading {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cat-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.cat-chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.14s;
}
.cat-chip:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.cat-chip.active {
  background: var(--text);
  color: #07090f;
  border-color: var(--text);
  font-weight: 700;
}

/* Video Library Grid (Netflix / Vimeo Showcase Style) */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  display: flex;
  flex-direction: column;
}
.video-card:hover {
  transform: translateY(-6px);
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.5), 0 0 30px rgba(245, 158, 11, 0.08);
}

.thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0a0f1d;
  overflow: hidden;
}
.thumb-wrap img, .thumb-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.video-card:hover .thumb-wrap img { transform: scale(1.06); }
.thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #162038 0%, #0b1120 100%);
  color: var(--muted);
}

.thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.08) 0%, rgba(7,9,15,0.72) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.92;
  transition: opacity 0.2s;
}
.play-orb {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.92);
  color: #07090f;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  transform: scale(0.92);
  opacity: 0;
  transition: all 0.2s ease;
}
.video-card:hover .play-orb { opacity: 1; transform: scale(1); }
.play-orb svg { width: 24px; height: 24px; margin-left: 2px; }

.thumb-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}
.pill-dark {
  background: rgba(7, 9, 15, 0.78);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.thumb-bottom-badges {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.card-body {
  padding: 15px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card-cat {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-bright);
  margin-bottom: 5px;
}
.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 8px 0;
  color: var(--text);
}
.card-meta {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
}
.lang-dots { display: inline-flex; gap: 4px; }
.lang-dot {
  font-size: 0.66rem;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(56, 189, 248, 0.14);
  color: var(--cyan);
}

/* ==========================================================================
   MODALS (THEATER PLAYER, UPLOAD, ADMIN CONSOLE)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 5, 10, 0.84);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow-y: auto;
}
.modal-backdrop.open { display: flex; }

.modal-panel {
  width: 100%;
  max-width: 1180px;
  max-height: 92vh;
  background: #0d1220;
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-panel.modal-sm { max-width: 560px; }

.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
}
.modal-header h2 { margin: 0; font-size: 1.15rem; font-weight: 800; }
.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
}

/* Theater Split View */
.theater-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.9fr);
  gap: 22px;
  align-items: start;
}
@media (max-width: 900px) {
  .theater-grid { grid-template-columns: 1fr; }
}
.theater-video {
  width: 100%;
  border-radius: 16px;
  background: #000;
  max-height: 62vh;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
}

.info-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}
.info-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-soft);
}
.info-chip svg { width: 14px; height: 14px; color: var(--accent-bright); }

.safety-card {
  background: rgba(245, 158, 11, 0.09);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 14px;
  padding: 13px 15px;
  margin-top: 14px;
}
.safety-card h4 {
  margin: 0 0 8px 0;
  font-size: 0.85rem;
  color: var(--accent-bright);
  display: flex;
  align-items: center;
  gap: 6px;
}
.safety-card ul { margin: 0; padding-left: 18px; color: #fde68a; font-size: 0.85rem; line-height: 1.5; }

.steps-rail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 66vh;
  overflow-y: auto;
  padding-right: 4px;
}
.step-item {
  display: flex;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s ease;
}
.step-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-strong);
}
.step-item.active-step {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.55);
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: rgba(245, 158, 11, 0.16);
  color: var(--accent-bright);
  font-weight: 800;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step-ts {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--cyan);
  margin-right: 6px;
}
.step-action { font-weight: 700; font-size: 0.94rem; }
.step-detail { color: var(--text-soft); font-size: 0.84rem; line-height: 1.45; margin-top: 4px; }

.transcript-box {
  background: #070a13;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-top: 12px;
  font-size: 0.84rem;
  color: var(--text-soft);
  line-height: 1.65;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

/* Upload Modal */
.quota-meter {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.quota-bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 8px;
}
.quota-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #10b981, #f59e0b);
  transition: width 0.3s ease;
}
.quota-bar-fill.danger { background: linear-gradient(90deg, #f59e0b, #f43f5e); }

.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: 18px;
  padding: 28px 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s, background 0.2s;
}
.dropzone:hover, .dropzone.drag-over { border-color: var(--accent); background: rgba(245, 158, 11, 0.06); }

.mic-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 14px;
  font-size: 0.8rem;
  color: var(--text-soft);
  cursor: pointer;
  user-select: none;
}
.mic-toggle input[type="checkbox"] {
  accent-color: var(--cyan);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.recorder-panel {
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 16px;
  background: rgba(7, 10, 19, 0.72);
}
.recorder-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.rec-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(244, 63, 94, 0.16);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fda4af;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.rec-indicator.paused {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--accent-bright);
}
.rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rose);
  animation: recBlink 1.1s ease-in-out infinite;
}
.rec-indicator.paused .rec-dot {
  background: var(--accent-bright);
  animation: none;
}
@keyframes recBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}
.rec-timer {
  font-family: ui-monospace, SFMono-Regular, monospace;
  color: var(--text);
}
.rec-mic-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cyan);
}
.recorder-preview {
  width: 100%;
  max-height: 290px;
  border-radius: 12px;
  background: #000;
  border: 1px solid var(--border);
  display: block;
}

/* ==========================================================================
   ADMIN CONSOLE
   ========================================================================== */
.admin-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.admin-tab {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.admin-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.admin-tab.active {
  background: rgba(245, 158, 11, 0.16);
  color: var(--accent-bright);
  border-color: rgba(245, 158, 11, 0.38);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.kpi-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}
.kpi-label { font-size: 0.76rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.kpi-val { font-size: 1.65rem; font-weight: 800; margin: 6px 0 4px; letter-spacing: -0.02em; }
.kpi-sub { font-size: 0.78rem; color: var(--muted); }

.admin-box {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}
.admin-box h3 { margin: 0 0 12px 0; font-size: 0.98rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 700; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; }
tr:hover td { background: rgba(255, 255, 255, 0.02); }
.table-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}
.status-active { background: rgba(16, 185, 129, 0.16); color: #6ee7b7; }
.status-pending { background: rgba(245, 158, 11, 0.18); color: #fcd34d; }
.status-disabled { background: rgba(148, 163, 184, 0.16); color: #94a3b8; }
.status-locked { background: rgba(244, 63, 94, 0.18); color: #fda4af; }

.invite-url-box {
  display: flex;
  gap: 8px;
  align-items: center;
  background: #070a13;
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 12px;
}
.invite-url-box input {
  flex: 1;
  background: transparent;
  border: none;
  color: #6ee7b7;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.82rem;
  outline: none;
}

.empty-state {
  text-align: center;
  padding: 52px 24px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-strong);
  border-radius: 20px;
  color: var(--muted);
}

.spin { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ==========================================================================
   CUSTOM DIALOGS & TOASTS
   ========================================================================== */
.dialog-backdrop {
  z-index: 200;
  background: rgba(3, 5, 10, 0.76);
}
.dialog-panel {
  max-width: 430px;
  border-radius: 20px;
  background: linear-gradient(180deg, #131a2b 0%, #0c111e 100%);
  border: 1px solid var(--border-strong);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  animation: dialogPop 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes dialogPop {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.dialog-body {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 22px 22px 18px;
}
.dialog-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.32);
  color: var(--cyan);
}
.dialog-icon svg { width: 20px; height: 20px; }
.dialog-icon.tone-danger,
.dialog-icon.tone-error {
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(244, 63, 94, 0.35);
  color: #fda4af;
}
.dialog-icon.tone-warn {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.38);
  color: var(--accent-bright);
}
.dialog-icon.tone-success {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}
.dialog-content { flex: 1; min-width: 0; }
.dialog-title {
  margin: 0 0 6px 0;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}
.dialog-message {
  margin: 0;
  font-size: 0.87rem;
  line-height: 1.5;
  color: var(--text-soft);
  word-wrap: break-word;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 20px 16px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 32px));
}
.toast-item {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  border-radius: 14px;
  background: rgba(14, 19, 32, 0.94);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.55);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
  animation: toastIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast-item.toast-out { opacity: 0; transform: translateY(8px); }
.toast-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.toast-item.toast-success { border-color: rgba(16, 185, 129, 0.42); }
.toast-item.toast-success svg { color: #6ee7b7; }
.toast-item.toast-error { border-color: rgba(244, 63, 94, 0.45); }
.toast-item.toast-error svg { color: #fda4af; }
.toast-item.toast-info { border-color: rgba(56, 189, 248, 0.4); }
.toast-item.toast-info svg { color: var(--cyan); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================================================
   INTERACTIVE QUICK TOUR (SPOTLIGHT + POPOVER)
   ========================================================================== */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: none;
  pointer-events: auto;
}
.tour-overlay.open { display: block; }
.tour-spotlight {
  position: fixed;
  border-radius: 14px;
  box-shadow:
    0 0 0 9999px rgba(3, 5, 10, 0.78),
    0 0 0 2px var(--accent-bright),
    0 0 28px rgba(245, 158, 11, 0.45);
  pointer-events: none;
  transition: top 0.24s cubic-bezier(0.22, 1, 0.36, 1),
              left 0.24s cubic-bezier(0.22, 1, 0.36, 1),
              width 0.24s cubic-bezier(0.22, 1, 0.36, 1),
              height 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}
.tour-card {
  position: fixed;
  width: min(360px, calc(100vw - 24px));
  background: linear-gradient(180deg, #141c2f 0%, #0c111e 100%);
  border: 1px solid rgba(245, 158, 11, 0.42);
  border-radius: 18px;
  padding: 18px 18px 15px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.72), 0 0 36px rgba(245, 158, 11, 0.14);
  z-index: 252;
  animation: dialogPop 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.tour-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.tour-step-pill {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-bright);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 3px 9px;
  border-radius: 999px;
}
.tour-close-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.tour-close-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.tour-close-btn svg { width: 16px; height: 16px; }
.tour-title {
  margin: 0 0 6px 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}
.tour-body {
  margin: 0 0 16px 0;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-soft);
}
.tour-body strong { color: var(--text); }
.tour-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.tour-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tour-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.3);
  transition: all 0.2s ease;
}
.tour-dot.active {
  width: 18px;
  background: var(--accent-bright);
}
.tour-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}
@media (max-width: 760px) {
  .tour-btn-label { display: none; }
}

@media (max-width: 640px) {
  .top-nav-inner { padding: 10px 14px; }
  .main-wrap { padding: 14px 14px 48px; }
  .hero-content { padding: 22px 20px; }
  .hero-banner { min-height: 290px; }
  .user-chip .user-name-text { display: none; }
}
