:root {
  --bg: #08090d;
  --bg-elevated: #11131b;
  --bg-card: #161924;
  --bg-hover: #1e2230;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f3f4f8;
  --text-muted: #9ca3b5;
  --primary: #e50914;
  --primary-hover: #ff1e29;
  --vip: #f59e0b;
  --vip-light: #fcd34d;
  --free: #10b981;
  --danger: #ef4444;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
  --font-main: 'Kantumruy Pro', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

.hidden {
  display: none !important;
}

/* ================= NAVBAR ================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 9, 13, 0.84);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #ff4b2b);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  box-shadow: 0 6px 20px rgba(229, 9, 20, 0.4);
}

.brand-icon.large {
  width: 52px;
  height: 52px;
  font-size: 22px;
  margin: 0 auto 12px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-text strong {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.brand-text small {
  font-size: 11px;
  color: var(--vip-light);
  font-weight: 500;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.nav-vip-link {
  color: var(--vip-light);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  font-size: 13px;
  opacity: 0.7;
  pointer-events: none;
}

.search-box input {
  width: 240px;
  padding: 9px 14px 9px 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.search-box input:focus {
  border-color: var(--primary);
  width: 280px;
  background: var(--bg-card);
}

.auth-nav-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.2s;
}

.user-pill:hover {
  border-color: var(--border-strong);
}

.avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mobile-menu-btn {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 18px;
  cursor: pointer;
}

/* ================= BUTTONS & BADGES ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
}

.btn-lg {
  padding: 13px 26px;
  font-size: 15px;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 22px rgba(229, 9, 20, 0.32);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-vip {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #111;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(245, 158, 11, 0.3);
}

.btn-vip:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.28);
}

.btn-google {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #ffffff;
  color: #111827;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}

.btn-google:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(255, 255, 255, 0.15);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.badge-vip {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #11131b;
}

.badge-free {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-admin {
  background: rgba(229, 9, 20, 0.22);
  color: #fca5a5;
  border: 1px solid rgba(229, 9, 20, 0.4);
}

.badge-google {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

/* ================= MAIN & HERO ================= */
.app-root {
  min-height: calc(100vh - 150px);
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

.hero-slider {
  position: relative;
  width: 100%;
  height: 520px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.hero.hero-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  min-height: 520px;
  border-bottom: none;
}

.hero-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(8, 9, 13, 0.58);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.hero-nav-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.hero-nav-btn.prev { left: 18px; }
.hero-nav-btn.next { right: 18px; }

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  gap: 8px;
}

.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: all 0.25s;
}

.hero-dot.active {
  width: 28px;
  background: var(--primary);
}

.hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 9, 13, 0.62) 0%, rgba(8, 9, 13, 0.18) 42%, rgba(8, 9, 13, 0) 75%),
    linear-gradient(0deg, rgba(8, 9, 13, 0.85) 0%, rgba(8, 9, 13, 0.1) 36%, rgba(8, 9, 13, 0) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 60px 24px 52px;
}

.hero-inner {
  max-width: 650px;
}

.hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-muted);
}

.hero h1 {
  font-size: clamp(28px, 4.4vw, 48px);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 14px;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.85);
}

.hero p {
  color: #e5e7f0;
  font-size: 15px;
  margin-bottom: 24px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ================= SECTIONS & MOVIE CARDS ================= */
.section {
  margin-bottom: 42px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-title {
  font-size: 21px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 22px;
  border-radius: 4px;
  background: var(--primary);
}

.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: 20px;
}

.movie-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: var(--shadow);
}

.poster-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #1a1e2e;
  overflow: hidden;
}

.poster-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.movie-card:hover .poster-wrap img {
  transform: scale(1.06);
}

.poster-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}

.ep-pill {
  background: rgba(8, 9, 13, 0.8);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.poster-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 9, 13, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.movie-card:hover .poster-play-overlay {
  opacity: 1;
}

.play-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 8px 25px rgba(229, 9, 20, 0.55);
}

