/* ═══════════════════════════════════════════════════════════
   WONDERFUL WRITERS — PREMIUM DESIGN SYSTEM v7
   Stripe Dashboard × Linear × Notion × Superhuman aesthetic
   ═══════════════════════════════════════════════════════════ */

/* ── Google Fonts (loaded in HTML) ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ══════════════════════════════════════
   CSS CUSTOM PROPERTIES — LIGHT THEME
══════════════════════════════════════ */
:root {
  /* Brand */
  --brand:          #FF7E2D;
  --brand-dark:     #e8621a;
  --brand-light:    #ffaa5e;
  --brand-soft:     rgba(255,126,45,0.08);
  --brand-softer:   rgba(255,126,45,0.04);
  --brand-glow:     rgba(255,126,45,0.25);

  /* Backgrounds */
  --bg:             #f8f9fb;
  --bg-card:        #ffffff;
  --bg-elevated:    #ffffff;
  --bg-subtle:      #f3f4f6;
  --bg-input:       #ffffff;

  /* Sidebar */
  --sidebar-bg:     #0e0804;
  --sidebar-border: rgba(255,255,255,0.07);
  --sidebar-text:   rgba(255,255,255,0.55);
  --sidebar-active: rgba(255,126,45,0.18);
  --sidebar-hover:  rgba(255,255,255,0.06);

  /* Text */
  --text:           #0f0a06;
  --text-muted:     #6b7280;
  --text-light:     #9ca3af;
  --text-xlight:    #d1d5db;

  /* Borders */
  --border:         #e5e7eb;
  --border-strong:  #d1d5db;
  --border-focus:   #FF7E2D;

  /* Status Colors */
  --green:          #10b981;
  --green-soft:     rgba(16,185,129,0.1);
  --blue:           #3b82f6;
  --blue-soft:      rgba(59,130,246,0.1);
  --purple:         #8b5cf6;
  --purple-soft:    rgba(139,92,246,0.1);
  --red:            #ef4444;
  --red-soft:       rgba(239,68,68,0.1);
  --yellow:         #f59e0b;
  --yellow-soft:    rgba(245,158,11,0.1);
  --teal:           #06b6d4;
  --teal-soft:      rgba(6,182,212,0.1);

  /* Glass */
  --glass-bg:       rgba(255,255,255,0.88);
  --glass-border:   rgba(255,255,255,0.5);

  /* Shadows */
  --shadow-xs:      0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.07);
  --shadow-md:      0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg:      0 8px 40px rgba(0,0,0,0.1);
  --shadow-xl:      0 20px 60px rgba(0,0,0,0.12);
  --shadow-brand:   0 8px 28px rgba(255,126,45,0.28);
  --shadow-card:    0 4px 24px rgba(255,126,45,0.06);

  /* Radius */
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   20px;
  --r-2xl:  24px;
  --r-full: 9999px;

  /* Typography */
  --font-sans:  'Inter', system-ui, sans-serif;
  --font-head:  'Plus Jakarta Sans', 'Inter', sans-serif;
  --font-mono:  'Space Grotesk', 'Inter', sans-serif;

  /* Transitions */
  --ease:       cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring:cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast:     0.15s;
  --t-base:     0.25s;
  --t-slow:     0.4s;

  /* Layout */
  --sidebar-w:  260px;
  --topbar-h:   64px;
}

/* ══════════════════════════════════════
   DARK THEME OVERRIDES
══════════════════════════════════════ */
[data-theme="dark"] {
  --bg:             #0a0604;
  --bg-card:        #130c05;
  --bg-elevated:    #1c1208;
  --bg-subtle:      #1c1208;
  --bg-input:       #1c1208;

  --sidebar-bg:     #060402;
  --sidebar-border: rgba(255,255,255,0.06);

  --text:           #f1ece8;
  --text-muted:     #9ca3af;
  --text-light:     #6b7280;
  --text-xlight:    #4b5563;

  --border:         rgba(255,126,45,0.12);
  --border-strong:  rgba(255,126,45,0.22);

  --glass-bg:       rgba(19,12,5,0.92);
  --glass-border:   rgba(255,126,45,0.15);

  --shadow-xs:      0 1px 2px rgba(0,0,0,0.4);
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:      0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg:      0 8px 40px rgba(0,0,0,0.6);
  --shadow-xl:      0 20px 60px rgba(0,0,0,0.7);
  --shadow-card:    0 4px 24px rgba(0,0,0,0.3);

  --brand-soft:     rgba(255,126,45,0.12);
  --brand-softer:   rgba(255,126,45,0.06);
  --green-soft:     rgba(16,185,129,0.12);
  --blue-soft:      rgba(59,130,246,0.12);
  --purple-soft:    rgba(139,92,246,0.12);
  --red-soft:       rgba(239,68,68,0.12);
  --yellow-soft:    rgba(245,158,11,0.12);
  --teal-soft:      rgba(6,182,212,0.12);
}

