:root {
  color-scheme: light;
  /* PANDUAN-UI-UX §3.1 palet dasar */
  --navy:#1b3a6b;
  --navy-deep:#14305a;
  --navy-soft:#e7edf6;
  --ink:#14181f;
  --muted:#5b6472;
  --line:#dfe3e8;
  --paper:#f5f6f7;
  --white:#fff;
  /* §3.2 warna status: teks, latar, garis */
  --green:#166534; --green-bg:#e8f5ec; --green-line:#b7dfc4;
  --amber:#92610d; --amber-bg:#fdf3e0; --amber-line:#ebd39b;
  --info:#1b3a6b; --info-bg:#e7edf6; --info-line:#bfd0e6;
  --red:#9b2c2c; --red-bg:#fdeded; --red-line:#f0c0c0;
  --neutral:#5b6472; --neutral-bg:#eff1f3; --neutral-line:#dfe3e8;
  /* §5.2 tiga radius, §5.3 dua bayangan */
  --radius-sm:6px;
  --radius:10px;
  --shadow:0 1px 2px rgba(20,24,31,.06);
  --shadow-2:0 4px 12px rgba(20,24,31,.12);
}

/* §4.1 satu keluarga huruf, dibundel bersama aplikasi (lisensi OFL, fonts/OFL-IBM-Plex.txt) */
@font-face { font-family:"IBM Plex Sans"; src:url("../fonts/IBMPlexSans-Regular.woff2") format("woff2"); font-weight:400; font-display:swap }
@font-face { font-family:"IBM Plex Sans"; src:url("../fonts/IBMPlexSans-SemiBold.woff2") format("woff2"); font-weight:600; font-display:swap }

* {
  box-sizing:border-box
}

body {
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font:14px/1.5 "IBM Plex Sans","Segoe UI",Arial,sans-serif;
  font-variant-numeric:tabular-nums
}

button,input,select {
  font:inherit
}

button {
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:36px;
  padding:8px 16px;
  border:1px solid var(--line);
  border-radius:var(--radius-sm);
  background:var(--white);
  color:var(--ink);
  font-weight:600;
  transition:background .15s,border-color .15s
}

button:hover {
  background:var(--paper);
  border-color:var(--info-line)
}

button:disabled {
  cursor:not-allowed;
  opacity:.55
}

button:focus-visible,a:focus-visible {
  outline:2px solid var(--navy);
  outline-offset:2px
}

/* §6.2: saat difokus garis Biru seragam 2 px */
input:focus-visible,select:focus-visible,textarea:focus-visible {
  outline:none;
  border-color:var(--navy);
  box-shadow:0 0 0 1px var(--navy)
}

input,select {
  min-width:0;
  border:1px solid var(--line);
  border-radius:var(--radius-sm);
  background:var(--white);
  color:var(--ink);
  min-height:36px;
  padding:8px 12px
}

input {
  width:100%
}

input::placeholder {
  color:var(--muted)
}

label {
  display:block;
  font-weight:600;
  font-size:12px;
  margin:16px 0 8px
}

h1,h2,h3,p {
  margin-top:0
}

h1 {
  font-size:28px;
  line-height:1.3;
  font-weight:650;
  margin-bottom:4px
}

h2 {
  font-size:14px;
  font-weight:650;
  margin:0
}

h3 {
  font-size:18px;
  line-height:1.4
}

p {
  margin-bottom:12px
}

small {
  font-size:12px
}

/* §4.1: angka memakai angka tabular dari keluarga yang sama, bukan huruf monospace */
.mono,code,kbd {
  font-variant-numeric:tabular-nums
}

.muted,.teks-kedua {
  color:var(--muted)
}

.ui-icon {
  width:18px;
  height:18px;
  flex-shrink:0
}

.eyebrow {
  margin:0 0 4px;
  color:var(--muted);
  font-size:12px;
  font-weight:600
}

.primary {
  background:var(--navy);
  border-color:var(--navy);
  color:var(--white);
  box-shadow:none
}

.primary:hover {
  background:var(--navy-deep);
  border-color:var(--navy-deep)
}

.text-button {
  border:0;
  background:transparent;
  box-shadow:none;
  color:var(--navy);
  padding:4px 0;
  font-size:12px;
  min-height:30px
}

.text-button:hover {
  background:transparent;
  text-decoration:underline
}

.icon-button {
  border:0;
  background:transparent;
  font-size:22px;
  min-width:36px;
  padding:0
}

.bahaya {
  background:var(--red-bg);
  color:var(--red);
  border-color:var(--red-line)
}

.badge {
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:4px 8px;
  border-radius:999px;
  background:var(--neutral-bg);
  color:var(--muted);
  font-size:12px;
  font-weight:600;
  white-space:nowrap;
  box-shadow:none
}

