:root {
  color-scheme: light;
  --ink: #18333c;
  --muted: #667980;
  --navy: #102f3a;
  --navy-2: #174653;
  --teal: #198a83;
  --teal-soft: #e2f3ef;
  --gold: #d7a84d;
  --gold-soft: #fbf2dc;
  --coral: #c86651;
  --coral-soft: #faeae5;
  --paper: #fbfcf9;
  --surface: #ffffff;
  --line: #dce5e3;
  --shadow: 0 12px 32px rgba(20, 54, 62, 0.08);
  --radius: 18px;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); min-width: 320px; }
button, select { font: inherit; }
button { color: inherit; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 20; background: white; padding: 10px 14px; border-radius: 8px; }
.skip-link:focus { top: 12px; }

.topbar { height: 76px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; background: var(--navy); color: white; position: sticky; top: 0; z-index: 10; }
.brand, .topbar-actions { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--gold); color: var(--navy); font-weight: 850; letter-spacing: -0.04em; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; letter-spacing: 0.01em; }
.brand small { color: #bdd1d5; margin-top: 2px; font-size: 12px; }
.environment-pill { border: 1px solid #54717a; border-radius: 999px; padding: 7px 11px; color: #d6e3e5; font-size: 12px; }
.avatar { border: 1px solid #6d8890; background: #28535e; color: white; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; }
.auth-button { border: 1px solid #6d8890; background: #28535e; color: white; border-radius: 999px; padding: 9px 14px; font: inherit; font-weight: 700; cursor: pointer; }

.app-shell { min-height: calc(100vh - 76px); display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.sidebar { background: #f1f5f2; border-right: 1px solid var(--line); padding: 28px 18px; display: flex; flex-direction: column; justify-content: space-between; }
.sidebar nav { display: grid; gap: 7px; }
.nav-item { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 9px; min-height: 44px; padding: 9px 12px; border-radius: 11px; color: #50666d; text-decoration: none; font-weight: 650; font-size: 14px; }
.nav-item:hover, .nav-item:focus-visible { background: #e6efeb; outline: none; }
.nav-item.active { background: var(--surface); color: var(--navy); box-shadow: 0 5px 18px rgba(22, 60, 67, 0.07); }
.nav-item b { background: var(--coral-soft); color: #9b4635; border-radius: 999px; min-width: 22px; padding: 3px 6px; text-align: center; font-size: 11px; }
.sidebar-note { background: #e3ece8; border-radius: 14px; padding: 14px; display: grid; gap: 5px; font-size: 12px; line-height: 1.45; color: #50676d; }
.sidebar-note strong { color: var(--navy); }

main { width: min(1440px, 100%); margin: 0 auto; padding: 34px 38px 54px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 7px; text-transform: uppercase; letter-spacing: 0.11em; font-weight: 800; font-size: 10px; color: var(--teal); }
h1, h2, p { margin-top: 0; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(28px, 3vw, 42px); line-height: 1.08; letter-spacing: -0.03em; margin-bottom: 10px; color: var(--navy); font-weight: 650; }
.page-heading > div > p:last-child { margin: 0; color: var(--muted); max-width: 680px; line-height: 1.55; }
.student-picker { min-width: 220px; display: grid; gap: 6px; font-size: 11px; font-weight: 750; color: var(--muted); }
.student-picker select { appearance: none; border: 1px solid var(--line); background: white; border-radius: 12px; padding: 12px 34px 12px 13px; color: var(--navy); font-weight: 700; background-image: linear-gradient(45deg, transparent 50%, #6d8085 50%), linear-gradient(135deg, #6d8085 50%, transparent 50%); background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px; background-size: 5px 5px; background-repeat: no-repeat; }

.health-strip { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; background: var(--navy); color: white; padding: 18px 20px; border-radius: var(--radius); box-shadow: var(--shadow); }
.health-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; font-weight: 900; }
.health-icon.complete { color: #0a635e; background: #9be0d4; }
.health-strip .eyebrow { color: #83cfc5; margin-bottom: 4px; }
.health-strip strong, .health-strip span { display: block; }
.health-strip > div:nth-child(2) strong { font-size: 16px; margin-bottom: 2px; }
.health-strip span { color: #b9cdd1; font-size: 12px; }
.health-time { text-align: right; }
.health-time strong { margin-top: 3px; font-size: 14px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0 28px; }
.metric-card { background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: 17px 18px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 3px 10px; }
.metric-card.accent { border-color: #b8dcd5; background: linear-gradient(135deg, #f6fcfa, #eaf6f2); }
.metric-card span { color: var(--muted); font-size: 12px; font-weight: 750; }
.metric-card strong { grid-row: span 2; font: 650 31px/1 Georgia, serif; color: var(--navy); }
.metric-card small { color: #8a989c; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
.assignment-panel, .confirmation-card, .connection-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(24, 57, 65, 0.045); }
.assignment-panel { padding: 22px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 16px; }
.section-heading.compact { margin-bottom: 12px; }
h2 { color: var(--navy); font-size: 19px; letter-spacing: -0.015em; margin-bottom: 0; }
.filters { background: #f2f5f3; border-radius: 10px; padding: 3px; display: flex; }
.filter { border: 0; background: transparent; border-radius: 8px; padding: 7px 11px; color: var(--muted); font-size: 12px; cursor: pointer; }
.filter.active { background: white; color: var(--navy); box-shadow: 0 2px 7px rgba(20, 54, 62, 0.08); font-weight: 750; }
.assignment-list { display: grid; gap: 9px; }
.assignment-row { width: 100%; display: grid; grid-template-columns: 10px minmax(0, 1.5fr) minmax(130px, .75fr) minmax(115px, .65fr) auto; gap: 14px; align-items: center; border: 1px solid var(--line); background: white; border-radius: 13px; padding: 13px 14px 13px 10px; text-align: left; cursor: pointer; }
.assignment-row:hover, .assignment-row:focus-visible { transform: translateY(-1px); border-color: #9dc9c2; box-shadow: 0 7px 18px rgba(20, 70, 75, 0.08); outline: none; }
.subject-bar { height: 38px; border-radius: 999px; background: var(--teal); }
.subject-bar.math { background: #3d7ca5; }
.subject-bar.science { background: #55916b; }
.subject-bar.ela { background: #966d9d; }
.assignment-title strong, .assignment-title small { display: block; }
.assignment-title strong { color: var(--navy); margin-bottom: 4px; }
.assignment-title small, .due-cell span { color: var(--muted); font-size: 11px; }
.due-cell strong, .due-cell span { display: block; }
.due-cell strong { font-size: 12px; margin-bottom: 4px; }
.status-pill { justify-self: start; border-radius: 999px; padding: 6px 9px; font-size: 11px; font-weight: 800; background: var(--teal-soft); color: #1c6f68; white-space: nowrap; }
.status-pill.blocked { background: var(--coral-soft); color: #a34d3c; }
.status-pill.completed { background: #edf0ee; color: #657277; }
.row-arrow { color: #819196; font-size: 20px; }
.empty-state { padding: 38px; text-align: center; background: #f8faf8; border-radius: 13px; color: var(--muted); }
.empty-state strong, .empty-state span { display: block; }
.empty-state strong { color: var(--navy); margin-bottom: 5px; }

.right-rail { display: grid; gap: 16px; }
.confirmation-card, .connection-card { padding: 19px; }
.count-badge { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: var(--coral-soft); color: #9b4635; font-size: 12px; font-weight: 850; }
.confirmation-item { border-left: 3px solid var(--gold); padding: 3px 0 3px 13px; }
.confirmation-item strong, .confirmation-item span, .confirmation-item small { display: block; }
.confirmation-item strong { font-size: 13px; color: var(--navy); margin-bottom: 5px; }
.confirmation-item span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.confirmation-item small { margin-top: 8px; color: #9a7a38; font-weight: 750; }
.confirmation-empty { color: var(--muted); font-size: 12px; padding: 8px 0; }
.connection-card h2 { margin-bottom: 13px; }
.connection-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 12px 0; border-top: 1px solid #edf1ef; }
.connection-row:first-of-type { border-top: 0; }
.service-mark { width: 31px; height: 31px; border-radius: 9px; display: grid; place-items: center; font-weight: 900; }
.service-mark.google { background: #e8f0fe; color: #3568c0; }
.service-mark.study { background: #eee9fd; color: #6b4ab0; }
.connection-row strong, .connection-row small { display: block; }
.connection-row strong { color: var(--navy); font-size: 12px; }
.connection-row small { color: var(--muted); font-size: 10px; margin-top: 3px; }
.connection-row b { color: var(--teal); font-size: 10px; }
.connection-row.muted b { color: #8a9699; }

dialog { width: min(620px, calc(100vw - 30px)); border: 0; border-radius: 20px; padding: 28px; color: var(--ink); box-shadow: 0 30px 90px rgba(7, 32, 39, .3); }
dialog::backdrop { background: rgba(9, 35, 42, .58); backdrop-filter: blur(3px); }
.dialog-close { float: right; border: 0; background: #edf2ef; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 23px; line-height: 1; }
#dialog-title { font: 650 28px/1.15 Georgia, serif; margin-bottom: 18px; padding-right: 38px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.detail-card { background: #f4f7f5; border-radius: 12px; padding: 13px; }
.detail-card span, .detail-card strong { display: block; }
.detail-card span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 5px; }
.detail-card strong { font-size: 13px; }
.fact-section { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.fact-section h3 { color: var(--navy); font-size: 13px; }
.fact-section p { color: var(--muted); line-height: 1.55; font-size: 13px; }

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { padding: 24px 11px; }
  .nav-item { grid-template-columns: 1fr; justify-items: center; font-size: 0; padding: 10px; }
  .nav-item span { font-size: 18px; }
  .nav-item b { position: absolute; margin: -24px 0 0 25px; font-size: 9px; }
  .sidebar-note { display: none; }
  .content-grid { grid-template-columns: 1fr; }
  .right-rail { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .topbar { height: 66px; padding: 0 17px; }
  .environment-pill { display: none; }
  .app-shell { display: block; }
  .sidebar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 9; padding: 7px 10px calc(7px + env(safe-area-inset-bottom)); border: 0; border-top: 1px solid var(--line); background: rgba(248, 251, 249, .97); }
  .sidebar nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
  .nav-item { min-height: 42px; }
  main { padding: 25px 16px 95px; }
  .page-heading { display: grid; }
  .student-picker { min-width: 100%; }
  .health-strip { grid-template-columns: auto 1fr; }
  .health-time { display: none; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .right-rail { grid-template-columns: 1fr; }
  .assignment-panel { padding: 16px; }
  .section-heading { align-items: flex-start; }
  .assignment-row { grid-template-columns: 7px 1fr auto; }
  .assignment-row .due-cell, .assignment-row .status-pill { display: none; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: no-preference) {
  .assignment-row { transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
}
