/* ============================================================
   KNOWLEDGE STAR — GLOBAL STYLESHEET
   Dark premium educational platform
   ============================================================ */

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

:root {
  --bg:         #070d1b;
  --bg2:        #0c1628;
  --bg3:        #111e35;
  --bg4:        #162440;
  --card:       #0d1a30;
  --card-h:     #132240;
  --border:     rgba(255,255,255,.07);
  --gold:       #f5a623;
  --gold-h:     #fbbf24;
  --blue:       #3b82f6;
  --blue-h:     #60a5fa;
  --green:      #10b981;
  --red:        #ef4444;
  --purple:     #8b5cf6;
  --text:       #e8edf5;
  --text2:      #94a3b8;
  --text3:      #64748b;
  --shadow:     0 4px 24px rgba(0,0,0,.4);
  --shadow-lg:  0 12px 48px rgba(0,0,0,.6);
  --radius:     12px;
  --radius-sm:  8px;
  --radius-lg:  20px;
  --trans:      all .2s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Noto Sans TC', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 15px;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
input, textarea, select, button { font-family: inherit; }

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

/* ─── TYPOGRAPHY ────────────────────────────────────────── */
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; line-height: 1.2; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
h4 { font-size: 1rem;   font-weight: 600; }

.text-gold   { color: var(--gold);  }
.text-blue   { color: var(--blue);  }
.text-green  { color: var(--green); }
.text-red    { color: var(--red);   }
.text-muted  { color: var(--text2); }
.text-center { text-align: center;  }

/* ─── BUTTONS ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 22px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .9rem; cursor: pointer;
  border: none; transition: var(--trans); white-space: nowrap;
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold), #e8910f);
  color: #0a0600;
  box-shadow: 0 4px 16px rgba(245,166,35,.3);
}
.btn-gold:hover { background: linear-gradient(135deg, var(--gold-h), var(--gold)); transform: translateY(-1px); box-shadow: 0 6px 24px rgba(245,166,35,.45); }
.btn-blue  { background: var(--blue); color: #fff; }
.btn-blue:hover  { background: var(--blue-h); transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--gold);
  border: 1.5px solid var(--gold);
}
.btn-outline:hover { background: var(--gold); color: #0a0600; }
.btn-ghost { background: rgba(255,255,255,.06); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: #059669; }
.btn-sm { padding: 6px 14px; font-size: .82rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }

/* ─── NAV ───────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(7,13,27,.92); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 clamp(16px, 4vw, 48px);
  height: 64px; display: flex; align-items: center;
}
.nav-inner {
  width: 100%; max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; gap: 32px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.25rem; font-weight: 800; color: var(--gold);
  flex-shrink: 0;
}
.nav-logo svg { width: 32px; height: 32px; }
.nav-links {
  display: flex; align-items: center; gap: 4px;
  list-style: none; flex: 1;
}
.nav-links a {
  padding: 6px 14px; border-radius: var(--radius-sm);
  color: var(--text2); font-weight: 500; transition: var(--trans);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: rgba(255,255,255,.07); }
.nav-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
#nav-auth  { display: flex; align-items: center; gap: 8px; }
#nav-user  { display: none; align-items: center; gap: 10px; }
.nav-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #e8910f);
  color: #0a0600; font-weight: 800; font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-username { font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; }
.btn-nav-logout {
  padding: 5px 12px; border-radius: var(--radius-sm);
  background: rgba(239,68,68,.15); color: var(--red);
  border: 1px solid rgba(239,68,68,.3); cursor: pointer;
  font-size: .82rem; font-weight: 500; transition: var(--trans);
}
.btn-nav-logout:hover { background: rgba(239,68,68,.25); }
#nav-admin-link { display: none; }

/* ─── BADGES ────────────────────────────────────────────── */
.badge-vip  { background: linear-gradient(135deg,#f5a623,#e8910f); color:#0a0600; padding:2px 8px; border-radius:20px; font-size:.7rem; font-weight:800; }
.badge-sub  { background: rgba(59,130,246,.2); color:var(--blue); padding:2px 8px; border-radius:20px; font-size:.7rem; font-weight:700; border:1px solid rgba(59,130,246,.3); }
.badge-free { background: rgba(16,185,129,.2); color:var(--green); padding:2px 8px; border-radius:20px; font-size:.7rem; font-weight:700; }
.badge-locked { background: rgba(100,116,139,.2); color:var(--text3); padding:2px 8px; border-radius:20px; font-size:.7rem; font-weight:700; }
.badge { display:inline-block; padding:3px 10px; border-radius:20px; font-size:.75rem; font-weight:700; }
.badge-success { background:rgba(16,185,129,.15); color:var(--green); border:1px solid rgba(16,185,129,.3); }
.badge-danger  { background:rgba(239,68,68,.15);  color:var(--red);   border:1px solid rgba(239,68,68,.3);  }
.badge-warning { background:rgba(245,166,35,.15); color:var(--gold);  border:1px solid rgba(245,166,35,.3); }
.badge-info    { background:rgba(59,130,246,.15); color:var(--blue);  border:1px solid rgba(59,130,246,.3); }

/* ─── HERO ──────────────────────────────────────────────── */
.hero {
  min-height: 88vh;
  background: radial-gradient(ellipse 80% 60% at 50% -20%, rgba(245,166,35,.15), transparent),
              radial-gradient(ellipse 60% 50% at 80% 60%, rgba(59,130,246,.1),  transparent),
              var(--bg);
  display: flex; align-items: center; padding: 80px clamp(16px,4vw,48px);
}
.hero-inner {
  max-width: 1280px; margin: 0 auto; width: 100%;
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(245,166,35,.12); color: var(--gold);
  border: 1px solid rgba(245,166,35,.3); padding: 6px 16px;
  border-radius: 20px; font-size: .85rem; font-weight: 600;
  margin-bottom: 20px;
}
.hero-title { margin-bottom: 20px; }
.hero-title span { color: var(--gold); }
.hero-desc { color: var(--text2); font-size: 1.1rem; margin-bottom: 36px; max-width: 480px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 32px; margin-top: 40px; }
.hero-stat-item { text-align: center; }
.hero-stat-num { font-size: 1.8rem; font-weight: 800; color: var(--gold); }
.hero-stat-label { font-size: .82rem; color: var(--text2); }
.hero-visual {
  position: relative;
}
.hero-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.hero-card-img { aspect-ratio: 16/9; background: var(--bg3); position: relative; overflow: hidden; }
.hero-card-img img { width: 100%; height: 100%; object-fit: cover; }
.hero-play-btn {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.35);
}
.hero-play-btn span {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(245,166,35,.9); display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: #0a0600;
}
.hero-card-body { padding: 20px; }
.hero-card-body h3 { margin-bottom: 6px; }
.floating-badge {
  position: absolute; top: -12px; right: 20px;
  background: linear-gradient(135deg, var(--gold), #e8910f);
  color: #0a0600; padding: 6px 16px; border-radius: 20px;
  font-size: .82rem; font-weight: 800;
}

/* ─── SECTION COMMONS ───────────────────────────────────── */
.section { padding: 80px clamp(16px,4vw,48px); }
.section-inner { max-width: 1280px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 48px; }
.section-header p { color: var(--text2); margin-top: 10px; font-size: 1.05rem; }
.divider { width: 60px; height: 4px; background: linear-gradient(90deg, var(--gold), transparent); border-radius: 2px; margin: 12px auto 0; }

/* ─── STATS BAR ─────────────────────────────────────────── */
.stats-bar {
  background: var(--bg2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 28px clamp(16px,4vw,48px);
}
.stats-bar-inner {
  max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.stat-item { text-align: center; }
.stat-num   { font-size: 2rem; font-weight: 800; color: var(--gold); }
.stat-label { font-size: .85rem; color: var(--text2); margin-top: 2px; }

/* ─── COURSE CARD ───────────────────────────────────────── */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.course-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: var(--trans); cursor: pointer;
  display: flex; flex-direction: column;
}
.course-card:hover {
  transform: translateY(-4px); border-color: rgba(245,166,35,.3);
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
.course-thumb {
  aspect-ratio: 16/9; overflow: hidden; position: relative;
}
.course-thumb img {
  width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease;
}
.course-card:hover .course-thumb img { transform: scale(1.06); }
.course-cat {
  position: absolute; top: 10px; left: 10px;
  background: rgba(7,13,27,.85); backdrop-filter: blur(8px);
  color: var(--gold); padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 700;
}
.course-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.course-title { font-size: 1rem; font-weight: 700; margin-bottom: 8px; line-height: 1.4; }
.course-meta  { color: var(--text2); font-size: .82rem; margin-bottom: 10px; }
.course-rating { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.stars { color: var(--gold); font-size: .9rem; }
.rating-num { color: var(--text2); font-size: .82rem; }
.course-footer {
  margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.course-instructor { font-size: .82rem; color: var(--text2); }
.course-episodes { font-size: .82rem; color: var(--text3); }
.free-tag { color: var(--green); font-size: .8rem; font-weight: 700; }

/* ─── PRICING ───────────────────────────────────────────── */
.pricing-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 400px)); gap: 24px;
  justify-content: center;
}
.plan-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px; position: relative;
  transition: var(--trans);
}
.plan-card:hover { transform: translateY(-4px); }
.plan-card.featured {
  border-color: var(--gold); background: linear-gradient(160deg, var(--card-h), var(--card));
  box-shadow: 0 0 60px rgba(245,166,35,.12);
}
.plan-badge {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--gold), #e8910f);
  color: #0a0600; padding: 5px 20px; border-radius: 20px; font-size: .8rem; font-weight: 800;
  white-space: nowrap;
}
.plan-name { font-size: 1.1rem; font-weight: 700; color: var(--text2); margin-bottom: 8px; }
.plan-price {
  display: flex; align-items: flex-end; gap: 4px;
  margin-bottom: 6px;
}
.plan-price .price-num { font-size: 3rem; font-weight: 900; color: var(--gold); line-height: 1; }
.plan-price .price-currency { font-size: 1.2rem; font-weight: 700; color: var(--gold); padding-bottom: 4px; }
.plan-price .price-period { font-size: .9rem; color: var(--text2); padding-bottom: 6px; }
.plan-desc { color: var(--text2); font-size: .9rem; margin-bottom: 28px; }
.plan-features { list-style: none; margin-bottom: 32px; display: flex; flex-direction: column; gap: 12px; }
.plan-features li {
  display: flex; align-items: center; gap: 10px;
  font-size: .92rem; color: var(--text);
}
.plan-features li::before { content:'✓'; color:var(--green); font-weight:900; }

/* ─── FORM ──────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-weight: 600; font-size: .88rem; color: var(--text2); margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 11px 16px;
  background: var(--bg3); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: .92rem; transition: var(--trans); outline: none;
}
.form-control:focus { border-color: var(--gold); background: var(--bg4); box-shadow: 0 0 0 3px rgba(245,166,35,.12); }
.form-control::placeholder { color: var(--text3); }
.form-error { color: var(--red); font-size: .82rem; margin-top: 4px; }
.form-hint  { color: var(--text3); font-size: .82rem; margin-top: 4px; }

/* ─── AUTH PAGE ─────────────────────────────────────────── */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at 30% 30%, rgba(245,166,35,.08), transparent 60%),
              radial-gradient(ellipse at 70% 70%, rgba(59,130,246,.06), transparent 60%), var(--bg);
}
.auth-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px;
  width: 100%; max-width: 440px;
  box-shadow: var(--shadow-lg);
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo .logo-name { font-size: 1.5rem; font-weight: 800; color: var(--gold); }
.auth-tabs { display: flex; gap: 4px; margin-bottom: 28px; background: var(--bg3); padding: 4px; border-radius: var(--radius-sm); }
.auth-tab {
  flex: 1; padding: 8px; text-align: center; border-radius: 6px;
  font-weight: 600; font-size: .9rem; color: var(--text2);
  cursor: pointer; transition: var(--trans); border: none; background: none;
}
.auth-tab.active { background: var(--card); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.auth-form { display: none; }
.auth-form.active { display: block; }
.auth-footer { text-align: center; margin-top: 20px; font-size: .88rem; color: var(--text2); }
.auth-footer a { color: var(--gold); font-weight: 600; }

/* ─── VIDEO PLAYER PAGE ─────────────────────────────────── */
.player-page { min-height: 100vh; display: flex; flex-direction: column; }
.player-layout {
  flex: 1; display: grid;
  grid-template-columns: 1fr 360px;
  gap: 0; min-height: 0;
}
.player-main { background: #000; display: flex; flex-direction: column; }
.player-video-wrap {
  position: relative; aspect-ratio: 16/9; background: #000;
  width: 100%;
}
.player-video-wrap iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: none;
}
.player-paywall {
  position: absolute; inset: 0;
  background: rgba(5,10,20,.94); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.paywall-box {
  text-align: center; padding: 40px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); max-width: 360px;
}
.paywall-icon { font-size: 3rem; margin-bottom: 16px; }
.paywall-box h3 { margin-bottom: 10px; }
.paywall-box p  { color: var(--text2); margin-bottom: 24px; font-size: .92rem; }
.player-info { padding: 20px 24px; border-bottom: 1px solid var(--border); }
.player-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 6px; }
.player-meta  { color: var(--text2); font-size: .85rem; }