.badge.positive {
  background:var(--green-bg);
  color:var(--green)
}

.badge.warning {
  background:var(--amber-bg);
  color:var(--amber)
}

.badge.info {
  background:var(--navy-soft);
  color:var(--navy)
}

.badge.danger {
  background:var(--red-bg);
  color:var(--red)
}

.dot {
  display:inline-block;
  width:5px;
  height:5px;
  border-radius:50%;
  background:currentColor;
  flex-shrink:0
}

.workspace {
  min-height:100vh;
  display:flex;
  flex-direction:column
}

.skip-link {
  position:fixed;
  left:16px;
  top:-60px;
  background:var(--navy);
  color:white;
  padding:12px;
  z-index:50
}

.skip-link:focus {
  top:10px
}

.topbar {
  min-height:64px;
  border-top:3px solid var(--navy);
  border-bottom:1px solid var(--line);
  background:var(--white);
  display:flex;
  align-items:center;
  gap:24px;
  padding:12px 32px
}

.brand {
  display:flex;
  align-items:center;
  gap:12px;
  white-space:nowrap
}

.brand strong {
  font-size:22px;
  color:var(--navy)
}

.brand strong span {
  font-size:12px;
  font-weight:500;
  color:var(--muted);
  margin-left:4px
}

.brand-mark {
  height:33px;
  width:30px;
  border:1.5px solid var(--navy);
  border-radius:var(--radius-sm);
  display:grid;
  place-items:center;
  color:var(--navy)
}

.brand-mark .ui-icon {
  width:21px;
  height:21px
}

.environment-tag {
  display:inline-flex;
  gap:8px;
  align-items:center;
  border:1px solid var(--line);
  border-radius:999px;
  padding:4px 8px;
  font-size:12px;
  color:var(--muted)
}

.account {
  display:flex;
  align-items:center;
  gap:16px;
  margin-left:auto;
  font-size:12px
}

.avatar,.mini-avatar {
  display:inline-grid;
  place-items:center;
  border-radius:50%;
  background:var(--navy-soft);
  color:var(--navy);
  width:30px;
  height:30px;
  font-size:12px;
  font-weight:600;
  flex-shrink:0
}

.navigation {
  background:var(--white);
  display:flex;
  align-items:stretch;
  gap:24px;
  padding:0 32px;
  overflow-x:auto;
  border-bottom:1px solid var(--line);
  scrollbar-width:thin
}

.navigation button {
  position:relative;
  flex-shrink:0;
  background:none;
  border:0;
  border-radius:0;
  padding:16px 0;
  color:var(--muted);
  font-size:12px;
  font-weight:500;
  min-height:47px
}

.navigation button.active {
  color:var(--navy);
  font-weight:650
}

.navigation button.active:after {
  content:"";
  height:3px;
  position:absolute;
  bottom:0;
  left:0;
  right:0;
  background:var(--navy)
}

.schoolbar {
  padding:16px 32px;
  display:flex;
  align-items:center;
  gap:12px;
  border-bottom:1px solid var(--line);
  background:var(--white)
}

.school-symbol {
  width:36px;
  height:36px;
  background:var(--neutral-bg);
  color:var(--navy);
  border-radius:var(--radius-sm);
  display:grid;
  place-items:center
}

.schoolbar strong {
  font-size:14px;
  font-weight:650;
  display:block
}

.schoolbar small {
  display:block;
  color:var(--muted);
  font-size:12px;
  margin-top:4px
}

.school-context {
  display:flex;
  gap:32px;
  margin-left:auto
}

.school-context>span {
  color:var(--muted);
  font-size:12px;
  display:grid;
  gap:4px
}

.school-context strong {
  color:var(--ink);
  font-size:12px;
  font-weight:500
}

.command-strip {
  display:flex;
  align-items:center;
  gap:24px;
  background:var(--navy-deep);
  color:var(--info-line);
  padding:8px 32px;
  min-height:43px
}

.command-form {
  display:flex;
  align-items:center;
  gap:12px;
  flex:1;
  max-width:650px;
  background:var(--navy-deep);
  border:1px solid rgba(76,100,134,0.25);
  border-radius:var(--radius-sm);
  padding:0 8px;
  min-width:0
}

.command-form input {
  background:transparent;
  border:0;
  color:var(--white);
  padding:4px 0;
  min-height:28px;
  font-size:12px
}

.command-form input::placeholder {
  color:var(--info-line)
}

.command-form kbd {
  font-size:12px;
  white-space:nowrap;
  border:1px solid var(--muted);
  padding:0 4px;
  border-radius:var(--radius-sm)
}

