@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@500;600;700;800&display=swap');

:root {
  --primary-color: #6366f1;
  --primary-dark: #4f46e5;
  --accent-color: #38bdf8;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --border-radius: 14px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.35);
  --glow: 0 0 40px rgba(99, 102, 241, 0.15);
}

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-primary, linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%));
  background-attachment: fixed;
  color: var(--text-primary, #f8fafc);
  min-height: 100vh;
  line-height: 1.55;
}

.hidden { display: none !important; }

a { color: inherit; }

/* ── Header ── */
.header {
  background: var(--header-bg, rgba(15, 23, 42, 0.88));
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-content {
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0.85rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.logo {
  font-family: 'Poppins', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  letter-spacing: -0.02em;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1, #38bdf8);
  color: #fff;
  font-size: 0.95rem;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.logo-text {
  background: linear-gradient(135deg, #f8fafc, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary, #cbd5e1);
}

.user-pill i { color: #818cf8; font-size: 0.75rem; }

/* ── Layout ── */
.main-content {
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 1.5rem;
}

.page-hero {
  margin-bottom: 1.25rem;
}

.page-hero h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.page-hero p {
  color: var(--text-secondary, #94a3b8);
  font-size: 0.9375rem;
}

/* ── Cards ── */
.card {
  background: var(--card-bg, rgba(15, 23, 42, 0.82));
  border: 1px solid var(--card-border, rgba(148, 163, 184, 0.14));
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg), var(--glow);
  padding: 1.35rem;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #38bdf8, #818cf8);
  opacity: 0.85;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.1rem;
  gap: 1rem;
}

.card-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text-primary, #f8fafc);
}

.card-title i {
  color: #818cf8;
  font-size: 0.95rem;
}

.card-subtitle {
  color: var(--text-secondary, #94a3b8);
  font-size: 0.875rem;
  margin: -0.5rem 0 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}

.card-subtitle i {
  margin-top: 0.15rem;
  color: #64748b;
  flex-shrink: 0;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.62rem 1.1rem;
  border: none;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--btn-primary, linear-gradient(135deg, #6366f1 0%, #4f46e5 100%));
  color: #fff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover { box-shadow: 0 6px 22px rgba(99, 102, 241, 0.45); }

.btn-outline {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: var(--text-primary, #f8fafc);
}

.btn-outline:hover {
  border-color: rgba(129, 140, 248, 0.5);
  background: rgba(99, 102, 241, 0.08);
}

.btn-danger {
  background: var(--btn-danger, linear-gradient(135deg, #ef4444, #dc2626));
  color: #fff;
}

.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8125rem; border-radius: 8px; }
.btn-block { width: 100%; }

/* ── Forms ── */
.form-group { margin-bottom: 1.1rem; }

.form-group label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary, #cbd5e1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group label i { color: #818cf8; font-size: 0.75rem; }

.input-wrap {
  position: relative;
}

.input-wrap > i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 0.875rem;
  pointer-events: none;
}

.input-wrap .form-input { padding-left: 2.5rem; }

.form-input {
  width: 100%;
  padding: 0.72rem 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  background: var(--input-bg, rgba(2, 6, 23, 0.45));
  color: var(--text-primary, #f8fafc);
  font-size: 0.9375rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-input::placeholder { color: #64748b; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
  font-size: 0.875rem;
  color: var(--text-secondary, #cbd5e1);
  cursor: pointer;
}

.checkbox-row input { accent-color: #6366f1; width: 16px; height: 16px; }

/* ── Tabs ── */
.tabs-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  padding: 0.35rem;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.1);
  width: fit-content;
}

.tab-btn {
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-secondary, #94a3b8);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: background 0.15s, color 0.15s;
}

.tab-btn:hover { color: var(--text-primary, #f8fafc); }

.tab-btn.active {
  background: var(--tab-active, linear-gradient(135deg, #6366f1, #4f46e5));
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.tab-panel { display: none; animation: fadeIn 0.25s ease; }
.tab-panel.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.data-table tbody tr:hover {
  background: rgba(99, 102, 241, 0.04);
}

.data-table th {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-secondary, #64748b);
  background: rgba(2, 6, 23, 0.35);
}

.data-table th i { margin-right: 0.35rem; color: #6366f1; }

.cell-with-icon {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.cell-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-muted {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.badge-live {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-live .pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ── Status messages ── */
.status-message {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.status-message.error {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-message.success {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--text-secondary, #94a3b8);
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.1);
  border: 1px dashed rgba(129, 140, 248, 0.3);
  color: #818cf8;
  font-size: 1.5rem;
}

.empty-state h3 {
  font-family: 'Poppins', sans-serif;
  color: var(--text-primary, #e2e8f0);
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.empty-state p { font-size: 0.875rem; max-width: 320px; margin: 0 auto; }

/* ── Modal ── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal.open { display: flex; animation: fadeIn 0.2s ease; }

.modal-content {
  width: 100%;
  max-width: 460px;
  background: var(--card-bg, #0f172a);
  border: 1px solid var(--card-border, rgba(148, 163, 184, 0.18));
  border-radius: var(--border-radius);
  padding: 1.35rem;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.1rem;
}

.modal-header h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-header h3 i { color: #818cf8; }

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.08);
  border: none;
  color: var(--text-secondary, #94a3b8);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.muted { color: var(--text-secondary, #94a3b8); }

/* ── Login pages ── */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  position: relative;
}

.login-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(56, 189, 248, 0.1), transparent);
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--card-bg, rgba(15, 23, 42, 0.92));
  border: 1px solid var(--card-border, rgba(148, 163, 184, 0.16));
  border-radius: 20px;
  padding: 2.25rem;
  box-shadow: var(--shadow-lg), var(--glow);
  position: relative;
  z-index: 1;
}

.login-brand {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-logo {
  display: block;
  width: min(220px, 70vw);
  height: auto;
  margin: 0 auto 0.75rem;
  object-fit: contain;
}

.header-logo {
  display: block;
  height: 44px;
  width: auto;
  max-width: min(180px, 50vw);
  object-fit: contain;
}

.login-brand-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1, #38bdf8);
  color: #fff;
  font-size: 1.4rem;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.login-brand h1 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.35rem;
}

.login-brand .subtitle {
  color: var(--text-secondary, #94a3b8);
  font-size: 0.9375rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-secondary, #94a3b8);
  text-decoration: none;
  transition: color 0.15s;
}

.back-link:hover { color: #818cf8; }

/* ── Home / landing ── */
.landing-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  position: relative;
}

.landing-wrap::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(99, 102, 241, 0.2), transparent),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(56, 189, 248, 0.12), transparent);
  pointer-events: none;
}

.landing-hero {
  text-align: center;
  max-width: 560px;
  margin-bottom: 2.5rem;
  position: relative;
  z-index: 1;
}

.landing-brand-logo {
  display: block;
  width: min(280px, 78vw);
  height: auto;
  margin: 0 auto 1.25rem;
  object-fit: contain;
}

.landing-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1 0%, #38bdf8 50%, #818cf8 100%);
  color: #fff;
  font-size: 2rem;
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.45);
}

.landing-hero h1 {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-hero p {
  color: var(--text-secondary, #94a3b8);
  font-size: clamp(0.9375rem, 1.5vw, 1.05rem);
}

.home-links {
  display: grid;
  gap: 1rem;
  width: 100%;
  max-width: 480px;
  position: relative;
  z-index: 1;
}

.home-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  border-radius: 16px;
  background: var(--card-bg, rgba(15, 23, 42, 0.85));
  border: 1px solid var(--card-border, rgba(148, 163, 184, 0.14));
  color: var(--text-primary, #f8fafc);
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow);
}

.home-link:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(99, 102, 241, 0.12);
}

.home-link-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.home-link-icon.admin {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(79, 70, 229, 0.15));
  color: #a5b4fc;
}

.home-link-icon.live {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(14, 165, 233, 0.15));
  color: #7dd3fc;
}

.home-link-text span {
  display: block;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-secondary, #94a3b8);
  margin-top: 0.15rem;
}

.home-link-arrow {
  margin-left: auto;
  color: #64748b;
  font-size: 0.875rem;
}

/* ── Video player ── */
.video-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.video-wrap video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.live-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(220, 38, 38, 0.92);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.live-badge .pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 1.5s infinite;
}

.loading-spinner {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary, #94a3b8);
}

.loading-spinner i { animation: spin 1s linear infinite; }

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

@media (max-width: 640px) {
  .header-content { padding: 0.75rem 1rem; }
  .main-content { padding: 1rem; }
  .tabs-nav { width: 100%; justify-content: center; }
  .landing-hero h1 { font-size: 2rem; }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — Mobile · Tablet · Laptop · Desktop · TV
   Breakpoints: 480 | 768 | 1024 | 1440 | 1920
   ═══════════════════════════════════════════════════════════ */

html {
  font-size: clamp(14px, 0.12vw + 13.5px, 16px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Full-width layout on all screens */
.header-content,
.main-content {
  max-width: 100%;
}

/* ── Mobile (≤479px) ── */
@media (max-width: 479px) {
  .header-content {
    flex-wrap: wrap;
    padding: 0.75rem max(1rem, env(safe-area-inset-left));
    gap: 0.65rem;
  }

  .user-info {
    width: 100%;
    justify-content: space-between;
  }

  .logo { font-size: 1.15rem; }
  .logo-icon { width: 32px; height: 32px; font-size: 0.85rem; }

  .page-hero h2 { font-size: 1.25rem; }
  .page-hero p { font-size: 0.875rem; }

  .tabs-nav {
    width: 100%;
    border-radius: 12px;
    flex-direction: column;
    gap: 0.35rem;
  }

  .tab-btn {
    width: 100%;
    justify-content: center;
    padding: 0.7rem 1rem;
    min-height: 44px;
  }

  .card { padding: 1rem; border-radius: 12px; }
  .card-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .card-header .btn { width: 100%; justify-content: center; min-height: 44px; }

  .btn { min-height: 44px; }
  .btn-sm { min-height: 40px; padding: 0.5rem 0.85rem; }

  .login-page { padding: 1rem; min-height: 100dvh; }
  .login-card { padding: 1.5rem; border-radius: 16px; max-width: 100%; }
  .login-brand h1 { font-size: 1.4rem; }
  .login-brand-icon { width: 48px; height: 48px; font-size: 1.2rem; }
  .login-logo { width: min(180px, 72vw); }
  .header-logo { height: 36px; }
  .landing-brand-logo { width: min(220px, 75vw); }

  .landing-wrap { padding: 1.25rem 1rem; min-height: 100dvh; }
  .landing-logo { width: 60px; height: 60px; font-size: 1.65rem; }
  .landing-hero h1 { font-size: 1.75rem; }
  .landing-hero p { font-size: 0.9375rem; }
  .home-link { padding: 1rem; }

  .modal { padding: 0; align-items: flex-end; }
  .modal-content {
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 92dvh;
    overflow-y: auto;
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
  }

  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; min-height: 44px; }

  /* Responsive data tables → stacked cards */
  .table-wrap { border: none; overflow: visible; }
  .data-table thead { display: none; }
  .data-table tbody tr {
    display: block;
    margin-bottom: 0.85rem;
    padding: 0.85rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(2, 6, 23, 0.25);
  }
  .data-table tbody tr:hover { background: rgba(99, 102, 241, 0.06); }
  .data-table td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.06);
    text-align: right;
  }
  .data-table td:last-child { border-bottom: none; padding-top: 0.65rem; }
  .data-table td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary, #64748b);
    text-align: left;
    flex-shrink: 0;
  }
  .data-table td.actions-cell {
    flex-direction: column;
    align-items: stretch;
  }
  .data-table td.actions-cell::before { margin-bottom: 0.25rem; }
  .data-table td.actions-cell .btn { width: 100%; justify-content: center; }
  .data-table td.url-cell {
    max-width: none;
    white-space: normal;
    word-break: break-all;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .video-wrap { border-radius: 10px; }
  .live-badge { top: 0.65rem; left: 0.65rem; font-size: 0.625rem; }
}

/* ── Mobile landscape / large phone (480–767px) ── */
@media (min-width: 480px) and (max-width: 767px) {
  .header-content { padding: 0.85rem 1.25rem; }
  .tabs-nav { width: 100%; flex-wrap: wrap; justify-content: stretch; }
  .tab-btn { flex: 1; min-width: 140px; justify-content: center; min-height: 44px; }
  .card-header { flex-wrap: wrap; gap: 0.75rem; }
  .login-card { max-width: 440px; }
  .home-links { max-width: 520px; }
}

/* ── Tablet (768–1023px) ── */
@media (min-width: 768px) and (max-width: 1023px) {
  .header-content,
  .main-content { max-width: 100%; padding-left: 1.5rem; padding-right: 1.5rem; }
  .tabs-nav { flex-wrap: nowrap; }
  .landing-hero { max-width: 640px; }
  .home-links { max-width: 560px; }
  .video-wrap { max-width: 100%; }
}

/* ── Laptop (1024–1439px) ── */
@media (min-width: 1024px) and (max-width: 1439px) {
  .header-content,
  .main-content { max-width: 100%; padding-left: 2rem; padding-right: 2rem; }
  .video-wrap { max-width: 100%; }
}

/* ── Desktop (1440–1919px) ── */
@media (min-width: 1440px) and (max-width: 1919px) {
  .header-content,
  .main-content { max-width: 100%; padding-left: 2.5rem; padding-right: 2.5rem; }
  .landing-hero { max-width: 680px; }
  .home-links { max-width: 560px; }
  .video-wrap { max-width: 100%; }
  .login-card { max-width: 460px; }
}

/* ── TV & ultra-wide (≥1920px) — full width ── */
@media (min-width: 1920px) {
  .header-content,
  .main-content { max-width: 100%; padding-left: 3rem; padding-right: 3rem; }

  .landing-hero { max-width: 720px; margin-bottom: 2.5rem; }
  .home-links { max-width: 560px; gap: 1.15rem; }

  .video-wrap {
    max-width: 100%;
    border-radius: 18px;
  }

  .data-table th,
  .data-table td { padding: 0.85rem 1rem; }
}

/* Touch devices — larger tap targets */
@media (hover: none) and (pointer: coarse) {
  .btn,
  .tab-btn,
  .home-link,
  .stream-card,
  .modal-close { -webkit-tap-highlight-color: transparent; }
  .btn { min-height: 44px; }
  .stream-card:active { transform: scale(0.98); }
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