.playlist {
  background: var(--bg2); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
.playlist-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: .95rem; flex-shrink: 0;
}
.playlist-items { overflow-y: auto; flex: 1; }
.playlist-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: var(--trans); position: relative;
}
.playlist-item:hover { background: var(--bg3); }
.playlist-item.active { background: rgba(245,166,35,.08); border-left: 3px solid var(--gold); }
.playlist-item.locked { cursor: default; opacity: .6; }
.ep-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg4); display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; flex-shrink: 0;
}
.playlist-item.active .ep-num { background: var(--gold); color: #0a0600; }
.ep-info { flex: 1; min-width: 0; }
.ep-title { font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-meta  { font-size: .75rem; color: var(--text2); margin-top: 2px; }
.ep-lock  { font-size: .9rem; color: var(--text3); }

/* ─── SUBSCRIBE PAGE ────────────────────────────────────── */
.subscribe-page {
  min-height: 100vh; padding: 60px clamp(16px,4vw,48px);
  background: radial-gradient(ellipse at 50% 0%, rgba(245,166,35,.08), transparent 60%), var(--bg);
}
.subscribe-inner { max-width: 900px; margin: 0 auto; }
.subscribe-steps {
  display: flex; gap: 0; margin-bottom: 48px;
  background: var(--bg2); border-radius: var(--radius); padding: 4px;
}
.step {
  flex: 1; padding: 12px; text-align: center; border-radius: var(--radius-sm);
  font-size: .85rem; font-weight: 600; color: var(--text3);
  position: relative; transition: var(--trans);
}
.step.done    { color: var(--green); }
.step.active  { background: var(--card); color: var(--gold); }
.step-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--bg3); color: var(--text2);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 700; margin-right: 6px;
}
.step.active .step-num { background: var(--gold); color: #0a0600; }
.step.done   .step-num { background: var(--green); color: #fff; }

.payment-box {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 36px;
}
.bank-info {
  background: var(--bg2); border: 2px solid rgba(245,166,35,.3);
  border-radius: var(--radius); padding: 28px; margin: 24px 0;
}
.bank-info h4 { color: var(--gold); margin-bottom: 16px; }
.bank-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
.bank-row:last-child { border-bottom: none; }
.bank-row .label { color: var(--text2); }
.bank-row .value { font-weight: 700; font-size: 1rem; color: var(--text); }
.bank-row .value.highlight { color: var(--gold); font-size: 1.2rem; }
.copy-btn {
  padding: 3px 10px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg3); color: var(--text2); cursor: pointer; font-size: .78rem;
  transition: var(--trans);
}
.copy-btn:hover { background: var(--bg4); color: var(--gold); border-color: var(--gold); }

.order-summary {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 24px;
}
.order-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: .92rem; }
.order-row.total { border-top: 1px solid var(--border); font-weight: 700; font-size: 1rem; margin-top: 6px; padding-top: 14px; }
.order-row.total .amount { color: var(--gold); font-size: 1.2rem; }