.command-hint {
  margin-left:auto;
  font-size:12px;
  white-space:nowrap
}

.command-hint span {
  padding:0 8px;
  color:var(--muted)
}

.content {
  padding:24px 24px 32px;
  width:100%;
  max-width:1920px;
  margin:0 auto;
  flex:1;
  min-width:0
}

.page-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:24px
}

.page-heading p:last-child {
  font-size:12px;
  color:var(--muted);
  margin:0
}

.page-heading .primary {
  font-size:12px
}

.page-heading kbd {
  font-size:12px;
  border:1px solid rgba(255,255,255,0.25);
  padding:0 4px;
  border-radius:var(--radius-sm);
  margin-left:8px
}

.page-total {
  font-size:12px;
  color:var(--muted);
  white-space:nowrap
}

.page-total strong {
  font-size:22px;
  color:var(--ink);
  font-weight:500;
  margin-right:4px
}

.summary-strip {
  display:grid;
  grid-template-columns:1.15fr repeat(4,1fr);
  background:var(--white);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:16px 0;
  margin-bottom:16px
}

.summary-strip>div {
  padding:0 24px;
  border-right:1px solid var(--line);
  min-width:0;
  display:flex;
  flex-direction:column
}

.summary-strip>div:last-child {
  border-right:0
}

.summary-context {
  justify-content:center
}

.summary-context strong {
  font-size:18px;
  font-weight:600
}

.summary-context small {
  color:var(--muted);
  margin-top:4px;
  font-size:12px
}

.metric>span {
  display:flex;
  gap:8px;
  align-items:center;
  font-size:12px;
  color:var(--muted)
}

.metric strong {
  font-size:28px;
  line-height:1.35;
  font-weight:500;
}

.metric small {
  font-size:12px;
  color:var(--muted)
}

.metric.positive strong,.metric.positive .dot {
  color:var(--green)
}

.metric.warning strong,.metric.warning .dot {
  color:var(--amber)
}

.metric.info strong,.metric.info .dot {
  color:var(--navy)
}

.metric.neutral strong {
  color:var(--muted)
}

.terminal-grid {
  display:grid;
  grid-template-columns:minmax(0,1fr) 290px;
  gap:16px;
  align-items:start
}

.main-column,.side-column {
  display:grid;
  gap:16px;
  min-width:0
}

.panel {
  background:var(--white);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
  min-width:0
}

.panel-header {
  min-height:49px;
  padding:12px 16px;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px
}

.panel-header h2 {
  display:flex;
  align-items:center;
  gap:8px;
  font-size:12px
}

.panel-header h2 .ui-icon {
  width:15px;
  height:15px;
  color:var(--muted)
}

.panel-meta {
  color:var(--muted);
  font-size:12px
}

.panel-footer {
  border-top:1px solid var(--line);
  padding:8px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  color:var(--muted);
  font-size:12px;
  min-height:40px
}

.panel-footnote {
  margin:0;
  padding:12px 16px;
  font-size:12px;
  color:var(--muted);
  border-top:1px solid var(--line)
}

.gate-banner {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:12px 16px;
  background:var(--paper);
  border-bottom:1px solid var(--neutral-bg)
}

.gate-banner strong {
  font-size:12px;
  font-weight:600;
  display:block
}

.gate-banner small {
  font-size:12px;
  color:var(--muted);
  display:block;
  margin-top:4px
}

.gate-empty {
  min-height:238px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  padding:32px;
  text-align:center;
  background:var(--white)
}

.empty-icon {
  display:inline-grid;
  place-items:center;
  color:var(--muted);
  background:var(--neutral-bg);
  width:48px;
  height:48px;
  border:1px solid var(--navy-soft);
  border-radius:var(--radius);
  margin-bottom:16px;
  box-shadow:none
}

.empty-icon .ui-icon {
  width:25px;
  height:25px
}

.gate-empty h3 {
  font-size:14px;
  margin:0 0 8px;
  font-weight:600
}

.gate-empty p {
  font-size:12px;
  max-width:320px;
  color:var(--muted);
  margin-bottom:8px
}

.tap-cards {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  padding:16px
}

.tap-card {
  border:1px solid var(--line);
  border-bottom:3px solid var(--navy);
  border-radius:var(--radius-sm);
  display:flex;
  align-items:center;
  flex-direction:column;
  padding:12px;
  min-width:0
}

.tap-card.positive {
  border-bottom-color:var(--green)
}

.tap-card.warning {
  border-bottom-color:var(--amber)
}

.tap-card-top {
  width:100%;
  display:flex;
  justify-content:space-between;
  font-size:12px;
  color:var(--muted)
}

