/* ============================================================
   CourseMax v6 — Obsidian Premium Academic Theme
   Deep slate · Indigo-violet accents · Sharp editorial feel
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Serif+Display:ital@0;1&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg:          #080c14;
  --bg2:         #0c1120;
  --bg3:         #101828;
  --surface:     #121929;
  --surface2:    #18243a;
  --surface3:    #1e2f49;
  --border:      rgba(148, 174, 255, 0.07);
  --border2:     rgba(148, 174, 255, 0.13);
  --border3:     rgba(148, 174, 255, 0.22);
  --text:        #f0f4ff;
  --text2:       #c5d3f0;
  --muted:       #7f95c0;
  --muted2:      #4a5e80;
  --accent:      #7c6bff;
  --accent-lt:   #a99cff;
  --accent-dim:  rgba(124, 107, 255, 0.14);
  --accent-glow: rgba(124, 107, 255, 0.28);
  --gold:        #f0c76a;
  --gold-lt:     #fae0a8;
  --gold-dim:    rgba(240, 199, 106, 0.13);
  --gold-glow:   rgba(240, 199, 106, 0.22);
  --blue:        #60a5fa;
  --blue-dim:    rgba(96, 165, 250, 0.12);
  --teal:        #2dd4bf;
  --teal-dim:    rgba(45, 212, 191, 0.12);
  --green:       #34d399;
  --green-dim:   rgba(52, 211, 153, 0.12);
  --red:         #fb7185;
  --red-dim:     rgba(251, 113, 133, 0.12);
  --amber:       #fbbf24;
  --amber-dim:   rgba(251, 191, 36, 0.12);
  --r-xs: 4px;
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-2xl: 32px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.45);
  --shadow:    0 4px 24px rgba(0,0,0,0.55);
  --shadow-lg: 0 16px 56px rgba(0,0,0,0.65);
  --shadow-xl: 0 28px 90px rgba(0,0,0,0.75);
  --glow:      0 0 48px rgba(124, 107, 255, 0.15);
}

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

html {
  background:
    radial-gradient(ellipse 70% 55% at -10% -10%, rgba(100, 80, 255, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 110% -5%, rgba(180, 130, 255, 0.15) 0%, transparent 50%),
    #080c14;
  background-attachment: fixed;
}

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  background: transparent;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle 600px at 15% 20%, rgba(100, 80, 255, 0.10), transparent),
    radial-gradient(circle 400px at 85% 15%, rgba(180, 100, 255, 0.07), transparent),
    radial-gradient(circle 500px at 50% 80%, rgba(45, 212, 191, 0.04), transparent);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

a { color: inherit; text-decoration: none; }

.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(14, 22, 42, 0.97) 0%, rgba(8, 14, 26, 0.99) 100%);
  border-right: 1px solid rgba(148, 174, 255, 0.09);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow-y: auto;
  box-shadow: 2px 0 24px rgba(0,0,0,0.3);
  scrollbar-width: thin;
  scrollbar-color: rgba(148,174,255,0.1) transparent;
}

.sidebar::before {
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(90deg, rgba(124,107,255,0.9), rgba(180,130,255,0.9), rgba(240,199,106,0.7), transparent);
  flex-shrink: 0;
}

.sidebar-logo { padding: 24px 18px 16px; border-bottom: 1px solid var(--border); }
.sidebar-logo-mark { display: flex; align-items: center; gap: 12px; }
.sidebar-logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, rgba(124,107,255,0.25), rgba(100,80,255,0.15));
  border: 1px solid rgba(124,107,255,0.3);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
  box-shadow: 0 0 18px rgba(124,107,255,0.2), inset 0 1px 0 rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.sidebar-logo-text { font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: -0.025em; }
.sidebar-logo-sub { font-size: 10px; color: var(--muted2); margin-top: 1px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; }

.sidebar-nav { flex: 1; padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }

.sidebar-section-label {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted2); padding: 12px 10px 5px; margin-top: 4px;
}
.sidebar-section-label:first-child { margin-top: 0; }

.sidebar-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: var(--r); font-size: 13.5px; font-weight: 500; color: var(--muted);
  transition: background .15s, color .15s, border-color .15s;
  cursor: pointer; border: 1px solid transparent; position: relative;
}
.sidebar-link:hover { background: rgba(148,174,255,0.06); color: var(--text2); }
.sidebar-link.active {
  background: linear-gradient(135deg, rgba(124,107,255,0.18), rgba(100,80,255,0.08));
  color: var(--text); border-color: rgba(124,107,255,0.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.sidebar-link.active::before {
  content: ''; position: absolute; left: 0; top: 22%; bottom: 22%;
  width: 3px; background: linear-gradient(180deg, var(--accent-lt), var(--accent));
  border-radius: 0 4px 4px 0;
}
.sidebar-link-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; opacity: 0.85; }

.sidebar-footer { padding: 12px 10px; border-top: 1px solid var(--border); }
.sidebar-user {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: var(--r); background: rgba(255,255,255,0.03); border: 1px solid var(--border);
}
.sidebar-user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(124,107,255,0.4), rgba(100,80,255,0.25));
  border: 1.5px solid rgba(124,107,255,0.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700; color: var(--accent-lt); flex-shrink: 0;
}
.sidebar-user-name { font-size: 13px; font-weight: 600; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-role { font-size: 10.5px; color: var(--muted2); margin-top: 1px; }
.sidebar-signout {
  display: block; text-align: center; margin-top: 8px; padding: 8px;
  border-radius: var(--r-sm); font-size: 12px; font-weight: 600;
  color: var(--muted2); border: 1px solid transparent; transition: all .15s;
}
.sidebar-signout:hover { background: var(--red-dim); border-color: rgba(251,113,133,0.25); color: var(--red); }

.main-content { flex: 1; margin-left: 260px; display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }

.topbar {
  height: 62px;
  background: rgba(8,12,20,0.70);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border-bottom: 1px solid rgba(148,174,255,0.08);
  display: flex; align-items: center; padding: 0 32px; gap: 12px;
  position: sticky; top: 0; z-index: 100;
}
.topbar-breadcrumb { flex: 1; display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); overflow: hidden; }
.topbar-breadcrumb a { color: var(--blue); transition: color .15s; }
.topbar-breadcrumb a:hover { color: var(--accent-lt); }
.topbar-breadcrumb .sep { color: var(--muted2); font-size: 10px; }
.topbar-breadcrumb .current { color: var(--text2); font-weight: 600; font-size: 13.5px; }

.container { flex: 1; padding: 32px 32px 72px; max-width: 1380px; animation: fadeUp .4s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.card {
  background: rgba(18,25,41,0.95); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 22px 24px; box-shadow: var(--shadow-sm); transition: border-color .2s;
}
.card + .card { margin-top: 14px; }
.card.inset { background: rgba(12,17,32,0.9); border-color: var(--border); box-shadow: none; }
.card.flush { padding: 0; overflow: hidden; }
.card.glow { border-color: rgba(124,107,255,0.22); box-shadow: var(--glow), var(--shadow); }

.page-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.page-title { font-family: 'DM Serif Display', Georgia, serif; font-size: 28px; font-weight: 400; color: var(--text); line-height: 1.2; letter-spacing: -0.01em; }
.page-sub { color: var(--muted); font-size: 13.5px; margin-top: 5px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 10px; flex-wrap: wrap; }
.breadcrumb a { color: var(--blue); }
.breadcrumb a:hover { color: var(--accent-lt); }
.breadcrumb-sep { color: var(--muted2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 16px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600;
  font-family: 'DM Sans', sans-serif; border: 1px solid var(--border2);
  background: rgba(255,255,255,0.04); color: var(--text2); cursor: pointer;
  white-space: nowrap; transition: all .16s; line-height: 1; letter-spacing: 0.01em;
}
.btn:hover { background: rgba(255,255,255,0.08); border-color: var(--border3); color: var(--text); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.btn:active { transform: scale(.97) translateY(0); }

.btn.primary {
  background: linear-gradient(135deg, #8b7aff 0%, #6b57ff 100%);
  border-color: rgba(124,107,255,0.5); color: #fff; font-weight: 700;
  box-shadow: 0 3px 16px rgba(107,87,255,0.35); text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.btn.primary:hover { background: linear-gradient(135deg, #9e8fff 0%, #7c6bff 100%); box-shadow: 0 6px 24px rgba(107,87,255,0.5); }

.btn.teal { background: var(--teal-dim); border-color: rgba(45,212,191,0.28); color: var(--teal); }
.btn.teal:hover { background: rgba(45,212,191,0.2); border-color: rgba(45,212,191,0.45); }

.btn.blue { background: var(--blue-dim); border-color: rgba(96,165,250,0.28); color: var(--blue); }
.btn.blue:hover { background: rgba(96,165,250,0.2); }

.btn.danger { background: transparent; border-color: rgba(251,113,133,0.22); color: var(--red); }
.btn.danger:hover { background: var(--red-dim); border-color: rgba(251,113,133,0.42); }

.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; }
.btn.ghost:hover { background: rgba(148,174,255,0.06); color: var(--text2); border-color: var(--border); }

.btn.sm  { padding: 5px 12px; font-size: 12px; }
.btn.lg  { padding: 11px 24px; font-size: 14.5px; }
.btn.icon { padding: 8px; }

.stat-card {
  background: rgba(18,25,41,0.95); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 22px 24px; position: relative; overflow: hidden;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.stat-card:hover { border-color: rgba(124,107,255,0.2); transform: translateY(-3px); box-shadow: var(--shadow), 0 0 32px rgba(124,107,255,0.08); }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.07), transparent); }
.stat-card::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: var(--accent-color, var(--accent)); opacity: 0.5; }
.stat-icon { width: 44px; height: 44px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; font-size: 21px; margin-bottom: 16px; }
.stat-value { font-family: 'DM Serif Display', Georgia, serif; font-size: 38px; font-weight: 400; line-height: 1; color: var(--text); letter-spacing: -0.02em; }
.stat-label { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.10em; margin-top: 6px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.section-title { font-weight: 700; font-size: 14px; color: var(--text); letter-spacing: 0.01em; }
.section-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.hr { height: 1px; background: var(--border); margin: 16px 0; }

label { display: block; margin: 16px 0 6px; font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; }
label:first-child { margin-top: 0; }
label .hint { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted2); }

input[type="text"], input[type="email"], input[type="password"], input[type="search"], textarea, select {
  width: 100%; padding: 10px 14px; border-radius: var(--r-sm); border: 1px solid var(--border2);
  background: rgba(8,12,20,0.7); color: var(--text); font-family: 'DM Sans', sans-serif;
  font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { min-height: 130px; resize: vertical; line-height: 1.65; font-family: 'JetBrains Mono', monospace; font-size: 13px; }
textarea.prose { font-family: 'DM Sans', sans-serif; font-size: 14px; }
textarea.tall  { min-height: 200px; }
input:focus, textarea:focus, select:focus { border-color: rgba(124,107,255,0.5); background: rgba(124,107,255,0.03); box-shadow: 0 0 0 3px rgba(124,107,255,0.10); }
select { cursor: pointer; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.field-row { display: flex; gap: 14px; }
.field-row > * { flex: 1; min-width: 0; }

.alert { padding: 12px 16px; border-radius: var(--r-sm); font-size: 13.5px; margin: 12px 0; border: 1px solid; display: flex; align-items: flex-start; gap: 10px; line-height: 1.55; }
.alert::before { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.alert.ok   { color: var(--green);  border-color: rgba(52,211,153,0.25);  background: var(--green-dim); }
.alert.ok::before   { content: "✓"; }
.alert.err  { color: var(--red);    border-color: rgba(251,113,133,0.25); background: var(--red-dim); }
.alert.err::before  { content: "✕"; }
.alert.info { color: var(--blue);   border-color: rgba(96,165,250,0.25);  background: var(--blue-dim); }
.alert.info::before { content: "ℹ"; }
.alert.warn { color: var(--amber);  border-color: rgba(251,191,36,0.25);  background: var(--amber-dim); }
.alert.warn::before { content: "⚠"; }

.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px;
  border-radius: 999px; font-size: 11px; font-weight: 700; border: 1px solid var(--border2);
  color: var(--muted); background: rgba(255,255,255,0.04); white-space: nowrap;
  letter-spacing: 0.03em; text-transform: uppercase;
}
.pill.gold    { border-color: rgba(240,199,106,0.3); color: var(--gold);    background: var(--gold-dim); }
.pill.blue    { border-color: rgba(96,165,250,0.3);  color: var(--blue);    background: var(--blue-dim); }
.pill.teal    { border-color: rgba(45,212,191,0.3);  color: var(--teal);    background: var(--teal-dim); }
.pill.green   { border-color: rgba(52,211,153,0.3);  color: var(--green);   background: var(--green-dim); }
.pill.red     { border-color: rgba(251,113,133,0.3); color: var(--red);     background: var(--red-dim); }
.pill.amber   { border-color: rgba(251,191,36,0.3);  color: var(--amber);   background: var(--amber-dim); }
.pill.purple, .pill.indigo { border-color: rgba(124,107,255,0.3); color: var(--accent-lt); background: var(--accent-dim); }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.table thead th { text-align: left; padding: 10px 14px; font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border2); background: rgba(8,12,20,0.6); }
table.table tbody td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.table tbody tr:last-child td { border-bottom: none; }
table.table tbody tr:hover td { background: rgba(148,174,255,0.04); }
table.table .actions { white-space: nowrap; }
.filterable-row.hidden { display: none; }

.search-bar { display: flex; gap: 10px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); background: rgba(8,12,20,0.4); }
.search-bar input { max-width: 280px; font-size: 13px; padding: 8px 13px; }
.search-count { font-size: 12.5px; color: var(--muted); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .icon { font-size: 40px; margin-bottom: 14px; opacity: 0.3; }
.empty-state .label { font-weight: 700; font-size: 16px; color: var(--text2); margin-bottom: 8px; }

.text-muted { color: var(--muted); }
.text-sm    { font-size: 12.5px; }
.text-xs    { font-size: 11.5px; }
.text-gold  { color: var(--gold); }
.text-blue  { color: var(--blue); }
.text-teal  { color: var(--teal); }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }
.fw-700     { font-weight: 700; }
.fw-800     { font-weight: 800; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }

.footer { text-align: center; padding: 20px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted2); }

.modal-overlay { display: none; position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,0.80); backdrop-filter: blur(12px) saturate(0.8); -webkit-backdrop-filter: blur(12px) saturate(0.8); align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal { background: rgba(18,25,41,0.98); border: 1px solid var(--border2); border-radius: var(--r-xl); padding: 32px; max-width: 420px; width: 100%; box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,0.04); animation: slideUp .25s cubic-bezier(0.32,0.72,0,1); }
@keyframes slideUp { from { transform: translateY(20px) scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-icon  { font-size: 28px; margin-bottom: 12px; }
.modal-title { font-family: 'DM Serif Display', serif; font-size: 20px; font-weight: 400; }
.modal-body  { font-size: 13.5px; color: var(--muted); margin: 8px 0 24px; line-height: 1.65; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

.ai-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 10.5px; font-weight: 700; border: 1px solid rgba(124,107,255,0.3); color: var(--accent-lt); background: var(--accent-dim); letter-spacing: 0.05em; text-transform: uppercase; }

.action-card { background: rgba(18,25,41,0.95); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px 22px; display: flex; align-items: center; gap: 16px; cursor: pointer; transition: all .2s; text-decoration: none; color: inherit; position: relative; overflow: hidden; }
.action-card::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(124,107,255,0.06) 0%, transparent 60%); opacity: 0; transition: opacity .2s; }
.action-card:hover { border-color: rgba(124,107,255,0.25); box-shadow: 0 0 0 1px rgba(124,107,255,0.1), var(--shadow); transform: translateY(-2px); }
.action-card:hover::before { opacity: 1; }
.action-card-icon { width: 46px; height: 46px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; position: relative; z-index: 1; }
.action-card-label { font-weight: 700; font-size: 14px; color: var(--text); position: relative; z-index: 1; }
.action-card-sub   { font-size: 12px; color: var(--muted); margin-top: 3px; position: relative; z-index: 1; }

.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border); transition: background .12s; }
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: rgba(148,174,255,0.04); }
.list-row-icon { width: 36px; height: 36px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.list-row-body { flex: 1; min-width: 0; }
.list-row-title { font-weight: 600; font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.list-row-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }

.upload-zone { border: 2px dashed var(--border2); border-radius: var(--r-lg); padding: 32px 24px; text-align: center; cursor: pointer; transition: all .2s; background: rgba(8,12,20,0.5); }
.upload-zone:hover, .upload-zone.drag-over { border-color: rgba(124,107,255,0.5); background: var(--accent-dim); }
.upload-zone.has-file { border-color: rgba(52,211,153,0.5); background: var(--green-dim); }
.upload-icon  { font-size: 34px; margin-bottom: 10px; }
.upload-label { font-size: 13.5px; font-weight: 600; color: var(--text2); }
.upload-sub   { font-size: 12px; color: var(--muted); margin-top: 5px; }

.divider-or { display: flex; align-items: center; gap: 14px; margin: 20px 0 16px; color: var(--muted2); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.divider-or::before, .divider-or::after { content: ''; flex: 1; height: 1px; background: var(--border2); }

.progress-bar { height: 4px; background: rgba(148,174,255,0.1); border-radius: 999px; overflow: hidden; margin: 6px 0; }
.progress-fill { height: 100%; border-radius: 999px; transition: width .5s ease; }

.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border2); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Login ── */
.login-page { min-height: 100vh; display: flex; align-items: stretch; }
.login-left {
  flex: 1; display: flex; align-items: center; justify-content: center; padding: 60px 48px;
  background:
    radial-gradient(ellipse 60% 50% at 20% 30%, rgba(100,80,255,0.20), transparent 55%),
    radial-gradient(ellipse 40% 35% at 80% 20%, rgba(180,130,255,0.12), transparent 50%),
    linear-gradient(160deg, #0e1832 0%, #08111f 55%, #04090f 100%);
  border-right: 1px solid rgba(148,174,255,0.08); position: relative; overflow: hidden;
}
.login-left::after {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(148,174,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(148,174,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px; pointer-events: none;
}
.login-left-content { position: relative; z-index: 1; max-width: 380px; }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 52px; }
.login-brand-icon { width: 46px; height: 46px; background: linear-gradient(135deg, rgba(124,107,255,0.25), rgba(100,80,255,0.15)); border: 1px solid rgba(124,107,255,0.35); border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; font-size: 22px; box-shadow: 0 0 28px rgba(124,107,255,0.25); }
.login-brand-text { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.login-headline { font-family: 'DM Serif Display', Georgia, serif; font-size: 44px; font-weight: 400; line-height: 1.15; color: var(--text); margin-bottom: 18px; letter-spacing: -0.02em; }
.login-headline span { color: transparent; background: linear-gradient(135deg, var(--accent-lt), var(--gold)); -webkit-background-clip: text; background-clip: text; }
.login-tagline { font-size: 14.5px; color: var(--text2); line-height: 1.7; opacity: 0.9; }
.login-features { margin-top: 36px; display: flex; flex-direction: column; gap: 14px; }
.login-feature { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--muted); }
.login-feature-dot { width: 6px; height: 6px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-lt)); flex-shrink: 0; box-shadow: 0 0 8px var(--accent); }
.login-right { width: 460px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; padding: 40px; background: rgba(8,12,20,0.6); }
.login-box { width: 100%; max-width: 360px; background: rgba(18,25,41,0.98); border: 1px solid var(--border2); border-radius: var(--r-2xl); padding: 36px; box-shadow: var(--shadow-xl); }
.login-heading { font-family: 'DM Serif Display', serif; font-size: 26px; font-weight: 400; margin-bottom: 6px; letter-spacing: -0.01em; }
.login-sub { font-size: 13.5px; color: var(--muted); margin-bottom: 28px; }