/* ─── PROFILE PAGE ──────────────────────────────────────── */
.profile-page { padding: 60px clamp(16px,4vw,48px); min-height: 100vh; }
.profile-inner { max-width: 960px; margin: 0 auto; }
.profile-header {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px;
  display: flex; align-items: center; gap: 24px; margin-bottom: 28px;
}
.profile-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #e8910f);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; font-weight: 800; color: #0a0600; flex-shrink: 0;
}
.profile-info h2 { margin-bottom: 4px; }
.profile-info p { color: var(--text2); }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.info-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.info-card h4 { margin-bottom: 16px; color: var(--text2); font-size: .88rem; text-transform: uppercase; letter-spacing: .06em; }
.sub-status {
  display: flex; align-items: center; gap: 16px;
  padding: 16px; background: var(--bg3); border-radius: var(--radius-sm); margin-bottom: 14px;
}
.sub-icon { font-size: 2rem; }
.sub-details h3 { margin-bottom: 2px; }
.sub-details p  { color: var(--text2); font-size: .85rem; }
.progress-bar { background: var(--bg3); border-radius: 10px; height: 8px; overflow: hidden; margin: 10px 0 4px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-h)); border-radius: 10px; transition: width .5s ease; }
.orders-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.orders-table th { color: var(--text2); font-weight: 600; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.orders-table td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.04); }
.orders-table tr:last-child td { border-bottom: none; }