.movie-info {
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.movie-title {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movie-sub {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* Continue Watching Cards */
.continue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: 18px;
}

.continue-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.continue-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
}

.continue-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #1a1e2e;
  overflow: hidden;
}

.continue-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.progress-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.22);
}

.progress-fill {
  height: 100%;
  background: var(--primary);
}

.continue-body {
  padding: 12px 14px;
}

.continue-body h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.continue-body p {
  font-size: 12px;
  color: var(--text-muted);
}

/* Category Pills */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.pill {
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.pill:hover, .pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ================= WATCH / PLAYER PAGE ================= */
.watch-layout {
  display: grid;
  grid-template-columns: 1fr 370px;
  gap: 24px;
  align-items: start;
}

.player-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.player-stage video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

.player-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 14px;
}

.player-controls-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.vip-lock-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(24, 20, 12, 0.92), rgba(8, 9, 13, 0.98));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px;
  gap: 14px;
  z-index: 5;
}

.vip-lock-icon {
  font-size: 46px;
}

.vip-lock-overlay h3 {
  font-size: 22px;
  color: var(--vip-light);
}

.vip-lock-overlay p {
  max-width: 440px;
  color: var(--text-muted);
  font-size: 14px;
}

.movie-detail-card {
  margin-top: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.movie-detail-header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.detail-poster {
  width: 220px;
  border-radius: 10px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  flex-shrink: 0;
}

.episodes-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  max-height: 760px;
  display: flex;
  flex-direction: column;
}

.season-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 14px;
}

.episode-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
}

.episode-row-wrap {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.episode-row-wrap .episode-item {
  flex: 1;
  min-width: 0;
}

.ep-edit-icon-btn {
  width: 38px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.ep-edit-icon-btn:hover {
  border-color: var(--vip);
  background: rgba(245, 158, 11, 0.16);
}

.episode-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.episode-item:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.episode-item.active {
  border-color: var(--primary);
  background: rgba(229, 9, 20, 0.14);
}

.episode-num {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-muted);
  min-width: 58px;
}

.episode-title-wrap {
  flex: 1;
  min-width: 0;
}

.episode-title-wrap strong {
  display: block;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.episode-title-wrap small {
  color: var(--text-muted);
  font-size: 12px;
}

/* Admin Quick-Add Episode Shortcut */
.quick-add-bar {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-strong);
  display: flex;
  gap: 8px;
}

.quick-add-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 10px;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(229, 9, 20, 0.55);
  background: rgba(229, 9, 20, 0.1);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.quick-add-btn:hover {
  background: rgba(229, 9, 20, 0.22);
  border-color: var(--primary);
}

.quick-add-btn.secondary {
  flex: 0 0 auto;
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.1);
  color: var(--vip-light);
}

.quick-add-btn.secondary:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--vip);
}

.quick-add-btn .plus-icon {
  font-size: 15px;
  font-weight: 800;
}

.quick-add-form {
  margin-top: 12px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
}

.quick-add-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.quick-close-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 12px;
}

.quick-vip-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.quick-vip-opt {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
}

.quick-vip-opt.active-free {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--free);
  color: #34d399;
}

.quick-vip-opt.active-vip {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-color: var(--vip);
  color: #111;
}

/* ================= CARDS, FORMS, MODALS ================= */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: left;
}

