:root {
  --bg:        #070d1a;
  --surface:   #0f1825;
  --surface2:  #172030;
  --border:    #1e2d45;
  --accent:    #0ea5e9;
  --accent2:   #38bdf8;
  --success:   #10b981;
  --warning:   #f59e0b;
  --danger:    #ef4444;
  --text:      #f1f5f9;
  --muted:     #64748b;
  --subtle:    #94a3b8;
  --font-head: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius:    12px;
  --radius-sm: 8px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── PORTAL HOMEPAGE ─────────────────────────────── */
#portalView { display: flex; flex-direction: column; min-height: 100vh; }

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0 24px 60px;
}

@media (max-width: 520px) {
  .hero { min-height: auto; padding: 80px 16px 32px; }
  .hero-stats { display: none; }
  .scroll-hint { display: none; }
  .how-section { display: none; }
  .hero-badge { font-size: 10px; padding: 4px 12px; margin-bottom: 16px; }
  .hero-headline { font-size: 26px; margin-bottom: 12px; }
  .hero-sub { font-size: 13px; margin-bottom: 24px; }
  .hero-cta { gap: 10px; }
  .btn-hero, .btn-hero-ghost { padding: 12px 24px; font-size: 14px; }
  .packages-section { padding: 24px 12px; }
  .section-headline { font-size: 20px; margin-bottom: 8px; }
  .section-sub { font-size: 12px; margin-bottom: 24px; }
  .packages-row { grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
  .pkg-big { padding: 16px 12px; border-radius: 12px; width: 100%; min-width: 0; }
  .pkg-big-icon { font-size: 20px; margin-bottom: 8px; }
  .pkg-big-name { font-size: 14px; margin-bottom: 4px; }
  .pkg-big-price { font-size: 20px; margin-bottom: 2px; }
  .pkg-big-duration { font-size: 11px; margin-bottom: 12px; }
  .pkg-big-features { display: none; }
  .pkg-popular-badge { font-size: 8px; padding: 2px 8px; }
  .checkSection { padding: 24px 12px; }
  .pay-section { padding: 24px 12px; }
  .pay-title { font-size: 18px; }
  .pay-sub { font-size: 12px; margin-bottom: 16px; }
  .pay-selected-pkg { padding: 12px 14px; margin-bottom: 14px; }
  .field input { padding: 12px 14px; font-size: 15px; }
  .btn-primary { padding: 14px; font-size: 15px; }
  .portal-footer { font-size: 11px; padding: 16px; }
  .session-timer { font-size: 36px; }
  .session-meta { grid-template-columns: 1fr 1fr; gap: 8px; }
  .session-meta-item { padding: 10px; }
  .session-meta-label { font-size: 10px; }
  .session-meta-value { font-size: 13px; }
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('https://images.unsplash.com/photo-1544197150-b99a580bb7a8?w=1600&q=80&auto=format&fit=crop');
  background-size: cover;
  background-position: center;
  filter: brightness(0.22) saturate(1.2);
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(7,13,26,0.3) 0%,
    rgba(7,13,26,0.1) 40%,
    rgba(7,13,26,0.7) 80%,
    rgba(7,13,26,1) 100%
  );
  z-index: 1;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(14,165,233,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14,165,233,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  text-align: center;
  max-width: 760px;
  padding-top: 80px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(14,165,233,0.12);
  border: 1px solid rgba(14,165,233,0.3);
  border-radius: 100px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent2);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.hero-badge-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

.hero-headline {
  font-family: var(--font-head);
  font-size: clamp(42px, 7vw, 80px);
  font-weight: 800;
  color: #fff;
  line-height: 1.05;
  letter-spacing: -2px;
  margin-bottom: 24px;
}

.hero-headline span {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--subtle);
  line-height: 1.6;
  margin-bottom: 48px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-bottom: 56px;
  flex-wrap: wrap;
}

.hero-stat { text-align: center; }
.hero-stat-value {
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  margin-bottom: 4px;
}
.hero-stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-hero {
  background: linear-gradient(135deg, var(--accent), #0284c7);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 16px 36px;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-head);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  letter-spacing: 0.2px;
}
.btn-hero:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-hero-ghost {
  background: rgba(255,255,255,0.06);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 16px 36px;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-head);
  cursor: pointer;
  transition: background 0.15s;
}
.btn-hero-ghost:hover { background: rgba(255,255,255,0.1); }

/* scroll indicator */
.scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  animation: bounce 2s ease-in-out infinite;
}
.scroll-hint svg { width: 16px; height: 16px; stroke: var(--muted); }
@keyframes bounce { 0%,100%{transform:translateX(-50%) translateY(0)} 50%{transform:translateX(-50%) translateY(6px)} }