.identity-photo {
  display:grid;
  place-items:center;
  background:var(--paper);
  color:var(--muted);
  height:85px;
  width:64px;
  border:1px solid var(--navy-soft);
  border-radius:var(--radius-sm);
  margin:16px 0;
  font-size:22px
}

.tap-card h3 {
  text-align:center;
  font-size:14px;
  font-weight:600;
  overflow-wrap:anywhere
}

.tap-card time {
  font-size:12px;
  color:var(--muted);
  margin-top:12px
}

.schedule-list,.readiness-list {
  padding:0 16px
}

.schedule-list>div,.readiness-list>div {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 0;
  border-bottom:1px solid var(--neutral-bg);
  font-size:12px
}

.schedule-list>div:last-child,.readiness-list>div:last-child {
  border:0
}

.schedule-list span,.readiness-list span {
  color:var(--muted)
}

.schedule-list strong,.readiness-list strong {
  font-size:12px;
  font-weight:500
}

.info-panel {
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:16px;
  background:var(--navy-soft);
  box-shadow:var(--shadow)
}

.info-panel h3 {
  font-size:14px;
  margin:8px 0
}

.info-panel p {
  color:var(--muted);
  font-size:12px;
  line-height:1.7;
  margin-bottom:8px
}

.info-panel p:last-child {
  margin-bottom:0
}

.panel-toolbar {
  padding:12px 16px;
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  border-bottom:1px solid var(--line)
}

.panel-toolbar>.muted {
  font-size:12px;
  margin-left:auto
}

.search-field {
  display:flex;
  align-items:center;
  gap:8px;
  min-width:180px;
  max-width:330px;
  flex:1;
  border:1px solid var(--line);
  border-radius:var(--radius-sm);
  padding:0 12px;
  background:var(--white)
}

.search-field .ui-icon {
  width:15px;
  height:15px;
  color:var(--muted)
}

.search-field input {
  border:0;
  box-shadow:none;
  background:transparent;
  padding:8px 0;
  min-height:34px;
  font-size:12px
}

.panel-toolbar select {
  font-size:12px;
  min-height:35px
}

.segmented {
  display:flex;
  gap:4px
}

.segmented button {
  min-height:31px;
  border:0;
  background:var(--paper);
  color:var(--muted);
  font-size:12px;
  padding:4px 12px
}

.segmented button.selected {
  background:var(--navy-soft);
  color:var(--navy)
}

.segmented b {
  font-size:12px;
  background:rgba(255,255,255,0.60);
  padding:0 4px;
  border-radius:var(--radius-sm)
}

.table-wrap {
  overflow-x:auto;
  scrollbar-width:thin
}

table {
  width:100%;
  border-collapse:collapse;
  text-align:left;
  white-space:nowrap
}

th {
  font-size:12px;
  color:var(--muted);
  font-weight:500;
  background:var(--white);
}

th,td {
  padding:12px 16px;
  border-bottom:1px solid var(--neutral-bg)
}

td {
  font-size:12px
}

tbody tr:last-child td {
  border:0
}

tbody tr:hover {
  background:var(--white)
}

.name-cell {
  font-weight:500
}

.name-cell .mini-avatar {
  width:27px;
  height:27px;
  font-size:12px;
  margin-right:8px;
  vertical-align:middle
}

.class-label {
  display:inline-grid;
  place-items:center;
  min-width:37px;
  height:29px;
  background:var(--neutral-bg);
  border:1px solid var(--navy-soft);
  border-radius:var(--radius-sm);
  color:var(--navy);
  font-weight:600
}

.empty-state {
  padding:48px 24px;
  text-align:center;
  font-size:12px;
  color:var(--muted)
}

.empty-state.compact {
  padding:24px
}

.development-state {
  max-width:640px;
  margin:32px auto;
  padding:32px
}

.development-state h2 {
  color:var(--ink);
  font-size:18px;
  margin-bottom:12px
}

.development-state p {
  font-size:12px;
  line-height:1.8
}

.reader-body {
  padding:16px
}

.reader-form label {
  margin-top:0
}

.input-action {
  display:flex;
  gap:8px
}

.input-action button {
  white-space:nowrap
}

.reader-result {
  display:flex;
  align-items:center;
  gap:16px;
  background:var(--paper);
  border:1px solid var(--line);
  padding:24px;
  border-radius:var(--radius-sm);
  margin-top:16px
}

.reader-symbol {
  display:grid;
  place-items:center;
  width:43px;
  height:43px;
  background:var(--navy-soft);
  color:var(--navy);
  border-radius:50%;
  flex-shrink:0
}

.reader-result h3 {
  font-size:14px;
  margin:0 0 4px
}

.reader-result p {
  color:var(--muted);
  font-size:12px;
  margin:0
}