.stat-card.clickable {
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.stat-card.clickable:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.stat-card.stat-vip {
  border-color: rgba(245, 158, 11, 0.35);
}

.stat-card.stat-vip:hover {
  border-color: var(--vip);
}

.vip-days-editor {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.vip-days-input {
  width: 68px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.vip-nav-countdown {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.vip-countdown-box {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--vip-light);
  font-variant-numeric: tabular-nums;
  font-size: 13.5px;
}

.vip-countdown-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.32);
  color: var(--vip-light);
  font-weight: 700;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stat-card span {
  font-size: 13px;
  color: var(--text-muted);
}

.stat-card strong {
  display: block;
  font-size: 28px;
  margin-top: 6px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: #cbd5e1;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 14px;
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
}

.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 10px 0 16px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

/* ================= MODAL ================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  cursor: pointer;
  font-size: 15px;
}

.auth-header {
  text-align: center;
  margin-bottom: 20px;
}

.auth-header h2 {
  font-size: 22px;
  margin-bottom: 4px;
}

.auth-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--text-muted);
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.auth-tab {
  padding: 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}

.auth-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
}

.alert-error {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fecaca;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde68a;
}

.oauth-guide {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-size: 12.5px;
  line-height: 1.65;
}

.oauth-guide code {
  display: inline-block;
  background: rgba(0, 0, 0, 0.45);
  padding: 2px 6px;
  border-radius: 5px;
  color: #fde68a;
  font-family: monospace;
  word-break: break-all;
}

/* ================= ADMIN TABLES ================= */
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

th, td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.code-chip {
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.14);
  color: var(--vip-light);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ================= VIP PLANS & KHQR MODAL ================= */
.vip-plans-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.vip-plan-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.2s, border-color 0.2s;
}

.vip-plan-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
}

.vip-plan-card.featured {
  border-color: rgba(245, 158, 11, 0.55);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08), var(--bg-elevated));
}

.vip-plan-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.vip-plan-days {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.vip-plan-price {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}

.vip-plan-price span {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.vip-plan-desc {
  font-size: 13.5px;
  color: var(--text-muted);
}

.vip-plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 6px 0 12px;
  font-size: 13px;
  color: #cbd5e1;
  flex: 1;
}

.vip-plan-features li::before {
  content: '✓ ';
  color: var(--free);
  font-weight: 700;
}

.khqr-modal-card {
  max-width: 420px;
  padding: 0;
  overflow: hidden;
}

.khqr-modal-card .modal-close {
  color: #fff;
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.25);
}

.khqr-header {
  background: linear-gradient(135deg, #c8102e, #e50914);
  padding: 18px 22px;
  color: #fff;
}

.khqr-brand {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
}

.khqr-subtitle {
  font-size: 12px;
  opacity: 0.9;
}

.khqr-body {
  padding: 20px 22px 24px;
}

.khqr-merchant-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.khqr-merchant-name {
  font-weight: 700;
  font-size: 15px;
}

.khqr-plan-label {
  font-size: 12.5px;
  color: var(--text-muted);
}

.khqr-price {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--vip-light);
}

.khqr-qr-box {
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.khqr-qr-box img {
  width: 240px;
  height: 240px;
  display: block;
}

.khqr-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-align: center;
}

.khqr-status {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  text-align: center;
  margin-bottom: 14px;
}

.khqr-status.pending {
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}

.khqr-status.paid {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
  font-weight: 600;
}

.khqr-status.expired {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

@media (max-width: 820px) {
  .vip-plans-grid {
    grid-template-columns: 1fr;
  }
}

/* ================= TOAST & LOADING ================= */
.loading-screen {
  min-height: 55vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-muted);
}

.spinner {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--primary);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-size: 13.5px;
  max-width: 360px;
}

.toast.success { border-left-color: var(--free); }
.toast.warning { border-left-color: var(--vip); }
.toast.error { border-left-color: var(--danger); }

.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 28px 24px;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-brand p, .footer-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-meta {
  display: flex;
  gap: 10px;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 1024px) {
  .watch-layout {
    grid-template-columns: 1fr;
  }
  .episodes-panel {
    max-height: none;
  }
}

