:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #6b7280;
  --line: #e5eaf2;
  --primary: #1d4ed8;
  --primary-dark: #173f9f;
  --primary-soft: #eaf1ff;
  --accent: #fbbf24;
  --green: #15803d;
  --green-soft: #e9f8ee;
  --red: #b91c1c;
  --red-soft: #fff0f0;
  --orange: #c2410c;
  --shadow: 0 16px 40px rgba(35, 57, 90, .10);
  --radius: 18px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 7px; font-size: 11px; font-weight: 800; letter-spacing: .14em; color: var(--primary); }
.auth-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, 1.05fr) minmax(420px, .95fr); }
.auth-hero { padding: clamp(40px, 7vw, 100px); color: #fff; background: radial-gradient(circle at 70% 20%, rgba(251,191,36,.28), transparent 25%), linear-gradient(145deg, #153d9a, #1d4ed8 55%, #0f2c71); display: flex; flex-direction: column; justify-content: center; }
.auth-hero .eyebrow { color: #bfdbfe; }
.auth-hero h1 { margin: 0; font-size: clamp(48px, 7vw, 88px); line-height: .96; letter-spacing: -.05em; }
.auth-hero .lead { max-width: 620px; margin: 28px 0; font-size: clamp(18px, 2vw, 25px); line-height: 1.5; color: #dbeafe; }
.brand-mark { width: 72px; height: 72px; margin-bottom: 32px; border-radius: 20px; display: grid; place-items: center; font-weight: 900; font-size: 34px; color: #173f9f; background: var(--accent); box-shadow: 0 16px 30px rgba(0,0,0,.15); }
.brand-mark.small { width: 42px; height: 42px; margin: 0; border-radius: 13px; font-size: 20px; box-shadow: none; }
.hero-benefits { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-benefits span { padding: 9px 13px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; background: rgba(255,255,255,.09); color: #eff6ff; }
.auth-panel { display: grid; place-items: center; padding: 32px; background: #eef3fb; }
.auth-card { width: min(460px, 100%); padding: 36px; border-radius: 24px; background: #fff; box-shadow: var(--shadow); }
.auth-card h2 { margin: 0 0 8px; font-size: 30px; }
.stack { display: grid; gap: 16px; margin-top: 22px; }
label { display: grid; gap: 7px; font-size: 13px; font-weight: 700; color: #334155; }
input, select, textarea { width: 100%; border: 1px solid #d8e0ec; border-radius: 12px; padding: 12px 13px; outline: none; color: var(--text); background: #fff; }
input:focus, select:focus, textarea:focus { border-color: #7aa2fa; box-shadow: 0 0 0 4px rgba(29,78,216,.09); }
.button { border: 0; border-radius: 12px; padding: 11px 16px; font-weight: 800; transition: transform .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--primary); color: #fff; }
.button.primary:hover { background: var(--primary-dark); }
.button.soft { color: var(--primary-dark); background: var(--primary-soft); }
.button.ghost { border: 1px solid var(--line); background: #fff; color: #334155; }
.button.danger { color: var(--red); background: var(--red-soft); }
.button.full { width: 100%; }
.text-button { width: 100%; margin-top: 14px; border: 0; background: transparent; color: var(--primary); font-weight: 800; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: #94a3b8; font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 16px; color: #fff; background: #10264f; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 24px; }
.sidebar-brand strong { display: block; font-size: 16px; }
.sidebar-brand span { display: block; margin-top: 2px; font-size: 12px; color: #93c5fd; }
.main-nav { display: grid; gap: 5px; }
.main-nav button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px; border: 0; border-radius: 11px; color: #cbdaf5; background: transparent; text-align: left; font-weight: 700; }
.main-nav button span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.08); font-size: 12px; }
.main-nav button:hover, .main-nav button.active { color: #fff; background: rgba(255,255,255,.11); }
.main-nav button.active span { color: #173f9f; background: var(--accent); }
.sidebar-footer { margin-top: auto; padding-top: 18px; }
.user-mini { display: grid; grid-template-columns: 38px 1fr; gap: 10px; align-items: center; margin-bottom: 12px; }
.avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 900; background: #dbeafe; color: var(--primary-dark); }
.user-mini strong, .user-mini span { display: block; }
.user-mini span { font-size: 11px; color: #9fb4d8; }
.main-content { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 15; min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px clamp(20px, 4vw, 52px); border-bottom: 1px solid rgba(229,234,242,.85); background: rgba(244,247,251,.92); backdrop-filter: blur(12px); }
.topbar h2 { margin: 0; font-size: 24px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.status-pill { padding: 7px 11px; border-radius: 999px; font-size: 12px; font-weight: 800; color: #475569; background: #e8edf5; }
.status-pill.online { color: var(--green); background: var(--green-soft); }
.view-root { padding: 28px clamp(20px, 4vw, 52px) 60px; }
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: 0 8px 24px rgba(32, 51, 82, .05); }
.card.pad { padding: 22px; }
.card h3 { margin: 0 0 8px; }
.hero-card { position: relative; overflow: hidden; padding: clamp(24px, 4vw, 42px); color: #fff; background: linear-gradient(135deg, #153d9a, #1d4ed8); }
.hero-card::after { content: ''; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: rgba(251,191,36,.24); }
.hero-card h2 { position: relative; z-index: 1; max-width: 720px; margin: 0 0 10px; font-size: clamp(28px, 4vw, 45px); line-height: 1.08; }
.hero-card p { position: relative; z-index: 1; max-width: 650px; margin: 0; color: #dbeafe; font-size: 17px; }
.hero-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero-card .button.primary { color: #173f9f; background: var(--accent); }
.stat-card { padding: 18px; }
.stat-card .label { color: var(--muted); font-size: 12px; font-weight: 700; }
.stat-card .value { margin: 8px 0 4px; font-size: 30px; font-weight: 900; }
.stat-card .sub { color: var(--muted); font-size: 12px; }
.section-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 28px 0 13px; }
.section-header h3 { margin: 0; font-size: 20px; }
.section-header p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.subject-card { overflow: hidden; }
.subject-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px; }
.subject-badge { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 15px; font-weight: 900; }
.subject-badge.polish { color: #9f1239; background: #ffe4e6; }
.subject-badge.english { color: #075985; background: #e0f2fe; }
.subject-badge.math { color: #5b21b6; background: #ede9fe; }
.subject-meta { flex: 1; }
.subject-meta h3 { margin: 0 0 3px; }
.subject-meta p { margin: 0; color: var(--muted); font-size: 12px; }
.progress-track { height: 9px; overflow: hidden; border-radius: 999px; background: #edf1f6; }
.progress-track > span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.subject-card .progress-wrap { padding: 0 20px 20px; }
.progress-line { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--muted); font-size: 12px; }
.task-list, .lesson-list, .event-list { display: grid; gap: 10px; }
.task-row, .lesson-row, .event-row { display: grid; grid-template-columns: auto 1fr auto; gap: 13px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.task-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; font-weight: 900; background: var(--primary-soft); color: var(--primary); }
.task-row h4, .lesson-row h4, .event-row h4 { margin: 0 0 3px; font-size: 14px; }
.task-row p, .lesson-row p, .event-row p { margin: 0; color: var(--muted); font-size: 12px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; }
.status-dot.done { background: #22c55e; }
.status-dot.review { background: #f59e0b; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.pill.green { color: var(--green); background: var(--green-soft); }
.pill.blue { color: var(--primary); background: var(--primary-soft); }
.pill.orange { color: var(--orange); background: #fff4e6; }
.empty { padding: 30px; border: 1px dashed #cdd7e5; border-radius: 16px; color: var(--muted); text-align: center; background: rgba(255,255,255,.55); }
.empty strong { display: block; margin-bottom: 6px; color: #334155; }
.subject-hero { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; padding: 25px; }
.subject-hero h2 { margin: 0 0 8px; font-size: 30px; }
.subject-hero p { margin: 0; color: var(--muted); }
.big-score { width: 100px; height: 100px; display: grid; place-items: center; border-radius: 50%; font-size: 24px; font-weight: 900; background: conic-gradient(var(--primary) var(--score), #e8edf5 0); position: relative; }
.big-score::after { content: ''; position: absolute; inset: 10px; border-radius: 50%; background: #fff; }
.big-score span { position: relative; z-index: 1; }
.unit-block { margin-top: 18px; }
.unit-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.unit-title h3 { margin: 0; }
.unit-title span { color: var(--muted); font-size: 12px; }
.lesson-row.completed { background: #f7fcf8; }
.lesson-row .score { min-width: 56px; text-align: right; font-weight: 900; }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.calendar-toolbar h3 { margin: 0; text-transform: capitalize; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--line); border-top: 1px solid var(--line); background: #fff; }
.calendar-weekday, .calendar-day { min-height: 105px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.calendar-weekday { min-height: auto; color: var(--muted); font-size: 11px; font-weight: 800; text-align: center; background: #f8fafc; }
.calendar-day { cursor: pointer; transition: background .15s ease; }
.calendar-day:hover { background: #f7faff; }
.calendar-day.other { color: #b7c1cf; background: #fbfcfe; }
.calendar-day.today { box-shadow: inset 0 0 0 2px var(--primary); }
.day-number { font-size: 12px; font-weight: 900; }
.day-items { display: grid; gap: 4px; margin-top: 7px; }
.day-chip { overflow: hidden; padding: 4px 6px; border-radius: 7px; color: #334155; background: #edf2f8; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.day-chip.event { color: #9a3412; background: #ffedd5; }
.chart-bars { height: 230px; display: flex; align-items: end; gap: 20px; padding: 20px 10px 0; border-bottom: 1px solid var(--line); }
.chart-bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: end; }
.chart-bar { width: min(58px, 70%); min-height: 4px; border-radius: 10px 10px 3px 3px; background: var(--primary); }
.chart-label { font-size: 11px; color: var(--muted); text-align: center; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.settings-section { padding: 22px; }
.settings-section h3 { margin: 0 0 5px; }
.settings-section > p { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.data-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(15, 23, 42, .55); backdrop-filter: blur(4px); }
.modal-card { position: relative; width: min(720px, 100%); max-height: 92vh; overflow: auto; padding: 28px; border-radius: 22px; background: #fff; box-shadow: 0 25px 70px rgba(15, 23, 42, .28); }
.modal-close { position: absolute; right: 16px; top: 13px; width: 36px; height: 36px; border: 0; border-radius: 50%; color: #64748b; background: #f1f5f9; font-size: 24px; }
.quiz-head { padding-right: 44px; }
.quiz-head h2 { margin: 0 0 8px; }
.quiz-progress { margin: 18px 0 24px; }
.question-card { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #f9fbfe; }
.question-card h3 { margin: 0 0 18px; font-size: 19px; line-height: 1.45; }
.answers { display: grid; gap: 9px; }
.answer-option { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid #dbe3ee; border-radius: 12px; background: #fff; }
.answer-option:hover { border-color: #8dacfa; }
.answer-option input { width: auto; margin-top: 3px; }
.feedback { margin-top: 14px; padding: 13px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.feedback.good { color: var(--green); background: var(--green-soft); }
.feedback.bad { color: var(--red); background: var(--red-soft); }
.quiz-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 18px; }
.result-circle { width: 150px; height: 150px; display: grid; place-items: center; margin: 20px auto; border-radius: 50%; color: #fff; background: var(--primary); }
.result-circle strong { display: block; font-size: 40px; }
.result-circle span { display: block; font-size: 11px; text-align: center; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; max-width: 340px; padding: 13px 16px; border-radius: 12px; color: #fff; background: #172033; box-shadow: var(--shadow); transform: translateY(120px); opacity: 0; transition: .25s ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.icon-button { border: 0; border-radius: 10px; padding: 9px 11px; background: #fff; }
.mobile-only { display: none; }
.notice { padding: 14px; border-left: 4px solid var(--accent); border-radius: 10px; background: #fff8df; color: #713f12; font-size: 13px; line-height: 1.5; }
@media (max-width: 1100px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .auth-screen { grid-template-columns: 1fr; }
  .auth-hero { min-height: 44vh; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -280px; z-index: 40; width: 260px; transition: left .2s ease; }
  .sidebar.open { left: 0; box-shadow: 20px 0 50px rgba(15,23,42,.25); }
  .mobile-only { display: inline-block; }
  .topbar { padding: 14px 18px; }
  .view-root { padding: 20px 16px 50px; }
  .settings-grid, .grid.cols-2 { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .auth-panel, .auth-hero { padding: 24px; }
  .auth-card { padding: 24px; }
  .demo-grid, .form-grid, .grid.cols-4 { grid-template-columns: 1fr; }
  .topbar-actions .status-pill { display: none; }
  .topbar-actions .button { padding: 9px 10px; font-size: 12px; }
  .subject-hero { grid-template-columns: 1fr; }
  .calendar-weekday, .calendar-day { min-height: 72px; padding: 5px; }
  .day-chip { font-size: 0; height: 7px; padding: 0; }
  .day-chip.event { font-size: 0; }
  .task-row, .lesson-row, .event-row { grid-template-columns: auto 1fr; }
  .task-row > :last-child, .lesson-row > :last-child, .event-row > :last-child { grid-column: 2; justify-self: start; }
}