.reader-result.positive {
  border-color:var(--green-line);
  background:var(--paper)
}

.reader-result.warning {
  border-color:var(--amber-line);
  background:var(--red-bg)
}

.reader-result.danger {
  border-color:var(--red-line);
  background:var(--paper)
}

.field-help {
  font-size:12px;
  color:var(--muted);
  line-height:1.6;
  margin:8px 0 0
}

.statusbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  background:var(--white);
  border-top:1px solid var(--line);
  padding:8px 24px;
  font-size:12px;
  color:var(--muted)
}

.statusbar>span:first-child {
  display:flex;
  align-items:center;
  gap:8px
}

.statusbar .dot {
  color:var(--navy)
}

.statusbar b {
  font-weight:400;
  padding:0 8px;
  color:var(--green-line)
}

.notice,.message {
  padding:12px 16px;
  border:1px solid var(--line);
  border-radius:var(--radius-sm);
  background:var(--neutral-bg);
  font-size:12px;
  color:var(--navy);
  line-height:1.7
}

.message.danger {
  background:var(--red-bg);
  color:var(--red);
  border-color:var(--red-line)
}

.message.positive {
  background:var(--green-bg);
  color:var(--green);
  border-color:var(--green-line)
}

.modal-backdrop {
  position:fixed;
  inset:0;
  z-index:30;
  background:rgba(17,35,59,0.53);
  display:grid;
  place-items:center;
  padding:24px;
}

.dialog {
  width:100%;
  max-width:500px;
  max-height:90dvh;
  overflow:auto;
  box-shadow:var(--shadow-2)
}

.dialog-body {
  padding:24px
}

.dialog-body>p {
  font-size:12px
}

.dialog-body h3 {
  margin-bottom:4px
}

.dialog-actions {
  display:flex;
  justify-content:flex-end;
  gap:12px;
  margin-top:24px
}

.settings-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
  max-width:1150px
}

.settings-wide {
  grid-column:1 / -1
}

.account-inline {
  margin:16px 0;
  display:grid;
  gap:8px
}

.account-form {
  margin-top:8px
}

tr.is-inactive td {
  color:var(--muted)
}

.settings-body {
  padding:24px
}

.settings-body>p {
  font-size:12px
}

.settings-body form>.primary {
  margin-top:16px
}

.button-row {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:16px
}

.button-row button {
  font-size:12px
}

.settings-body hr {
  border:0;
  border-top:1px solid var(--line);
  margin:24px 0
}

.settings-body h3 {
  font-size:14px
}

.login-layout {
  min-height:100vh;
  display:grid;
  grid-template-columns:1fr 1fr
}

.login-story {
  padding:48px 9%;
  background:var(--navy-soft);
  border-right:1px solid var(--line);
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:48px;
  position:relative;
  overflow:hidden
}

.login-story h2 {
  font-size:22px;
  font-weight:600;
  line-height:1.25;
  color:var(--navy);
  margin:16px 0
}

.login-story>div>p:not(.eyebrow) {
  color:var(--muted);
  max-width:330px;
  font-size:14px;
  line-height:1.8
}

.login-form-area {
  display:grid;
  place-items:center;
  padding:48px 32px;
  background:var(--white)
}

.login-card {
  max-width:370px;
  width:100%
}

.login-card h1 {
  font-size:22px;
  margin-top:24px;
  overflow-wrap:anywhere
}

.login-card>.muted {
  font-size:12px
}

.login-submit {
  width:100%;
  justify-content:space-between;
  margin-top:24px;
  padding:12px 16px
}

.test-accounts {
  border-top:1px solid var(--line);
  margin-top:32px;
  padding-top:24px
}

.test-accounts>.muted {
  font-size:12px
}

.test-accounts>button {
  display:flex;
  justify-content:space-between;
  text-align:left;
  width:100%;
  border:1px solid var(--line);
  background:var(--white);
  margin:8px 0;
  font-size:12px;
  padding:8px 12px
}

.test-accounts>button small {
  display:block;
  font-weight:400;
  color:var(--muted);
  font-size:12px;
  margin-top:0
}

.memuat,.galat {
  padding:32px;
  max-width:800px;
  margin:auto
}

.galat,.pesan-galat,.fail {
  color:var(--red)
}

.diagnostik {
  max-width:850px;
  padding:32px;
  margin:auto
}

.ok {
  color:var(--green)
}

@media(min-width:1600px) {
  .content {
    padding:24px 32px 48px
  }
  .terminal-grid {
    grid-template-columns:minmax(0,1fr) 330px
  }
  .gate-empty {
    min-height:265px
  }
}