/* ══════════════════════════════════════
   GLOBAL RESETS & BASE
══════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  margin: 0;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background var(--t-base), color var(--t-base);
}

h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-head);
  color: var(--text);
  line-height: 1.25;
  margin: 0;
}

a { color: var(--brand); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--brand-dark); }

img { max-width: 100%; height: auto; }

button, input, select, textarea {
  font-family: var(--font-sans);
}

/* ══════════════════════════════════════
   AUTH PAGES — PREMIUM TWO-PANEL LAYOUT
══════════════════════════════════════ */

/* Page wrapper */
.auth-page {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
}

/* Left brand panel */
.auth-brand-panel {
  width: 44%;
  background: linear-gradient(160deg, #0e0804 0%, #1c1005 50%, #0a0602 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 48px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

/* Decorative orbs */
.auth-brand-panel::before {
  content: '';
  position: absolute;
  top: -120px; right: -80px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255,126,45,0.18) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.auth-brand-panel::after {
  content: '';
  position: absolute;
  bottom: -100px; left: -60px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255,126,45,0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.auth-orb-1 {
  position: absolute;
  top: 35%; left: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(255,170,94,0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* Brand logo */
.auth-brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  position: relative;
  z-index: 2;
}

.auth-brand-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, #FF7E2D, #ffaa5e);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.1rem;
  box-shadow: 0 4px 16px rgba(255,126,45,0.4);
  flex-shrink: 0;
}

.auth-brand-name {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.3rem;
  color: #fff;
}

.auth-brand-name span { color: #FF7E2D; }

/* Brand headline */
.auth-brand-content {
  position: relative;
  z-index: 2;
}

.auth-brand-headline {
  font-family: var(--font-head);
  font-size: 2.4rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.auth-brand-headline span {
  background: linear-gradient(135deg, #FF7E2D, #ffaa5e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-brand-sub {
  color: rgba(255,255,255,0.55);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 36px;
}

/* Feature list on brand panel */
.auth-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 40px;
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-feature-icon {
  width: 36px; height: 36px;
  background: rgba(255,126,45,0.15);
  border: 1px solid rgba(255,126,45,0.25);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #FF7E2D;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.auth-feature-text {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.72);
  font-weight: 500;
}

/* Testimonial */
.auth-testimonial {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 20px 22px;
  position: relative;
  z-index: 2;
}

.auth-testimonial-text {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.8);
  line-height: 1.7;
  margin-bottom: 14px;
  font-style: italic;
}

.auth-testimonial-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-testimonial-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF7E2D, #ffaa5e);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 0.8rem; font-weight: 700;
}

.auth-testimonial-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
}

.auth-testimonial-role {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
}

.auth-stars {
  color: #FF7E2D;
  font-size: 0.75rem;
  margin-top: 2px;
}

/* Stats row */
.auth-stats {
  display: flex;
  gap: 24px;
  margin-top: 28px;
}

.auth-stat-item {
  text-align: center;
}

.auth-stat-num {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
}

.auth-stat-label {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Right form panel */
.auth-form-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 48px;
  overflow-y: auto;
  position: relative;
}

.auth-form-inner {
  width: 100%;
  max-width: 440px;
}

/* Form panel top bar */
.auth-form-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
}

.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--t-fast);
}

.auth-back-link:hover { color: var(--brand); }

/* Theme toggle button */
.auth-theme-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: all var(--t-base);
}

.auth-theme-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* Server status pill */
.server-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.server-pill-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-xlight);
  transition: background var(--t-base);
}

.server-pill.ok .server-pill-dot  { background: var(--green); box-shadow: 0 0 6px var(--green); }
.server-pill.err .server-pill-dot { background: var(--red); }

/* Auth heading */
.auth-heading {
  font-family: var(--font-head);
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.auth-subheading {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 32px;
}

/* Form inputs */
.auth-form-group {
  margin-bottom: 18px;
}

.auth-form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
}

.auth-input-wrap {
  position: relative;
}

.auth-input-wrap .auth-input-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 0.88rem;
  pointer-events: none;
  transition: color var(--t-fast);
}

.auth-input {
  width: 100%;
  padding: 13px 16px 13px 42px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.93rem;
  font-family: var(--font-sans);
  outline: none;
  transition: all var(--t-fast);
  -webkit-appearance: none;
}

.auth-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.auth-input:focus + .auth-input-icon,
.auth-input-wrap:focus-within .auth-input-icon {
  color: var(--brand);
}

.auth-input.no-icon {
  padding-left: 16px;
}

.auth-input-toggle {
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 0.88rem;
  padding: 0;
  transition: color var(--t-fast);
}

.auth-input-toggle:hover { color: var(--brand); }

/* Forgot link */
.auth-forgot-link {
  float: right;
  font-size: 0.8rem;
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}

