:root {
  color-scheme: light;
  --navy-950: #031a35;
  --navy-900: #082a54;
  --navy-800: #0b3f78;
  --blue-700: #0759c7;
  --blue-600: #0874e8;
  --cyan-500: #10bfd0;
  --cyan-100: #dff9fb;
  --yellow-500: #ffb400;
  --yellow-100: #fff4d6;
  --green-600: #07875f;
  --green-100: #e3f7ef;
  --red-600: #d43a45;
  --red-100: #ffe9eb;
  --ink: #11243d;
  --muted: #5d6c82;
  --line: #dce4ed;
  --surface: #ffffff;
  --surface-soft: #f5f8fb;
  --surface-blue: #edf7ff;
  --focus: #ffb400;
  --shadow: 0 12px 32px rgba(3, 42, 84, .10);
  --radius: 14px;
  --sidebar: 264px;
  font-family: "Aptos", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--surface-soft); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--surface-soft);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

img { max-width: 100%; display: block; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .35rem; font-size: 1.8rem; line-height: 1.15; letter-spacing: -.025em; }
h2 { margin-bottom: .4rem; font-size: 1.25rem; line-height: 1.25; letter-spacing: -.015em; }
h3 { margin-bottom: .25rem; font-size: 1rem; line-height: 1.3; }
p { line-height: 1.55; }

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