@media(max-width:1100px) {
  .navigation {
    gap:24px
  }
  .topbar,.schoolbar {
    padding-left:24px;
    padding-right:24px
  }
  .content {
    padding:24px 16px 32px
  }
  .terminal-grid {
    grid-template-columns:minmax(0,1fr) 255px;
    gap:12px
  }
  .main-column,.side-column {
    gap:12px
  }
  .summary-strip>div {
    padding:0 16px
  }
  .tap-cards {
    grid-template-columns:repeat(2,minmax(0,1fr))
  }
  .command-strip {
    padding-left:24px;
    padding-right:24px
  }
  .command-hint {
    display:none
  }
}

@media(max-width:800px) {
  .terminal-grid {
    grid-template-columns:minmax(0,1fr)
  }
  .side-column {
    grid-template-columns:repeat(2,minmax(0,1fr))
  }
  .side-column>.info-panel {
    grid-column:1/-1
  }
  .school-context {
    gap:16px
  }
  .summary-strip {
    grid-template-columns:repeat(4,minmax(0,1fr));
    padding:0 0 16px
  }
  .summary-strip .summary-context {
    grid-column:1/-1;
    padding:12px 16px;
    border-right:0;
    border-bottom:1px solid var(--line);
    display:flex;
    flex-direction:row;
    gap:16px;
    justify-content:flex-start;
    align-items:center;
    margin-bottom:12px
  }
  .summary-context .eyebrow {
    margin:0
  }
  .summary-context strong {
    font-size:12px
  }
  .summary-context small {
    margin-left:auto
  }
  .metric small {
    font-size:12px
  }
  .metric strong {
    font-size:28px
  }
  .statusbar>span:nth-child(2) {
    display:none
  }
  .login-story {
    padding:32px 8%;
    gap:32px
  }
  .login-story h2 {
    font-size:28px
  }
}

@media(max-width:600px) {
  .topbar {
    padding:12px 16px;
    gap:12px;
    flex-wrap:wrap
  }
  .brand strong {
    font-size:18px
  }
  .topbar .environment-tag {
    margin-left:auto
  }
  .account {
    width:100%;
    justify-content:flex-end;
    border-top:1px solid var(--neutral-bg);
    padding-top:8px;
    gap:12px
  }
  .account .avatar {
    width:24px;
    height:24px
  }
  .navigation {
    padding:0 16px;
    gap:24px
  }
  .navigation button {
    font-size:12px;
    padding:12px 0;
    min-height:43px
  }
  .schoolbar {
    padding:12px 16px;
    flex-wrap:wrap
  }
  .schoolbar>div:nth-child(2) {
    flex:1;
    min-width:0
  }
  .schoolbar strong {
    font-size:12px
  }
  .school-context {
    margin-left:48px;
    width:100%;
    gap:24px
  }
  .school-context strong {
    font-size:12px
  }
  .command-strip {
    padding:8px 16px;
    gap:12px
  }
  .command-form {
    gap:4px
  }
  .command-form input {
    font-size:12px
  }
  .command-form kbd {
    display:none
  }
  .content {
    padding:16px 12px 24px
  }
  .page-heading {
    gap:12px;
    align-items:flex-start;
    margin-bottom:16px
  }
  .page-heading h1 {
    font-size:22px
  }
  .page-heading p:last-child {
    font-size:12px;
    max-width:240px
  }
  .page-heading .primary {
    font-size:12px;
    padding:8px 8px
  }
  .page-heading .primary kbd {
    display:none
  }
  .page-heading .eyebrow {
    font-size:12px
  }
  .summary-strip>div {
    padding:0 12px
  }
  .metric>span {
    font-size:12px;
    gap:4px;
    line-height:1.4;
    min-height:25px
  }
  .metric small {
    display:none
  }
  .metric strong {
    font-size:22px
  }
  .summary-strip .summary-context {
    gap:12px;
    padding:12px
  }
  .summary-context .eyebrow {
    font-size:12px
  }
  .summary-context small {
    font-size:12px
  }
  .panel-header {
    padding:12px 16px
  }
  .panel-code {
    font-size:12px
  }
  .panel-header h2 {
    font-size:12px
  }
  .side-column {
    grid-template-columns:minmax(0,1fr)
  }
  .side-column>.info-panel {
    grid-column:auto
  }
  .panel-toolbar {
    padding:12px 12px;
    gap:8px
  }
  .panel-toolbar>.muted {
    margin:0;
    width:100%
  }
  .search-field {
    max-width:none;
    min-width:140px
  }
  .panel-toolbar select {
    max-width:135px
  }
  .panel-footer {
    font-size:12px;
    padding:8px 12px;
    flex-wrap:wrap
  }
  .gate-banner {
    padding:12px 16px
  }
  .gate-banner strong {
    font-size:12px
  }
  .gate-banner small {
    font-size:12px
  }
  .gate-empty {
    min-height:220px;
    padding:24px 16px
  }
  .gate-empty p {
    font-size:12px
  }
  .segmented {
    width:100%
  }
  .segmented button {
    flex:1;
    font-size:12px
  }
  th,td {
    padding:12px 12px
  }
  .statusbar {
    padding:8px 12px;
    font-size:12px;
    gap:8px
  }
  .settings-grid {
    grid-template-columns:minmax(0,1fr)
  }
  .reader-body {
    padding:16px
  }
  .input-action {
    flex-direction:column
  }
  .input-action button {
    align-self:flex-start
  }
  .reader-result {
    padding:16px;
    gap:12px
  }
  .reader-result h3 {
    font-size:14px
  }
  .reader-result p {
    font-size:12px
  }
  .reader-symbol {
    width:33px;
    height:33px
  }
  .login-layout {
    grid-template-columns:minmax(0,1fr)
  }
  .login-story {
    padding:24px;
    gap:32px;
    min-height:auto;
    border-right:0;
    border-bottom:1px solid var(--line)
  }
  .login-story>div:nth-child(2) {
    display:none
  }
  .login-form-area {
    padding:32px 24px
  }
  .login-card h1 {
    font-size:22px
  }
  .dialog-body {
    padding:16px
  }
  .modal-backdrop {
    padding:12px
  }
}