.auth-forgot-link:hover { text-decoration: underline; }

/* Submit button */
.auth-submit-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #FF7E2D 0%, #ff9f5e 100%);
  color: #fff;
  border: none;
  border-radius: var(--r-full);
  font-size: 0.97rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--t-base);
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-head);
  letter-spacing: 0.01em;
  box-shadow: 0 4px 14px rgba(255,126,45,0.35);
}

.auth-submit-btn:hover {
  background: linear-gradient(135deg, #e8621a 0%, #FF7E2D 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-brand);
}

.auth-submit-btn:active { transform: translateY(0); }
.auth-submit-btn:disabled {
  background: var(--text-xlight);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Message div */
.auth-msg {
  display: none;
  margin-top: 14px;
  padding: 11px 16px;
  border-radius: var(--r-md);
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.5;
  animation: fadeSlideIn 0.3s var(--ease);
}

.auth-msg.error   { background: var(--red-soft);    color: #dc2626; border: 1px solid rgba(239,68,68,0.2); }
.auth-msg.success { background: var(--green-soft);   color: #059669; border: 1px solid rgba(16,185,129,0.2); }
.auth-msg.info    { background: var(--blue-soft);    color: #2563eb; border: 1px solid rgba(59,130,246,0.2); }

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0;
}

.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Auth footer link */
.auth-footer-text {
  text-align: center;
  margin-top: 24px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.auth-footer-text a {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.auth-footer-text a:hover { text-decoration: underline; }

/* Role tabs */
.auth-role-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.auth-role-tab {
  flex: 1;
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  text-align: center;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-input);
  transition: all var(--t-base);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.auth-role-tab:hover,
.auth-role-tab.active {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

/* Benefits list */
.auth-benefits {
  background: var(--brand-softer);
  border: 1px solid rgba(255,126,45,0.15);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.auth-benefit {
  font-size: 0.79rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.auth-benefit i { color: var(--brand); font-size: 0.78rem; }

/* Terms checkbox */
.auth-terms-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0;
}

.auth-terms-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--brand);
  flex-shrink: 0;
  cursor: pointer;
}

.auth-terms-row label {
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1.5;
}

/* Form row (2 cols) */
.auth-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Forgot modal */
.auth-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-modal-overlay.open { display: flex; }

.auth-modal {
  background: var(--bg-card);
  border-radius: var(--r-2xl);
  max-width: 420px;
  width: 100%;
  padding: 36px;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.3s var(--ease-spring);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-modal h3 {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.auth-modal p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 20px;
}

/* ══════════════════════════════════════
   DASHBOARD LAYOUT
══════════════════════════════════════ */

/* Topbar */
.d-topbar {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 500;
  box-shadow: 0 1px 0 var(--border);
  transition: background var(--t-base), border-color var(--t-base);
}

.d-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.15rem;
}

.d-logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #FF7E2D, #ffaa5e);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(255,126,45,0.3);
}

.d-logo span { color: var(--brand); }

.d-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.d-icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: all var(--t-base);
  position: relative;
  text-decoration: none;
}

.d-icon-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

.d-notif-badge {
  position: absolute;
  top: -3px; right: -3px;
  min-width: 17px; height: 17px;
  background: var(--red);
  color: #fff;
  border-radius: 50px;
  font-size: 0.6rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* User pill */
.d-user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: all var(--t-base);
  position: relative;
}

.d-user-pill:hover { border-color: var(--brand); box-shadow: var(--shadow-card); }

.d-user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF7E2D, #ffaa5e);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
}

.d-user-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* User dropdown */
.d-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  min-width: 200px;
  box-shadow: var(--shadow-xl);
  z-index: 600;
  overflow: hidden;
  padding: 6px;
}

.d-dropdown.open {
  display: block;
  animation: scaleInDown 0.2s var(--ease-spring);
}

@keyframes scaleInDown {
  from { opacity: 0; transform: scale(0.93) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.d-dropdown a,
.d-dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background var(--t-fast);
  border-radius: var(--r-md);
}

.d-dropdown a:hover,
.d-dropdown button:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.d-dropdown a i, .d-dropdown button i { width: 16px; text-align: center; }

.d-dropdown .sep {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ── Sidebar Toggle Button in Topbar ── */
.d-sidebar-toggle {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: all var(--t-base);
  flex-shrink: 0;
}
.d-sidebar-toggle:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

/* ── Sidebar ── */
.d-sidebar {
  background: var(--sidebar-bg);
  width: var(--sidebar-w);
  height: calc(100vh - var(--topbar-h));
  position: sticky;
  top: var(--topbar-h);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
  border-right: 1px solid var(--sidebar-border);
  transition: background var(--t-base), width 0.28s cubic-bezier(0.4,0,0.2,1), transform 0.28s cubic-bezier(0.4,0,0.2,1), margin-left 0.28s cubic-bezier(0.4,0,0.2,1);
}
.d-sidebar.sidebar-collapsed {
  width: 0;
  min-width: 0;
  overflow: hidden;
  border-right: none;
  padding: 0;
  flex-shrink: 0;
}

.d-sidebar::-webkit-scrollbar { width: 4px; }
.d-sidebar::-webkit-scrollbar-thumb { background: rgba(255,126,45,0.2); border-radius: 4px; }

/* Sidebar profile section */
.s-profile {
  padding: 20px 16px;
  border-bottom: 1px solid var(--sidebar-border);
  text-align: center;
}

.s-avatar-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 10px;
}

.s-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF7E2D, #ffaa5e);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 1.4rem;
  font-weight: 800;
  border: 3px solid rgba(255,126,45,0.3);
}

.s-online {
  position: absolute;
  bottom: 2px; right: 2px;
  width: 14px; height: 14px;
  background: #10b981;
  border-radius: 50%;
  border: 2px solid var(--sidebar-bg);
}

.s-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.s-email {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.4);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.s-plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--r-full);
  background: rgba(255,126,45,0.18);
  color: #FF7E2D;
  border: 1px solid rgba(255,126,45,0.25);
}

