:root {
  --navy: #0f2438;
  --navy-2: #17364e;
  --navy-3: #234b67;
  --teal: #18a999;
  --teal-soft: #dff6f2;
  --gold: #d7a83d;
  --gold-soft: #fff4d8;
  --paper: #f7f3e9;
  --ivory: #fffdf7;
  --white: #ffffff;
  --ink: #13212c;
  --muted: #687784;
  --line: #dfe6e8;
  --danger: #b33e4a;
  --danger-soft: #fae8eb;
  --success: #27815f;
  --success-soft: #e7f5ed;
  --shadow: 0 16px 45px rgba(15, 36, 56, 0.12);
  --radius-xl: 26px;
  --radius-lg: 18px;
  --radius-md: 12px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Manrope, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #edf2f3;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.eyebrow { margin: 0 0 5px; text-transform: uppercase; letter-spacing: .14em; font-size: .7rem; font-weight: 800; color: var(--teal); }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 10% 10%, rgba(24,169,153,.25), transparent 32%),
    radial-gradient(circle at 90% 90%, rgba(215,168,61,.22), transparent 32%),
    linear-gradient(135deg, #0c1d2d, #17364e 55%, #0b2434);
  padding: 28px;
}
.ambient { position: absolute; border-radius: 50%; filter: blur(10px); opacity: .35; }
.ambient-one { width: 260px; height: 260px; background: var(--teal); top: -110px; right: 10%; }
.ambient-two { width: 210px; height: 210px; background: var(--gold); bottom: -80px; left: 8%; }
.login-shell { width: min(1040px, 100%); position: relative; z-index: 2; display: grid; grid-template-columns: 1.1fr .9fr; gap: 34px; align-items: center; }
.brand-lockup { color: white; display: flex; gap: 22px; align-items: flex-start; }
.brand-mark { width: 84px; height: 84px; filter: drop-shadow(0 12px 24px rgba(0,0,0,.18)); }
.brand-lockup h1 { margin: 0; font-size: clamp(3.1rem, 7vw, 6rem); line-height: .9; letter-spacing: -.06em; }
.brand-subtitle { font-size: 1.1rem; color: rgba(255,255,255,.76); max-width: 360px; }
.login-card { background: rgba(255,255,255,.97); border: 1px solid rgba(255,255,255,.35); border-radius: 30px; padding: 26px; box-shadow: 0 30px 70px rgba(0,0,0,.28); }
.role-switch { display: grid; grid-template-columns: 1fr 1fr; background: #edf1f2; padding: 5px; border-radius: 14px; margin-bottom: 24px; }
.role-btn { border: 0; background: transparent; padding: 11px; border-radius: 10px; color: var(--muted); font-weight: 800; }
.role-btn.active { background: white; color: var(--navy); box-shadow: 0 4px 15px rgba(15,36,56,.08); }
.login-form { display: none; }
.login-form.active { display: grid; gap: 16px; }
label { display: grid; gap: 7px; font-size: .82rem; font-weight: 800; color: var(--navy); }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px; background: white; color: var(--ink); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(24,169,153,.12); }
.demo-note { color: var(--muted); font-size: .78rem; text-align: center; margin: 0; }
.login-proof { grid-column: 1 / -1; color: rgba(255,255,255,.75); display: flex; gap: 12px; flex-wrap: wrap; }
.login-proof span { border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); border-radius: 999px; padding: 8px 12px; font-size: .76rem; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { background: var(--navy); color: white; padding: 22px 16px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 20; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 24px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-brand img { width: 42px; height: 42px; }
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand span { color: rgba(255,255,255,.64); font-size: .82rem; }
.nav-list { display: grid; gap: 5px; margin-top: 18px; }
.nav-item { border: 0; color: rgba(255,255,255,.7); background: transparent; text-align: left; padding: 12px 13px; border-radius: 12px; display: flex; gap: 11px; align-items: center; font-weight: 750; }
.nav-item:hover, .nav-item.active { color: white; background: rgba(255,255,255,.11); }
.nav-item.active { box-shadow: inset 3px 0 0 var(--gold); }
.sidebar-footer { margin-top: auto; display: grid; gap: 6px; }
.main-area { min-width: 0; }
.topbar { min-height: 86px; padding: 18px 28px; background: rgba(255,255,255,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar h2 { margin: 0; color: var(--navy); font-size: 1.45rem; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 6px 10px 6px 6px; border: 1px solid var(--line); border-radius: 999px; background: white; font-size: .78rem; font-weight: 800; }
.user-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: white; }
.menu-btn { display: none; border: 0; background: transparent; font-size: 1.4rem; }

.view { display: none; padding: 28px; animation: fade .22s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: .25; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.page-grid { display: grid; gap: 20px; }
.hero-panel { background: linear-gradient(135deg, var(--navy), var(--navy-2)); border-radius: var(--radius-xl); padding: 26px; color: white; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.hero-panel::after { content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%; right: -70px; top: -80px; background: radial-gradient(circle, rgba(24,169,153,.5), transparent 67%); }
.hero-panel h3 { font-size: clamp(1.8rem, 4vw, 3.2rem); margin: 5px 0 12px; line-height: 1; letter-spacing: -.04em; max-width: 760px; }
.hero-panel p { color: rgba(255,255,255,.72); max-width: 720px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; position: relative; z-index: 2; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.metric-card { background: white; border-radius: var(--radius-lg); padding: 18px; border: 1px solid var(--line); box-shadow: 0 8px 25px rgba(15,36,56,.06); }
.metric-card .metric-label { color: var(--muted); font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.metric-card strong { display: block; color: var(--navy); font-size: 2rem; margin-top: 8px; }
.metric-card small { color: var(--muted); }
.section-card { background: white; border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 22px; box-shadow: 0 10px 30px rgba(15,36,56,.055); }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.section-head h3 { margin: 0; color: var(--navy); }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: .85rem; }
.two-col { display: grid; grid-template-columns: 1.2fr .8fr; gap: 20px; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card-list { display: grid; gap: 10px; }
.list-item { border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; gap: 12px; align-items: flex-start; background: white; }
.list-item.clickable:hover { border-color: var(--teal); transform: translateY(-1px); }
.list-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); flex: 0 0 auto; font-weight: 900; }
.list-content { flex: 1; min-width: 0; }
.list-content strong { color: var(--navy); }
.list-content p { color: var(--muted); margin: 4px 0 0; font-size: .82rem; }
.list-meta { color: var(--muted); font-size: .72rem; white-space: nowrap; }
.student-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.student-card { border: 1px solid var(--line); border-radius: 20px; padding: 18px; background: white; transition: .2s ease; }
.student-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: rgba(24,169,153,.5); }
.student-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.student-avatar { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy), var(--teal)); color: white; font-weight: 900; }
.student-card h4 { margin: 12px 0 3px; color: var(--navy); font-size: 1.08rem; }
.student-card p { margin: 0; color: var(--muted); font-size: .8rem; }
.tag-row { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 14px; }
.tag { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 6px 9px; font-size: .68rem; font-weight: 850; background: #edf2f3; color: var(--navy-2); }
.tag.teal { background: var(--teal-soft); color: #0c6e64; }
.tag.gold { background: var(--gold-soft); color: #8a6412; }
.tag.red { background: var(--danger-soft); color: var(--danger); }
.progress-line { height: 8px; border-radius: 999px; background: #e8edef; overflow: hidden; margin: 14px 0 8px; }
.progress-line span { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--gold)); border-radius: inherit; }

.primary-btn, .secondary-btn, .ghost-btn, .danger-btn, .text-btn { border: 0; border-radius: 12px; padding: 11px 15px; font-weight: 850; }
.primary-btn { background: var(--teal); color: white; box-shadow: 0 8px 20px rgba(24,169,153,.22); }
.primary-btn:hover { filter: brightness(.95); transform: translateY(-1px); }
.secondary-btn { background: var(--navy); color: white; }
.ghost-btn { background: white; color: var(--navy); border: 1px solid var(--line); }
.danger-btn { background: var(--danger); color: white; }
.text-btn { background: transparent; color: rgba(255,255,255,.68); text-align: left; }
.full { width: 100%; }
.compact { padding: 9px 11px; }
.icon-btn { border: 0; background: transparent; font-size: 1.6rem; color: var(--muted); }

.timeline { position: relative; padding-left: 22px; display: grid; gap: 16px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--teal), var(--gold)); }
.timeline-item { position: relative; border: 1px solid var(--line); border-radius: 17px; padding: 15px; background: white; }
.timeline-item::before { content: ""; position: absolute; left: -21px; top: 21px; width: 11px; height: 11px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px #edf2f3; }
.timeline-item h4 { margin: 0 0 5px; color: var(--navy); }
.timeline-item p { margin: 6px 0; color: var(--muted); font-size: .84rem; line-height: 1.55; }
.timeline-item .signal { font-weight: 850; color: var(--teal); }

.pressure-map { display: grid; grid-template-columns: 70px 1fr 1fr; gap: 8px; align-items: stretch; }
.pressure-map > div { border-radius: 14px; padding: 14px; min-height: 90px; }
.pressure-axis { display: grid; place-items: center; color: var(--muted); font-size: .72rem; font-weight: 850; text-align: center; }
.pressure-cell { background: linear-gradient(135deg, #f8fbfb, #e9f4f2); border: 1px solid #d6ebe7; }
.pressure-cell.high { background: linear-gradient(135deg, #fffaf0, #fff1ce); border-color: #f0dfb4; }
.pressure-cell strong { display: block; font-size: 1.7rem; color: var(--navy); }
.pressure-cell span { color: var(--muted); font-size: .74rem; }

.skill-list { display: grid; gap: 12px; }
.skill-row { display: grid; grid-template-columns: 1.2fr 2fr 90px; gap: 12px; align-items: center; }
.skill-name strong { color: var(--navy); display: block; }
.skill-name span { color: var(--muted); font-size: .72rem; }
.skill-track { height: 10px; background: #e9eef0; border-radius: 999px; overflow: hidden; }
.skill-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--gold)); }
.skill-level { font-size: .72rem; font-weight: 850; color: var(--navy); text-align: right; }

.signal-ring { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; background: conic-gradient(var(--teal) calc(var(--score) * 1%), #e7edef 0); position: relative; }
.signal-ring::after { content: ""; width: 112px; height: 112px; border-radius: 50%; background: white; position: absolute; }
.signal-ring strong, .signal-ring span { position: relative; z-index: 2; display: block; text-align: center; }
.signal-ring strong { font-size: 2rem; color: var(--navy); }
.signal-ring span { font-size: .7rem; color: var(--muted); }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: .8rem; vertical-align: top; }
.data-table th { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: .68rem; }
.data-table td strong { color: var(--navy); }

.modal { width: min(720px, calc(100% - 24px)); border: 0; padding: 0; border-radius: 24px; box-shadow: 0 30px 80px rgba(15,36,56,.28); }
.wide-modal { width: min(920px, calc(100% - 24px)); }
.small-modal { width: min(460px, calc(100% - 24px)); padding: 24px; }
.modal::backdrop { background: rgba(8,22,32,.7); backdrop-filter: blur(4px); }
.modal form { padding: 24px; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.modal-header h3 { margin: 0; color: var(--navy); font-size: 1.5rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.span-2 { grid-column: span 2; }
.check-row { display: flex; align-items: center; gap: 8px; }
.check-row input { width: auto; }
.file-drop { border: 1px dashed #afc2ca; border-radius: 15px; padding: 14px; background: #f7fafb; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.score-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; max-height: 55vh; overflow: auto; padding-right: 5px; }
.score-item { border: 1px solid var(--line); border-radius: 15px; padding: 13px; }
.score-item label { grid-template-columns: 1fr 90px; align-items: center; }
.full-label { margin-top: 14px; }

.empty-state { text-align: center; padding: 34px; border: 1px dashed var(--line); border-radius: 18px; color: var(--muted); }
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--navy); color: white; border-radius: 12px; padding: 12px 15px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(8px); transition: .2s; z-index: 1000; }
.toast.show { opacity: 1; transform: none; }

.student-hero { display: grid; grid-template-columns: 1.2fr .8fr; gap: 20px; align-items: stretch; }
.student-welcome { background: linear-gradient(135deg, var(--navy), #1b5261); color: white; border-radius: var(--radius-xl); padding: 26px; min-height: 260px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.student-welcome::after { content: ""; position: absolute; width: 190px; height: 190px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; right: -40px; bottom: -70px; box-shadow: 0 0 0 24px rgba(255,255,255,.035), 0 0 0 52px rgba(255,255,255,.02); }
.student-welcome h3 { font-size: clamp(2rem, 5vw, 3.3rem); margin: 5px 0 10px; line-height: .98; letter-spacing: -.04em; }
.student-welcome p { max-width: 620px; color: rgba(255,255,255,.74); }
.focus-card { background: var(--paper); border: 1px solid #eadfca; border-radius: var(--radius-xl); padding: 22px; }
.focus-card h4 { color: var(--navy); font-size: 1.2rem; margin: 0 0 10px; }
.focus-card p { color: var(--muted); }
.next-action { background: white; border-radius: 16px; padding: 14px; border-left: 4px solid var(--gold); }

.mobile-bottom-nav { display: none; }

@media (max-width: 1100px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .student-grid { grid-template-columns: repeat(2, 1fr); }
  .three-col { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .login-shell { grid-template-columns: 1fr; }
  .brand-lockup { justify-content: center; text-align: left; }
  .login-proof { justify-content: center; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -270px; width: 250px; transition: .25s; box-shadow: 20px 0 50px rgba(0,0,0,.2); }
  .sidebar.open { left: 0; }
  .menu-btn { display: block; }
  .topbar { padding: 14px 16px; }
  .topbar-actions .secondary-btn, .topbar-actions .primary-btn { display: none; }
  .view { padding: 18px 14px 90px; }
  .two-col, .student-hero { grid-template-columns: 1fr; }
  .student-grid, .three-col { grid-template-columns: 1fr; }
  .skill-row { grid-template-columns: 1fr; gap: 6px; }
  .skill-level { text-align: left; }
  .form-grid, .score-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .data-table { display: block; overflow-x: auto; }
}
@media (max-width: 540px) {
  .login-screen { padding: 18px; place-items: start center; }
  .brand-lockup { display: grid; justify-items: start; margin-top: 20px; }
  .brand-mark { width: 64px; height: 64px; }
  .brand-lockup h1 { font-size: 3.8rem; }
  .login-card { padding: 18px; border-radius: 22px; }
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { padding: 14px; }
  .metric-card strong { font-size: 1.55rem; }
  .pressure-map { grid-template-columns: 58px 1fr 1fr; }
  .pressure-map > div { padding: 10px; min-height: 80px; }
  .student-card { padding: 15px; }
  .hero-panel, .section-card, .student-welcome, .focus-card { border-radius: 20px; }
  .hero-panel h3 { font-size: 2rem; }
}

@media print {
  body { background: white; }
  .sidebar, .topbar, .coach-only, .student-only, button { display: none !important; }
  .app-shell { display: block; }
  .view { display: none !important; padding: 0; }
  #studentOverviewView, #studentJourneyView, #studentFeedbackView, #studentAssessmentsView { display: block !important; page-break-after: always; }
  .section-card, .student-welcome, .focus-card { box-shadow: none; break-inside: avoid; }
}