@media(prefers-reduced-motion:reduce) {
  * {
    transition:none!important;
    scroll-behavior:auto!important
  }
}

/* Panel detail siswa/guru (PRD §14.6): muncul di samping tanpa berpindah halaman. */
.name-link {
  display:inline-flex;
  align-items:center;
  gap:inherit;
  padding:0;
  border:0;
  background:none;
  color:var(--navy);
  font-weight:600;
  text-align:left;
  cursor:pointer
}

.name-link:hover {
  text-decoration:underline
}

.name-link:focus-visible,.drawer:focus-visible {
  outline:2px solid var(--navy);
  outline-offset:2px
}

.drawer-backdrop {
  position:fixed;
  inset:0;
  z-index:30;
  background:rgba(17,35,59,0.33)
}

.drawer {
  position:fixed;
  top:0;
  right:0;
  bottom:0;
  z-index:31;
  width:min(560px,100vw);
  margin:0;
  border-radius:0;
  overflow-y:auto;
  box-shadow:var(--shadow-2)
}

.drawer-body {
  display:grid;
  gap:16px;
  padding:24px 24px 32px
}

.detail-identity {
  display:flex;
  gap:16px;
  align-items:flex-start
}

.detail-identity h3 {
  margin:0 0 4px
}

.detail-identity p {
  margin:0 0 8px
}

.detail-avatar {
  flex:none;
  display:grid;
  place-items:center;
  width:52px;
  height:52px;
  border-radius:999px;
  background:var(--navy);
  color:var(--white);
  font-weight:700
}

.detail-facts {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(140px,1fr));
  gap:12px;
  margin:0
}

.detail-facts div {
  padding:12px 12px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--paper)
}

.detail-facts dt {
  color:var(--muted);
  font-size:12px
}

.detail-facts dd {
  margin:4px 0 0;
  word-break:break-all
}

.channel-settings {
  padding:12px 12px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--paper)
}

.channel-form {
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap
}

.channel-form select {
  min-width:140px
}

.detail-month {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap
}

.recap-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(78px,1fr));
  gap:8px
}

.recap-grid div {
  display:grid;
  padding:12px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  text-align:center
}

.recap-grid strong {
  font-size:22px
}

.recap-grid small {
  color:var(--muted)
}

.correction-mark {
  margin-left:8px
}

@media(max-width:640px) {
  .drawer-body {
    padding:16px
  }
  .detail-month strong {
    order:-1;
    width:100%
  }
}

/* Formulir koreksi status (PRD §16.10). */
.correction-form {
  display:grid;
  gap:8px
}

.correction-form h3,.correction-form p {
  margin:0
}

.correction-form label {
  margin-top:8px;
  font-weight:600
}

.correction-form select,.correction-form textarea {
  width:100%;
  padding:8px 12px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  font:inherit
}

.drawer-correction {
  margin-bottom:16px;
  padding:16px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--paper)
}

/* Foto siswa/guru (PRD §5.5): tanpa foto tampil lingkaran inisial. */
.visually-hidden {
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip:rect(0 0 0 0);
  white-space:nowrap
}

.detail-photo {
  display:grid;
  justify-items:center;
  gap:4px
}

img.detail-avatar,img.mini-avatar {
  object-fit:contain;
  background:var(--paper);
  border:1px solid var(--line)
}

