*, *::before, *::after { box-sizing: border-box; }
:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --primary: #6366f1;
  --primary-2: #8b5cf6;
  --success: #10b981;
  --danger: #ef4444;
  --border: rgba(255,255,255,.08);
  --radius: 14px;
  --shadow: 0 8px 32px rgba(0,0,0,.35);
}
body {
  margin: 0; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  color: var(--text); min-height: 100vh; -webkit-font-smoothing: antialiased;
}
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid var(--border);
  background: rgba(15,23,42,.6); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; font-size: 20px; }
.userbar { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 14px; }
.userbar button { background: transparent; color: var(--muted); border: 1px solid var(--border); padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.userbar button:hover { color: var(--text); border-color: var(--primary); }

.wrap { max-width: 960px; margin: 0 auto; padding: 32px 20px 80px; }

.auth { max-width: 440px; margin: 40px auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.auth h1 { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tabs { display: flex; gap: 4px; margin: 20px 0 16px; background: var(--surface-2); padding: 4px; border-radius: 10px; }
.tab { flex: 1; background: transparent; color: var(--muted); border: none; padding: 10px; border-radius: 8px; cursor: pointer; font-weight: 500; }
.tab--active { background: var(--primary); color: white; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.form input {
  padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: rgba(255,255,255,.04); color: var(--text); font-size: 16px;
}
.form input:focus { outline: none; border-color: var(--primary); background: rgba(255,255,255,.06); }
.btn {
  padding: 12px 20px; border-radius: 10px; border: none; font-size: 16px; font-weight: 600; cursor: pointer;
  background: var(--surface-2); color: var(--text);
}
.btn--primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: white; }
.btn:hover { transform: translateY(-1px); }
.err { color: var(--danger); font-size: 14px; min-height: 20px; }

.home h1 { margin: 0 0 24px; font-size: 28px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 8px;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.tile:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--shadow); }
.tile__icon { font-size: 40px; }
.tile__title { font-size: 18px; font-weight: 600; }
.tile__sub { color: var(--muted); font-size: 14px; }
.tile--en { background: linear-gradient(135deg, rgba(99,102,241,.25), rgba(139,92,246,.15)); }
.tile--math { background: linear-gradient(135deg, rgba(16,185,129,.22), rgba(59,130,246,.12)); }
.tile--ru { background: linear-gradient(135deg, rgba(236,72,153,.22), rgba(217,70,239,.12)); }
.tile--geo { background: linear-gradient(135deg, rgba(34,197,94,.28), rgba(59,130,246,.15)); }
.tile--history { background: linear-gradient(135deg, rgba(217,119,6,.28), rgba(180,83,9,.15)); }
.tile--soon { opacity: .5; cursor: not-allowed; }

#parent-panel { margin-top: 48px; }
#parent-panel h2 { margin: 0 0 16px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 12px; display: block; }
.stat-card h3 { margin: 0 0 8px; font-size: 16px; }
.stat-card--link { text-decoration: none; color: inherit; cursor: pointer; transition: all .15s; }
.stat-card--link:hover { border-color: #7c3aed; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(124,58,237,.15); }
.stat-card__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.stat-card__head h3 { margin: 0; }
.stat-card__open { font-size: 13px; color: #7c3aed; font-weight: 600; opacity: .85; white-space: nowrap; }
.btn--admin { display: inline-block; padding: 6px 12px; margin-right: 8px; background: linear-gradient(135deg, #7c3aed, #a855f7); color: white; text-decoration: none; border-radius: 8px; font-size: 13px; font-weight: 600; }
.btn--admin:hover { opacity: .9; }
.stat-row { display: flex; gap: 20px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.stat-row b { color: var(--text); font-weight: 600; }