@media (max-width: 768px) { .login-left { display: none; } .login-right { width: 100%; padding: 30px 24px; } }

/* ── Dashboard ── */
.dashboard-shell { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.75fr); gap: 22px; }
.dashboard-main { min-width: 0; }
.dashboard-side  { min-width: 0; }

.dashboard-hero {
  position: relative; overflow: hidden; padding: 36px 36px 32px; border-radius: var(--r-2xl);
  background:
    radial-gradient(circle 280px at 10% 30%, rgba(100,80,255,0.18), transparent),
    radial-gradient(circle 200px at 85% 20%, rgba(180,130,255,0.12), transparent),
    linear-gradient(135deg, rgba(16,26,48,0.99), rgba(8,14,26,0.99));
  border: 1px solid rgba(148,174,255,0.10); box-shadow: var(--shadow-lg);
}
.dashboard-hero::after { content: ''; position: absolute; right: -80px; top: -80px; width: 280px; height: 280px; background: radial-gradient(circle, rgba(240,199,106,0.12), transparent 70%); pointer-events: none; }
.dashboard-hero::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent 5%, rgba(255,255,255,0.10) 40%, transparent 80%); }

.eyebrow { font-size: 10.5px; text-transform: uppercase; letter-spacing: .16em; color: var(--accent-lt); font-weight: 700; opacity: 0.85; }
.hero-title { font-family: 'DM Serif Display', Georgia, serif; font-size: 38px; line-height: 1.1; letter-spacing: -0.025em; font-weight: 400; max-width: 820px; margin: 12px 0 10px; color: var(--text); }
.hero-sub { max-width: 720px; font-size: 14.5px; color: var(--text2); opacity: 0.85; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.hero-meta-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }

