/* AI School Admin — house tokens + console layout. */
:root {
  --paper: #f8fafc; --panel: #ffffff; --panel-alt: #f1f5f9;
  --ink: #1e293b; --ink-strong: #0f172a; --muted: #64748b;
  --line: #e2e8f0; --line-strong: #cbd5e1;
  --accent: #f97316; --accent-hover: #ea580c; --accent-soft: #fff7ed;
  --radius-sm: 0.5rem; --radius: 0.75rem; --radius-lg: 1rem;
  --shadow: 0 1px 3px rgba(15,23,42,0.08), 0 1px 2px -1px rgba(15,23,42,0.06);
  --shadow-lg: 0 10px 25px -8px rgba(15,23,42,0.15), 0 4px 10px -4px rgba(15,23,42,0.08);
  --font-body: 'Manrope', ui-sans-serif, system-ui, sans-serif;
  --font-display: 'Fraunces', ui-serif, Georgia, serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 16px;
}
:root[data-theme="dark"] {
  --paper: #0f172a; --panel: #1e293b; --panel-alt: #0f172a;
  --ink: #f1f5f9; --ink-strong: #ffffff; --muted: #94a3b8;
  --line: #334155; --line-strong: #475569;
  --accent: #fb923c; --accent-hover: #fdba74; --accent-soft: #2a1c0e;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-body); color: var(--ink); background: var(--paper); line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-display); color: var(--ink-strong); letter-spacing: -0.02em; }
a { color: var(--accent); text-decoration: none; }

.bar { display: flex; align-items: center; gap: 1rem; padding: 0.8rem 1.25rem; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 20; }
.bar .brand-mark { width: 34px; height: 34px; border-radius: 9px; }
.bar h1 { font-size: 1.05rem; }
.bar .spacer { margin-left: auto; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); color: var(--ink); cursor: pointer; }
.icon-btn:hover { border-color: var(--line-strong); }

.wrap { max-width: 1000px; margin: 1.5rem auto; padding: 0 1.25rem; }

.gate { max-width: 420px; margin: 4rem auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.8rem; box-shadow: var(--shadow-lg); }
.gate h2 { margin-bottom: 0.3rem; }
.gate p { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.2rem; }

.tabs { display: flex; gap: 0.4rem; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; }
.tab { padding: 0.6rem 1rem; font-weight: 700; color: var(--muted); background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; font-family: var(--font-body); font-size: 0.95rem; }
.tab.active { color: var(--ink-strong); border-bottom-color: var(--accent); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.4rem; box-shadow: var(--shadow); margin-bottom: 1.5rem; }
.panel h3 { font-size: 1.1rem; margin-bottom: 1rem; }

label { display: block; font-weight: 700; font-size: 0.82rem; margin-bottom: 0.3rem; color: var(--ink-strong); }
input, select, textarea { width: 100%; padding: 0.55rem 0.7rem; font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.field { margin-bottom: 0.9rem; }
.grid2 { display: grid; gap: 0.9rem; grid-template-columns: 1fr 1fr; }
.grid3 { display: grid; gap: 0.9rem; grid-template-columns: 1fr 1fr 1fr; }
.check-inline { display: flex; align-items: center; gap: 0.5rem; }
.check-inline input { width: auto; }
.check-inline label { margin: 0; }

.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.6rem 1.1rem; border-radius: var(--radius-sm); font-weight: 700; font-size: 0.9rem; background: var(--accent); color: #fff; border: 1px solid transparent; cursor: pointer; font-family: var(--font-body); }
.btn:hover { background: var(--accent-hover); }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }
.btn-ghost { background: transparent; color: var(--ink-strong); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--panel-alt); }
.btn-danger { background: transparent; color: #dc2626; border-color: #fca5a5; }
.btn-danger:hover { background: #fee2e2; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { text-align: left; padding: 0.6rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 700; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.03em; }
td .sub { color: var(--muted); font-size: 0.8rem; }
.badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; background: var(--panel-alt); border: 1px solid var(--line); color: var(--muted); }
.badge.live { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.badge.draft { background: #fef9c3; color: #854d0e; border-color: #fde68a; }
.actions { display: flex; gap: 0.4rem; justify-content: flex-end; }

.note { padding: 0.7rem 1rem; border-radius: var(--radius-sm); font-size: 0.88rem; font-weight: 600; margin-bottom: 1rem; }
.note.ok { background: #dcfce7; color: #166534; }
.note.err { background: #fee2e2; color: #991b1b; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.right { text-align: right; }

.bar select { width: auto; padding: 0.4rem 0.6rem; font-size: 0.85rem; }
.userchip { font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.banner { border-radius: var(--radius); padding: 0.8rem 1.1rem; font-size: 0.9rem; font-weight: 600; margin-bottom: 1.3rem; border: 1px solid; }
.banner.warn { background: #fef9c3; color: #854d0e; border-color: #fde68a; }
.banner.info { background: var(--accent-soft); color: var(--accent-hover); border-color: var(--accent); }
:root[data-theme="dark"] .banner.warn { background: #422006; color: #fde68a; border-color: #713f12; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty h3 { margin-bottom: 0.4rem; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } .bar h1 span { display: none; } }
