/* ============================================================
   KOZO RESTAURANT — Staff Training Platform
   Global Stylesheet  |  assets/css/kozo.css
   ============================================================ */

/* ── GOOGLE FONTS ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Outfit:wght@300;400;500;600&display=swap');

/* ── DESIGN TOKENS ────────────────────────────────────────── */
:root {
  --bb:        #070B12;
  --navy:      #0C1220;
  --navy-2:    #101829;
  --navy-3:    #152035;
  --navy-4:    #1A2840;
  --accent:    #2463EB;
  --accent-2:  #1A4DB8;
  --white:     #FFFFFF;
  --off:       #C8D4E8;
  --muted:     #4E607A;
  --muted-2:   #3A4F68;
  --green:     #16A34A;
  --green-bg:  rgba(22, 163, 74, 0.12);
  --amber:     #D97706;
  --amber-bg:  rgba(217, 119, 6, 0.12);
  --red:       #DC2626;
  --red-bg:    rgba(220, 38, 38, 0.10);
  --radius:    14px;
  --radius-sm: 8px;
  --radius-lg: 20px;

  --font-display: 'Bebas Neue', sans-serif;
  --font-body:    'Outfit', sans-serif;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bb:        #F4F7FB;
  --navy:      #FFFFFF;
  --navy-2:    #F1F5F9;
  --navy-3:    #E2E8F0;
  --navy-4:    #CBD5E1;
  --white:     #0F172A;
  --off:       #1E293B;
  --muted:     #64748B;
  --muted-2:   #94A3B8;
  --green-bg:  rgba(22, 163, 74, 0.10);
  --amber-bg:  rgba(217, 119, 6, 0.10);
  --red-bg:    rgba(220, 38, 38, 0.08);
  color-scheme: light;
}

/* ── RESET ────────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* ── BASE ─────────────────────────────────────────────────── */
html { font-size: 16px; }

body {
  background: var(--bb);
  color: var(--white);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

/* Background grid pattern (used on login + dashboard) */
body.grid-bg::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(36, 99, 235, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 99, 235, 0.07) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
  z-index: 0;
}

html[data-theme="light"] body.grid-bg::before {
  background-image:
    linear-gradient(rgba(36, 99, 235, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 99, 235, 0.08) 1px, transparent 1px);
}

/* ── TYPOGRAPHY ───────────────────────────────────────────── */
h1, h2, h3.display {
  font-family: var(--font-display);
  letter-spacing: 2px;
  color: var(--white);
}

h2 { font-size: 28px; margin-bottom: 20px; }

p { line-height: 1.6; }

.text-muted   { color: var(--muted); }
.text-accent  { color: var(--accent); }
.text-white   { color: var(--white); }
.text-off     { color: var(--off); }

