:root {
  --navy-950: #062e47;
  --navy-900: #073f60;
  --navy-800: #0b648f;
  --navy-100: #dceef6;
  --cyan-600: #18a6b8;
  --cyan-100: #dff7fa;
  --violet-600: #7759c2;
  --violet-100: #eee9fb;
  --green-600: #2f9d77;
  --green-100: #e5f6ef;
  --amber-500: #f59e0b;
  --amber-100: #fff5d8;
  --orange-500: #f97316;
  --orange-100: #fff0e5;
  --red-600: #dc2626;
  --red-100: #fee7e7;
  --slate-950: #17212b;
  --slate-700: #405261;
  --slate-600: #64748b;
  --slate-300: #ccd7df;
  --slate-200: #e3eaf0;
  --slate-100: #f0f4f7;
  --canvas: #f4f7f9;
  --white: #ffffff;
  --shadow: 0 12px 35px rgba(6, 46, 71, 0.08);
  --radius-lg: 22px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--slate-950);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  color: var(--white);
  background: var(--navy-950);
  border-radius: 8px;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: 286px;
  flex-direction: column;
  padding: 28px 20px 22px;
  color: var(--white);
  background:
    radial-gradient(circle at 20% 10%, rgba(24, 166, 184, 0.25), transparent 30%),
    linear-gradient(175deg, var(--navy-950), #061f31 72%);
}

