:root {
    --navy-950: #071126;
    --navy-900: #0b1730;
    --navy-850: #101f3c;
    --ink: #14213d;
    --ink-soft: #41506d;
    --muted: #71809b;
    --line: #e3e8f1;
    --line-soft: #edf1f7;
    --surface: #ffffff;
    --canvas: #f4f6fa;
    --accent: #2f6bff;
    --accent-dark: #1e50d5;
    --accent-soft: #edf3ff;
    --green: #0ba879;
    --green-soft: #e8f8f2;
    --amber: #e49116;
    --amber-soft: #fff6e4;
    --red: #da3f55;
    --red-soft: #fff0f2;
    --purple: #7a52d1;
    --purple-soft: #f3efff;
    --radius-sm: 9px;
    --radius: 15px;
    --radius-lg: 22px;
    --shadow-sm: 0 1px 2px rgba(12, 27, 58, .03), 0 5px 18px rgba(12, 27, 58, .035);
    --shadow: 0 18px 50px rgba(14, 30, 62, .08);
    --sidebar: 272px;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100%; color: var(--ink); background: var(--canvas); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
img, svg { display: block; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4, strong { letter-spacing: -.018em; }
fieldset { padding: 0; margin: 0; border: 0; }
fieldset + fieldset { padding-top: 6px; }
legend { width: 100%; padding: 0 0 14px; color: var(--ink); font-size: 14px; font-weight: 800; }

/* Shared controls */
.btn { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border: 1px solid transparent; border-radius: 10px; background: var(--surface); color: var(--ink); font-weight: 750; line-height: 1; cursor: pointer; transition: transform .16s, background .16s, border-color .16s, box-shadow .16s; }
.btn:hover { transform: translateY(-1px); }
.btn--primary { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 22%, transparent); }
.btn--primary:hover { border-color: var(--accent-dark); background: var(--accent-dark); }
.btn--ghost { border-color: var(--line); background: #fff; }
.btn--ghost:hover { border-color: #cbd4e3; background: #fafbfe; }
.btn--soft { border-color: transparent; background: var(--accent-soft); color: var(--accent-dark); }
.btn--soft:hover { background: #dfe9ff; }
.btn--light { border-color: #fff; background: #fff; color: var(--navy-900); }
.btn--on-dark { border-color: rgba(255,255,255,.24); background: rgba(255,255,255,.08); color: #fff; }
.btn--on-dark:hover { background: rgba(255,255,255,.15); }
.btn--lg { min-height: 51px; padding: 12px 20px; border-radius: 12px; }
.btn--sm { min-height: 36px; padding: 7px 12px; font-size: 13px; }
.btn--full { width: 100%; }
.icon-btn { display: inline-flex; width: 38px; height: 38px; flex: 0 0 auto; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 18px; line-height: 1; cursor: pointer; transition: background .15s, border .15s; }
.icon-btn:hover { border-color: #cbd4e2; background: #f8faff; }
.text-link { color: var(--accent-dark); font-size: 13px; font-weight: 800; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.muted { color: var(--muted); }
.eyebrow { display: block; margin-bottom: 7px; color: var(--accent-dark); font-size: 10px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow--light { color: #8eb2ff; }
.stack-lg > * + * { margin-top: 17px; }
.stack-xl > * + * { margin-top: 22px; }
.form-grid { display: grid; gap: 14px; }
.form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field--span-2 { grid-column: span 2; }
.field { display: flex; min-width: 0; flex-direction: column; gap: 7px; }
.field > span { color: var(--ink-soft); font-size: 12px; font-weight: 800; }
.field small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.field input, .field select, .field textarea, .search-field input { width: 100%; min-height: 43px; padding: 10px 12px; outline: none; border: 1px solid #d9e0eb; border-radius: 9px; background: #fff; color: var(--ink); transition: border .15s, box-shadow .15s; }
.field textarea { min-height: 84px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder, .search-field input::placeholder { color: #a2adbe; }
.field input:focus, .field select:focus, .field textarea:focus, .search-field input:focus { border-color: color-mix(in srgb, var(--accent) 70%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 11%, transparent); }
.field .color-input { height: 43px; padding: 5px; cursor: pointer; }
.password-field, .input-suffix { position: relative; display: block; }
.password-field input { padding-right: 53px; }
.password-field button { position: absolute; top: 50%; right: 8px; padding: 5px 7px; transform: translateY(-50%); border: 0; border-radius: 6px; background: #eff3f8; color: var(--ink-soft); font-size: 11px; font-weight: 800; cursor: pointer; }
.input-suffix input { padding-right: 42px; }
.input-suffix b { position: absolute; top: 50%; right: 14px; transform: translateY(-50%); color: var(--muted); }
.check-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #f8faff; cursor: pointer; }
.check-card input, .check-line input { width: 18px; height: 18px; flex: 0 0 auto; margin: 2px 0 0; accent-color: var(--accent); }
.check-card span, .check-line span { display: flex; flex-direction: column; gap: 3px; }
.check-card strong, .check-line strong { font-size: 13px; }
.check-card small, .check-line small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.check-line { display: flex; gap: 11px; align-items: flex-start; cursor: pointer; }
.form-actions { display: flex; justify-content: flex-end; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 15px; border: 1px solid; border-radius: 10px; font-size: 13px; }
.alert ul { margin: 5px 0 0; padding-left: 19px; }
.alert--danger { border-color: #f2c9d0; background: var(--red-soft); color: #a4263a; }
.alert--success { border-color: #bce8d9; background: var(--green-soft); color: #087756; }
.alert--warning { border-color: #f2ddb4; background: var(--amber-soft); color: #8a5a09; }
.alert.is-dismissible { align-items: center; justify-content: space-between; box-shadow: var(--shadow-sm); }
.alert.is-dismissible button { border: 0; background: transparent; font-size: 20px; cursor: pointer; }

/* Login and installer */
.auth-page { min-height: 100vh; background: #eef2f8; }
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark { display: inline-flex; width: 38px; height: 38px; flex: 0 0 auto; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.18); border-radius: 11px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 900; letter-spacing: .06em; box-shadow: 0 7px 22px rgba(47,107,255,.3); }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.1; }
.brand strong { font-size: 14px; letter-spacing: -.01em; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.brand--light { color: #fff; }
.brand--light small { color: #91a0bd; }
.login-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(420px, 1.08fr) minmax(420px, .92fr); }
.login-visual { position: relative; display: flex; min-height: 720px; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 46px clamp(42px, 6vw, 94px); background: var(--navy-900); color: #fff; }
.login-visual::before { position: absolute; width: 580px; height: 580px; right: -260px; bottom: -260px; border: 1px solid rgba(105,148,255,.17); border-radius: 50%; box-shadow: 0 0 0 90px rgba(105,148,255,.035), 0 0 0 180px rgba(105,148,255,.025); content: ""; }
.login-visual::after { position: absolute; width: 340px; height: 340px; top: 23%; left: -280px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; box-shadow: 0 0 0 70px rgba(255,255,255,.018); content: ""; }
.login-visual__top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; }
.private-badge { padding: 7px 10px; border: 1px solid rgba(255,255,255,.13); border-radius: 999px; background: rgba(255,255,255,.05); color: #b6c2d8; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.login-message { position: relative; z-index: 1; max-width: 650px; padding: 70px 0 40px; }
.login-message h1 { max-width: 610px; margin-bottom: 20px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(40px, 4.5vw, 66px); font-weight: 500; line-height: 1.04; letter-spacing: -.045em; }
.login-message p { max-width: 560px; margin: 0; color: #acb9d0; font-size: 17px; line-height: 1.7; }
.login-preview { position: relative; z-index: 1; display: grid; max-width: 520px; grid-template-columns: 170px 1fr; gap: 26px; align-items: end; padding: 22px 25px; border: 1px solid rgba(255,255,255,.12); border-radius: 17px; background: rgba(255,255,255,.055); backdrop-filter: blur(12px); }
.login-preview > div:first-child { display: flex; flex-direction: column; }
.login-preview small { color: #9cacc8; font-size: 11px; }
.login-preview strong { margin: 2px 0; font-size: 42px; font-weight: 750; line-height: 1; }
.trend { color: #69e1bd; font-size: 11px; font-weight: 800; }
.mini-bars { display: flex; height: 75px; gap: 9px; align-items: end; }
.mini-bars i { flex: 1; min-height: 8px; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, #5f8cff, #2f6bff); opacity: .9; }
.login-panel { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 55px clamp(34px, 6vw, 90px); background: #fff; }
.login-form-wrap { width: 100%; max-width: 440px; }
.login-form-wrap h2 { margin-bottom: 7px; font-family: Georgia, "Times New Roman", serif; font-size: 36px; font-weight: 500; letter-spacing: -.035em; }
.login-form-wrap > .muted { margin-bottom: 30px; }
.login-form-wrap .alert { margin-bottom: 16px; }
.login-help { margin: 24px 0 0; color: #8b96a8; font-size: 11px; text-align: center; }
.install-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(350px, .78fr) minmax(600px, 1.22fr); }
.install-intro { position: sticky; top: 0; display: flex; height: 100vh; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 45px clamp(36px, 5vw, 78px); background: var(--navy-900); color: #fff; }
.install-intro::after { position: absolute; width: 520px; height: 520px; right: -310px; bottom: -130px; border: 1px solid rgba(90,137,255,.18); border-radius: 50%; box-shadow: 0 0 0 80px rgba(90,137,255,.035), 0 0 0 160px rgba(90,137,255,.025); content: ""; }
.install-intro > * { position: relative; z-index: 1; }
.install-intro h1 { max-width: 530px; margin: 9px 0 18px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(38px, 4vw, 58px); font-weight: 500; line-height: 1.06; letter-spacing: -.045em; }
.install-intro p { max-width: 520px; margin: 0; color: #acb9d0; font-size: 16px; line-height: 1.7; }
.install-features { display: flex; flex-wrap: wrap; gap: 8px; }
.install-features span { padding: 8px 11px; border: 1px solid rgba(255,255,255,.1); border-radius: 999px; background: rgba(255,255,255,.045); color: #b7c3d7; font-size: 11px; }
.install-card { width: 100%; max-width: 840px; margin: auto; padding: 56px clamp(32px, 6vw, 84px); }
.install-card .section-heading h2 { margin-bottom: 25px; font-family: Georgia, "Times New Roman", serif; font-size: 34px; font-weight: 500; }
.step-row { display: flex; max-width: 220px; align-items: center; margin-bottom: 34px; }
.step { display: inline-flex; width: 25px; height: 25px; align-items: center; justify-content: center; border-radius: 50%; background: #dfe5ef; color: #8190a6; font-size: 10px; font-weight: 900; }
.step.is-active { background: var(--accent); color: #fff; }
.step-row i { height: 1px; flex: 1; background: #ccd5e3; }
.requirements { display: flex; flex-wrap: wrap; gap: 7px; margin: 17px 0 23px; }
.requirement { display: inline-flex; gap: 6px; align-items: center; padding: 6px 9px; border-radius: 7px; background: #edf1f6; color: var(--ink-soft); font-size: 10px; font-weight: 750; }
.requirement b { display: inline-flex; width: 15px; height: 15px; align-items: center; justify-content: center; border-radius: 50%; font-size: 9px; }
.requirement.is-ok b { background: var(--green-soft); color: var(--green); }
.requirement.is-error { background: var(--red-soft); color: var(--red); }
.requirement.is-error b { background: var(--red); color: #fff; }

/* Application shell */
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 50; inset: 0 auto 0 0; display: flex; width: var(--sidebar); flex-direction: column; padding: 26px 18px 20px; background: var(--navy-900); color: #fff; }
.sidebar__head { display: flex; align-items: center; justify-content: space-between; padding: 0 7px 24px; }
.sidebar-close { display: none; border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.05); color: #fff; }
.cycle-chip { display: flex; gap: 10px; align-items: center; margin: 2px 3px 25px; padding: 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 11px; background: rgba(255,255,255,.045); }
.cycle-chip__dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #4bdfb2; box-shadow: 0 0 0 4px rgba(75,223,178,.1); }
.cycle-chip div { display: flex; min-width: 0; flex-direction: column; }
.cycle-chip small { color: #8797b5; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.cycle-chip strong { overflow: hidden; color: #dbe4f4; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.main-nav { display: flex; flex: 1; flex-direction: column; gap: 4px; }
.nav-label { margin: 13px 12px 5px; color: #647491; font-size: 9px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.main-nav a, .nav-settings { display: flex; gap: 12px; align-items: center; min-height: 43px; padding: 9px 12px; border-radius: 9px; color: #9ba9c1; font-size: 13px; font-weight: 700; transition: background .15s, color .15s; }
.main-nav a:hover, .nav-settings:hover { background: rgba(255,255,255,.05); color: #e9eef8; }
.main-nav a.is-active, .nav-settings.is-active { background: color-mix(in srgb, var(--accent) 22%, transparent); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.main-nav svg, .nav-settings svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sidebar__bottom { padding-top: 10px; border-top: 1px solid rgba(255,255,255,.07); }
.sidebar-user { display: grid; grid-template-columns: 37px 1fr 30px; gap: 10px; align-items: center; margin-top: 12px; padding: 12px 8px 0; border-top: 1px solid rgba(255,255,255,.06); }
.avatar { display: inline-flex; width: 37px; height: 37px; align-items: center; justify-content: center; border-radius: 11px; background: linear-gradient(145deg, var(--accent), color-mix(in srgb, var(--accent) 62%, #7857d8)); color: #fff; font-size: 11px; font-weight: 900; box-shadow: 0 7px 17px color-mix(in srgb, var(--accent) 18%, transparent); }
.avatar--large { width: 46px; height: 46px; border-radius: 13px; }
.sidebar-user > div { display: flex; min-width: 0; flex-direction: column; }
.sidebar-user strong { overflow: hidden; color: #edf2fb; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user small { overflow: hidden; color: #73839f; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.logout-btn { width: 29px; height: 29px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #7686a3; cursor: pointer; }
.logout-btn:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar-overlay { display: none; }
.workspace { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; z-index: 30; top: 0; display: flex; height: 82px; align-items: center; justify-content: space-between; padding: 0 clamp(24px, 3.5vw, 54px); border-bottom: 1px solid rgba(220,226,237,.85); background: rgba(244,246,250,.91); backdrop-filter: blur(15px); }
.topbar__title { display: flex; gap: 13px; align-items: center; }
.topbar__title small { display: block; margin-bottom: 1px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.topbar__title h1 { margin: 0; font-size: 21px; font-weight: 800; line-height: 1.1; }
.topbar__actions { display: flex; gap: 10px; align-items: center; }
.today-chip { display: inline-flex; gap: 8px; align-items: center; min-height: 37px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.today-chip span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.menu-btn { display: none; flex-direction: column; gap: 4px; }
.menu-btn span { width: 17px; height: 1.5px; background: currentColor; }
.flash-stack { position: fixed; z-index: 70; top: 92px; right: 24px; width: min(430px, calc(100% - 48px)); }
.content { width: 100%; max-width: 1540px; min-height: calc(100vh - 130px); margin: 0 auto; padding: 35px clamp(24px, 3.5vw, 54px) 60px; }
.app-footer { display: flex; justify-content: space-between; padding: 0 clamp(24px, 3.5vw, 54px) 25px; color: #98a3b4; font-size: 10px; }

/* Core cards and dashboard */
.welcome-row, .page-intro { display: flex; gap: 25px; align-items: flex-end; justify-content: space-between; margin-bottom: 26px; }
.welcome-row h2, .page-intro h2 { margin-bottom: 6px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(29px, 3vw, 39px); font-weight: 500; line-height: 1.1; letter-spacing: -.035em; }
.welcome-row p, .page-intro p { margin: 0; color: var(--muted); }
.welcome-row p strong { color: var(--ink-soft); }
.quick-actions, .header-actions { display: flex; gap: 9px; align-items: center; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 22px; }
.metric-card { position: relative; min-height: 167px; overflow: hidden; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.metric-card--featured { border-color: transparent; background: var(--navy-900); color: #fff; }
.metric-card--featured::after { position: absolute; width: 160px; height: 160px; right: -80px; bottom: -95px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 34px rgba(255,255,255,.018); content: ""; }
.metric-card__top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin-bottom: 21px; }
.metric-icon { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent-dark); font-size: 13px; font-weight: 900; }
.metric-icon--green { background: var(--green-soft); color: var(--green); }
.metric-icon--amber { background: var(--amber-soft); color: var(--amber); }
.metric-icon--purple { background: var(--purple-soft); color: var(--purple); }
.metric-card--featured .metric-icon { background: rgba(255,255,255,.11); color: #fff; }
.metric-tag { padding: 5px 8px; border-radius: 999px; background: rgba(255,255,255,.08); color: #95a7c7; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.metric-delta { color: var(--green); font-size: 11px; font-weight: 900; }
.metric-card > small { display: block; margin-bottom: 3px; color: var(--muted); font-size: 11px; font-weight: 750; }
.metric-card--featured > small { color: #92a2be; }
.metric-card > strong { position: relative; z-index: 1; font-size: 31px; font-weight: 800; line-height: 1; }
.metric-card strong em { margin-left: 2px; color: var(--muted); font-size: 16px; font-style: normal; }
.metric-card p { position: relative; z-index: 1; margin: 10px 0 0; color: var(--muted); font-size: 10px; }
.metric-card--featured p { color: #8292ae; }
.progress { height: 6px; overflow: hidden; border-radius: 999px; background: #edf0f5; }
.progress i { display: block; width: var(--progress, 0%); height: 100%; border-radius: inherit; background: var(--subject, var(--accent)); transition: width .4s ease; }
.metric-card > .progress { margin-top: 17px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 22px; }
.span-8 { grid-column: span 8; }
.span-4 { grid-column: span 4; }
.card, .form-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.card { padding: 21px; }
.form-card { padding: 22px; }
.card-header { display: flex; gap: 15px; align-items: center; justify-content: space-between; margin-bottom: 17px; }
.card-header h3 { margin: 0; font-size: 17px; font-weight: 800; }
.card-header .eyebrow { margin-bottom: 3px; }
.card-description { margin: -7px 0 19px; color: var(--muted); font-size: 12px; }
.subject-performance-list { margin: 0 -4px; }
.subject-performance { display: grid; grid-template-columns: 42px minmax(130px, 1.3fr) minmax(140px, 1.6fr) 51px 14px; gap: 13px; align-items: center; padding: 14px 5px; border-top: 1px solid var(--line-soft); transition: background .15s; }
.subject-performance:first-child { border-top: 0; }
.subject-performance:hover { background: #fafbfe; }
.subject-monogram { display: inline-flex; width: 38px; height: 38px; flex: 0 0 auto; align-items: center; justify-content: center; border-radius: 10px; background: color-mix(in srgb, var(--subject, var(--accent)) 13%, #fff); color: var(--subject, var(--accent)); font-size: 13px; font-weight: 900; }
.subject-monogram--lg { width: 43px; height: 43px; border-radius: 11px; font-size: 15px; }
.subject-monogram--xl { width: 66px; height: 66px; border: 1px solid rgba(255,255,255,.22); border-radius: 17px; background: rgba(255,255,255,.12); color: #fff; font-size: 22px; }
.subject-performance__name { display: flex; min-width: 0; flex-direction: column; }
.subject-performance__name strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.subject-performance__name small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.subject-performance__bar { display: flex; flex-direction: column; gap: 5px; }
.subject-performance__bar::before { display: block; height: 6px; overflow: hidden; border-radius: 999px; background: linear-gradient(to right, var(--subject, var(--accent)) var(--progress, 0%), #edf0f5 var(--progress, 0%)); content: ""; }
.subject-performance__bar i { display: none; }
.subject-performance__bar small { color: var(--muted); font-size: 9px; }
.grade-pill { display: inline-flex; min-width: 42px; min-height: 30px; align-items: center; justify-content: center; border-radius: 8px; background: #f1f3f7; color: var(--ink-soft); font-size: 12px; font-weight: 850; }
.grade-pill.is-good { background: var(--green-soft); color: var(--green); }
.row-arrow { color: #a0abba; font-size: 21px; }
.agenda-list { margin: 0 -4px; }
.agenda-item { display: grid; grid-template-columns: 43px minmax(150px, 1fr) 48px 63px; gap: 12px; align-items: center; padding: 12px 5px; border-top: 1px solid var(--line-soft); }
.agenda-item:first-child { border-top: 0; }
.date-tile { display: inline-flex; width: 40px; height: 43px; flex-direction: column; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 9px; background: #f8faff; line-height: 1; }
.date-tile strong { font-size: 15px; }
.date-tile small { margin-top: 3px; color: var(--muted); font-size: 8px; font-weight: 850; }
.date-tile.is-overdue { border-color: #f2c9d0; background: var(--red-soft); color: var(--red); }
.agenda-item__info { display: flex; min-width: 0; flex-direction: column; }
.agenda-item__info strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.agenda-item__info small { display: flex; gap: 5px; align-items: center; color: var(--muted); font-size: 9px; }
.agenda-item__info i, .goal-item__body i { width: 6px; height: 6px; border-radius: 50%; background: var(--subject); }
.agenda-weight { color: var(--ink-soft); font-size: 11px; font-weight: 850; text-align: center; }
.deadline-label { color: var(--muted); font-size: 9px; font-weight: 800; text-align: right; }
.deadline-label.is-overdue { color: var(--red); }
.compact-goals { margin-bottom: 17px; }
.compact-goal { display: grid; grid-template-columns: 8px 1fr; gap: 10px; align-items: start; padding: 11px 0; border-top: 1px solid var(--line-soft); }
.compact-goal:first-child { border-top: 0; }
.compact-goal > div { display: flex; min-width: 0; flex-direction: column; }
.compact-goal strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.compact-goal small { color: var(--muted); font-size: 9px; }
.priority-dot { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--amber); }
.priority-dot--high { background: var(--red); }
.priority-dot--low { background: #4a86dc; }
.empty-mini { display: flex; flex-direction: column; align-items: center; padding: 18px 0 21px; color: var(--muted); text-align: center; }
.empty-mini span { display: inline-flex; width: 35px; height: 35px; align-items: center; justify-content: center; margin-bottom: 7px; border-radius: 50%; background: var(--green-soft); color: var(--green); }
.empty-mini p { margin: 0; font-size: 11px; }
.insight-card { display: flex; gap: 14px; align-items: flex-start; padding: 19px; border: 1px solid #dce6ff; border-radius: var(--radius); background: linear-gradient(135deg, #edf3ff, #f8faff); }
.insight-icon { display: inline-flex; width: 36px; height: 36px; flex: 0 0 auto; align-items: center; justify-content: center; border-radius: 10px; background: var(--accent); color: #fff; }
.insight-card small { color: var(--accent-dark); font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.insight-card h3 { margin: 3px 0 5px; font-size: 15px; }
.insight-card p { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.55; }
.empty-inline { display: flex; gap: 13px; align-items: center; justify-content: space-between; padding: 22px 4px 5px; color: var(--muted); }
.empty-inline p { margin: 0; font-size: 12px; }
.empty-inline--large { justify-content: flex-start; padding: 35px 5px 25px; }
.empty-inline--large > span { display: inline-flex; width: 48px; height: 48px; align-items: center; justify-content: center; border-radius: 13px; background: var(--accent-soft); color: var(--accent); font-size: 20px; }
.empty-inline--large h4 { margin: 0 0 3px; color: var(--ink); }
.empty-inline--large div { flex: 1; }
.empty-state { display: flex; min-height: 300px; flex-direction: column; align-items: center; justify-content: center; padding: 45px 25px; border: 1px dashed #cfd7e4; border-radius: var(--radius-lg); background: rgba(255,255,255,.55); text-align: center; }
.empty-state--hero { min-height: 480px; }
.empty-icon { display: inline-flex; min-width: 52px; height: 52px; align-items: center; justify-content: center; margin-bottom: 15px; padding: 0 10px; border-radius: 15px; background: var(--accent-soft); color: var(--accent-dark); font-size: 18px; font-weight: 900; }
.empty-state h2, .empty-state h3 { margin-bottom: 6px; }
.empty-state p { max-width: 430px; margin-bottom: 19px; color: var(--muted); }

/* Periods and subjects */
.split-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.split-layout.has-form { grid-template-columns: minmax(0, 1fr) minmax(315px, 390px); }
.sticky-card { position: sticky; top: 104px; align-self: start; }
.timeline { position: relative; }
.timeline::before { position: absolute; top: 9px; bottom: 9px; left: 13px; width: 1px; background: #d9e0eb; content: ""; }
.period-card { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: 17px; padding-bottom: 19px; }
.timeline-marker { position: relative; z-index: 2; padding-top: 25px; background: var(--canvas); }
.timeline-marker span { display: block; width: 11px; height: 11px; margin: auto; border: 3px solid var(--canvas); border-radius: 50%; background: #aab5c5; box-shadow: 0 0 0 1px #b8c2d0; }
.period-card.is-current .timeline-marker span { background: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 0 5px var(--accent-soft); }
.period-card__main { padding: 21px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.period-card.is-current .period-card__main { border-color: color-mix(in srgb, var(--accent) 33%, #e3e8f1); }
.period-card__head { display: flex; gap: 15px; align-items: flex-start; justify-content: space-between; }
.period-card__head h3 { margin: 7px 0 2px; font-size: 19px; }
.period-card__head p { margin: 0; color: var(--muted); font-size: 11px; }
.status-badge { display: inline-flex; align-items: center; min-height: 22px; padding: 3px 8px; border-radius: 999px; background: #f0f2f6; color: #657087; font-size: 8px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.status-badge--current, .status-badge--active, .status-badge--passed { background: var(--green-soft); color: #087b5a; }
.status-badge--planned { background: var(--accent-soft); color: var(--accent-dark); }
.status-badge--completed { background: #edf0f5; color: #66738a; }
.status-badge--failed { background: var(--red-soft); color: var(--red); }
.status-badge--dropped { background: var(--amber-soft); color: #94610b; }
.period-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 18px 0 15px; padding: 15px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.period-stats > span { display: flex; flex-direction: column; padding: 0 15px; border-left: 1px solid var(--line-soft); }
.period-stats > span:first-child { padding-left: 0; border-left: 0; }
.period-stats small { color: var(--muted); font-size: 9px; font-weight: 750; }
.period-stats strong { margin-top: 2px; font-size: 14px; }
.period-notes { margin: 0 0 14px; color: var(--ink-soft); font-size: 11px; }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; z-index: 25; top: calc(100% + 5px); left: 0; display: none; min-width: 155px; overflow: hidden; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 16px 40px rgba(15,30,60,.13); }
.dropdown-menu--right { right: 0; left: auto; }
.dropdown.is-open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button { display: block; width: 100%; min-height: 32px; padding: 7px 9px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-soft); font-size: 11px; font-weight: 700; text-align: left; cursor: pointer; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: #f3f6fa; color: var(--ink); }
.dropdown-menu .danger-text { color: var(--red); }
.filter-bar { display: flex; gap: 15px; align-items: center; justify-content: space-between; margin-bottom: 20px; padding: 7px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.period-tabs { display: flex; gap: 3px; overflow-x: auto; }
.period-tabs a { flex: 0 0 auto; min-height: 34px; padding: 8px 12px; border-radius: 8px; color: var(--muted); font-size: 11px; font-weight: 800; }
.period-tabs a:hover { background: #f4f6fa; color: var(--ink); }
.period-tabs a.is-active { background: var(--navy-900); color: #fff; }
.search-field { display: flex; width: min(230px, 100%); align-items: center; padding: 0 9px; border-left: 1px solid var(--line); }
.search-field--small { width: 190px; }
.search-field span { color: #8996aa; font-size: 18px; }
.search-field input { min-height: 34px; padding: 7px 8px; border: 0; box-shadow: none; font-size: 11px; }
.search-field input:focus { box-shadow: none; }
.subject-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.split-layout.has-form .subject-grid { grid-template-columns: 1fr; }
.subject-card { position: relative; overflow: hidden; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); transition: transform .17s, box-shadow .17s; }
.subject-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.subject-card__accent { position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--subject); }
.subject-card__head { display: flex; align-items: center; margin-bottom: 15px; }
.subject-card__head .status-badge { margin-left: 11px; }
.subject-card__head .dropdown { margin-left: auto; }
.subject-card h3 { margin: 0 0 3px; font-size: 18px; }
.subject-card > p { margin: 0 0 18px; color: var(--muted); font-size: 10px; }
.subject-score-row { display: grid; grid-template-columns: repeat(2, 1fr); margin-bottom: 17px; padding: 14px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.subject-score-row > span { display: flex; flex-direction: column; }
.subject-score-row > span + span { padding-left: 18px; border-left: 1px solid var(--line-soft); }
.subject-score-row small { color: var(--muted); font-size: 9px; }
.subject-score-row strong { font-size: 21px; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 6px; color: var(--muted); font-size: 9px; }
.progress-label b { color: var(--ink-soft); }
.subject-card__footer { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; color: var(--muted); font-size: 9px; }
.subject-card__footer a { color: var(--accent-dark); font-weight: 850; }

/* Subject detail */
.subject-hero { position: relative; overflow: hidden; margin: -35px calc(clamp(24px, 3.5vw, 54px) * -1) 0; padding: 25px clamp(24px, 3.5vw, 54px) 34px; background: linear-gradient(120deg, color-mix(in srgb, var(--subject) 58%, var(--navy-900)), var(--navy-900) 68%); color: #fff; }
.subject-hero::after { position: absolute; width: 330px; height: 330px; right: -120px; bottom: -235px; border: 1px solid rgba(255,255,255,.11); border-radius: 50%; box-shadow: 0 0 0 58px rgba(255,255,255,.025), 0 0 0 115px rgba(255,255,255,.017); content: ""; }
.subject-hero__top { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; }
.subject-hero__actions { display: flex; gap: 9px; }
.back-link { color: #c2cee2; font-size: 11px; font-weight: 750; }
.back-link:hover { color: #fff; }
.subject-hero__content { position: relative; z-index: 1; display: flex; gap: 18px; align-items: center; margin-top: 38px; }
.hero-kicker { color: #9fb0cb; font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.subject-hero h2 { margin: 2px 0 2px; font-family: Georgia, "Times New Roman", serif; font-size: 36px; font-weight: 500; }
.subject-hero p { margin: 0; color: #aebbd1; font-size: 11px; }
.subject-hero p span { color: #72deb9; }
.subject-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); margin-bottom: 20px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.subject-metric { min-height: 121px; padding: 22px; border-left: 1px solid var(--line-soft); }
.subject-metric:first-child { border-left: 0; }
.subject-metric--target { background: linear-gradient(135deg, #f7f9ff, #eef3ff); }
.metric-caption { display: flex; gap: 5px; align-items: center; margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 750; }
.subject-metric > strong { display: inline-block; font-size: 29px; font-weight: 850; line-height: 1; }
.subject-metric > strong em { color: var(--muted); font-size: 15px; font-style: normal; }
.subject-metric > small { display: block; margin-top: 6px; color: var(--muted); font-size: 9px; }
.subject-metric > .progress { margin-top: 13px; }
.info-dot { position: relative; display: inline-flex; width: 15px; height: 15px; align-items: center; justify-content: center; padding: 0; border: 1px solid #ccd4e1; border-radius: 50%; background: #fff; color: #8290a6; font-size: 9px; font-weight: 800; cursor: help; }
.info-dot::after { position: absolute; z-index: 50; bottom: calc(100% + 8px); left: 50%; width: 210px; padding: 9px 10px; transform: translate(-50%, 4px); border-radius: 7px; background: #17223a; color: #fff; content: attr(data-tooltip); font-size: 10px; font-weight: 500; line-height: 1.4; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; }
.info-dot:hover::after, .info-dot:focus::after { transform: translate(-50%, 0); opacity: 1; }
.plan-notice { display: flex; gap: 13px; align-items: center; margin-bottom: 20px; padding: 14px 17px; border: 1px solid #cfddff; border-radius: 11px; background: #f2f6ff; }
.plan-notice > span { display: inline-flex; width: 29px; height: 29px; flex: 0 0 auto; align-items: center; justify-content: center; border-radius: 8px; background: var(--accent); color: #fff; font-family: Georgia, serif; font-weight: 800; }
.plan-notice div { flex: 1; }
.plan-notice strong { font-size: 11px; }
.plan-notice p { margin: 1px 0 0; color: var(--muted); font-size: 10px; }
.plan-notice a { color: var(--accent-dark); font-size: 10px; font-weight: 850; }
.subject-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.subject-layout.has-form { grid-template-columns: minmax(0, 1fr) minmax(330px, 405px); }
.weight-total { padding: 6px 9px; border-radius: 7px; background: var(--amber-soft); color: #98630a; font-size: 10px; font-weight: 850; }
.weight-total.is-complete { background: var(--green-soft); color: var(--green); }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 10px 11px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .07em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 12px 11px; border-bottom: 1px solid var(--line-soft); color: var(--ink-soft); font-size: 10px; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.table-primary { display: flex; gap: 9px; align-items: center; min-width: 170px; }
.table-primary > span:last-child { display: flex; min-width: 0; flex-direction: column; }
.table-primary strong { color: var(--ink); font-size: 11px; }
.table-primary small { color: var(--muted); font-size: 8px; }
.category-icon { display: inline-flex; width: 31px; height: 31px; flex: 0 0 auto; align-items: center; justify-content: center; border-radius: 8px; background: #f0f3f8; color: #6c7890; font-size: 9px; font-weight: 900; }
.partial-chip { display: inline-flex; min-width: 29px; min-height: 23px; align-items: center; justify-content: center; border-radius: 6px; background: var(--accent-soft); color: var(--accent-dark); font-size: 8px; font-weight: 900; }
.inline-max { color: var(--muted); }
.completion-badge { padding: 4px 7px; border-radius: 999px; background: var(--amber-soft); color: #94610b; font-size: 8px; font-weight: 850; }
.completion-badge.is-done { background: var(--green-soft); color: var(--green); }
.official-label { padding: 5px 8px; border-radius: 7px; background: #f0f2f6; color: var(--muted); font-size: 8px; font-weight: 850; }
.official-grades-form { display: grid; grid-template-columns: repeat(4, minmax(75px, 1fr)) auto; gap: 12px; align-items: end; }
.grade-field { display: flex; flex-direction: column; gap: 6px; }
.grade-field span { color: var(--muted); font-size: 9px; font-weight: 750; }
.grade-field input { width: 100%; min-height: 43px; padding: 8px 10px; border: 1px solid #d9e0eb; border-radius: 9px; font-size: 16px; font-weight: 800; text-align: center; }
.analysis-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.partial-analysis > div { display: grid; grid-template-columns: 1fr 36px; gap: 6px 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.partial-analysis > div:first-child { border-top: 0; }
.partial-analysis span { display: flex; flex-direction: column; }
.partial-analysis strong { font-size: 10px; }
.partial-analysis small { color: var(--muted); font-size: 8px; }
.partial-analysis b { font-size: 12px; text-align: right; }
.partial-analysis .progress { grid-column: 1 / -1; }
.category-list > div { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-top: 1px solid var(--line-soft); }
.category-list > div:first-child { border-top: 0; }
.category-list span { display: flex; gap: 8px; align-items: center; }
.category-list i { width: 7px; height: 7px; border-radius: 50%; background: var(--subject); }
.category-list strong { font-size: 10px; }
.category-list b { font-size: 11px; }
.category-list small { display: inline-flex; min-width: 30px; justify-content: center; padding: 3px 5px; border-radius: 5px; background: var(--green-soft); color: var(--green); font-size: 8px; font-weight: 850; }
.score-box { padding: 14px; border: 1px solid var(--line-soft); border-radius: 11px; background: #f8faff; }
.score-box > strong { font-size: 11px; }
.score-box > p { margin: 2px 0 12px; color: var(--muted); font-size: 9px; }

/* Goals */
.goal-summary { display: grid; grid-template-columns: 180px 180px 1fr; gap: 12px; margin-bottom: 21px; }
.goal-summary > div { display: flex; gap: 12px; align-items: center; min-height: 83px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.goal-summary__icon { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 10px; background: var(--amber-soft); color: var(--amber); }
.goal-summary__icon--done { background: var(--green-soft); color: var(--green); }
.goal-summary > div span:not(.goal-summary__icon) { display: flex; flex-direction: column; }
.goal-summary small { color: var(--muted); font-size: 9px; }
.goal-summary strong { font-size: 23px; line-height: 1.1; }
.goal-summary .goal-progress { display: grid; grid-template-columns: 120px 1fr; }
.goal-list { margin: 0 -5px; }
.goal-item { position: relative; display: grid; grid-template-columns: 30px 4px minmax(180px, 1fr) 50px 55px 38px; gap: 12px; align-items: center; padding: 14px 5px; border-top: 1px solid var(--line-soft); }
.goal-item:first-child { border-top: 0; }
.goal-item.is-completed { opacity: .6; }
.goal-item.is-completed .goal-item__body strong { text-decoration: line-through; }
.goal-check { display: inline-flex; width: 25px; height: 25px; align-items: center; justify-content: center; padding: 0; border: 1px solid #ccd5e2; border-radius: 8px; background: #fff; color: #fff; font-size: 12px; cursor: pointer; }
.is-completed .goal-check { border-color: var(--green); background: var(--green); }
.priority-line { width: 3px; height: 31px; border-radius: 999px; background: var(--amber); }
.priority-line--high { background: var(--red); }
.priority-line--low { background: #4d86dd; }
.goal-item__body { display: flex; min-width: 0; flex-direction: column; }
.goal-item__body strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.goal-item__body span { display: flex; gap: 5px; align-items: center; color: var(--muted); font-size: 9px; }
.priority-badge, .overdue-badge { padding: 4px 7px; border-radius: 999px; background: var(--amber-soft); color: #94610b; font-size: 8px; font-weight: 850; text-align: center; }
.priority-badge--high, .overdue-badge { background: var(--red-soft); color: var(--red); }
.priority-badge--low { background: #edf3fc; color: #3b70bc; }

/* Reports */
.report-sheet { padding: 34px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.report-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 24px; border-bottom: 2px solid var(--navy-900); }
.report-brand { display: flex; gap: 11px; align-items: center; }
.report-brand > div { display: flex; flex-direction: column; }
.report-brand strong { font-size: 13px; }
.report-brand small { color: var(--muted); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.report-meta { display: flex; flex-direction: column; text-align: right; }
.report-meta small { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.report-meta strong { font-size: 10px; }
.student-record { display: grid; grid-template-columns: 1.2fr 1.2fr 1fr; gap: 16px; padding: 23px 0; border-bottom: 1px solid var(--line); }
.student-record > div { display: flex; flex-direction: column; }
.student-record small { color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.student-record strong { margin: 3px 0 1px; font-size: 12px; }
.student-record span { color: var(--muted); font-size: 9px; }
.report-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 22px 0 29px; border: 1px solid var(--line); border-radius: 11px; background: #f8faff; }
.report-kpis > div { display: flex; min-height: 91px; flex-direction: column; justify-content: center; padding: 15px; border-left: 1px solid var(--line); }
.report-kpis > div:first-child { border-left: 0; }
.report-kpis small { color: var(--muted); font-size: 8px; font-weight: 750; }
.report-kpis strong { margin: 2px 0; font-size: 22px; }
.report-kpis span { color: var(--muted); font-size: 8px; }
.report-kpis .report-status { font-size: 15px; }
.report-section-title { display: flex; gap: 18px; align-items: center; justify-content: space-between; margin: 27px 0 10px; }
.report-section-title > div { display: flex; gap: 10px; align-items: center; }
.report-section-title > div > span { display: inline-flex; width: 25px; height: 25px; align-items: center; justify-content: center; border-radius: 7px; background: var(--navy-900); color: #fff; font-size: 8px; font-weight: 900; }
.report-section-title h3 { margin: 0; font-size: 14px; }
.report-section-title > small { color: var(--muted); font-size: 8px; }
.report-table { border: 1px solid var(--line); }
.report-subject { display: flex; gap: 9px; align-items: center; min-width: 150px; }
.report-subject > i { width: 4px; height: 30px; border-radius: 999px; background: var(--subject); }
.report-subject span { display: flex; flex-direction: column; }
.report-subject strong { color: var(--ink); font-size: 10px; }
.report-subject small { color: var(--muted); font-size: 8px; }
.final-grade { display: inline-flex; min-width: 33px; min-height: 28px; align-items: center; justify-content: center; border-radius: 7px; background: var(--navy-900); color: #fff; }
.grade-chart { padding: 16px; border: 1px solid var(--line); border-radius: 11px; }
.grade-chart__row { display: grid; grid-template-columns: minmax(110px, 180px) 1fr 35px; gap: 13px; align-items: center; padding: 8px 0; }
.grade-chart__row > span { overflow: hidden; font-size: 9px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.grade-chart__row > div { height: 8px; overflow: hidden; border-radius: 999px; background: #edf0f5; }
.grade-chart__row i { display: block; width: var(--value); height: 100%; border-radius: inherit; background: var(--subject); }
.grade-chart__row strong { font-size: 10px; text-align: right; }
.report-footer { display: flex; justify-content: space-between; margin-top: 34px; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 8px; }
.history-summary { margin-top: 22px; }
.history-table { display: grid; grid-template-columns: 180px 1fr 1fr; gap: 0 20px; }
.history-table h4 { grid-column: 1; margin: 0; padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: 11px; }
.history-table h4 small { display: block; color: var(--muted); font-size: 8px; font-weight: 500; }
.history-table div { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: 10px; }

/* Settings */
.settings-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(270px, .75fr); gap: 22px; }
.security-icon, .data-card__icon { display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 10px; background: var(--green-soft); color: var(--green); font-size: 18px; }
.data-card { position: relative; overflow: hidden; }
.data-card__icon { margin-bottom: 21px; background: var(--accent-soft); color: var(--accent); }
.data-card h3 { margin: 3px 0 8px; }
.data-card p { margin-bottom: 19px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.privacy-card { display: flex; gap: 12px; background: var(--navy-900); color: #fff; }
.privacy-card > span { display: inline-flex; width: 34px; height: 34px; flex: 0 0 auto; align-items: center; justify-content: center; border-radius: 10px; background: rgba(255,255,255,.08); color: #8eafff; }
.privacy-card h3 { margin: 0 0 5px; font-size: 14px; }
.privacy-card p { margin: 0; color: #95a4c0; font-size: 10px; line-height: 1.55; }
.online-dot { display: inline-flex; gap: 5px; align-items: center; color: var(--green); font-size: 8px; font-weight: 850; text-transform: uppercase; }
.online-dot::before { width: 6px; height: 6px; border-radius: 50%; background: var(--green); content: ""; }
.system-card dl { margin: 0; }
.system-card dl > div { display: flex; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--line-soft); }
.system-card dt, .system-card dd { margin: 0; font-size: 9px; }
.system-card dt { color: var(--muted); }
.system-card dd { font-weight: 750; }

@media (max-width: 1220px) {
    :root { --sidebar: 240px; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .span-8, .span-4 { grid-column: auto; }
    .subject-layout.has-form, .split-layout.has-form { grid-template-columns: minmax(0, 1fr) 340px; }
    .subject-grid { grid-template-columns: 1fr; }
    .official-grades-form { grid-template-columns: repeat(4, minmax(70px, 1fr)); }
    .official-grades-form .btn { grid-column: 1 / -1; }
}

@media (max-width: 980px) {
    .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
    .sidebar-close, .menu-btn { display: inline-flex; }
    .sidebar-overlay { position: fixed; z-index: 45; inset: 0; border: 0; background: rgba(6,14,31,.52); opacity: 0; pointer-events: none; transition: opacity .2s; }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .sidebar-overlay { display: block; opacity: 1; pointer-events: auto; }
    .workspace { margin-left: 0; }
    .login-shell { grid-template-columns: minmax(330px, .8fr) minmax(410px, 1.2fr); }
    .login-visual { padding: 40px; }
    .login-preview { grid-template-columns: 130px 1fr; }
    .install-shell { grid-template-columns: 1fr; }
    .install-intro { position: relative; height: auto; min-height: 370px; padding: 38px; }
    .install-intro > div:nth-child(2) { padding: 65px 0; }
    .install-card { max-width: 760px; }
    .split-layout.has-form, .subject-layout.has-form { grid-template-columns: 1fr; }
    .sticky-card { position: static; }
    .subject-metric-grid { grid-template-columns: repeat(2, 1fr); }
    .subject-metric:nth-child(3) { border-top: 1px solid var(--line-soft); border-left: 0; }
    .subject-metric:nth-child(4) { border-top: 1px solid var(--line-soft); }
    .settings-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    body { font-size: 14px; }
    .topbar { height: 70px; padding: 0 16px; }
    .topbar__title small, .today-chip { display: none; }
    .topbar__title h1 { font-size: 17px; }
    .content { padding: 25px 16px 45px; }
    .app-footer { flex-direction: column; gap: 3px; padding: 0 16px 20px; }
    .welcome-row, .page-intro { align-items: flex-start; flex-direction: column; }
    .welcome-row h2, .page-intro h2 { font-size: 30px; }
    .quick-actions { width: 100%; }
    .quick-actions .btn { flex: 1; }
    .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .metric-card { min-height: 152px; padding: 16px; }
    .card { padding: 17px; }
    .subject-performance { grid-template-columns: 38px 1fr 45px 12px; }
    .subject-performance__bar { grid-column: 2 / 4; grid-row: 2; }
    .grade-pill { grid-column: 3; grid-row: 1; }
    .row-arrow { grid-column: 4; grid-row: 1; }
    .agenda-item { grid-template-columns: 41px 1fr 54px; }
    .agenda-weight { display: none; }
    .login-shell { grid-template-columns: 1fr; }
    .login-visual { min-height: 390px; padding: 28px 24px; }
    .login-message { padding: 55px 0 35px; }
    .login-message h1 { font-size: 37px; }
    .login-message p { font-size: 14px; }
    .login-preview { display: none; }
    .login-panel { min-height: auto; padding: 52px 24px; }
    .install-intro { min-height: 320px; padding: 28px 23px; }
    .install-intro > div:nth-child(2) { padding: 45px 0; }
    .install-intro h1 { font-size: 37px; }
    .install-card { padding: 43px 22px; }
    .form-grid--2, .form-grid--3 { grid-template-columns: 1fr; }
    .field--span-2 { grid-column: auto; }
    .filter-bar { align-items: stretch; flex-direction: column; }
    .search-field { width: 100%; border-top: 1px solid var(--line); border-left: 0; }
    .subject-grid { grid-template-columns: 1fr; }
    .period-stats { grid-template-columns: 1fr 1fr; }
    .period-stats > span:nth-child(3) { grid-column: 1 / -1; margin-top: 12px; padding: 12px 0 0; border-top: 1px solid var(--line-soft); border-left: 0; }
    .subject-hero { margin: -25px -16px 0; padding: 20px 16px 29px; }
    .subject-hero__top { align-items: flex-start; }
    .subject-hero__actions .btn--ghost { display: none; }
    .subject-hero__content { margin-top: 30px; }
    .subject-monogram--xl { width: 55px; height: 55px; }
    .subject-hero h2 { font-size: 29px; }
    .subject-metric-grid { grid-template-columns: 1fr 1fr; }
    .subject-metric { min-height: 112px; padding: 17px; }
    .subject-metric > strong { font-size: 25px; }
    .plan-notice { align-items: flex-start; }
    .plan-notice > a { display: none; }
    .analysis-grid { grid-template-columns: 1fr; }
    .official-grades-form { grid-template-columns: repeat(2, 1fr); }
    .official-grades-form .btn { grid-column: 1 / -1; }
    .goal-summary { grid-template-columns: 1fr 1fr; }
    .goal-summary .goal-progress { grid-column: 1 / -1; }
    .goal-item { grid-template-columns: 30px 4px 1fr 38px; }
    .priority-badge, .overdue-badge { display: none; }
    .goal-item .dropdown { grid-column: 4; }
    .report-sheet { padding: 20px 15px; }
    .student-record { grid-template-columns: 1fr; }
    .report-kpis { grid-template-columns: 1fr 1fr; }
    .report-kpis > div:nth-child(3) { border-top: 1px solid var(--line); border-left: 0; }
    .report-kpis > div:nth-child(4) { border-top: 1px solid var(--line); }
    .report-section-title { align-items: flex-start; flex-direction: column; }
    .grade-chart__row { grid-template-columns: 90px 1fr 30px; }
    .history-table { grid-template-columns: 1fr; }
    .history-table h4 { margin-top: 10px; }
}

@media (max-width: 430px) {
    .metric-grid { grid-template-columns: 1fr; }
    .metric-card { min-height: 145px; }
    .subject-metric-grid { grid-template-columns: 1fr; }
    .subject-metric { border-top: 1px solid var(--line-soft); border-left: 0; }
    .subject-metric:first-child { border-top: 0; }
    .subject-hero__content { align-items: flex-start; }
    .subject-monogram--xl { display: none; }
    .header-actions .weight-total { display: none; }
    .goal-summary { grid-template-columns: 1fr; }
    .goal-summary .goal-progress { grid-column: auto; }
    .report-header { align-items: flex-start; flex-direction: column; gap: 12px; }
    .report-meta { text-align: left; }
}

@media print {
    @page { size: A4 portrait; margin: 12mm; }
    body { background: #fff; color: #111; font-size: 10px; }
    .sidebar, .topbar, .app-footer, .no-print, .flash-stack { display: none !important; }
    .workspace { margin: 0; }
    .content { max-width: none; min-height: auto; padding: 0; }
    .report-sheet { padding: 0; border: 0; box-shadow: none; }
    .report-kpis, .student-record, .data-table, .grade-chart { break-inside: avoid; }
    .report-table th, .report-table td { padding: 8px 6px; }
    .report-footer { position: fixed; right: 0; bottom: 0; left: 0; }
}