@media (max-width: 820px) {
  .nav-container {
    padding: 10px 14px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .nav-left {
    gap: 10px;
    flex: 0 0 auto;
  }
  .brand {
    gap: 7px;
  }
  .brand-icon {
    width: 32px;
    height: 32px;
    font-size: 13px;
    border-radius: 8px;
  }
  .brand-text strong {
    font-size: 16px;
  }
  .brand-text small {
    font-size: 10px;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    flex-direction: column;
    align-items: stretch;
    z-index: 120;
    box-shadow: var(--shadow);
  }
  .nav-links.open {
    display: flex;
  }
  .nav-right {
    display: contents;
  }
  .auth-nav-area {
    margin-left: auto;
    gap: 6px;
    order: 2;
  }
  #logoutNavBtn {
    display: none;
  }
  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    font-size: 16px;
    flex-shrink: 0;
    order: 3;
  }
  .search-box {
    order: 4;
    flex: 0 0 100%;
    width: 100%;
  }
  .search-box input,
  .search-box input:focus {
    width: 100%;
    padding: 8px 12px 8px 34px;
    font-size: 13px;
  }
  .search-icon {
    left: 11px;
  }
  .auth-nav-area .btn-sm {
    padding: 7px 12px;
    font-size: 12px;
    white-space: nowrap;
  }
  .user-pill {
    padding: 3px 8px 3px 4px;
    gap: 6px;
    max-width: 210px;
  }
  .user-pill .vip-nav-countdown {
    font-size: 10px;
    padding: 2px 6px;
  }
  .avatar-circle {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }

  /* Mobile Hero Slider (clean 16:9 feel, no cropping) */
  .hero-slider,
  .hero.hero-slide,
  .hero {
    height: 290px;
    min-height: 290px;
  }
  .hero-content {
    padding: 20px 16px 34px;
  }
  .hero-meta {
    gap: 6px;
    font-size: 11.5px;
    margin-bottom: 8px;
  }
  .hero h1 {
    font-size: 22px;
    margin-bottom: 8px;
  }
  .hero p {
    display: none;
  }
  .hero-actions {
    gap: 8px;
  }
  .hero-actions .btn-lg {
    padding: 9px 15px;
    font-size: 13px;
  }
  .hero-nav-btn {
    width: 32px;
    height: 32px;
    font-size: 20px;
  }
  .hero-nav-btn.prev { left: 8px; }
  .hero-nav-btn.next { right: 8px; }
  .hero-dots {
    bottom: 10px;
  }

  /* Mobile Container & Sections */
  .container {
    padding: 18px 14px 48px;
  }
  .section {
    margin-bottom: 28px;
  }
  .section-header {
    gap: 10px;
    margin-bottom: 12px;
  }
  .section-title {
    font-size: 16.5px;
  }
  .section-header .btn-sm {
    white-space: nowrap;
    padding: 6px 10px;
    font-size: 12px;
  }

  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
  .movie-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .movie-info {
    padding: 9px 10px;
  }
  .movie-title {
    font-size: 13px;
  }
  .movie-sub {
    font-size: 11px;
  }
  .poster-badges {
    top: 6px;
    left: 6px;
    right: 6px;
  }
  .poster-badges .badge,
  .poster-badges .ep-pill {
    font-size: 9.5px;
    padding: 2px 6px;
  }

  /* Mobile Watch Page — hide redundant thumbnail under player */
  .watch-layout {
    gap: 16px;
  }
  .player-toolbar {
    padding: 12px 14px;
    gap: 10px;
    margin-top: 10px;
  }
  .player-controls-group {
    width: 100%;
    justify-content: space-between;
  }
  .player-controls-group .btn-sm {
    padding: 6px 10px;
    font-size: 12px;
  }
  .movie-detail-card {
    margin-top: 14px;
    padding: 16px;
  }
  .detail-poster {
    display: none;
  }
  .movie-detail-card h1 {
    font-size: 19px !important;
  }
  .episodes-panel {
    padding: 14px;
  }

  /* Safe bottom padding above mobile Safari/Chrome bar */
  .footer {
    padding: 22px 16px 72px;
  }
}