img.detail-avatar {
  width:64px;
  height:64px;
  padding:0
}

.photo-upload {
  font-size:12px;
  cursor:pointer
}

.detail-photo:focus-within .photo-upload {
  outline:2px solid var(--navy);
  outline-offset:2px
}

/* Laporan (PRD §11). */
.report-toolbar {
  flex-wrap:wrap;
  align-items:flex-end
}

.report-toolbar label {
  display:grid;
  gap:4px;
  font-size:12px;
  color:var(--muted)
}

.report-actions {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:12px;
  padding:12px 16px
}

.report-preview {
  margin-top:16px
}

.report-grid th,.report-grid td {
  padding:4px 4px;
  text-align:center
}

.report-grid td:first-child,.report-grid th:first-child {
  text-align:left;
  white-space:nowrap
}

.report-grid .holiday {
  background:var(--navy-soft);
  color:var(--muted)
}

.report-card {
  padding:16px
}

@media print {
  body * {
    visibility:hidden
  }
  #report-preview,#report-preview * {
    visibility:visible
  }
  #report-preview {
    position:absolute;
    inset:0 auto auto 0;
    width:100%;
    box-shadow:none;
    border:0
  }
  .report-grid .holiday {
    background:var(--line)
  }
}

/* Gate controller stays separate from the TV display document. */
.gate-control-status,
.gate-dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.gate-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.master-row-actions {
  display:flex;
  gap:12px;
  flex-wrap:wrap
}

.master-dialog { max-width:650px }
.master-import-dialog { max-width:930px }

.master-fields {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
  border:0;
  padding:0;
  margin:0;
  min-width:0
}

.master-fields input,
.master-fields select { width:100% }
.master-field-wide { grid-column:1/-1 }

.master-import-inputs {
  display:flex;
  gap:16px;
  align-items:end;
  flex-wrap:wrap;
  margin:16px 0 8px
}

.master-import-preview { max-height:40vh; overflow:auto }

.master-import-preview thead {
  position:sticky;
  top:0
}

@media (max-width:580px) {
  .master-fields { grid-template-columns:1fr }
}

.calendar-grid {
  display:grid;
  grid-template-columns:repeat(7,minmax(0,1fr));
  gap:8px;
  padding:16px;
}

.calendar-label { text-align:center; font-size:12px }
.calendar-day { display:grid; align-content:start; gap:4px; min-width:0; min-height:65px; text-align:left }
.calendar-day small { overflow-wrap:anywhere; font-weight:400 }
.calendar-day.holiday { background:var(--neutral-bg) }
.calendar-day[aria-pressed="true"] { border-color:var(--navy); outline:1px solid var(--navy) }

.period-students {
  display:grid;
  gap:8px;
  max-height:180px;
  overflow:auto;
  padding:4px 0
}

.period-students label { margin:0 }
.master-fields input[type=checkbox] { width:auto }

@media (max-width:580px) {
  .calendar-grid { gap:4px; padding:8px }
  .calendar-day { padding:4px 4px; min-height:48px; text-align:center }
  .calendar-day small { font-size:12px }
}

.master-fields.single { grid-template-columns:1fr }
.schedule-view-bar { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin:12px 0 }
.schedule-view-bar label { margin:0 }
#schedule-edit-table input[type=time] { width:100%; min-width:92px }
#teacher-status-form { border-top:1px solid var(--line) }
.logo-row { display:flex; gap:16px; align-items:center; margin:8px 0 16px }
.school-logo { width:64px; height:64px; border-radius:var(--radius-sm); object-fit:contain; border:1px solid var(--line); background:var(--white) }
.school-logo.empty { display:inline-flex; align-items:center; justify-content:center; text-align:center; font-size:12px; color:var(--muted) }
.school-logo-img { object-fit:contain; background:var(--white); padding:4px }
.login-logo { display:block; width:56px; height:56px; object-fit:contain; margin:12px 0 4px }
.wizard-layout { min-height:100vh; display:grid; place-items:center; padding:24px }
.wizard-card { width:min(960px,100%) }
.wizard-steps { display:flex; flex-wrap:wrap; gap:8px; list-style:none; margin:0; padding:12px 24px 0; font-size:12px }
.wizard-steps li { padding:4px 12px; border-radius:999px; background:var(--neutral-bg); color:var(--muted) }
.wizard-steps li.is-current { background:var(--navy); color:var(--white) }
.wizard-steps li.is-done { background:var(--green-bg); color:var(--green) }
.wizard-card .settings-body > input, .wizard-card .settings-body > select { display:block; width:100%; max-width:420px; margin:4px 0 12px }
#wizard-schedule input[type=time] { width:100%; min-width:92px }
.wizard-actions { margin-top:16px }