/* Sidebar nav */
.s-nav {
  flex: 1;
  padding: 8px 8px;
  overflow-y: auto;
}

.s-nav::-webkit-scrollbar { width: 0; }

.s-section-label {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.2);
  padding: 14px 10px 5px;
}

.s-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--sidebar-text);
  cursor: pointer;
  border-radius: var(--r-md);
  transition: all var(--t-base);
  text-decoration: none;
  margin-bottom: 1px;
  position: relative;
  border: none;
  background: none;
  width: 100%;
  font-family: var(--font-sans);
}

.s-link::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #FF7E2D, #ffaa5e);
  border-radius: 0 2px 2px 0;
  transform: scaleY(0);
  transition: transform var(--t-base);
}

.s-link:hover {
  background: var(--sidebar-hover);
  color: rgba(255,255,255,0.9);
}

.s-link.active {
  background: var(--sidebar-active);
  color: #FF7E2D;
  font-weight: 700;
}

.s-link.active::before { transform: scaleY(1); }

.s-link i {
  width: 18px;
  text-align: center;
  font-size: 0.88rem;
  flex-shrink: 0;
}

.s-badge {
  margin-left: auto;
  background: var(--brand);
  color: #fff;
  border-radius: var(--r-full);
  padding: 1px 7px;
  font-size: 0.6rem;
  font-weight: 800;
  flex-shrink: 0;
}

.s-badge.red { background: var(--red); }

/* Sidebar footer */
.s-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--sidebar-border);
}

.s-logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: rgba(239,68,68,0.08);
  color: rgba(239,68,68,0.8);
  border: 1px solid rgba(239,68,68,0.15);
  border-radius: var(--r-md);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all var(--t-base);
}

.s-logout-btn:hover {
  background: rgba(239,68,68,0.14);
  color: #ef4444;
}

/* ── Dashboard wrap ── */
.d-wrap {
  display: flex;
  min-height: calc(100vh - var(--topbar-h));
  overflow-x: hidden;
}

.d-main {
  flex: 1;
  background: var(--bg);
  overflow: auto;
  min-width: 0;
  transition: flex 0.28s cubic-bezier(0.4,0,0.2,1), padding 0.28s cubic-bezier(0.4,0,0.2,1);
}

.d-inner {
  padding: 28px;
  max-width: 1400px;
}

/* ── Section panels ── */
.section-panel {
  display: none;
}

.section-panel.active {
  display: block;
  animation: fadeInUp 0.3s var(--ease);
}

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

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Welcome Banner ── */
.welcome-banner {
  background: linear-gradient(135deg, #FF7E2D 0%, #ffaa5e 100%);
  border-radius: var(--r-2xl);
  padding: 30px 36px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.welcome-banner::before {
  content: '';
  position: absolute;
  right: -60px; top: -60px;
  width: 220px; height: 220px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  pointer-events: none;
}

.welcome-banner::after {
  content: '';
  position: absolute;
  right: 80px; bottom: -40px;
  width: 120px; height: 120px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  pointer-events: none;
}

.welcome-banner-left { position: relative; z-index: 1; }

.welcome-banner h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.welcome-banner p {
  color: rgba(255,255,255,0.85);
  font-size: 0.92rem;
  margin: 0;
}

.welcome-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.btn-glass {
  background: rgba(255,255,255,0.18);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.3);
  padding: 9px 18px;
  border-radius: var(--r-full);
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all var(--t-base);
  text-decoration: none;
  font-family: var(--font-sans);
}

.btn-glass:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-2px);
  color: #fff;
}

.welcome-emoji {
  font-size: 4rem;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* ── Stats Grid ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: all var(--t-base);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #FF7E2D, #ffaa5e);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-base);
}