.label-caps {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── BRAND ────────────────────────────────────────────────── */
.brand {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 3px;
  color: var(--white);
}

.brand .z { color: var(--accent); }

.brand-mark {
  width: 68px;
  height: 68px;
  background: linear-gradient(145deg, var(--accent) 0%, #0A2260 100%);
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 1px;
  color: var(--white);
  box-shadow: 0 10px 40px rgba(36, 99, 235, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* ── TOPBAR ───────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 11, 18, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(36, 99, 235, 0.15);
  padding: 13px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

html[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.92);
}

/* Admin topbar variant (solid, no blur) */
.topbar.solid {
  background: var(--navy);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 13px 22px;
}

.topbar.solid .topbar-right {
  margin-left: auto;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-menu {
  position: relative;
}

.profile-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.profile-menu-trigger .avatar {
  pointer-events: none;
}

.profile-menu-caret {
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.profile-menu.open .profile-menu-caret {
  transform: rotate(-135deg) translateY(-1px);
  border-color: var(--off);
}

.profile-menu-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 210px;
  background: var(--navy);
  border: 1px solid rgba(36, 99, 235, 0.16);
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 160;
}

.profile-menu-panel[hidden] {
  display: none !important;
}

.profile-menu-link {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid rgba(36, 99, 235, 0.14);
  border-radius: 12px;
  background: rgba(36, 99, 235, 0.06);
  color: var(--off);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}

.profile-menu-link:hover {
  background: rgba(36, 99, 235, 0.12);
  border-color: rgba(36, 99, 235, 0.28);
  color: var(--white);
}

.profile-menu-danger {
  color: #fca5a5;
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.18);
}

.profile-menu-danger:hover {
  color: #fff;
  background: rgba(220, 38, 38, 0.18);
  border-color: rgba(220, 38, 38, 0.32);
}

.theme-toggle-menu {
  width: 100%;
  justify-content: center;
  min-height: 40px;
  border-radius: 12px;
  padding: 10px 12px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(36, 99, 235, 0.22);
  background: rgba(36, 99, 235, 0.10);
  color: var(--off);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.1s, color 0.2s;
}

.theme-toggle:hover {
  background: rgba(36, 99, 235, 0.16);
  border-color: rgba(36, 99, 235, 0.35);
}

.theme-toggle:active { transform: scale(0.98); }

.theme-toggle-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f59e0b, #facc15);
  box-shadow: inset -3px -3px 0 rgba(255,255,255,0.45);
  position: relative;
  flex-shrink: 0;
}

html[data-theme="light"] .theme-toggle-icon {
  background: linear-gradient(135deg, #1d4ed8, #60a5fa);
  box-shadow: inset -3px -3px 0 rgba(255,255,255,0.12);
}

html[data-theme="light"] .theme-toggle-icon::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  right: 1px;
  top: 2px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
}

.theme-toggle-label {
  line-height: 1;
}

.theme-auth {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 120;
}

/* ── AVATAR ───────────────────────────────────────────────── */
.avatar {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  box-shadow: 0 0 0 2px rgba(36, 99, 235, 0.3);
  flex-shrink: 0;
  overflow: hidden;
}

.avatar img,
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-has-image {
  background: var(--navy-3);
}

/* ── LINKS & NAV ──────────────────────────────────────────── */
a { color: inherit; text-decoration: none; }

.nav-link {
  color: var(--muted);
  font-size: 13px;
  transition: color 0.15s;
}
.nav-link:hover { color: var(--white); }

.logout-link {
  color: var(--muted);
  font-size: 12px;
  border: 1px solid rgba(36, 99, 235, 0.2);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.logout-link:hover { color: var(--white); border-color: var(--accent); }

.topbar-link-blue {
  color: #93c5fd;
  border-color: rgba(36, 99, 235, 0.35);
  background: rgba(36, 99, 235, 0.12);
}
.topbar-link-blue:hover {
  color: var(--white);
  border-color: var(--accent);
  background: rgba(36, 99, 235, 0.2);
}

.topbar-link-green {
  color: #86efac;
  border-color: rgba(22, 163, 74, 0.4);
  background: rgba(22, 163, 74, 0.12);
}
.topbar-link-green:hover {
  color: var(--white);
  border-color: var(--green);
  background: rgba(22, 163, 74, 0.22);
}

.topbar-link-red {
  color: #fca5a5;
  border-color: rgba(220, 38, 38, 0.4);
  background: rgba(220, 38, 38, 0.12);
}
.topbar-link-red:hover {
  color: var(--white);
  border-color: var(--red);
  background: rgba(220, 38, 38, 0.22);
}

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: box-shadow 0.2s, opacity 0.2s, transform 0.1s;
  letter-spacing: 0.3px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(36, 99, 235, 0.3);
}
.btn-primary:hover { box-shadow: 0 6px 24px rgba(36, 99, 235, 0.45); }
.btn-primary:active { transform: scale(0.99); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid rgba(36, 99, 235, 0.2);
}
.btn-ghost:hover { color: var(--white); border-color: var(--accent); }

.btn-full { width: 100%; }

/* ── CARDS ────────────────────────────────────────────────── */
.card {
  background: var(--navy);
  border: 1px solid rgba(36, 99, 235, 0.12);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
}

.card-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

/* ── FORMS ────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 13px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group.full { grid-column: 1 / -1; }

.add-user-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 5px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="file"],
select,
textarea {
  width: 100%;
  background: var(--navy-3);
  border: 1px solid rgba(36, 99, 235, 0.18);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(36, 99, 235, 0.15);
}

input::placeholder,
textarea::placeholder { color: var(--muted); }

select {
  padding-right: 42px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

select option { background: var(--navy-3); }

select[multiple] {
  height: 110px;
  padding-right: 13px;
  background-image: none;
}

.pw-wrap { position: relative; }

.eye-btn {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 3px;
}

/* ── STATUS PILLS ─────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* Semantic */
.pill-green   { background: var(--green-bg);           color: #4ADE80; }
.pill-blue    { background: rgba(36,99,235,0.12);      color: #93C5FD; }
.pill-amber   { background: var(--amber-bg);           color: #FCD34D; }
.pill-red     { background: var(--red-bg);             color: #F87171; }
.pill-muted   { background: rgba(78,96,122,0.15);      color: var(--muted); }

/* Episode status pills */
.status-pill.completed    { background: var(--green-bg);           color: #4ADE80; }
.status-pill.in_progress  { background: rgba(255,255,255,0.05);    color: var(--muted); }
.status-pill.not_started  { background: rgba(255,255,255,0.05);    color: var(--muted); }
.status-pill.playing      { background: rgba(36,99,235,0.2);       color: #93C5FD; }
.status-pill.paused       { background: rgba(255,170,0,0.12);      color: #FBB740; }

/* ── TABLES ───────────────────────────────────────────────── */
.tbl-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(36, 99, 235, 0.12);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  padding: 10px 14px;
  text-align: left;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid rgba(36, 99, 235, 0.12);
  background: rgba(36, 99, 235, 0.04);
  white-space: nowrap;
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
}

tr:hover td { background: rgba(36, 99, 235, 0.04); }
tr:last-child td { border-bottom: none; }

/* Mini progress bar in table */
.mini-bar {
  display: inline-block;
  width: 80px;
  height: 4px;
  background: rgba(36, 99, 235, 0.12);
  border-radius: 4px;
  overflow: hidden;
  vertical-align: middle;
  margin-left: 6px;
}

.mini-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
}

.mini-bar-fill.done { background: #4ADE80; }

/* ── ACTION BUTTONS (table rows) ──────────────────────────── */
.act-btn {
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
  transition: opacity 0.15s;
}

.act-btn:hover { opacity: 0.8; }
.act-pub   { background: var(--green-bg); color: #4ADE80; }
.act-unpub { background: var(--red-bg);   color: #F87171; }

/* ── DIVIDER ──────────────────────────────────────────────── */
.rule {
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(36, 99, 235, 0.35), transparent);
  margin: 28px 0;
}

/* ── ERROR / MESSAGE BOXES ────────────────────────────────── */
.msg-success {
  background: rgba(22, 163, 74, 0.10);
  border: 1px solid rgba(22, 163, 74, 0.30);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: #4ADE80;
  font-size: 13px;
  margin-bottom: 18px;
}

.msg-error {
  background: var(--red-bg);
  border: 1px solid rgba(220, 38, 38, 0.30);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 13px;
  color: #F07070;
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

/* ── LOADING / SPINNER ────────────────────────────────────── */
.loader {
  text-align: center;
  padding: 56px 20px;
  color: var(--muted);
}

.spinner {
  width: 30px;
  height: 30px;
  border: 2px solid rgba(36, 99, 235, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 14px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── EMPTY STATE ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--muted);
}

.empty-state .icon {
  font-size: 42px;
  margin-bottom: 14px;
  opacity: 0.4;
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 2px;
  color: var(--off);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 13px;
  line-height: 1.6;
}

/* ── DUE DATE BADGES ──────────────────────────────────────── */
.due-badge {
  font-size: 10px;
  color: var(--amber);
  background: var(--amber-bg);
  padding: 2px 7px;
  border-radius: 10px;
}

.due-badge.overdue {
  color: var(--red) !important;
  background: var(--red-bg) !important;
}

/* ── UTILITIES ────────────────────────────────────────────── */
.mt-0  { margin-top: 0; }
.mt-1  { margin-top: 8px; }
.mt-2  { margin-top: 14px; }
.mt-3  { margin-top: 20px; }
.mt-4  { margin-top: 28px; }

/* ── SWEETALERT THEMING ───────────────────────────────────── */
.swal-popup-custom {
  border-radius: var(--radius-lg);
  border: 1px solid var(--navy-3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.swal-popup-custom .swal2-title {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 1px;
  color: var(--white);
}

.swal-popup-custom .swal2-html-container {
  color: var(--off);
  font-size: 14px;
  line-height: 1.5;
}

.swal-popup-custom .swal2-confirm,
.swal-popup-custom .swal2-cancel {
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 500;
  padding: 10px 20px;
  transition: all 0.2s;
}

.swal-popup-custom .swal2-confirm:hover,
.swal-popup-custom .swal2-cancel:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.mb-2  { margin-bottom: 14px; }
.mb-3  { margin-bottom: 20px; }
.flex  { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 12px; }
.gap-3 { gap: 18px; }

/* ── LOGIN PAGE ───────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
}

.glow-orb {
  position: fixed;
  width: 700px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(36, 99, 235, 0.18) 0%, transparent 70%);
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--navy);
  border: 1px solid rgba(36, 99, 235, 0.22);
  border-radius: 22px;
  padding: 44px 36px;
  position: relative;
  z-index: 1;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.03);
  animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

html[data-theme="light"] .login-card {
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.04);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-logo { text-align: center; margin-bottom: 34px; }

.login-logo .brand-name {
  font-family: var(--font-display);
  font-size: 30px;
  letter-spacing: 4px;
  color: var(--white);
  line-height: 1;
  margin-top: 14px;
  margin-bottom: 5px;
}

.login-logo .brand-sub {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 3.5px;
  text-transform: uppercase;
}

.btn-login {
  width: 100%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
  cursor: pointer;
  letter-spacing: 0.3px;
  margin-top: 8px;
  box-shadow: 0 6px 28px rgba(36, 99, 235, 0.4);
  transition: box-shadow 0.2s, transform 0.1s;
}

.btn-login:hover { box-shadow: 0 10px 36px rgba(36, 99, 235, 0.55); }
.btn-login:active { transform: scale(0.99); }

.login-help {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 20px;
}

.forgot-link {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.15s;
}
.forgot-link:hover { opacity: 1; text-decoration: underline; }

/* ── DASHBOARD ────────────────────────────────────────────── */

/* CHANGED: increased bottom padding to clear both the fixed footer
   (~46px) and the audio player (~160px) when it slides up          */
.dashboard-body { padding-bottom: 60px; }
body:has(.player.visible) .ep-list { padding-bottom: 200px; }

.hero {
  padding: 26px 18px 0;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 200px;
  background: linear-gradient(to bottom, rgba(36, 99, 235, 0.06), transparent);
  pointer-events: none;
}

.greet-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.greet-name {
  font-family: var(--font-display);
  font-size: 36px;
  letter-spacing: 2px;
  color: var(--white);
  line-height: 1;
  margin-bottom: 22px;
}

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 26px;
}

.stat-card {
  background: var(--navy);
  border: 1px solid rgba(36, 99, 235, 0.15);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 2px;
}

.stat-card.done::after  { background: #16A34A; }
.stat-card.prog::after  { background: var(--accent); }
.stat-card.total::after { background: var(--muted-2); }

.stat-num {
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card.done  .stat-num { color: #4ADE80; }
.stat-card.prog  .stat-num { color: #60A5FA; }
.stat-card.total .stat-num { color: var(--white); }

.stat-lbl {
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Filter tabs */
.filter-scroll {
  padding: 0 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-bottom: 16px;
}

.filter-scroll::-webkit-scrollbar { display: none; }

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.ftab {
  background: var(--navy);
  border: 1px solid rgba(36, 99, 235, 0.18);
  border-radius: 20px;
  padding: 7px 15px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}

.ftab.active {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(36, 99, 235, 0.35);
}

.ftab-doc { border-color: rgba(74, 222, 128, 0.25); color: #4ADE80; }
.ftab-doc.active { background: #166534; border-color: #4ADE80; box-shadow: 0 4px 16px rgba(74,222,128,0.2); }

.search-wrap {
  padding: 0;
  flex-shrink: 0;
}

.content-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 18px 14px;
}

.filter-select {
  min-width: 180px;
}

.content-summary {
  padding: 0 18px 10px;
  font-size: 12px;
  color: var(--muted);
}

.tag-row {
  padding: 0 18px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  background: rgba(36, 99, 235, 0.08);
  border: 1px solid rgba(36, 99, 235, 0.18);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--off);
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
}

.tag-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

@media (max-width: 600px) {
  .filter-scroll {
    overflow-x: visible;
  }

  .filter-tabs {
    flex-wrap: wrap;
    white-space: normal;
  }

  .ftab {
    flex: 1;
    text-align: center;
  }

  .search-wrap {
    flex: 0 0 100%;
    box-sizing: border-box;
  }

  .content-controls {
    padding: 0 14px 14px;
  }

  .filter-select {
    min-width: 0;
    width: 100%;
  }

  .search-box {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--navy);
  border: 1px solid rgba(36, 99, 235, 0.16);
  border-radius: 14px;
  padding: 8px 12px;
  min-width: 240px;
}

.search-icon {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--accent);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  min-width: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 0 !important;
  color: var(--white);
}

.search-input:focus {
  outline: none !important;
  box-shadow: none !important;
}

.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search-box:focus-within {
  border-color: rgba(36, 99, 235, 0.6);
  box-shadow: 0 0 0 3px rgba(36, 99, 235, 0.15);
}

.search-clear {
  display: none;
  background: rgba(36, 99, 235, 0.12);
  border: 1px solid rgba(36, 99, 235, 0.18);
  color: var(--off);
  border-radius: 999px;
  padding: 6px 10px;
  font-family: var(--font-body);
  font-size: 11px;
  cursor: pointer;
}

.search-clear.visible {
  display: inline-flex;
}

.admin-panel-tools {
  margin-bottom: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-search-box {
  width: 100%;
  max-width: 420px;
}

.admin-filter-box {
  width: 100%;
  max-width: 240px;
}

.admin-filter-select {
  min-width: 0;
  width: 100%;
  max-width: none;
  background-color: transparent;
  border: none;
  box-shadow: none;
  padding: 0 28px 0 0;
}

.admin-filter-select:focus {
  box-shadow: none;
}

.admin-filter-box:focus-within .admin-filter-select {
  border: none;
}

/* ── DOCUMENT CARDS ──────────────────────────────────────── */
.doc-list {
  padding: 0 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 12px;
}

.doc-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--navy);
  border: 1px solid rgba(36, 99, 235, 0.12);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.doc-card:hover { border-color: rgba(36,99,235,0.4); box-shadow: 0 4px 20px rgba(0,0,0,0.3); }

.doc-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(36,99,235,0.15);
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.doc-desc {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-open-btn {
  background: rgba(36,99,235,0.15);
  color: var(--accent);
  border: 1px solid rgba(36,99,235,0.25);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.18s;
}

.doc-open-btn:hover { background: var(--accent); color: #fff; }

/* ── PROFILE ─────────────────────────────────────────────── */
.profile-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 14px 110px;
  width: 100%;
}

.profile-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.profile-summary {
  display: flex;
  align-items: center;
  gap: 18px;
}

.profile-avatar {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 1px;
  overflow: hidden;
  flex-shrink: 0;
}

.profile-name {
  margin: 6px 0 2px;
}

.profile-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.profile-meta-item {
  min-width: 120px;
}

.profile-meta-item strong {
  display: block;
  margin-top: 5px;
  color: var(--white);
}

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

.profile-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0;
  text-transform: none;
  font-size: 13px;
}

/* ── PDF READER ───────────────────────────────────────────── */
.reader-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.reader-header {
  padding: 20px 18px 8px;
}

.reader-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}

.reader-desc {
  font-size: 13px;
  color: var(--muted);
}

.reader-wrap {
  flex: 1;
  padding: 0 14px 96px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--navy);
  border: 1px solid rgba(36,99,235,0.15);
  border-radius: 12px;
  padding: 10px 14px;
}

.reader-page-info {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.5px;
}

.reader-nav-btn {
  background: rgba(36,99,235,0.12);
  border: 1px solid rgba(36,99,235,0.2);
  color: var(--accent);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.15s;
}

.reader-nav-btn:hover:not(:disabled) { background: var(--accent); color: #fff; }
.reader-nav-btn:disabled { opacity: 0.35; cursor: default; }

.reader-canvas-wrap {
  background: var(--navy);
  border: 1px solid rgba(36,99,235,0.12);
  border-radius: 14px;
  overflow-x: hidden;
  overflow-y: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 300px;
  -webkit-overflow-scrolling: touch;
}

#pdf-canvas {
  display: none;
  width: 100%;
  max-width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
  border-radius: 14px;
}

@media (max-width: 700px) {
  .reader-wrap { padding: 0 8px 24px; }

  .reader-nav-btn {
    padding: 10px 18px;
    font-size: 13px;
    min-height: 44px;
  }

  .reader-toolbar {
    padding: 8px 10px;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .reader-page-info {
    width: 100%;
    text-align: center;
    order: -1;
  }

  .reader-canvas-wrap { border-radius: 10px; }

  .reader-wrap { padding-bottom: 110px; }
}

.reader-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px;
  color: var(--muted);
  font-size: 13px;
}

/* ── SITE FOOTER ──────────────────────────────────────────── */
/* CHANGED: fixed to bottom of viewport, sits below the audio player */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 14px 18px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.5px;
  border-top: 1px solid rgba(36, 99, 235, 0.12);
  background: var(--navy);
  z-index: 50; /* below audio player (z-index: 200) so player slides over it */
}

.sec-label {
  padding: 0 18px 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--muted);
}

/* Episode list */
.ep-list {
  padding: 0 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}

.ep-card {
  background: var(--navy);
  border: 1px solid rgba(36, 99, 235, 0.12);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  gap: 13px;
  align-items: flex-start;
  cursor: pointer;
  transition: border-color 0.2s, background 0.15s;
  position: relative;
  overflow: hidden;
  -webkit-user-select: none;
}

.ep-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0; width: 3px;
  background: transparent;
  transition: background 0.2s;
}

.ep-card:active { background: var(--navy-3); }

.ep-card.playing {
  border-color: rgba(36, 99, 235, 0.45);
  background: rgba(36, 99, 235, 0.07);
}

.ep-card.playing::before { background: var(--accent); }

.ep-thumb {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  background: var(--navy-3);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  overflow: hidden;
  border: 1px solid rgba(36, 99, 235, 0.1);
}

.ep-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }

.ep-body { flex: 1; min-width: 0; }

.ep-cat {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 3px;
  color: var(--accent);
}

.ep-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--white);
  line-height: 1.3;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ep-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

.ep-dur { font-size: 11px; color: var(--muted); }

.ep-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag-pill {
  background: rgba(36, 99, 235, 0.08);
  color: var(--off);
  border: 1px solid rgba(36, 99, 235, 0.14);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10px;
}

.ep-bar {
  height: 2px;
  background: rgba(36, 99, 235, 0.12);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.ep-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s;
  background: var(--accent);
}

.ep-bar-fill.done { background: #4ADE80; }

.play-btn {
  width: 34px;
  height: 34px;
  background: rgba(36, 99, 235, 0.12);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  align-self: center;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  color: var(--off);
}

.ep-card.playing .play-btn,
.ep-card:hover .play-btn {
  background: var(--accent);
  color: var(--white);
}

/* ── AUDIO PLAYER ─────────────────────────────────────────── */
/* ── TRANSCRIPT PANEL ────────────────────────────────────── */
.transcript-panel {
  display: none;
  max-height: 40vh;
  overflow-y: auto;
  border-top: 1px solid rgba(36,99,235,0.2);
  margin: 10px -16px 0;
  padding: 0 16px;
}

.transcript-panel.open { display: block; }

.transcript-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 8px;
  position: sticky;
  top: 0;
  background: rgba(10, 15, 24, 0.97);
}

html[data-theme="light"] .transcript-header {
  background: rgba(255, 255, 255, 0.97);
}

.transcript-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
}

.transcript-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
}

.transcript-body { padding-bottom: 12px; }

.t-para {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  margin: 0 0 10px;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.t-para.t-active {
  background: rgba(36,99,235,0.12);
  color: var(--white);
}

.transcript-btn { color: var(--muted); }
.transcript-btn.active { color: var(--accent); }

.player {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 200;
  background: rgba(10, 15, 24, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(36, 99, 235, 0.22);
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5);
}

html[data-theme="light"] .player {
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -16px 40px rgba(15, 23, 42, 0.14);
}

.player.visible { transform: translateY(0); }

.player-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.player-thumb {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  background: var(--navy-3);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  overflow: hidden;
  border: 1px solid rgba(36, 99, 235, 0.15);
}

.player-thumb img { width: 100%; height: 100%; object-fit: cover; }

.player-text { flex: 1; min-width: 0; }

.player-title {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 1px;
}

.player-cat { font-size: 11px; color: var(--muted); }

.player-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

/* Seek bar */
.seek-wrap {
  position: relative;
  height: 20px;
  display: flex;
  align-items: center;
  margin-bottom: 3px;
  cursor: pointer;
}

.seek-track {
  position: absolute;
  width: 100%;
  height: 3px;
  background: rgba(36, 99, 235, 0.18);
  border-radius: 3px;
}

.seek-fill {
  position: absolute;
  left: 0;
  height: 3px;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s linear;
}

input[type="range"].seek-range {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  margin: 0;
  -webkit-appearance: none;
  z-index: 2;
}

.player-times {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 10px;
}

/* Player controls */
.player-ctrls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.ctrl {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  padding: 5px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.ctrl:hover { color: var(--white); }

.ctrl.pp {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 50%;
  color: var(--white);
  font-size: 18px;
  padding: 0;
  box-shadow: 0 6px 24px rgba(36, 99, 235, 0.45);
  transition: box-shadow 0.2s, transform 0.1s;
}

.ctrl.pp:active { transform: scale(0.95); }

.spd-btn {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--muted);
  background: var(--navy-3);
  border: 1px solid rgba(36, 99, 235, 0.2);
  border-radius: 7px;
  padding: 5px 9px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s;
}

.spd-btn.on { border-color: var(--accent); color: #93C5FD; }

/* ── ADMIN LAYOUT ─────────────────────────────────────────── */
.admin-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  min-height: calc(100vh - 50px);
}

.sidebar {
  background: var(--navy);
  border-right: 1px solid rgba(36, 99, 235, 0.10);
  padding: 16px 0;
}

.sidebar-head,
.drawer-toggle,
.sidebar-close,
.drawer-backdrop {
  display: none;
}

.nav-section {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 18px 6px;
  opacity: 0.6;
}

.nav-btn {
  display: block;
  width: 100%;
  padding: 11px 18px;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}

.nav-btn:hover { color: var(--off); background: rgba(36, 99, 235, 0.05); }
.nav-btn.active { color: var(--white); border-left-color: var(--accent); background: rgba(36, 99, 235, 0.08); }

.admin-main { padding: 26px; }

.panel { display: none; }
.panel.active { display: block; }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 480px) {
  .topbar-right {
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .profile-hero,
  .profile-summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .theme-auth {
    top: 12px;
    right: 12px;
  }

  .login-card { padding: 32px 20px; }
  h2 { font-size: 24px; }
}

@media (max-width: 900px) {
  .add-user-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-page .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-layout { grid-template-columns: 1fr; }

  .drawer-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 42px;
    height: 42px;
    background: rgba(36, 99, 235, 0.12);
    border: 1px solid rgba(36, 99, 235, 0.18);
    border-radius: 10px;
    padding: 0 11px;
    cursor: pointer;
    flex-shrink: 0;
  }

  .drawer-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: var(--white);
  }

  .admin-page .topbar.solid {
    justify-content: space-between;
  }

  .admin-page .topbar.solid .topbar-right {
    margin-left: 0;
  }

  .drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(7, 11, 18, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 140;
  }

  .admin-page.drawer-open .drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(82vw, 300px);
    padding: 0 0 18px;
    border-right: 1px solid rgba(36, 99, 235, 0.16);
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    z-index: 150;
    overflow-y: auto;
    box-shadow: 24px 0 50px rgba(0, 0, 0, 0.38);
  }

  .admin-page.drawer-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 18px 12px;
    border-bottom: 1px solid rgba(36, 99, 235, 0.12);
    margin-bottom: 6px;
  }

  .sidebar-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(36, 99, 235, 0.12);
    border-radius: 10px;
    color: var(--off);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
  }

  .nav-btn {
    border-left: 3px solid transparent;
    border-bottom: none;
    padding: 13px 18px;
  }

  .nav-btn.active {
    border-left-color: var(--accent);
  }

  .nav-section { display: block; }
}

@media (max-width: 600px) {
  .add-user-grid { grid-template-columns: 1fr; }
  .admin-page .topbar.solid {
    padding: 12px 14px;
  }

  .admin-page .topbar.solid .topbar-right {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
  }

  .admin-page .logout-link {
    padding: 8px 12px;
    font-size: 12px;
  }

  .admin-main {
    padding: 14px;
  }

  .card {
    padding: 16px;
    border-radius: 12px;
  }

  .admin-page .form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .admin-page .flex {
    flex-wrap: wrap;
  }

  .admin-page .btn,
  .admin-page .act-btn {
    min-height: 40px;
  }

  .admin-page .mt-2.flex.gap-1 .btn {
    width: 100%;
  }

  .admin-page h2 {
    font-size: 22px;
    margin-bottom: 14px;
  }

  .admin-page .tbl-wrap {
    border-radius: 12px;
    -webkit-overflow-scrolling: touch;
  }

  .admin-page table {
    min-width: 640px;
  }

  .admin-page th,
  .admin-page td {
    padding: 10px 12px;
  }

  .admin-page .msg-success,
  .admin-page .msg-error {
    font-size: 12px;
    padding: 10px 12px;
  }
}