.hero-mini { padding: 16px 18px; border-radius: var(--r-lg); background: rgba(255,255,255,0.04); border: 1px solid rgba(148,174,255,0.08); backdrop-filter: blur(12px); transition: border-color .2s; }
.hero-mini:hover { border-color: rgba(124,107,255,0.18); }
.hero-mini-label { font-size: 10px; letter-spacing: .10em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.hero-mini-value { font-family: 'DM Serif Display', serif; font-size: 26px; font-weight: 400; line-height: 1.1; margin-top: 8px; letter-spacing: -0.02em; }
.hero-mini-sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

.mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.info-card { border-radius: var(--r-xl); padding: 22px; }
.info-card-title { font-size: 13.5px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.info-card-sub   { color: var(--muted); font-size: 12px; margin-top: 4px; }
.metric-list { margin-top: 18px; display: grid; gap: 12px; }
.metric-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.metric-row-label { color: var(--muted); font-size: 13px; }
.metric-row-value { color: var(--text); font-size: 14px; font-weight: 700; }
.side-stack { display: grid; gap: 18px; }
.side-kpi { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-radius: var(--r); background: rgba(255,255,255,0.03); border: 1px solid rgba(148,174,255,0.07); }
.side-kpi strong { display: block; font-family: 'DM Serif Display', serif; font-size: 24px; font-weight: 400; line-height: 1; margin-top: 6px; letter-spacing: -0.02em; }

.panel-header { padding: 16px 20px; border-bottom: 1px solid rgba(148,174,255,0.07); display: flex; align-items: center; justify-content: space-between; gap: 12px; background: rgba(8,12,20,0.3); }
.panel-header h3 { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.panel-header p  { font-size: 12px; color: var(--muted); margin-top: 3px; }
.section-gap { margin-top: 22px; }
.card-body-pad { padding: 8px 0; }

.stat-card:nth-child(1) { animation: fadeUp .4s .05s ease both; }
.stat-card:nth-child(2) { animation: fadeUp .4s .10s ease both; }
.stat-card:nth-child(3) { animation: fadeUp .4s .15s ease both; }
.stat-card:nth-child(4) { animation: fadeUp .4s .20s ease both; }
.action-card:nth-child(1) { animation: fadeUp .4s .15s ease both; }
.action-card:nth-child(2) { animation: fadeUp .4s .20s ease both; }
.action-card:nth-child(3) { animation: fadeUp .4s .25s ease both; }

@media (max-width: 1180px) { .dashboard-shell { grid-template-columns: 1fr; } }
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .container { padding: 20px 16px 50px; }
  .topbar { padding: 0 18px; }
  .hero-title { font-size: 28px; }
  .hero-meta-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 540px) { .hero-meta-grid, .mini-grid { grid-template-columns: 1fr; } .login-headline { font-size: 34px; } }

@media print {
  .sidebar, .topbar, .page-actions, .no-print { display: none !important; }
  .main-content { margin-left: 0; }
  body, .card { background: white !important; color: black !important; }
  .card { border: 1px solid #ccc; box-shadow: none; }
  :root { --text: #000; --text2: #333; --muted: #666; --surface: #fff; --border: #ddd; }
}