.brand-block { padding: 0 6px 26px; border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-logo { width: 48px; height: 48px; object-fit: contain; border-radius: 12px; background: white; padding: 4px; }
.brand-lockup strong { display: block; font-size: 15px; letter-spacing: -0.01em; }
.brand-lockup span { display: block; margin-top: 2px; color: #bcd1dc; font-size: 12px; }
.term-badge {
  display: inline-flex;
  margin-top: 18px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #d9f4f8;
  background: rgba(24, 166, 184, 0.12);
  font-size: 12px;
  font-weight: 700;
}

.nav-list { display: grid; gap: 7px; margin-top: 24px; }
.nav-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  color: #c9d9e2;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 11px;
  transition: 160ms ease;
}
.nav-item:hover, .nav-item:focus-visible { color: white; background: rgba(255, 255, 255, 0.08); outline: none; }
.nav-item.is-active { color: white; background: rgba(24, 166, 184, 0.2); box-shadow: inset 3px 0 var(--cyan-600); }
.nav-icon { display: inline-grid; width: 28px; height: 28px; place-items: center; color: #8ddce6; border: 1px solid rgba(141, 220, 230, 0.3); border-radius: 8px; font-size: 10px; font-weight: 800; }
.nav-item span:last-child { font-size: 14px; font-weight: 650; }

.sidebar-note { margin-top: auto; padding: 18px; border: 1px solid rgba(255, 255, 255, 0.13); border-radius: 15px; background: rgba(255, 255, 255, 0.055); }
.sidebar-note .eyebrow { color: #80d8e3; }
.sidebar-note strong { display: block; margin-top: 6px; font-size: 15px; line-height: 1.35; }
.sidebar-note p { margin: 10px 0 0; color: #b9cbd5; font-size: 12px; line-height: 1.55; }

.main-content { min-height: 100vh; margin-left: 286px; padding: 36px 44px 24px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 0 auto 28px; max-width: 1450px; }
.eyebrow { margin: 0; color: var(--navy-800); font-size: 11px; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; }
h1 { margin: 6px 0 5px; color: var(--navy-950); font-size: clamp(27px, 3vw, 38px); line-height: 1.16; letter-spacing: -0.035em; }
.page-description { margin: 0; color: var(--slate-600); font-size: 14px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.data-freshness { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; color: var(--slate-700); background: var(--white); border: 1px solid var(--slate-200); border-radius: 999px; font-size: 12px; font-weight: 650; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-600); box-shadow: 0 0 0 3px var(--green-100); }
.mobile-nav-trigger { display: none; }

#page-content { max-width: 1450px; margin: 0 auto; }
.view-stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; animation: enter 260ms ease; }
.view-stack > *, .visual-grid-main > *, .visual-grid-secondary > * { min-width: 0; }
@keyframes enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.notice {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 16px 18px;
  border: 1px solid #bfe5ea;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, #effcfd, #f7fbfc);
}
.notice-icon { display: grid; flex: 0 0 auto; width: 28px; height: 28px; place-items: center; color: var(--navy-800); background: var(--cyan-100); border-radius: 50%; font-weight: 900; }
.notice strong { display: block; color: var(--navy-950); font-size: 14px; }
.notice p { margin: 3px 0 0; color: var(--slate-700); font-size: 13px; }
.notice.is-warning { border-color: #f4dba5; background: linear-gradient(90deg, #fff9e9, #fffdf7); }
.notice.is-warning .notice-icon { color: #8a5700; background: var(--amber-100); }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.kpi-card { position: relative; overflow: hidden; padding: 20px; border: 1px solid var(--slate-200); border-radius: var(--radius-md); background: var(--white); box-shadow: 0 4px 14px rgba(6, 46, 71, 0.035); }
.kpi-button { width: 100%; color: inherit; text-align: left; }
.kpi-button:hover, .kpi-button:focus-visible { border-color: var(--cyan-600); box-shadow: 0 8px 24px rgba(24, 166, 184, 0.13); outline: none; transform: translateY(-1px); }
.kpi-card::before { position: absolute; inset: 0 auto 0 0; width: 4px; content: ""; background: var(--accent, var(--navy-800)); }
.kpi-label { color: var(--slate-600); font-size: 12px; font-weight: 700; }
.kpi-value { margin-top: 9px; color: var(--slate-950); font-size: clamp(27px, 3vw, 36px); font-weight: 780; line-height: 1; letter-spacing: -0.04em; }
.kpi-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; color: var(--slate-600); font-size: 11px; }
.kpi-chip { padding: 4px 7px; color: var(--accent, var(--navy-800)); background: color-mix(in srgb, var(--accent, var(--navy-800)) 10%, white); border-radius: 999px; font-weight: 800; white-space: nowrap; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 18px; }
.grid-2.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { padding: 22px; border: 1px solid var(--slate-200); border-radius: var(--radius-lg); background: var(--white); box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-header h2, .section-title { margin: 0; color: var(--navy-950); font-size: 18px; letter-spacing: -0.02em; }
.panel-header p { margin: 5px 0 0; color: var(--slate-600); font-size: 12px; }
.panel-actions { display: flex; gap: 8px; }

.secondary-button, .primary-button, .ghost-button {
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 750;
}
.primary-button { color: white; background: var(--navy-800); border: 1px solid var(--navy-800); }
.primary-button:hover { background: var(--navy-950); }
.secondary-button { color: var(--navy-800); background: white; border: 1px solid var(--slate-300); }
.secondary-button:hover { border-color: var(--navy-800); background: var(--navy-100); }
.ghost-button { color: var(--slate-700); background: transparent; border: 1px solid transparent; }
.ghost-button:hover { background: var(--slate-100); }

.level-bars { display: grid; gap: 11px; }
.level-row {
  display: grid;
  grid-template-columns: 88px 1fr 90px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 6px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 10px;
}
.level-row:hover, .level-row:focus-visible { background: var(--slate-100); outline: 2px solid transparent; }
.level-name strong { display: block; color: var(--slate-950); font-size: 13px; }
.level-name span { color: var(--slate-600); font-size: 10px; }
.bar-track { position: relative; height: 30px; overflow: hidden; background: var(--slate-100); border-radius: 8px; }
.bar-fill { height: 100%; min-width: 3px; background: var(--navy-800); border-radius: 8px; transition: width 350ms ease; }
.bar-fill.level-5 { background: var(--violet-600); }
.bar-value { text-align: right; }
.bar-value strong { display: block; font-size: 14px; }
.bar-value span { color: var(--slate-600); font-size: 10px; }

.insight-list { display: grid; gap: 12px; }
.insight-item { display: grid; grid-template-columns: 36px 1fr; gap: 11px; padding: 13px; background: var(--slate-100); border-radius: 12px; }
.insight-number { display: grid; width: 36px; height: 36px; place-items: center; color: var(--navy-800); background: white; border: 1px solid var(--slate-200); border-radius: 10px; font-size: 12px; font-weight: 850; }
.insight-item strong { display: block; font-size: 13px; }
.insight-item p { margin: 3px 0 0; color: var(--slate-600); font-size: 11px; }

.attention-list { display: grid; gap: 9px; }
.attention-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; text-align: left; background: white; border: 1px solid var(--slate-200); border-radius: 11px; }
.attention-row:hover { border-color: var(--cyan-600); box-shadow: 0 5px 15px rgba(24, 166, 184, 0.09); }
.class-code { color: var(--navy-950); font-weight: 850; }
.class-meta { color: var(--slate-600); font-size: 11px; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 850; white-space: nowrap; }
.status-badge::before { width: 6px; height: 6px; content: ""; border-radius: 50%; background: currentColor; }
.status-high { color: #a94a09; background: var(--orange-100); }
.status-monitor { color: #8a5700; background: var(--amber-100); }
.status-good { color: #4c3897; background: var(--violet-100); }
.status-neutral { color: var(--slate-600); background: var(--slate-100); }

.mini-donut-wrap { display: grid; grid-template-columns: 160px 1fr; align-items: center; gap: 18px; }
.donut { position: relative; display: grid; width: 150px; aspect-ratio: 1; place-items: center; border-radius: 50%; }
.donut::after { position: absolute; width: 96px; aspect-ratio: 1; content: ""; background: white; border-radius: 50%; }
.donut-center { position: relative; z-index: 1; text-align: center; }
.donut-center strong { display: block; color: var(--navy-950); font-size: 25px; }
.donut-center span { color: var(--slate-600); font-size: 10px; }
.legend { display: grid; gap: 10px; }
.legend-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; }
.legend-label { display: flex; align-items: center; gap: 7px; color: var(--slate-700); }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; }

.funnel { display: grid; gap: 10px; padding: 8px 0; }
.funnel-step { display: grid; grid-template-columns: 94px minmax(100px, 1fr) 90px; align-items: center; gap: 13px; }
.funnel-label strong { display: block; font-size: 13px; }
.funnel-label span { color: var(--slate-600); font-size: 10px; }
.funnel-visual { display: flex; align-items: center; justify-content: center; height: 44px; margin: auto; color: white; background: var(--navy-800); border-radius: 9px; font-size: 12px; font-weight: 800; }
.funnel-step:last-child .funnel-visual { background: var(--violet-600); }
.funnel-count { text-align: right; font-size: 13px; font-weight: 800; }

.definition-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.definition-card { padding: 17px; border: 1px solid var(--slate-200); border-radius: 13px; background: white; }
.definition-card .definition-index { color: var(--cyan-600); font-size: 11px; font-weight: 850; }
.definition-card h3 { margin: 8px 0 6px; font-size: 14px; }
.definition-card p { margin: 0; color: var(--slate-600); font-size: 12px; }

.filter-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 11px; padding: 16px; border: 1px solid var(--slate-200); border-radius: var(--radius-md); background: white; }
.field { display: grid; min-width: 150px; gap: 5px; }
.field.search { flex: 1; min-width: 210px; }
.field label { color: var(--slate-600); font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.field input, .field select { width: 100%; height: 39px; padding: 8px 10px; color: var(--slate-950); background: white; border: 1px solid var(--slate-300); border-radius: 9px; outline: none; }
.field input:focus, .field select:focus { border-color: var(--cyan-600); box-shadow: 0 0 0 3px rgba(24, 166, 184, 0.13); }
.filter-summary { margin-right: auto; color: var(--slate-600); font-size: 11px; }

.global-filter-panel { padding: 18px; border: 1px solid var(--slate-200); border-radius: var(--radius-lg); background: white; box-shadow: 0 5px 18px rgba(6, 46, 71, 0.04); }
.global-filter-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.global-filter-head h2 { margin: 0; color: var(--navy-950); font-size: 15px; }
.global-filter-head p { margin: 3px 0 0; color: var(--slate-600); font-size: 11px; }
.global-filter-grid { display: grid; grid-template-columns: minmax(220px, 1.7fr) repeat(5, minmax(125px, 0.8fr)) auto; align-items: end; gap: 9px; }
.active-filter-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--slate-100); color: var(--slate-600); font-size: 10px; }
.filter-pill { padding: 4px 8px; color: var(--navy-800); background: var(--navy-100); border-radius: 999px; font-weight: 800; }
.internal-data-button.is-unlocked { color: #216e55; border-color: #9fd8c4; background: var(--green-100); }

.visual-dashboard { gap: 16px; }
.visual-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 26px;
  color: white;
  background:
    linear-gradient(120deg, rgba(24, 166, 184, 0.22), transparent 36%),
    linear-gradient(105deg, var(--navy-950), var(--violet-600));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.visual-hero-kicker { color: #bfeff4; font-size: 10px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.visual-hero h2 { margin: 5px 0 4px; font-size: clamp(21px, 2.2vw, 30px); letter-spacing: -.03em; }
.visual-hero p { margin: 0; color: #dbe9ef; font-size: 12px; }
.visual-hero-legend { display: grid; flex: 0 1 560px; grid-template-columns: repeat(3, minmax(130px, 1fr)); gap: 8px 14px; }
.visual-hero-legend span { display: flex; align-items: center; gap: 7px; color: #edf6f8; font-size: 10px; font-weight: 700; }
.visual-hero-legend i { width: 10px; height: 10px; border: 2px solid rgba(255,255,255,.7); border-radius: 3px; }
.visual-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.visual-panel { border-radius: 16px; box-shadow: 0 8px 24px rgba(6, 46, 71, .065); }
.visual-grid-main { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(260px, .75fr); gap: 16px; }
.visual-grid-secondary { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); gap: 16px; }
.stacked-distribution { display: flex; min-height: 76px; overflow: hidden; background: var(--slate-100); border-radius: 12px; }
.stacked-distribution button { display: grid; min-width: 34px; place-content: center; gap: 2px; padding: 8px 4px; color: white; text-align: center; border: 0; border-right: 1px solid rgba(255,255,255,.55); text-shadow: 0 1px 2px rgba(0,0,0,.28); transition: filter 150ms ease, transform 150ms ease; }
.stacked-distribution button:hover, .stacked-distribution button:focus-visible { z-index: 1; filter: brightness(1.08); outline: 3px solid white; outline-offset: -4px; }
.stacked-distribution strong { font-size: 16px; }
.stacked-distribution span { font-size: 9px; font-weight: 850; }
.distribution-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.distribution-legend button { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 7px; padding: 8px 9px; color: var(--slate-700); text-align: left; background: var(--slate-100); border: 1px solid transparent; border-radius: 9px; font-size: 10px; }
.distribution-legend button:hover, .distribution-legend button:focus-visible { border-color: var(--cyan-600); outline: none; }
.distribution-legend i { width: 10px; height: 10px; border-radius: 3px; }
.distribution-legend strong { color: var(--slate-950); }
.gauge-panel { display: grid; justify-items: center; }
.gauge-panel .panel-header { width: 100%; }
.progress-gauge { position: relative; display: grid; width: 190px; max-width: 74%; aspect-ratio: 1; place-items: center; padding: 0; background: conic-gradient(var(--violet-600) var(--gauge-value), var(--slate-100) 0); border: 0; border-radius: 50%; }
.progress-gauge::before { position: absolute; width: 70%; aspect-ratio: 1; content: ""; background: white; border-radius: 50%; }
.progress-gauge:hover, .progress-gauge:focus-visible { outline: 4px solid var(--violet-100); outline-offset: 3px; }
.progress-gauge span { position: relative; z-index: 1; text-align: center; }
.progress-gauge strong { display: block; color: var(--navy-950); font-size: 34px; line-height: 1; }
.progress-gauge small { display: block; margin-top: 5px; color: var(--slate-600); font-size: 10px; font-weight: 800; }
.gauge-caption { max-width: 260px; margin: 14px 0 0; color: var(--slate-600); text-align: center; font-size: 11px; }
.gauge-caption strong { color: var(--slate-950); }
.visual-ranking { display: grid; gap: 7px; }
.visual-ranking > button { display: grid; grid-template-columns: 22px minmax(100px, 1.1fr) minmax(80px, 1fr) 30px; align-items: center; gap: 9px; width: 100%; padding: 7px 8px; color: var(--slate-950); text-align: left; background: white; border: 1px solid transparent; border-radius: 9px; }
.visual-ranking > button:hover, .visual-ranking > button:focus-visible { border-color: var(--cyan-600); background: var(--cyan-100); outline: none; }
.rank-number { display: grid; width: 22px; height: 22px; place-items: center; color: var(--navy-800); background: var(--navy-100); border-radius: 6px; font-size: 9px; font-weight: 900; }
.rank-label strong, .rank-label small { display: block; }
.rank-label strong { font-size: 11px; }
.rank-label small { overflow: hidden; color: var(--slate-600); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.rank-track { height: 14px; overflow: hidden; background: var(--slate-100); border-radius: 5px; }
.rank-track i { display: block; height: 100%; background: var(--cyan-600); border-radius: 5px; }
.rank-value { text-align: right; font-size: 11px; }
.session-matrix { min-width: 790px; }
.visual-table-wrap { max-height: 520px; }

.stage-group { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; }
.stage-card { position: relative; overflow: hidden; padding: 15px 13px; color: var(--slate-950); text-align: left; background: white; border: 1px solid var(--slate-200); border-radius: 12px; }
.stage-card::after { position: absolute; inset: auto 0 0; height: 4px; content: ""; background: var(--stage-color); }
.stage-card:hover, .stage-card:focus-visible { border-color: var(--stage-color); outline: none; }
.stage-card span { display: block; color: var(--slate-600); font-size: 9px; }
.stage-card strong { display: block; margin: 5px 0 3px; font-size: 22px; }
.stage-card small { color: var(--slate-700); font-size: 10px; font-weight: 750; }

.cohort-bars { display: grid; gap: 10px; }
.cohort-row { display: grid; grid-template-columns: 82px 1fr 70px; align-items: center; gap: 10px; }
.cohort-label { padding: 0; color: var(--navy-800); text-align: left; background: transparent; border: 0; font-size: 11px; font-weight: 850; }
.cohort-label:hover { text-decoration: underline; }
.cohort-track { display: flex; height: 24px; overflow: hidden; background: var(--slate-100); border-radius: 7px; }
.cohort-segment { height: 100%; min-width: 1px; padding: 0; border: 0; border-right: 1px solid rgba(255,255,255,.45); }
.cohort-segment:hover, .cohort-segment:focus-visible { filter: brightness(1.14); outline: 2px solid white; outline-offset: -3px; }
.cohort-total { text-align: right; font-size: 11px; font-weight: 800; }

.matrix-wrap { overflow: auto; border: 1px solid var(--slate-200); border-radius: 13px; }
.cohort-matrix { min-width: 790px; }
.matrix-cell-button { width: 100%; min-width: 48px; padding: 7px; color: var(--slate-950); background: var(--slate-100); border: 1px solid transparent; border-radius: 7px; font-size: 11px; font-weight: 800; }
.matrix-cell-button:hover, .matrix-cell-button:focus-visible { border-color: var(--cyan-600); background: var(--cyan-100); outline: none; }
.matrix-cell-button.is-zero { color: #9aabb7; font-weight: 500; }

.student-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.privacy-label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; color: var(--slate-700); background: var(--slate-100); border-radius: 999px; font-size: 10px; font-weight: 800; }
.privacy-label.is-internal { color: #216e55; background: var(--green-100); }
.student-name { display: flex; align-items: center; gap: 9px; }
.avatar-initials { display: grid; flex: 0 0 auto; width: 34px; height: 34px; place-items: center; color: var(--navy-800); background: var(--navy-100); border-radius: 9px; font-size: 9px; font-weight: 900; }
.text-button { padding: 0; color: var(--navy-800); text-align: left; background: none; border: 0; font-weight: 800; }
.text-button:hover { text-decoration: underline; }

.detail-dialog.detail-dialog-wide {
  width: min(82vw, 1300px);
  height: min(72vh, 820px);
  min-width: 560px;
  min-height: 360px;
  max-width: 96vw;
  max-height: 94vh;
  overflow: auto;
  resize: both;
}
.detail-dialog.detail-dialog-wide.is-expanded { width: 96vw; height: 92vh; max-width: 96vw; max-height: 92vh; resize: none; }
.detail-dialog-wide .dialog-header { position: sticky; top: 0; z-index: 4; background: white; }
#student-list-content { min-height: 0; padding: 20px 24px 26px; }
.dialog-header-actions { display: flex; align-items: center; gap: 8px; }
.expand-button { font-size: 17px; }
.dialog-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.dialog-toolbar p { margin: 0; color: var(--slate-600); font-size: 11px; }
.dialog-actions { display: flex; gap: 8px; }
.timeline { position: relative; display: grid; gap: 12px; margin-top: 18px; padding-left: 18px; }
.timeline::before { position: absolute; inset: 5px auto 5px 5px; width: 2px; content: ""; background: var(--slate-200); }
.timeline-item { position: relative; padding: 13px 15px; background: var(--slate-100); border-radius: 11px; }
.timeline-item::before { position: absolute; top: 18px; left: -17px; width: 9px; height: 9px; content: ""; background: var(--violet-600); border: 3px solid white; border-radius: 50%; box-shadow: 0 0 0 1px var(--violet-600); }
.timeline-item strong { display: block; font-size: 12px; }
.timeline-item span { display: block; margin-top: 3px; color: var(--slate-600); font-size: 10px; }
.private-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; margin-top: 16px; }
.private-field { padding: 11px; background: var(--green-100); border-radius: 9px; }
.private-field span { display: block; color: #467062; font-size: 9px; text-transform: uppercase; }
.private-field strong { display: block; margin-top: 3px; font-size: 12px; word-break: break-word; }

.class-chart { display: grid; gap: 9px; }
.class-chart-row { display: grid; grid-template-columns: 48px 1fr 65px; align-items: center; gap: 9px; }
.class-chart-row button { padding: 0; color: var(--navy-800); text-align: left; background: transparent; border: 0; font-size: 11px; font-weight: 800; }
.class-chart-row button:hover { text-decoration: underline; }
.class-chart-track { height: 17px; overflow: hidden; background: var(--slate-100); border-radius: 6px; }
.class-chart-fill { height: 100%; background: var(--cyan-600); border-radius: 6px; }
.class-chart-value { color: var(--slate-600); text-align: right; font-size: 10px; }

.table-wrap { overflow: auto; border: 1px solid var(--slate-200); border-radius: 13px; }
table { width: 100%; min-width: 920px; border-collapse: collapse; background: white; font-size: 12px; }
thead { position: sticky; top: 0; z-index: 1; background: #f6f9fb; }
th { padding: 11px 12px; color: var(--slate-600); text-align: left; border-bottom: 1px solid var(--slate-200); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; }
th button { display: inline-flex; align-items: center; gap: 5px; padding: 0; color: inherit; background: transparent; border: 0; font: inherit; text-transform: inherit; }
th button::after { content: "↕"; color: #9aabb7; font-size: 10px; }
th button.is-sorted::after { content: attr(data-direction); color: var(--navy-800); }
td { padding: 12px; border-bottom: 1px solid var(--slate-100); vertical-align: middle; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #f8fbfc; }
tbody tr:last-child td { border-bottom: 0; }
.cell-primary { display: block; color: var(--slate-950); font-weight: 800; }
.cell-secondary { display: block; margin-top: 2px; color: var(--slate-600); font-size: 10px; }
.empty-state { padding: 42px 20px; color: var(--slate-600); text-align: center; }

.roadmap-list { position: relative; display: grid; gap: 14px; }
.roadmap-card { display: grid; grid-template-columns: 150px minmax(0, 1fr) minmax(240px, 0.85fr); gap: 22px; padding: 20px; border: 1px solid var(--slate-200); border-left: 4px solid var(--navy-800); border-radius: 14px; background: white; }
.roadmap-card:nth-child(2) { border-left-color: var(--cyan-600); }
.roadmap-card:nth-child(3) { border-left-color: var(--green-600); }
.roadmap-card:nth-child(4) { border-left-color: var(--violet-600); }
.roadmap-phase strong { display: block; color: var(--navy-950); font-size: 14px; }
.roadmap-status { display: inline-block; margin-top: 7px; padding: 4px 7px; color: var(--slate-700); background: var(--slate-100); border-radius: 999px; font-size: 10px; font-weight: 800; }
.roadmap-items { margin: 0; padding-left: 18px; color: var(--slate-700); font-size: 12px; }
.roadmap-items li + li { margin-top: 5px; }
.roadmap-decision { padding: 14px; color: var(--slate-700); background: var(--slate-100); border-radius: 10px; font-size: 12px; }
.roadmap-decision strong { display: block; margin-bottom: 4px; color: var(--slate-950); }

.model-table { display: grid; gap: 8px; }
.model-row { display: grid; grid-template-columns: 140px 1fr 1fr; gap: 10px; padding: 11px 13px; border-radius: 10px; background: var(--slate-100); font-size: 11px; }
.model-row strong { color: var(--navy-950); }
.model-row span { color: var(--slate-600); }

.detail-dialog { width: min(620px, calc(100vw - 30px)); max-height: calc(100vh - 30px); padding: 0; color: var(--slate-950); border: 0; border-radius: 20px; box-shadow: 0 28px 80px rgba(6, 46, 71, 0.28); }
.detail-dialog::backdrop { background: rgba(2, 25, 39, 0.55); backdrop-filter: blur(3px); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 22px 24px 18px; border-bottom: 1px solid var(--slate-200); }
.dialog-header h2 { margin: 5px 0 0; color: var(--navy-950); font-size: 23px; }
.icon-button { display: grid; width: 36px; height: 36px; place-items: center; color: var(--slate-600); background: var(--slate-100); border: 0; border-radius: 50%; font-size: 24px; }
#dialog-content { padding: 22px 24px 26px; }
.dialog-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dialog-kpi { padding: 13px; background: var(--slate-100); border-radius: 10px; }
.dialog-kpi span { display: block; color: var(--slate-600); font-size: 10px; }
.dialog-kpi strong { display: block; margin-top: 4px; font-size: 16px; }
.detail-list { display: grid; gap: 10px; margin: 18px 0; }
.detail-row { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding-bottom: 9px; border-bottom: 1px solid var(--slate-100); font-size: 12px; }
.detail-row span { color: var(--slate-600); }
.action-box { padding: 15px; border: 1px solid #f1d19b; border-radius: 11px; background: #fff9eb; }
.action-box strong { display: block; color: #7a4d05; font-size: 12px; }
.action-box p { margin: 5px 0 0; color: var(--slate-700); font-size: 12px; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; max-width: 360px; padding: 12px 16px; color: white; background: var(--navy-950); border-radius: 10px; box-shadow: var(--shadow); font-size: 12px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: 180ms ease; }
.toast.is-visible { opacity: 1; transform: none; }
.footer { display: flex; justify-content: space-between; gap: 20px; max-width: 1450px; margin: 28px auto 0; padding-top: 18px; color: var(--slate-600); border-top: 1px solid var(--slate-200); font-size: 10px; }

@media (max-width: 1100px) {
  .sidebar { width: 236px; }
  .main-content { margin-left: 236px; padding: 30px 26px 22px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-2.equal { grid-template-columns: 1fr; }
  .visual-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .visual-grid-main, .visual-grid-secondary { grid-template-columns: minmax(0, 1fr); }
  .roadmap-card { grid-template-columns: 130px 1fr; }
  .roadmap-decision { grid-column: 2; }
  .global-filter-grid { grid-template-columns: repeat(3, 1fr); }
  .stage-group { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
  .sidebar { position: static; display: block; width: auto; padding: 16px; }
  .brand-block { display: flex; align-items: center; justify-content: space-between; padding: 0; border: 0; }
  .brand-lockup span, .sidebar-note { display: none; }
  .term-badge { margin: 0; }
  .nav-list { display: none; grid-template-columns: 1fr; margin-top: 15px; }
  .sidebar.is-open .nav-list { display: grid; }
  .main-content { margin-left: 0; padding: 22px 16px; }
  .topbar { align-items: flex-start; }
  .data-freshness { display: none; }
  .mobile-nav-trigger { display: inline-flex; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .visual-kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-card { padding: 16px; }
  .visual-hero { align-items: flex-start; flex-direction: column; }
  .visual-hero-legend { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .distribution-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini-donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .definition-grid { grid-template-columns: 1fr; }
  .global-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .global-filter-grid .field.search { grid-column: 1 / -1; }
  .stage-group { grid-template-columns: 1fr 1fr; }
  .roadmap-card { grid-template-columns: 1fr; gap: 12px; }
  .roadmap-decision { grid-column: auto; }
  .model-row { grid-template-columns: 1fr; }
  .footer { flex-direction: column; }
  .internal-data-button { display: none; }
  .detail-dialog.detail-dialog-wide, .detail-dialog.detail-dialog-wide.is-expanded { width: calc(100vw - 16px); height: calc(100vh - 16px); min-width: 0; min-height: 0; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); resize: none; }
}

@media (max-width: 470px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .visual-kpi-grid { grid-template-columns: 1fr; }
  .distribution-legend { grid-template-columns: 1fr; }
  .visual-ranking > button { grid-template-columns: 22px 1fr 28px; }
  .rank-track { display: none; }
  .level-row { grid-template-columns: 72px 1fr 68px; gap: 7px; }
  .dialog-kpis { grid-template-columns: 1fr; }
  .global-filter-grid { grid-template-columns: minmax(0, 1fr); }
  .global-filter-grid .field.search { grid-column: auto; }
  .private-fields { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