/* ── PACKAGES SECTION ────────────────────────────── */
.packages-section {
  background: var(--bg);
  padding: 80px 24px;
}

.section-eyebrow {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.section-headline {
  font-family: var(--font-head);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  color: var(--text);
  text-align: center;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.section-sub {
  text-align: center;
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 56px;
}

.packages-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
  align-items: stretch;
}

.pkg-big {
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
}

.pkg-big-features {
  flex: 1;
}

.pkg-big {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 32px 24px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.pkg-big::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0;
  transition: opacity 0.2s;
}

.pkg-big:hover, .pkg-big.selected {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(14,165,233,0.12);
}

.pkg-big:hover::before, .pkg-big.selected::before { opacity: 1; }

.pkg-big.selected { background: rgba(14,165,233,0.06); }

.pkg-big.popular {
  border-color: var(--accent);
}

.pkg-popular-badge {
  position: absolute;
  top: 16px; right: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 100px;
  padding: 3px 10px;
}

.pkg-big-icon { font-size: 28px; margin-bottom: 16px; }

.pkg-big-name {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.pkg-big-price {
  font-family: var(--font-head);
  font-size: 36px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}
.pkg-big-price sub { font-size: 14px; font-weight: 500; color: var(--muted); }

.pkg-big-duration {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}

.pkg-big-features { list-style: none; display: flex; flex-direction: column; gap: 8px; }

.pkg-big-features li {
  font-size: 13px;
  color: var(--subtle);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pkg-big-features li::before {
  content: '';
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}

.pkg-selected-check {
  position: absolute;
  bottom: 16px; right: 16px;
  width: 24px; height: 24px;
  background: var(--accent);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
}

.pkg-big.selected .pkg-selected-check { display: flex; }

/* ── PAYMENT FORM SECTION ───────────────────────── */
.pay-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 64px 24px;
}

.pay-inner {
  max-width: 480px;
  margin: 0 auto;
}

.pay-title {
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.pay-sub {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 32px;
  line-height: 1.6;
}

.pay-selected-pkg {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pay-selected-pkg-name { font-weight: 600; color: var(--text); font-size: 15px; }
.pay-selected-pkg-price { font-family: var(--font-head); font-size: 18px; font-weight: 700; color: var(--accent); }

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--subtle);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.field input {
  width: 100%;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 16px;
  color: var(--text);
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.15s;
}
.field input:focus { border-color: var(--accent); }
.field input::placeholder { color: var(--muted); }

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), #0284c7);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-head);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  letter-spacing: 0.2px;
  margin-top: 8px;
}
.btn-primary:hover { opacity: 0.92; }
.btn-primary:active { transform: scale(0.99); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.progress-wrap { margin-bottom: 16px; display: none; }
.progress-wrap.show { display: block; }
.progress-bar-track { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin-bottom: 10px; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 2px; transition: width 0.4s ease; }
.progress-status { font-size: 13px; color: var(--subtle); display: flex; align-items: center; gap: 8px; }
.spinner { width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.6;transform:scale(0.85)} }

/* ── HOW IT WORKS ───────────────────────────────── */
.how-section {
  padding: 80px 24px;
  background: var(--bg);
}

.how-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  max-width: 900px;
  margin: 0 auto;
}

.how-step {
  text-align: center;
  padding: 32px 24px;
}

.how-step-num {
  width: 52px; height: 52px;
  background: rgba(14,165,233,0.1);
  border: 1.5px solid rgba(14,165,233,0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
  color: var(--accent);
  margin: 0 auto 20px;
}

.how-step-title {
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.how-step-desc { font-size: 14px; color: var(--muted); line-height: 1.6; }

/* ── SESSION ACTIVE ─────────────────────────────── */
.session-active { display: none; text-align: center; }
.session-active.show { display: block; }

.session-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: 100px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--success);
  margin-bottom: 24px;
}
.session-dot { width: 8px; height: 8px; background: var(--success); border-radius: 50%; animation: pulse 2s ease-in-out infinite; }
.session-timer { font-family: var(--font-mono); font-size: 52px; font-weight: 500; color: var(--text); letter-spacing: -1px; margin-bottom: 8px; line-height: 1; }
.session-expires { font-size: 13px; color: var(--muted); margin-bottom: 28px; }
.session-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; text-align: left; }
.session-meta-item { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; }
.session-meta-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.session-meta-value { font-size: 14px; font-weight: 600; color: var(--text); font-family: var(--font-mono); }