.stat-card:hover {
  border-color: rgba(255,126,45,0.3);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.stat-card:hover::after { transform: scaleX(1); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.stat-num {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-change {
  font-size: 0.72rem;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.stat-change.up   { color: var(--green); }
.stat-change.flat { color: var(--text-light); }

/* ── Widget ── */
.widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  margin-bottom: 20px;
  transition: box-shadow var(--t-base), border-color var(--t-base);
}

.widget:hover { box-shadow: var(--shadow-card); }

.widget-head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.widget-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 9px;
}

.widget-action {
  font-size: 0.8rem;
  color: var(--brand);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: none;
  font-family: var(--font-sans);
}

.widget-action:hover { text-decoration: underline; color: var(--brand-dark); }

/* ── Section header ── */
.section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-hdr h2 {
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 800;
}

/* ── Button styles ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #FF7E2D, #ffaa5e);
  color: #fff;
  padding: 10px 22px;
  border-radius: var(--r-full);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all var(--t-base);
  box-shadow: 0 4px 12px rgba(255,126,45,0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-brand);
  color: #fff;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  padding: 10px 22px;
  border-radius: var(--r-full);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  border: 1.5px solid var(--border);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all var(--t-base);
}

.btn-secondary:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* ── Badges / status ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}

.badge-orange  { background: var(--brand-soft);   color: var(--brand-dark); }
.badge-green   { background: var(--green-soft);   color: #059669; }
.badge-blue    { background: var(--blue-soft);    color: #1d4ed8; }
.badge-purple  { background: var(--purple-soft);  color: #7c3aed; }
.badge-red     { background: var(--red-soft);     color: #dc2626; }
.badge-yellow  { background: var(--yellow-soft);  color: #92400e; }
.badge-gray    { background: var(--bg-subtle);    color: var(--text-muted); }

/* ── Progress bar ── */
.progress-bar {
  height: 7px;
  background: var(--border);
  border-radius: var(--r-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #FF7E2D, #ffaa5e);
  border-radius: var(--r-full);
  transition: width 1.2s var(--ease);
}

/* ── Order rows ── */
.order-row {
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: background var(--t-fast);
}

.order-row:last-child { border-bottom: none; }
.order-row:hover { background: var(--brand-softer); }

.order-icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.order-info { flex: 1; min-width: 0; }
.order-name { font-size: 0.88rem; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-meta { font-size: 0.74rem; color: var(--text-muted); margin-top: 2px; }
.order-right { text-align: right; flex-shrink: 0; }
.order-price { font-size: 0.92rem; font-weight: 800; color: var(--brand); }
.order-date  { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

/* ── Material cards ── */
.mat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  padding: 20px 22px;
}

.mat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  transition: all var(--t-base);
}

.mat-card:hover {
  border-color: rgba(255,126,45,0.3);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.mat-card-icon {
  width: 46px; height: 46px;
  background: var(--brand-soft);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  color: var(--brand);
  margin-bottom: 12px;
}

.mat-card h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.3;
}

.mat-card p {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 52px 24px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 3rem;
  display: block;
  margin-bottom: 16px;
  opacity: 0.2;
}

.empty-state h3 {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.86rem;
  margin-bottom: 20px;
}

/* ── Profile form ── */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 22px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-input);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: all var(--t-fast);
}

.form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255,126,45,0.12);
}

.form-control::placeholder { color: var(--text-light); }

/* ── Profile avatar section ── */
.profile-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 22px;
  border-bottom: 1px solid var(--border);
}

.profile-avatar {
  width: 90px; height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF7E2D, #ffaa5e);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 14px;
  position: relative;
  border: 4px solid rgba(255,126,45,0.2);
}

.avatar-edit-btn {
  position: absolute;
  bottom: 0; right: 0;
  width: 28px; height: 28px;
  background: var(--brand);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 0.68rem;
  cursor: pointer;
  border: 2px solid var(--bg-card);
  transition: all var(--t-fast);
}

.avatar-edit-btn:hover { background: var(--brand-dark); }

/* ── Chat styles ── */
.chat-wrap {
  height: 380px;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-msg-wrap { display: flex; flex-direction: column; }

.chat-msg {
  padding: 12px 16px;
  border-radius: 14px;
  max-width: 85%;
  font-size: 0.86rem;
  line-height: 1.6;
}

.chat-msg.admin {
  background: var(--brand-soft);
  color: var(--text);
  border-radius: 14px 14px 14px 4px;
  align-self: flex-start;
}

.chat-msg.user-msg {
  background: var(--brand);
  color: #fff;
  align-self: flex-end;
  border-radius: 14px 14px 4px 14px;
}

.chat-msg-time {
  font-size: 0.7rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* ── 2-col grid ── */
.panel-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.panel-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}

/* ── Chart container ── */
.chart-wrap {
  padding: 16px 20px 20px;
}

.chart-legend {
  display: flex;
  gap: 16px;
  padding: 8px 22px 16px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}

/* ── Quick actions ── */
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 14px 10px;
  border-radius: var(--r-lg);
  border: 1.5px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  transition: all var(--t-base);
  text-decoration: none;
}