.svg-sprite { position: absolute; overflow: hidden; }
.icon { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(390px, 1.05fr) minmax(430px, .95fr); background: white; }
.login-brand {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: clamp(2rem, 6vw, 5rem);
  color: white;
  background: var(--navy-950);
}
.login-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(3, 26, 53, .08), rgba(3, 26, 53, .82)), url("assets/brand/presente-professor-horizontal.png") center 30% / cover no-repeat;
}
.login-brand__copy { position: relative; z-index: 1; max-width: 34rem; }
.login-brand__copy h1 { font-size: clamp(2rem, 5vw, 4.5rem); max-width: 8ch; }
.login-brand__copy p { max-width: 34rem; margin: 1rem 0 0; color: #d7e9f7; font-size: 1.08rem; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: clamp(1.5rem, 5vw, 5rem); }
.login-box { width: min(100%, 31rem); }
.brand-lockup { display: flex; align-items: center; gap: .85rem; margin-bottom: 2.5rem; }
.brand-lockup img { width: 58px; height: 58px; object-fit: cover; border-radius: 13px; }
.brand-lockup strong { display: block; color: var(--navy-900); font-size: 1.25rem; }
.brand-lockup span { color: var(--cyan-500); }
.brand-lockup small { display: block; margin-top: .15rem; color: var(--muted); }
.login-box > p { color: var(--muted); margin-bottom: 1.6rem; }
.login-form { padding: 0; }
.demo-notice { display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 1rem; margin-bottom: 1.25rem; color: #6c4a00; background: var(--yellow-100); border-radius: 12px; }
.role-options { display: grid; gap: .75rem; }
.role-option {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .9rem;
  align-items: center;
  padding: 1rem;
  text-align: left;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .18s ease-out, box-shadow .18s ease-out, transform .18s ease-out;
}
.role-option:hover { border-color: var(--blue-600); box-shadow: 0 8px 22px rgba(3, 42, 84, .09); transform: translateY(-1px); }
.role-option__icon { display: grid; place-items: center; width: 44px; height: 44px; color: white; background: var(--navy-900); border-radius: 12px; }
.role-option:nth-child(2) .role-option__icon { background: var(--blue-600); }
.role-option:nth-child(3) .role-option__icon { color: var(--navy-950); background: var(--cyan-500); }
.role-option strong, .role-option small { display: block; }
.role-option small { margin-top: .15rem; color: var(--muted); }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 1.15rem .85rem;
  color: #d8e7f5;
  background: var(--navy-950);
}
.sidebar .brand-lockup { margin: .25rem .6rem 2rem; }
.sidebar .brand-lockup img { width: 46px; height: 46px; }
.sidebar .brand-lockup strong { color: white; font-size: 1.05rem; }
.sidebar .brand-lockup small { color: #9eb9d3; }
.nav-list { display: grid; gap: .3rem; }
.nav-button {
  width: 100%;
  min-height: 48px;
  display: flex;
  gap: .8rem;
  align-items: center;
  padding: .7rem .85rem;
  color: #b8cee2;
  background: transparent;
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  text-align: left;
}
.nav-button:hover { color: white; background: rgba(255,255,255,.07); }
.nav-button[aria-current="page"] { color: white; background: var(--navy-800); }
.nav-button[aria-current="page"] .icon { color: var(--cyan-500); }
.sidebar__bottom { margin-top: auto; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.12); }
.profile-mini { display: grid; grid-template-columns: auto 1fr; gap: .7rem; align-items: center; padding: .6rem; }
.avatar { display: grid; place-items: center; width: 40px; height: 40px; color: white; background: var(--blue-600); border-radius: 50%; font-weight: 750; }
.profile-mini strong, .profile-mini small { display: block; }
.profile-mini small { margin-top: .1rem; color: #9eb9d3; }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 72px;
  margin-left: var(--sidebar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem clamp(1.25rem, 3vw, 2.5rem);
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
}
.topbar__context { display: flex; align-items: center; gap: .9rem; }
.topbar__context strong, .topbar__context small { display: block; }
.topbar__context small { margin-top: .15rem; color: var(--muted); }
.topbar__actions { display: flex; align-items: center; gap: .6rem; }
.mobile-brand { display: none; align-items: center; gap: .6rem; }
.mobile-brand img { width: 40px; height: 40px; border-radius: 10px; }
.mobile-brand strong { color: var(--navy-900); }

.app-main { margin-left: var(--sidebar); padding: clamp(1.25rem, 3vw, 2.5rem); padding-bottom: 3rem; }
.page { width: min(100%, 1180px); margin: 0 auto; }
.page-header { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: 1.6rem; }
.page-header p { margin: 0; color: var(--muted); max-width: 66ch; }
.page-actions { display: flex; gap: .65rem; flex-wrap: wrap; }

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .7rem 1rem;
  color: white;
  background: var(--blue-700);
  border: 1px solid var(--blue-700);
  border-radius: 11px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background .18s ease-out, transform .18s ease-out, box-shadow .18s ease-out;
}
.button:hover { background: var(--navy-800); box-shadow: 0 8px 20px rgba(7, 89, 199, .18); transform: translateY(-1px); }
.button:active { transform: none; box-shadow: none; }
.button--secondary { color: var(--navy-900); background: white; border-color: var(--line); }
.button--secondary:hover { color: var(--blue-700); background: var(--surface-blue); border-color: #a8c8e8; }
.button--quiet { color: var(--navy-800); background: transparent; border-color: transparent; }
.button--quiet:hover { background: var(--surface-blue); box-shadow: none; }
.button--danger { color: var(--red-600); background: white; border-color: #efb8bd; }
.button--wide { width: 100%; }
.icon-button { width: 44px; height: 44px; display: grid; place-items: center; color: var(--navy-800); background: white; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.icon-button:hover { background: var(--surface-blue); border-color: #a8c8e8; }

.status { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 750; }
.status--success { color: #056547; background: var(--green-100); }
.status--warning { color: #704a00; background: var(--yellow-100); }
.status--danger { color: #a62531; background: var(--red-100); }
.status--info { color: var(--navy-800); background: var(--surface-blue); }

.today-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(310px, .55fr); gap: 1.25rem; }
.now-stage {
  min-height: 370px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1.4rem, 4vw, 2.4rem);
  color: white;
  background: var(--navy-900);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}
.now-stage::after { content: ""; position: absolute; width: 320px; height: 320px; right: -130px; bottom: -160px; border: 56px solid var(--cyan-500); border-radius: 50%; opacity: .16; }
.now-stage__top, .now-stage__body, .now-stage__action { position: relative; z-index: 1; }
.now-label { display: inline-flex; gap: .5rem; align-items: center; color: #9ff4f6; font-weight: 780; }
.now-stage h2 { max-width: 12ch; margin: 1.1rem 0 .6rem; font-size: clamp(2rem, 5vw, 3.4rem); }
.now-stage__meta { display: flex; flex-wrap: wrap; gap: .65rem 1.2rem; color: #d9e9f6; }
.meta-item { display: inline-flex; align-items: center; gap: .4rem; }
.now-stage__action { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 2rem; }
.now-stage__action p { margin: 0; color: #bdd5e8; }
.now-stage .button { min-height: 54px; padding-inline: 1.4rem; color: var(--navy-950); background: var(--cyan-500); border-color: var(--cyan-500); }
.now-stage .button:hover { background: #5de2e7; }

.priority-stack { display: grid; align-content: start; gap: 1rem; }
.priority-section { padding: 1.25rem; background: white; border-radius: var(--radius); box-shadow: 0 8px 22px rgba(3,42,84,.07); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: .7rem; margin-bottom: .75rem; }
.section-title h2 { display: flex; align-items: center; gap: .55rem; margin: 0; }
.section-title--warning h2 { color: #7b5200; }
.task-row { width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: .7rem; align-items: center; padding: .85rem 0; text-align: left; color: inherit; background: transparent; border: 0; border-top: 1px solid var(--line); cursor: pointer; }
.task-row:first-of-type { border-top: 0; }
.task-row small { display: block; margin-top: .15rem; color: var(--muted); }
.task-row:hover strong { color: var(--blue-700); }
.task-dot { width: 34px; height: 34px; display: grid; place-items: center; color: var(--navy-800); background: var(--surface-blue); border-radius: 10px; }
.task-dot--warning { color: #7b5200; background: var(--yellow-100); }

.metric-strip { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); margin: 1.25rem 0; background: white; border-radius: var(--radius); box-shadow: 0 8px 22px rgba(3,42,84,.06); }
.metric { padding: 1.2rem; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric strong { display: block; color: var(--navy-900); font-size: 1.55rem; }
.metric span { display: block; margin-top: .25rem; color: var(--muted); font-size: .9rem; }

.timeline { position: relative; margin-top: 1rem; padding-left: 6.5rem; }
.timeline::before { content: ""; position: absolute; left: 5.25rem; top: .5rem; bottom: .5rem; width: 2px; background: #cbd8e5; }
.timeline-item { position: relative; min-height: 150px; padding: 0 0 1.5rem 1.6rem; }
.timeline-time { position: absolute; width: 4.5rem; left: -6.5rem; top: .4rem; text-align: right; }
.timeline-time strong, .timeline-time small { display: block; }
.timeline-time strong { color: var(--navy-900); font-size: 1.25rem; }
.timeline-time small { margin-top: .25rem; color: var(--muted); }
.timeline-marker { position: absolute; z-index: 1; left: -.15rem; top: .55rem; width: 16px; height: 16px; background: white; border: 3px solid #93a8bd; border-radius: 50%; transform: translateX(-50%); }
.timeline-item--current .timeline-marker { background: var(--cyan-500); border-color: white; box-shadow: 0 0 0 3px var(--cyan-500); }
.timeline-item--done .timeline-marker { background: var(--green-600); border-color: var(--green-600); }
.timeline-content { padding: 1.15rem 1.25rem; background: white; border-radius: var(--radius); }
.timeline-item--current .timeline-content { background: var(--surface-blue); box-shadow: 0 10px 28px rgba(7,89,199,.10); }
.timeline-content__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.timeline-content__head p { margin: .2rem 0 0; color: var(--muted); }
.timeline-meta { display: flex; flex-wrap: wrap; gap: .75rem 1rem; margin-top: .85rem; color: var(--muted); }
.timeline-actions { display: flex; gap: .65rem; flex-wrap: wrap; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #cbdfea; }

.data-section { background: white; border-radius: var(--radius); overflow: hidden; }
.data-toolbar { display: flex; gap: .75rem; justify-content: space-between; align-items: center; padding: 1rem 1.15rem; border-bottom: 1px solid var(--line); }
.search-field { position: relative; flex: 1; max-width: 420px; }
.search-field .icon { position: absolute; left: .85rem; top: 50%; color: var(--muted); transform: translateY(-50%); }
.search-field input { width: 100%; min-height: 44px; padding: .65rem .8rem .65rem 2.7rem; color: var(--ink); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 11px; }
.data-list { margin: 0; padding: 0; list-style: none; }
.data-row { display: grid; grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(90px, .75fr)) auto; gap: 1rem; align-items: center; padding: 1rem 1.15rem; border-bottom: 1px solid var(--line); }
.data-row:last-child { border-bottom: 0; }
.data-row:hover { background: #fbfdff; }
.data-cell strong, .data-cell small { display: block; }
.data-cell--actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .5rem; }
.data-cell small { margin-top: .15rem; color: var(--muted); }

.attendance-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; padding: 1.15rem 1.25rem; color: white; background: var(--navy-900); border-radius: var(--radius) var(--radius) 0 0; }
.attendance-head p { margin: .25rem 0 0; color: #c8dded; }
.attendance-summary { display: flex; gap: 1rem; flex-wrap: wrap; }
.attendance-summary span { min-width: 68px; padding: .45rem .65rem; text-align: center; background: rgba(255,255,255,.1); border-radius: 10px; }
.attendance-summary strong, .attendance-summary small { display: block; }
.attendance-summary small { margin-top: .1rem; color: #c8dded; }
.attendance-list { background: white; }
.attendance-row { display: grid; grid-template-columns: minmax(170px, 1fr) minmax(290px, 420px); gap: 1rem; align-items: center; padding: .9rem 1.15rem; border-bottom: 1px solid var(--line); }
.student-identity { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.student-number { width: 30px; color: var(--muted); text-align: center; }
.student-identity strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.student-identity small { display: block; margin-top: .15rem; color: var(--muted); }
.status-control { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; padding: .3rem; background: var(--surface-soft); border-radius: 12px; }
.attendance-choice { min-height: 44px; padding: .45rem .55rem; background: transparent; border: 0; border-radius: 9px; cursor: pointer; font-weight: 750; }
.attendance-choice:hover { background: white; }
.attendance-choice[data-active="true"][data-status="present"] { color: #045b50; background: #72e7e6; }
.attendance-choice[data-active="true"][data-status="absent"] { color: white; background: var(--red-600); }
.attendance-choice[data-active="true"][data-status="justified"] { color: #5c3e00; background: var(--yellow-500); }
.attendance-justification { margin-top: .5rem; }
.attendance-footer { position: sticky; bottom: 0; z-index: 10; display: flex; justify-content: flex-end; gap: .75rem; padding: .85rem 1.15rem; background: rgba(255,255,255,.97); border-top: 1px solid var(--line); box-shadow: 0 -10px 28px rgba(3,42,84,.08); }

.report-layout { display: grid; grid-template-columns: 1.15fr .85fr; gap: 1.25rem; }
.report-filters { display: grid; grid-template-columns: repeat(4, minmax(135px, 1fr)) auto; gap: .75rem; align-items: end; padding: 1rem; margin-bottom: 1rem; background: white; border-radius: var(--radius); }
.report-sheet { padding: clamp(1.25rem, 3vw, 2rem); background: white; border-radius: var(--radius); }
.report-sheet__brand { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: 1.25rem; border-bottom: 2px solid var(--navy-900); }
.report-sheet__brand img { width: 56px; height: 56px; border-radius: 12px; }
.report-sheet__brand p { margin: .15rem 0 0; color: var(--muted); }
.bar-chart { display: grid; gap: 1rem; margin: 1.5rem 0; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 42px; gap: .75rem; align-items: center; }
.bar-track { height: 12px; overflow: hidden; background: #e9eef4; border-radius: 999px; }
.bar-fill { height: 100%; background: var(--blue-600); border-radius: inherit; }
.bar-row:nth-child(2) .bar-fill { background: var(--cyan-500); }
.bar-row:nth-child(3) .bar-fill { background: var(--yellow-500); }
.report-aside { display: grid; align-content: start; gap: 1rem; }
.summary-block { padding: 1.25rem; background: var(--navy-900); color: white; border-radius: var(--radius); }
.summary-block p { color: #c8dded; }
.summary-block__number { display: block; margin: .8rem 0 .2rem; font-size: 3rem; letter-spacing: -.03em; }

.empty-state { padding: 3rem 1.25rem; text-align: center; }
.empty-state .task-dot { width: 52px; height: 52px; margin: 0 auto 1rem; }
.empty-state p { max-width: 38rem; margin: .5rem auto 1.25rem; color: var(--muted); }

.settings-list { background: white; border-radius: var(--radius); }
.setting-row { display: flex; justify-content: space-between; gap: 1.5rem; align-items: center; padding: 1.15rem 1.25rem; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row p { margin: .2rem 0 0; color: var(--muted); }
.switch { position: relative; width: 52px; height: 30px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: absolute; inset: 0; background: #b7c3cf; border-radius: 999px; cursor: pointer; transition: background .18s ease-out; }
.switch span::after { content: ""; position: absolute; width: 24px; height: 24px; top: 3px; left: 3px; background: white; border-radius: 50%; box-shadow: 0 2px 6px rgba(3,26,53,.25); transition: transform .18s ease-out; }
.switch input:checked + span { background: var(--blue-600); }
.switch input:checked + span::after { transform: translateX(22px); }
.switch input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.entity-dialog { width: min(92vw, 680px); max-height: 88vh; padding: 0; overflow: auto; color: var(--ink); background: white; border: 0; border-radius: 16px; box-shadow: 0 26px 80px rgba(3,26,53,.3); }
.entity-dialog::backdrop { background: rgba(3, 26, 53, .68); }
.dialog-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; padding: 1.2rem 1.3rem; border-bottom: 1px solid var(--line); }
.dialog-head p { margin: .2rem 0 0; color: var(--muted); }
.form-stack { display: grid; gap: 1rem; padding: 1.25rem 1.3rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: grid; gap: .4rem; }
.field span { font-size: .9rem; font-weight: 700; }
.field small { color: var(--muted); line-height: 1.35; }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; padding: .65rem .75rem; color: var(--ink); background: white; border: 1px solid #bac7d4; border-radius: 10px; }
.field textarea { min-height: 88px; resize: vertical; }
.file-field { padding: .85rem; background: var(--surface-soft); border: 1px dashed var(--line); border-radius: var(--radius); }
.file-field input { min-height: auto; padding: .55rem; background: white; }
.form-error { margin: 0; padding: .75rem .85rem; color: #8b1620; background: var(--red-100); border-radius: 10px; }
.credential-box { padding: 1rem; background: var(--surface-blue); border: 1px solid var(--line); border-radius: var(--radius); }
.credential-box span, .credential-box strong { display: block; }
.credential-box strong { margin: .35rem 0 .65rem; font-size: 1.35rem; letter-spacing: .02em; overflow-wrap: anywhere; }
.credential-box p { margin: 0; color: var(--muted); }
.form-actions { display: flex; justify-content: flex-end; gap: .65rem; padding-top: .3rem; }

.toast-region { position: fixed; z-index: 100; right: 1rem; bottom: 1rem; display: grid; gap: .5rem; }
.toast { max-width: 360px; display: flex; gap: .7rem; align-items: flex-start; padding: .9rem 1rem; color: white; background: var(--navy-950); border-radius: 12px; box-shadow: var(--shadow); animation: toast-in .2s ease-out; }
.toast--success .icon { color: #66ead2; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.mobile-nav { display: none; }
.prototype-ribbon { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .6rem; color: #6b4a00; background: var(--yellow-100); border-radius: 999px; font-size: .78rem; font-weight: 750; }

@media (max-width: 960px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-brand { min-height: 280px; padding: 2rem; }
  .login-brand::before { background-image: linear-gradient(160deg, rgba(8, 42, 84, .2), rgba(3, 26, 53, .92)); }
  .login-brand__copy h1 { max-width: none; font-size: 2.25rem; }
  .login-panel { padding: 2rem 1.25rem 3rem; }
  .sidebar { transform: translateX(-100%); }
  .topbar, .app-main { margin-left: 0; }
  .mobile-brand { display: flex; }
  .topbar__context { display: none; }
  .today-grid, .report-layout { grid-template-columns: 1fr; }
  .report-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .priority-stack { grid-template-columns: 1fr 1fr; }
  .data-row { grid-template-columns: minmax(180px, 1.4fr) repeat(2, minmax(90px, .75fr)) auto; }
  .data-row .data-cell:nth-child(4) { display: none; }
}

@media (max-width: 720px) {
  :root { --radius: 13px; }
  body { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  h1 { font-size: 1.55rem; }
  .topbar { min-height: 64px; padding: .65rem 1rem; }
  .topbar__actions .prototype-ribbon { padding-inline: .5rem; font-size: .68rem; }
  .app-main { padding: 1rem; padding-bottom: 1.5rem; }
  .entity-dialog { width: calc(100vw - 1rem); max-height: calc(100dvh - 1rem); margin: .5rem auto; overflow: hidden; }
  .entity-dialog[open] { display: block; }
  .entity-dialog #dialog-content { max-height: calc(100dvh - 1rem); overflow-y: auto; overscroll-behavior: contain; scroll-padding-block: 6rem; }
  .dialog-head { position: sticky; z-index: 2; top: 0; padding: 1rem; background: white; }
  .form-stack { padding: 1rem; }
  .form-actions { position: sticky; z-index: 2; bottom: 0; margin: .25rem -1rem 0; padding: .85rem 1rem max(.85rem, env(safe-area-inset-bottom)); background: white; box-shadow: 0 -10px 24px rgba(3, 42, 84, .08); }
  .page-header { align-items: stretch; flex-direction: column; margin-bottom: 1.15rem; }
  .page-actions .button { flex: 1; }
  .now-stage { min-height: 340px; padding: 1.35rem; }
  .now-stage h2 { font-size: 2.35rem; }
  .now-stage__action { align-items: stretch; flex-direction: column; }
  .priority-stack { grid-template-columns: 1fr; }
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .timeline { padding-left: 4.5rem; }
  .timeline::before { left: 3.7rem; }
  .timeline-time { width: 3.3rem; left: -4.55rem; }
  .timeline-time strong { font-size: 1rem; }
  .timeline-content { padding: 1rem; }
  .timeline-content__head { flex-direction: column; }
  .timeline-actions .button { width: 100%; }
  .data-toolbar { align-items: stretch; flex-direction: column; }
  .search-field { max-width: none; }
  .data-row { grid-template-columns: 1fr auto; gap: .5rem .8rem; }
  .data-row .data-cell { display: none; }
  .data-row .data-cell:first-child { display: block; }
  .data-row .data-cell:last-child { display: flex; }
  .attendance-head { flex-direction: column; }
  .attendance-summary { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
  .attendance-summary span { min-width: 0; padding: .45rem .2rem; }
  .attendance-row { grid-template-columns: 1fr; gap: .65rem; padding: .9rem 1rem; }
  .attendance-list { padding-bottom: 76px; }
  .attendance-footer { position: fixed; right: 0; bottom: calc(68px + env(safe-area-inset-bottom)); left: 0; padding: .7rem 1rem; }
  .attendance-footer .button { flex: 1; }
  .bar-row { grid-template-columns: 95px 1fr 38px; }
  .setting-row { align-items: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
  .report-filters { grid-template-columns: 1fr; }
  .entity-dialog { width: calc(100vw - 1.25rem); }
  .mobile-nav {
    position: fixed;
    z-index: 40;
    inset: auto 0 0 0;
    min-height: calc(68px + env(safe-area-inset-bottom));
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    padding: .35rem .35rem calc(.35rem + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.98);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(3,42,84,.08);
  }
  .mobile-nav .nav-button { min-height: 58px; justify-content: center; flex-direction: column; gap: .2rem; padding: .35rem .2rem; font-size: .7rem; text-align: center; }
  .mobile-nav .nav-button[aria-current="page"] { color: var(--blue-700); background: transparent; }
  .mobile-nav .nav-button[aria-current="page"]::before { content: ""; position: absolute; top: -.36rem; width: 30px; height: 3px; background: var(--blue-600); border-radius: 999px; }
  .mobile-nav .nav-button { position: relative; color: var(--muted); }
  .mobile-nav .icon { width: 1.35rem; height: 1.35rem; }
  .toast-region { right: .75rem; bottom: calc(78px + env(safe-area-inset-bottom)); left: .75rem; }
  .toast { max-width: none; }
}

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

@media print {
  .sidebar, .topbar, .mobile-nav, .page-header, .report-aside, .prototype-ribbon { display: none !important; }
  .app-main { margin: 0; padding: 0; }
  .report-layout { display: block; }
  .report-sheet { box-shadow: none; }
}