/* ── PORTAL FOOTER ──────────────────────────────── */
.portal-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.portal-footer a {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}

/* ── ADMIN ──────────────────────────────────────── */
.admin-wrap { display: none; }
.admin-wrap.show { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar-logo-text .brand { font-family: var(--font-head); font-size: 15px; font-weight: 700; color: var(--text); }
.sidebar-logo-text .role { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0 8px;
  margin: 16px 0 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--subtle);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  margin-bottom: 2px;
  font-weight: 500;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: rgba(14,165,233,0.12); color: var(--accent); }
.nav-item .icon { font-size: 16px; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 100px;
  padding: 2px 7px;
}

.sidebar-footer { padding: 16px 12px; border-top: 1px solid var(--border); }

.admin-content { flex: 1; margin-left: 240px; display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title { font-family: var(--font-head); font-size: 18px; font-weight: 600; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 16px; }

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--success);
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: 100px;
  padding: 5px 12px;
}

.status-dot { width: 6px; height: 6px; background: var(--success); border-radius: 50%; animation: pulse 2s ease-in-out infinite; }

.page { padding: 32px; display: none; }
.page.active { display: block; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.stat-card::before { content:''; position:absolute; top:0;left:0;right:0; height:2px; background:linear-gradient(90deg,var(--accent),transparent); }
.stat-icon { font-size: 20px; margin-bottom: 12px; }
.stat-value { font-family: var(--font-head); font-size: 28px; font-weight: 700; color: var(--text); line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat-change { font-size: 11px; color: var(--success); margin-top: 6px; font-weight: 500; }

.section-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }

.section-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title { font-family: var(--font-head); font-size: 15px; font-weight: 600; color: var(--text); }
.section-count { font-size: 12px; color: var(--muted); background: var(--surface2); border: 1px solid var(--border); border-radius: 100px; padding: 3px 10px; }

table { width: 100%; border-collapse: collapse; }
th { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; padding: 10px 20px; text-align: left; background: var(--surface2); border-bottom: 1px solid var(--border); }
td { padding: 13px 20px; font-size: 13px; color: var(--subtle); border-bottom: 1px solid rgba(30,45,69,0.5); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(14,165,233,0.03); }

.badge { display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:600; border-radius:100px; padding:3px 10px; text-transform:uppercase; letter-spacing:0.3px; }
.badge-success { background:rgba(16,185,129,0.12); color:var(--success); }
.badge-warning { background:rgba(245,158,11,0.12); color:var(--warning); }
.badge-danger  { background:rgba(239,68,68,0.12); color:var(--danger); }
.badge-info    { background:rgba(14,165,233,0.12); color:var(--accent); }
.badge-muted   { background:rgba(100,116,139,0.15); color:var(--muted); }

.mono { font-family: var(--font-mono); font-size: 12px; }

.action-btn { background: var(--surface2); border: 1px solid var(--border); color: var(--subtle); border-radius: 6px; padding: 5px 10px; font-size: 12px; cursor: pointer; transition: border-color 0.12s, color 0.12s; font-family: var(--font-body); }
.action-btn:hover { border-color: var(--accent); color: var(--accent); }
.action-btn.danger:hover { border-color: var(--danger); color: var(--danger); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ── DEVICES PAGE: paid vs unpaid tabs ───────────── */
.tab-bar {
  display: flex;
  gap: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  width: fit-content;
}

.tab-btn {
  padding: 7px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tab-btn.active { background: var(--surface); color: var(--text); }

.device-status-paid   { color: var(--success); }
.device-status-unpaid { color: var(--warning); }

/* ── MODAL ──────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7,13,26,0.85);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  display: none;
}
.modal-overlay.show { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
  width: 100%;
  max-width: 480px;
  position: relative;
  box-shadow: 0 32px 64px rgba(0,0,0,0.5);
}

.modal-title {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.modal-sub { font-size: 13px; color: var(--muted); margin-bottom: 28px; }

.modal-close {
  position: absolute;
  top: 20px; right: 20px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: color 0.12s;
}
.modal-close:hover { color: var(--text); }

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

.modal-actions { display: flex; gap: 12px; margin-top: 24px; }
.modal-actions .btn-primary { flex: 1; margin-top: 0; }
.btn-cancel { flex: 1; background: var(--surface2); color: var(--subtle); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; font-size: 15px; font-weight: 600; font-family: var(--font-head); cursor: pointer; }
.btn-cancel:hover { border-color: var(--muted); color: var(--text); }

/* ── LOGIN ──────────────────────────────────────── */
.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 32px 64px rgba(0,0,0,0.4);
}

.login-title { font-family: var(--font-head); font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.login-sub { font-size: 13px; color: var(--muted); margin-bottom: 32px; }

.error-msg { background:rgba(239,68,68,0.1); border:1px solid rgba(239,68,68,0.25); border-radius:var(--radius-sm); padding:10px 14px; font-size:13px; color:var(--danger); margin-bottom:16px; display:none; }
.error-msg.show { display: block; }

.alert-item { display:flex; align-items:flex-start; gap:12px; padding:14px 20px; border-bottom:1px solid rgba(30,45,69,0.5); }
.alert-item:last-child { border-bottom:none; }
.alert-dot { width:8px; height:8px; border-radius:50%; margin-top:5px; flex-shrink:0; }
.alert-dot.critical { background:var(--danger); }
.alert-dot.warning  { background:var(--warning); }
.alert-dot.info     { background:var(--accent); }
.alert-body { flex:1; }
.alert-title { font-size:13px; font-weight:500; color:var(--text); margin-bottom:2px; }
.alert-meta  { font-size:11px; color:var(--muted); }

/* ── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 1024px) {
  .packages-row { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .packages-row { grid-template-columns: 1fr 1fr; }
  .how-steps { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .admin-content { margin-left: 0; }
  .topbar { padding: 0 16px; }
  .page { padding: 16px; }
  .hero-stats { gap: 32px; }
  .modal-grid { grid-template-columns: 1fr; }
  .hero-headline { font-size: 36px; letter-spacing: -1px; }
  .hero-content { padding-top: 60px; }
  .hero-sub { font-size: 15px; }
  .section-headline { font-size: 26px; }
  .pay-section { padding: 40px 16px; }
  .packages-section { padding: 48px 16px; }
  .how-section { padding: 48px 16px; }
  .pkg-big { padding: 24px 16px; }
  .pkg-big-price { font-size: 28px; }
  table { font-size: 12px; }
  th, td { padding: 10px 12px; }
  .topbar-title { font-size: 15px; }
  .stat-value { font-size: 22px; }
  .modal { padding: 24px 20px; }
}

@media (max-width: 520px) {
  .hero { min-height: auto; padding: 80px 16px 32px; }
  .hero-stats { display: none; }
  .scroll-hint { display: none; }
  .how-section { display: none; }
  .hero-badge { font-size: 10px; padding: 4px 12px; margin-bottom: 16px; }
  .hero-headline { font-size: 26px; margin-bottom: 12px; letter-spacing: -1px; }
  .hero-sub { font-size: 13px; margin-bottom: 24px; }
  .hero-cta { flex-direction: column; align-items: center; gap: 10px; }
  .btn-hero, .btn-hero-ghost { padding: 12px 24px; font-size: 14px; }
  .packages-section { padding: 24px 12px; }
  .section-headline { font-size: 20px; margin-bottom: 8px; }
  .section-sub { font-size: 12px; margin-bottom: 24px; }
  .packages-row { grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
  .pkg-big { padding: 14px 10px; border-radius: 10px; width: 100%; min-width: 0; }
  .pkg-big-icon { font-size: 18px; margin-bottom: 6px; }
  .pkg-big-name { font-size: 13px; margin-bottom: 4px; }
  .pkg-big-price { font-size: 18px; margin-bottom: 2px; }
  .pkg-big-price sub { font-size: 10px; }
  .pkg-big-duration { font-size: 10px; margin-bottom: 0; }
  .pkg-big-features { display: none; }
  .pkg-popular-badge { font-size: 8px; padding: 2px 6px; }
  .pay-section { padding: 24px 12px; }
  .pay-title { font-size: 18px; }
  .pay-sub { font-size: 12px; margin-bottom: 16px; }
  .pay-selected-pkg { padding: 12px 14px; margin-bottom: 14px; }
  .field input { padding: 12px 14px; font-size: 15px; }
  .btn-primary { padding: 14px; font-size: 15px; }
  .portal-footer { font-size: 11px; padding: 16px; }
  .session-timer { font-size: 36px; }
  .session-meta { grid-template-columns: 1fr 1fr; gap: 8px; }
  .session-meta-item { padding: 10px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 20px; }
  .stat-label { font-size: 11px; }
  .tab-bar { flex-wrap: wrap; }
  .tab-btn { font-size: 11px; padding: 6px 12px; }
  th { font-size: 10px; padding: 8px 10px; }
  td { padding: 10px; font-size: 12px; }
  .action-btn { font-size: 11px; padding: 4px 8px; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .topbar { height: 52px; }
  .topbar-title { font-size: 14px; }
  #topbarTime { display: none; }
}