.quick-action:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  transform: translateY(-2px);
}

.quick-action-icon {
  width: 42px; height: 42px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}

.quick-action-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

/* ── Achievement badges ── */
.achievement-badge {
  text-align: center;
  padding: 16px 10px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--bg);
  transition: all var(--t-base);
  cursor: pointer;
}

.achievement-badge.earned { border-color: rgba(255,126,45,0.25); background: var(--brand-softer); }
.achievement-badge.locked { opacity: 0.4; filter: grayscale(1); }
.achievement-badge:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }

.ach-icon { font-size: 1.8rem; display: block; margin-bottom: 7px; }
.ach-name { font-size: 0.72rem; font-weight: 700; color: var(--text); }

/* ── Course progress card ── */
.course-progress-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg);
  transition: all var(--t-base);
}

.course-progress-card:hover {
  border-color: rgba(255,126,45,0.25);
  box-shadow: var(--shadow-xs);
}

.cpc-icon {
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.cpc-info { flex: 1; min-width: 0; }
.cpc-name { font-size: 0.85rem; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.cpc-meta { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 6px; }
.cpc-percent { font-size: 0.85rem; font-weight: 800; color: var(--brand); }

/* ── Notification item ── */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  transition: background var(--t-fast);
  cursor: pointer;
}

.notif-item:hover { background: var(--brand-softer); }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: rgba(255,126,45,0.03); }

.notif-icon {
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.notif-title { font-size: 0.86rem; font-weight: 600; color: var(--text); }
.notif-body  { font-size: 0.77rem; color: var(--text-muted); margin-top: 2px; }
.notif-dot   { width: 8px; height: 8px; background: var(--brand); border-radius: 50%; margin-top: 6px; flex-shrink: 0; }

/* ── Streak card ── */
.streak-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 22px;
  text-align: center;
  transition: all var(--t-base);
}

.streak-card:hover {
  border-color: rgba(255,126,45,0.3);
  box-shadow: var(--shadow-card);
}

.streak-flame { font-size: 2.5rem; margin-bottom: 6px; }
.streak-days {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--brand);
  line-height: 1;
}

