/* ═══════════════════════════════════════════════════════════════
   ACADEMIST — Dashboard (student) and shared admin chrome
   ═══════════════════════════════════════════════════════════════ */

.dash-head {
  background: linear-gradient(150deg, #111827 0%, #1E3A8A 100%);
  color: #fff; padding: clamp(30px,5vw,44px) 0 clamp(30px,5vw,40px);
  position: relative; overflow: hidden;
}
.dash-head::after {
  content: ''; position: absolute; inset: auto -70px -140px auto;
  width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(20,184,166,.18), transparent 66%);
}
.dash-hello { display: flex; align-items: center; gap: 16px; position: relative; z-index: 2; }
.dash-hello h1 {
  font-size: clamp(1.35rem, 3vw, 1.9rem); font-weight: 900;
  margin: 0 0 3px; letter-spacing: -.02em;
}
.dash-hello .muted { color: rgba(255,255,255,.62) !important; }

.dash-stats {
  display: grid; gap: 12px; margin-top: 26px; position: relative; z-index: 2;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.dash-stat {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.13);
  border-radius: var(--r); padding: 14px 16px;
}
.dash-stat b {
  display: block; font-size: 1.5rem; font-weight: 900;
  letter-spacing: -.02em; line-height: 1.1;
}
.dash-stat span {
  font-size: .64rem; font-weight: 700; letter-spacing: .11em;
  text-transform: uppercase; color: rgba(255,255,255,.55);
}

/* ── Tabs ─────────────────────────────────────────────────────── */
.dash-tabs {
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: var(--nav-h); z-index: 80;
}
.dash-tabs .wrap {
  display: flex; gap: 4px; overflow-x: auto;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.dash-tabs .wrap::-webkit-scrollbar { display: none; }
.dash-tab {
  background: none; border: 0; border-bottom: 3px solid transparent;
  padding: 15px 16px; font-family: var(--font); font-size: .81rem;
  font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.dash-tab:hover { color: var(--ink); }
.dash-tab.on { color: var(--ac); border-bottom-color: var(--ac); }

.dash-panel.hidden { display: none; }
.card-title { font-size: .98rem; font-weight: 800; margin: 0 0 16px; }

.settings-cols { display: grid; gap: 20px; grid-template-columns: 1.25fr 1fr; align-items: start; }
@media (max-width: 860px) { .settings-cols { grid-template-columns: 1fr; } }

/* ── Owned book row ───────────────────────────────────────────── */
.owned-row {
  display: flex; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 13px; margin-bottom: 10px;
}
.owned-thumb {
  width: 52px; height: 70px; border-radius: 8px; overflow: hidden;
  flex-shrink: 0; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
}
.owned-thumb img { width: 100%; height: 100%; object-fit: cover; }
.owned-info { flex: 1; min-width: 0; }
.owned-info b { display: block; font-size: .87rem; font-weight: 800; line-height: 1.3; }
.owned-info span { font-size: .72rem; color: var(--muted); }
.owned-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; flex-shrink: 0; }
@media (max-width: 600px) {
  .owned-row { flex-wrap: wrap; }
  .owned-actions { width: 100%; flex-direction: row; }
  .owned-actions .btn { flex: 1; }
}

.quota {
  height: 4px; background: var(--surface-2); border-radius: 3px;
  overflow: hidden; margin-top: 6px; width: 110px;
}
.quota i { display: block; height: 100%; background: var(--mg); }
.quota.low i { background: var(--io); }
.quota.out i { background: var(--danger); }

/* ── Status pills in tables ───────────────────────────────────── */
.pill-paid    { background: var(--mg-soft);   color: #15803D; }
.pill-pending { background: var(--io-soft);   color: #C2410C; }
.pill-failed  { background: var(--danger-soft); color: #991B1B; }
.pill-refunded{ background: var(--surface-2); color: var(--muted); }

/* ── Admin: upload form ───────────────────────────────────────── */
.upload-cols { display: grid; gap: 20px; grid-template-columns: 1fr 1.35fr; align-items: start; }
@media (max-width: 900px) { .upload-cols { grid-template-columns: 1fr; } }

/* ── Admin: inline sales chart ────────────────────────────────── */
.chart { padding: 8px 0; }
.chart-bars {
  display: flex; align-items: flex-end; gap: 3px;
  height: 150px; padding-bottom: 20px; position: relative;
}
.chart-col {
  flex: 1; height: 100%; display: flex; flex-direction: column;
  justify-content: flex-end; align-items: center; position: relative; min-width: 0;
}
.chart-bar {
  width: 100%; max-width: 22px; border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--ca), var(--ac));
  transition: opacity .15s;
}
.chart-col:hover .chart-bar { opacity: .75; }
.chart-col span {
  position: absolute; bottom: -18px; font-size: .56rem;
  color: var(--muted); font-weight: 600;
}
@media (max-width: 600px) {
  .chart-col:nth-child(even) span { display: none; }
}

/* ── Auth pages ───────────────────────────────────────────────── */
.auth-wrap {
  min-height: calc(100vh - var(--nav-h)); display: grid;
  grid-template-columns: 1fr 1fr; align-items: stretch;
}
@media (max-width: 880px) { .auth-wrap { grid-template-columns: 1fr; } }

.auth-side {
  background: linear-gradient(150deg, #111827 0%, #1E3A8A 100%);
  color: #fff; padding: clamp(34px,5vw,60px); display: flex;
  flex-direction: column; justify-content: center; position: relative; overflow: hidden;
}
@media (max-width: 880px) { .auth-side { display: none; } }
.auth-side h2 {
  font-size: clamp(1.5rem,2.6vw,2.1rem); font-weight: 900;
  line-height: 1.15; margin: 0 0 14px; letter-spacing: -.02em;
}
.auth-side h2 em { font-style: normal; color: var(--su); }
.auth-side p { color: rgba(255,255,255,.75); max-width: 42ch; margin: 0 0 26px; font-size: .92rem; }
.auth-tiles { display: flex; gap: 8px; flex-wrap: wrap; }

.auth-panel {
  display: flex; align-items: center; justify-content: center;
  padding: clamp(30px,5vw,56px) clamp(18px,4vw,40px); background: var(--surface);
}
.auth-card { width: 100%; max-width: 396px; }
.auth-card h1 { font-size: 1.5rem; font-weight: 900; margin: 0 0 6px; letter-spacing: -.02em; }
.auth-card > p { color: var(--muted); font-size: .87rem; margin: 0 0 26px; }