/* ─── ADMIN ─────────────────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; background: var(--bg2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 20px 20px 16px; border-bottom: 1px solid var(--border);
  font-size: 1.15rem; font-weight: 800; color: var(--gold);
}
.sidebar-logo span { display: block; font-size: .72rem; color: var(--text3); font-weight: 500; margin-top: 2px; }
.sidebar-nav { padding: 12px 10px; flex: 1; }
.sidebar-section { font-size: .72rem; color: var(--text3); text-transform: uppercase; letter-spacing: .08em; padding: 14px 10px 6px; }
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: .88rem; font-weight: 500; color: var(--text2);
  cursor: pointer; transition: var(--trans); border: none; background: none;
  width: 100%; text-align: left; margin-bottom: 2px;
}
.sidebar-item:hover  { background: var(--bg3); color: var(--text); }
.sidebar-item.active { background: rgba(245,166,35,.1); color: var(--gold); }
.sidebar-item .icon  { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-item .badge-count {
  margin-left: auto; background: var(--red); color: #fff;
  font-size: .7rem; font-weight: 700; padding: 1px 6px; border-radius: 10px;
}

.admin-main { flex: 1; overflow-x: hidden; }
.admin-topbar {
  padding: 16px 28px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg2);
}
.admin-topbar h2 { font-size: 1.15rem; }
.admin-content { padding: 28px; }
.admin-panel { display: none; }
.admin-panel.active { display: block; }

.stats-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--card); 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: 3px;
}
.stat-card.gold::before   { background: linear-gradient(90deg, var(--gold), transparent); }
.stat-card.blue::before   { background: linear-gradient(90deg, var(--blue),   transparent); }
.stat-card.green::before  { background: linear-gradient(90deg, var(--green),  transparent); }
.stat-card.red::before    { background: linear-gradient(90deg, var(--red),    transparent); }
.stat-card.purple::before { background: linear-gradient(90deg, var(--purple), transparent); }
.stat-card-label { font-size: .8rem; color: var(--text2); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.stat-card-value { font-size: 2rem; font-weight: 800; }
.stat-card.gold   .stat-card-value { color: var(--gold);   }
.stat-card.blue   .stat-card-value { color: var(--blue);   }
.stat-card.green  .stat-card-value { color: var(--green);  }
.stat-card.red    .stat-card-value { color: var(--red);    }
.stat-card.purple .stat-card-value { color: var(--purple); }
.stat-card-icon { position: absolute; right: 16px; top: 16px; font-size: 1.8rem; opacity: .15; }

.charts-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 28px; }
.chart-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.chart-card h4 { margin-bottom: 16px; color: var(--text2); font-size: .88rem; }
.chart-wrap { position: relative; height: 220px; }

.data-table {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 20px;
}
.data-table-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.data-table-header h4 { font-size: .95rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .87rem; }
thead th {
  background: var(--bg2); padding: 12px 16px;
  text-align: left; color: var(--text2); font-weight: 600;
  font-size: .8rem; text-transform: uppercase; letter-spacing: .05em;
  white-space: nowrap;
}
tbody td { padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.04); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,.02); }

.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 14px;
  font-size: .88rem; color: var(--text2);
}
.search-bar input {
  background: none; border: none; outline: none;
  color: var(--text); width: 200px; font-size: .88rem;
}

/* ─── MODAL ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px;
  width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
  transform: translateY(20px); transition: transform .2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-close { background: none; border: none; color: var(--text2); cursor: pointer; font-size: 1.4rem; padding: 4px 8px; border-radius: 6px; transition: var(--trans); }
.modal-close:hover { background: var(--bg3); color: var(--text); }

/* ─── TOAST ─────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  padding: 12px 20px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .9rem; max-width: 320px;
  transform: translateX(110%); transition: transform .3s ease;
  box-shadow: var(--shadow);
}
.toast.show { transform: translateX(0); }
.toast-success { background: rgba(16,185,129,.15); color: var(--green); border: 1px solid rgba(16,185,129,.3); }
.toast-error   { background: rgba(239,68,68,.15);  color: var(--red);   border: 1px solid rgba(239,68,68,.3);  }
.toast-info    { background: rgba(59,130,246,.15);  color: var(--blue);  border: 1px solid rgba(59,130,246,.3);  }

/* ─── FOOTER ────────────────────────────────────────────── */
.footer {
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 48px clamp(16px,4vw,48px) 24px;
}
.footer-inner { max-width: 1280px; margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 32px; }
.footer-brand p { color: var(--text2); font-size: .9rem; margin-top: 10px; max-width: 280px; }
.footer-col h5 { font-size: .88rem; font-weight: 700; color: var(--text); margin-bottom: 14px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-col a  { color: var(--text2); font-size: .88rem; transition: var(--trans); }
.footer-col a:hover { color: var(--gold); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-bottom p { color: var(--text3); font-size: .82rem; }

/* ─── MISC ──────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text2); }
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; opacity: .4; }
.loading { display: flex; align-items: center; justify-content: center; padding: 40px; color: var(--text2); gap: 10px; }
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--bg4); border-top-color: var(--gold); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.page-header { padding: 48px clamp(16px,4vw,48px) 32px; }
.page-header-inner { max-width: 1280px; margin: 0 auto; }
.breadcrumb { font-size: .82rem; color: var(--text3); margin-bottom: 12px; }
.breadcrumb a { color: var(--text2); } .breadcrumb a:hover { color: var(--gold); }
.breadcrumb span { margin: 0 6px; }

.tag { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 700; }
.tag-blue   { background: rgba(59,130,246,.12);  color: var(--blue);  }
.tag-gold   { background: rgba(245,166,35,.12);  color: var(--gold);  }
.tag-green  { background: rgba(16,185,129,.12);  color: var(--green); }
.tag-purple { background: rgba(139,92,246,.12);  color: var(--purple);}

.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: .9rem; }
.alert-warning { background: rgba(245,166,35,.1); border: 1px solid rgba(245,166,35,.25); color: var(--gold); }
.alert-success { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.25); color: var(--green); }
.alert-info    { background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.25);  color: var(--blue); }

/* ─── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 1024px) {
  .hero-inner    { grid-template-columns: 1fr; }
  .hero-visual   { display: none; }
  .charts-grid   { grid-template-columns: 1fr; }
  .footer-grid   { grid-template-columns: 1fr 1fr; }
  .player-layout { grid-template-columns: 1fr; }
  .playlist      { border-left: none; border-top: 1px solid var(--border); max-height: 360px; }
  .profile-grid  { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .nav-links     { display: none; }
  .stats-bar-inner { grid-template-columns: repeat(2,1fr); }
  .sidebar       { display: none; }
  .admin-main    { width: 100%; }
  .footer-grid   { grid-template-columns: 1fr; }
  .pricing-grid  { grid-template-columns: 1fr; }
  .subscribe-steps { display: none; }
  .payment-box   { padding: 24px 20px; }
}
@media (max-width: 480px) {
  .hero { padding: 60px 16px; }
  .hero-actions { flex-direction: column; }
  .hero-stats { gap: 16px; }
  .stats-bar-inner { grid-template-columns: repeat(2,1fr); }
  .auth-card { padding: 28px 20px; }
}