/* ── Mini calendar ── */
.mini-calendar {
  padding: 14px 16px;
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.cal-month {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.cal-nav {
  width: 28px; height: 28px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem;
  transition: all var(--t-fast);
}

.cal-nav:hover { border-color: var(--brand); color: var(--brand); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-day-name {
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-light);
  padding: 4px 0;
  text-transform: uppercase;
}

.cal-day {
  text-align: center;
  font-size: 0.75rem;
  padding: 5px 2px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--t-fast);
  color: var(--text-muted);
}

.cal-day:hover { background: var(--brand-soft); color: var(--brand); }
.cal-day.today { background: var(--brand); color: #fff; font-weight: 700; }
.cal-day.other-month { color: var(--text-xlight); }

/* ── Cert card ── */
.cert-card {
  background: linear-gradient(135deg, #FF7E2D, #ffaa5e);
  border-radius: var(--r-xl);
  padding: 28px 24px;
  color: #fff;
  position: relative;
  overflow: hidden;
  transition: all var(--t-base);
}

.cert-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 120px; height: 120px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
}

.cert-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-brand); }
.cert-card h3 { color: #fff; font-size: 1.05rem; margin-bottom: 8px; }
.cert-card p  { color: rgba(255,255,255,0.85); font-size: 0.84rem; margin-bottom: 0; }

.cert-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.btn-cert {
  padding: 8px 16px;
  border-radius: var(--r-full);
  font-size: 0.79rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: var(--font-sans);
  transition: all var(--t-base);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-cert.primary { background: #fff; color: var(--brand); }
.btn-cert.ghost   { background: rgba(255,255,255,0.2); color: #fff; border: 1.5px solid rgba(255,255,255,0.35); }
.btn-cert:hover   { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

/* ── Payment row ── */
.payment-row {
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background var(--t-fast);
}

.payment-row:hover { background: var(--brand-softer); }
.payment-row:last-child { border-bottom: none; }
.payment-name { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.payment-meta { font-size: 0.74rem; color: var(--text-muted); margin-top: 2px; }
.payment-amt  { font-size: 0.95rem; font-weight: 800; color: var(--green); }
.payment-date { font-size: 0.72rem; color: var(--text-muted); text-align: right; }

/* ── Recommendation card ── */
.recommendation-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  border: 1.5px solid var(--border);
  background: var(--bg);
  text-decoration: none;
  transition: all var(--t-base);
}

.recommendation-card:hover {
  border-color: rgba(255,126,45,0.3);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.rec-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.rec-title { font-size: 0.86rem; font-weight: 700; color: var(--text); }
.rec-sub   { font-size: 0.74rem; color: var(--text-muted); margin-top: 2px; }

/* ── Insight card ── */
.insight-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 22px 24px;
  transition: all var(--t-base);
}

.insight-card:hover {
  border-color: rgba(255,126,45,0.2);
  box-shadow: var(--shadow-sm);
}

/* ── Admin KPI grid ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 18px;
  transition: all var(--t-base);
  position: relative;
  overflow: hidden;
}

.kpi-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #FF7E2D, #ffaa5e);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-base);
}

.kpi-card:hover {
  border-color: rgba(255,126,45,0.25);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.kpi-card:hover::after { transform: scaleX(1); }

.kpi-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.kpi-num {
  font-family: var(--font-mono);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

.kpi-label { font-size: 0.76rem; color: var(--text-muted); }
.kpi-change { font-size: 0.72rem; margin-top: 4px; display: flex; align-items: center; gap: 3px; }
.kpi-change.up   { color: var(--green); }
.kpi-change.down { color: var(--red); }

/* ── Admin table ── */
.admin-table-wrap { overflow-x: auto; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }

.admin-table tr:hover td { background: var(--brand-softer); }

/* ── Admin sidebar (dark) ── */
.admin-sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: #0a0604;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 200;
  overflow-y: auto;
  border-right: 1px solid rgba(255,126,45,0.1);
  transition: transform var(--t-base);
}

.admin-sidebar::-webkit-scrollbar { width: 4px; }
.admin-sidebar::-webkit-scrollbar-thumb { background: rgba(255,126,45,0.2); border-radius: 4px; }

.admin-side-logo {
  padding: 22px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.admin-side-logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, #FF7E2D, #ffaa5e);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(255,126,45,0.35);
}

.admin-side-logo-text {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
}

.admin-side-logo-text span { color: #FF7E2D; }

.admin-side-badge {
  font-size: 0.62rem;
  padding: 2px 7px;
  background: rgba(255,126,45,0.2);
  color: #FF7E2D;
  border-radius: var(--r-full);
  font-weight: 800;
  margin-left: auto;
}

.admin-side-nav { padding: 10px 8px; flex: 1; }

.admin-side-section {
  font-size: 0.61rem;
  font-weight: 800;
  color: rgba(255,255,255,0.2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 14px 10px 5px;
}

.admin-side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  color: rgba(255,255,255,0.5);
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--t-base);
  margin-bottom: 1px;
  cursor: pointer;
  position: relative;
  border: none;
  background: none;
  width: 100%;
  font-family: var(--font-sans);
}

.admin-side-link::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #FF7E2D, #ffaa5e);
  border-radius: 0 2px 2px 0;
  transform: scaleY(0);
  transition: transform var(--t-base);
}

.admin-side-link:hover {
  background: rgba(255,126,45,0.1);
  color: #FF7E2D;
}

.admin-side-link.active {
  background: rgba(255,126,45,0.18);
  color: #FF7E2D;
  font-weight: 700;
}

.admin-side-link.active::before { transform: scaleY(1); }
.admin-side-link:hover::before  { transform: scaleY(1); }
.admin-side-link i { width: 18px; text-align: center; font-size: 0.88rem; flex-shrink: 0; }

.admin-side-bottom {
  padding: 12px 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.admin-side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  margin-bottom: 6px;
}

.admin-side-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF7E2D, #ffaa5e);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  flex-shrink: 0;
}

.admin-side-user-name { color: #fff; font-size: 0.83rem; font-weight: 700; }
.admin-side-user-role { color: rgba(255,255,255,0.4); font-size: 0.7rem; }

.admin-side-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  color: rgba(255,255,255,0.4);
  font-size: 0.83rem;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  font-family: var(--font-sans);
  transition: all var(--t-base);
}

.admin-side-logout:hover {
  background: rgba(239,68,68,0.12);
  color: #ef4444;
}

/* ── Admin main layout ── */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 var(--border);
}

.admin-topbar-left h2 {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.admin-topbar-left p {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.admin-content {
  padding: 28px;
  flex: 1;
}

/* ── Tab nav ── */
.tab-nav {
  display: flex;
  gap: 2px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 4px;
  margin-bottom: 24px;
  width: fit-content;
  flex-wrap: wrap;
}

.tab-item {
  padding: 8px 20px;
  border-radius: var(--r-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-base);
  white-space: nowrap;
  font-family: var(--font-sans);
}

.tab-item.active {
  background: linear-gradient(135deg, #FF7E2D, #ffaa5e);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255,126,45,0.3);
}

/* ── Toast system ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 380px;
  animation: toastIn 0.35s var(--ease-spring);
  pointer-events: all;
}

.toast.removing {
  animation: toastOut 0.3s var(--ease) forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px) scale(0.9); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to   { opacity: 0; transform: translateX(30px) scale(0.9); }
}

.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast-text { font-size: 0.86rem; font-weight: 600; color: var(--text); flex: 1; }

.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--brand); }
.toast.warning { border-left: 3px solid var(--yellow); }

/* ── Realtime dot ── */
.realtime-dot {
  width: 7px; height: 7px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse-live 2s infinite;
  display: inline-block;
}

@keyframes pulse-live {
  0%,100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
  50%      { opacity: 0.8; transform: scale(1.2); box-shadow: 0 0 0 4px rgba(16,185,129,0); }
}

/* ── Search input ── */
.search-input-wrap {
  position: relative;
  width: 240px;
}

.search-input-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 0.85rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-full);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.84rem;
  font-family: var(--font-sans);
  outline: none;
  transition: all var(--t-fast);
}

.search-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255,126,45,0.1);
}

/* ── Admin action buttons ── */
.btn-admin {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--r-full);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: var(--font-sans);
  transition: all var(--t-base);
}

.btn-admin.primary {
  background: linear-gradient(135deg, #FF7E2D, #ffaa5e);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255,126,45,0.3);
}

.btn-admin.primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-brand);
}

.btn-admin.secondary {
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}

.btn-admin.secondary:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.btn-admin.danger {
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.2);
}

.btn-admin.danger:hover {
  background: var(--red);
  color: #fff;
}

/* ── Loading spinner ── */
.spin { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .d-sidebar { display: none; }
  .d-inner { padding: 16px; }
  .panel-grid-2, .panel-grid-3 { grid-template-columns: 1fr; }
  .auth-page { flex-direction: column; }
  .auth-brand-panel { display: none; }
  .auth-form-panel { padding: 24px 20px; }
  .admin-sidebar { transform: translateX(-100%); }
  .admin-main { margin-left: 0; }
  .admin-sidebar.open { transform: translateX(0); }
}

@media (max-width: 640px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .welcome-emoji { display: none; }
  .welcome-banner { padding: 22px 20px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .auth-form-row { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════
   PREMIUM DASHBOARD TAB BUTTON ENHANCEMENTS
   ═══════════════════════════════════════════════════════════════ */

/* Section-header action buttons — make premium */
.section-hdr .btn-primary,
.section-hdr a.btn-primary {
  background: linear-gradient(135deg, #FF7E2D 0%, #ff9a5c 100%);
  color: #fff;
  padding: 10px 24px;
  border-radius: 50px;
  font-size: 0.84rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255,126,45,0.35);
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  letter-spacing: 0.01em;
}
.section-hdr .btn-primary:hover,
.section-hdr a.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255,126,45,0.45);
  color: #fff;
}

/* Widget action buttons - premium ghost style */
.widget-action {
  font-size: 0.79rem;
  color: var(--brand);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1.5px solid rgba(255,126,45,0.2);
  background: rgba(255,126,45,0.06);
  border-radius: 50px;
  padding: 5px 12px;
  font-family: var(--font-sans);
  transition: all 0.2s;
}
.widget-action:hover {
  text-decoration: none;
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255,126,45,0.3);
}

/* Settings panel action buttons — premium style */
.panel-settings-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 600;
  transition: all 0.22s;
  text-align: left;
  width: 100%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.panel-settings-btn:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  transform: translateX(3px);
  box-shadow: 0 4px 14px rgba(255,126,45,0.15);
}
.panel-settings-btn.danger {
  border-color: rgba(239,68,68,0.25);
  background: rgba(239,68,68,0.04);
  color: #dc2626;
}
.panel-settings-btn.danger:hover {
  border-color: #ef4444;
  background: rgba(239,68,68,0.1);
  box-shadow: 0 4px 14px rgba(239,68,68,0.2);
}

/* Save Profile button — extra premium */
[onclick="saveProfile()"] {
  background: linear-gradient(135deg, #FF7E2D, #ff9a5c) !important;
  box-shadow: 0 4px 16px rgba(255,126,45,0.3) !important;
  letter-spacing: 0.02em;
}
[onclick="saveProfile()"]:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(255,126,45,0.4) !important;
}

/* Mark all read button */
#markAllRead {
  font-size: 0.78rem;
  padding: 5px 14px;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 600;
  transition: all 0.2s;
}
#markAllRead:hover {
  border-color: var(--green);
  color: var(--green);
  background: rgba(16,185,129,0.06);
}

/* Chat send button */
[onclick="sendChatMsg()"].btn-primary {
  border-radius: 50px;
  padding: 10px 20px;
  font-size: 0.84rem;
}

/* Empty state action buttons */
.empty-state .btn-primary {
  margin-top: 10px;
  display: inline-flex;
  justify-content: center;
}
