:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eff5ff;
  --ink: #17243b;
  --muted: #64748b;
  --line: #e9edf4;
  --paper: #fff;
  --canvas: #f6f8fc;
  --green: #19a176;
  --red: #e36b72;
  --purple: #8a79d8;
  --amber: #dca645;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
  line-height: 1.5;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
[hidden] {
  display: none !important;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button,
input,
select,
textarea {
  transition:
    background-color 0.16s,
    border-color 0.16s,
    box-shadow 0.16s,
    transform 0.16s;
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
a {
  color: var(--blue);
  text-decoration: none;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #9abafc;
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 29px;
  line-height: 1.25;
  font-weight: 720;
  letter-spacing: -1px;
}
h2 {
  font-size: 17px;
  letter-spacing: -0.3px;
}
h3 {
  font-size: 14px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.sr-only {
  position: absolute;
  clip: rect(0, 0, 0, 0);
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.shell {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  min-height: 100dvh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  background: var(--paper);
  border-right: 1px solid var(--line);
  padding: 32px 20px 18px;
  display: flex;
  flex-direction: column;
  z-index: 25;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 760;
  letter-spacing: -0.8px;
  padding: 0 5px;
}
.brand span span {
  color: var(--blue);
}
.brand small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.2px;
  color: var(--muted);
  margin-top: 1px;
  text-transform: uppercase;
}
.workspace-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin: 42px 14px 15px;
}
nav {
  display: grid;
  gap: 6px;
}
nav button {
  border: 0;
  background: transparent;
  padding: 12px 14px;
  color: var(--muted);
  text-align: left;
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 560;
  min-height: 44px;
}
nav button svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.65;
}
nav button:hover {
  background: var(--canvas);
  color: var(--blue);
}
nav button.active {
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 650;
}
nav button.active:after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue);
  margin-left: auto;
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 30px;
}
.school-badge {
  border-top: 1px solid var(--line);
  padding: 22px 3px 10px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.school-symbol {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  background: #f0f4fc;
  color: #57709f;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 11px;
}
.school-badge strong {
  font-size: 11px;
  display: block;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.school-badge small {
  font-size: 10px;
  color: var(--muted);
}
.logout {
  display: flex;
  justify-content: space-between;
  border: 0;
  background: none;
  width: 100%;
  text-align: left;
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
}
.logout:hover {
  color: var(--red);
  background: #fff8f8;
  border-radius: 8px;
}
.version {
  font-size: 10px;
  color: var(--muted);
  padding-left: 12px;
}
.workspace {
  min-width: 0;
}
.topbar {
  height: 83px;
  padding: 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 20px;
  background: var(--paper);
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.breadcrumb strong {
  font-weight: 550;
  color: var(--muted);
}
.divider {
  color: #cdd4df;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 22px;
}
select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  padding: 10px 12px;
  min-height: 44px;
  max-width: 100%;
}
select:hover,
input:hover,
textarea:hover {
  border-color: #c1cde1;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px #2563eb12;
  outline: none;
}
textarea {
  resize: vertical;
  min-height: 76px;
}
.topbar select {
  min-width: 135px;
  font-size: 12px;
  background: var(--canvas);
  padding: 8px 10px;
}
.profile-button {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  min-height: 44px;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 650;
  background: #e8effd;
  color: #4c70af;
  flex-shrink: 0;
}
.profile-text strong {
  display: block;
  font-size: 11px;
  font-weight: 650;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-text small {
  color: var(--muted);
  font-size: 10px;
}
.demo-badge {
  font-size: 10px;
  color: #a27826;
  background: #fff8e7;
  border: 1px solid #faeac6;
  border-radius: 5px;
  padding: 4px 7px;
}
main {
  padding: 32px 36px 20px;
  max-width: 1650px;
  margin: 0 auto;
  min-height: calc(100dvh - 140px);
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 28px;
}
.eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.7px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}
.page-head p {
  margin-top: 9px;
  font-size: 12px;
  color: var(--muted);
}
.head-actions,
.inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.primary,
.secondary,
.quiet,
.danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  padding: 10px 15px;
  font-size: 12px;
  font-weight: 600;
  min-height: 44px;
  white-space: nowrap;
}
.primary {
  background: var(--blue);
  border: 1px solid var(--blue);
  color: white;
  box-shadow: 0 3px 6px #2563eb12;
}
.primary:hover {
  background: var(--blue-dark);
  box-shadow: 0 4px 13px #2563eb28;
}
.secondary {
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
}
.secondary:hover {
  background: var(--canvas);
  border-color: #b8c9e9;
  color: var(--blue);
}
.quiet {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
}
.quiet:hover {
  background: var(--blue-soft);
  color: var(--blue);
}
.danger {
  background: #fff3f3;
  border: 1px solid #fae1e1;
  color: #c65b61;
}
button svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.date-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  padding: 11px 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 21px 22px;
  min-width: 0;
  box-shadow: 0 2px 5px #24365a02;
}
.stat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 7px;
}
.stat-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.stat-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
}
.stat-icon svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.stat-value {
  font-size: 30px;
  line-height: 1.1;
  font-weight: 710;
  letter-spacing: -1.1px;
}
.stat-bottom {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--muted);
  margin-top: 12px;
}
.stat-bottom strong {
  font-weight: 550;
  color: var(--green);
}
.blue {
  background: #edf4ff;
  color: var(--blue);
}
.green {
  background: #eaf8f2;
  color: var(--green);
}
.purple {
  background: #f2effd;
  color: var(--purple);
}
.amber {
  background: #fff7e8;
  color: var(--amber);
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(260px, 1fr);
  gap: 22px;
  margin-bottom: 22px;
}
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 0;
  overflow: hidden;
}
.panel-head {
  padding: 22px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}
.panel-head h2 {
  font-size: 14px;
  font-weight: 650;
}
.panel-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}
.panel-body {
  padding: 20px 24px 24px;
}
.legend {
  display: flex;
  gap: 13px;
  align-items: center;
  font-size: 10px;
  color: var(--muted);
  flex-wrap: wrap;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.chart {
  width: 100%;
  height: 205px;
  display: block;
  overflow: visible;
}
.chart text {
  font-family: inherit;
  font-size: 10px;
  fill: #a2adbd;
}
.chart line {
  stroke: #edf0f6;
  stroke-dasharray: 3 5;
}
.chart-caption {
  font-size: 10px;
  color: var(--muted);
  margin-top: 8px;
}
.status-overview {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 6px 0 24px;
}
.ring {
  width: 126px;
  height: 126px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  position: relative;
}
.ring:before {
  content: "";
  position: absolute;
  background: var(--paper);
  inset: 13px;
  border-radius: 50%;
}
.ring-label {
  position: relative;
  text-align: center;
}
.ring-label strong {
  font-size: 23px;
  display: block;
  letter-spacing: -0.6px;
}
.ring-label small {
  font-size: 9px;
  color: var(--muted);
}
.status-list {
  display: grid;
  gap: 10px;
  width: 100%;
  font-size: 11px;
  color: var(--muted);
}
.status-list div {
  display: flex;
  align-items: center;
  gap: 7px;
}
.status-list strong {
  margin-left: auto;
  color: #43516a;
  font-weight: 600;
}
.completion {
  border-top: 1px solid var(--line);
  padding-top: 17px;
}
.completion-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
}
.completion-label strong {
  color: var(--blue);
  font-weight: 600;
}
.progress-track {
  height: 5px;
  border-radius: 5px;
  background: var(--canvas);
  margin-top: 10px;
  overflow: hidden;
}
.progress-track span {
  display: block;
  height: 100%;
  background: #497eed;
  border-radius: 5px;
  transition: width 0.3s;
}
.filters {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--canvas);
}
.field {
  display: grid;
  gap: 6px;
  min-width: 145px;
}
.field label,
.form-field > span {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}
.field input,
.field select {
  font-size: 12px;
}
.filters .spacer {
  flex: 1;
}
.table-scroll {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}
th {
  text-align: left;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--canvas);
  padding: 13px 22px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 15px 22px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  vertical-align: middle;
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: var(--canvas);
}
td strong {
  font-weight: 600;
  color: #3c4d68;
  font-size: 11px;
}
td small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}
.class-chip {
  display: inline-grid;
  place-items: center;
  min-width: 35px;
  height: 32px;
  border-radius: 8px;
  font-size: 11px;
  color: #627aa7;
  background: #f1f5fc;
  font-weight: 650;
}
.name-cell {
  display: flex;
  align-items: center;
  gap: 11px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  font-size: 9px;
  border-radius: 5px;
  white-space: nowrap;
  font-weight: 550;
}
.badge.success {
  color: #21a079;
  background: #edf9f3;
}
.badge.pending {
  color: #bb984c;
  background: #fff9eb;
}
.badge.neutral {
  color: var(--muted);
  background: #f1f4fa;
}
.badge.error {
  color: #d0616e;
  background: #fff1f3;
}
.table-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 23px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: var(--muted);
}
.empty {
  padding: 42px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.empty svg {
  display: block;
  width: 30px;
  height: 30px;
  margin: 0 auto 12px;
  color: var(--muted);
  stroke: currentColor;
  fill: none;
  stroke-width: 1.3;
}
.notice {
  font-size: 11px;
  color: var(--muted);
  padding: 12px 15px;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.7;
}
.notice.warning {
  background: #fff9ec;
  border-color: #f3e7cb;
  color: #9e813f;
}
.notice.error {
  background: #fff3f4;
  border-color: #f8dee2;
  color: #bc606a;
}
.notice.success {
  background: #eefaf5;
  border-color: #d8efe4;
  color: #368d6c;
}
.attendance-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}
.segmented {
  display: inline-flex;
  gap: 5px;
}
.status-button {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  min-width: 44px;
  min-height: 44px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
}
.status-button:hover {
  border-color: #b7c9e7;
  transform: translateY(-1px);
}
.status-button[aria-pressed="true"][data-status="H"] {
  background: #e9f8f1;
  border-color: #73c8a4;
  color: #137a57;
}
.status-button[aria-pressed="true"][data-status="S"] {
  background: #f0edfc;
  border-color: #b5a5e8;
  color: #7353b0;
}
.status-button[aria-pressed="true"][data-status="I"] {
  background: #fff7e7;
  border-color: #e8cb86;
  color: #936c17;
}
.status-button[aria-pressed="true"][data-status="A"] {
  background: #fff0f1;
  border-color: #e9a6ad;
  color: #b04453;
}
.note-input {
  min-width: 150px;
  max-width: 230px;
  width: 100%;
  font-size: 11px;
  padding: 8px 10px;
  min-height: 35px;
  border-color: var(--line);
}
.sticky-save {
  position: sticky;
  bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 32px #1b3d7a0d;
  padding: 15px 22px;
  background: var(--paper);
  backdrop-filter: blur(14px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  z-index: 10;
  margin-top: 18px;
}
.sticky-save p {
  color: var(--muted);
  font-size: 11px;
}
.sticky-save strong {
  font-size: 12px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.form-field {
  display: grid;
  gap: 7px;
}
.form-field.full {
  grid-column: 1/-1;
}
.form-field input,
.form-field select {
  width: 100%;
  font-size: 12px;
}
.form-field small {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.5;
}
.check-label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
  min-height: 44px;
}
.check-label input {
  min-height: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}
.participant-list {
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--line);
  padding: 9px 12px;
  border-radius: 8px;
}
.participant-list .check-label {
  min-height: 30px;
}
.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(250px, 1fr);
  gap: 20px;
}
.settings-layout .panel + .panel {
  margin-top: 20px;
}
.code {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11px;
  overflow-wrap: anywhere;
  background: var(--canvas);
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.loading-state {
  padding: 60px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 10px;
  color: var(--muted);
  padding: 15px 36px 23px;
}
.icon-button {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 8px;
  min-height: 44px;
  min-width: 36px;
  color: var(--muted);
}
.mobile-only {
  display: none;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 0;
  max-width: 570px;
  width: calc(100% - 32px);
  box-shadow: 0 25px 100px #10254b30;
  color: var(--ink);
}
dialog::backdrop {
  background: #17243b55;
  backdrop-filter: blur(3px);
}
.dialog-heading {
  padding: 25px 28px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}
.dialog-heading h2 {
  font-size: 19px;
}
.dialog-heading p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}
.dialog-content {
  padding: 24px 28px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 28px;
  border-top: 1px solid var(--line);
  background: var(--canvas);
}
.form-error {
  font-size: 11px;
  color: #c1616b;
  min-height: 0;
  margin-top: 12px;
}
.toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  background: #22314a;
  color: white;
  border-radius: 9px;
  z-index: 60;
  box-shadow: 0 5px 25px #17243b25;
  font-size: 12px;
  max-width: calc(100% - 28px);
}
.auth-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 20% 10%, #eaf1ff 0, transparent 55%),
    radial-gradient(ellipse at 90% 95%, #eaf6f3 0, transparent 50%), var(--canvas);
  padding: 35px 20px;
}
.auth-card {
  max-width: 460px;
  width: 100%;
  padding: 36px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: 0 12px 60px #31518508;
}
.auth-card .brand {
  margin-bottom: 35px;
}
.auth-card h1 {
  font-size: 25px;
}
.auth-card > p {
  color: var(--muted);
  font-size: 12px;
  margin: 9px 0 25px;
}
.auth-card form {
  display: grid;
  gap: 17px;
}
.auth-card .primary {
  width: 100%;
  margin-top: 3px;
}
.auth-footer {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  margin-top: 24px;
}
.auth-card.setup {
  max-width: 600px;
}
.upload {
  border: 1px dashed #c8d8f1;
  border-radius: 9px;
  padding: 22px;
  text-align: center;
  background: var(--canvas);
  cursor: pointer;
  display: block;
  color: var(--muted);
}
.upload strong {
  display: block;
  font-size: 12px;
  color: #5b75a1;
  margin-bottom: 8px;
}
.weekdays {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.report-status {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  color: var(--muted);
  margin: 4px 0 18px;
}
.search-input {
  min-width: 210px;
  font-size: 12px;
}
.audit-detail {
  font-size: 10px;
  max-height: 160px;
  overflow: auto;
  white-space: pre-wrap;
  background: var(--canvas);
  padding: 12px;
  margin: 10px 0;
}
@media (min-width: 1600px) {
  main {
    padding-top: 40px;
  }
  .stat-card {
    padding: 26px;
  }
  .chart {
    height: 235px;
  }
}
@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }
  .sidebar {
    padding: 28px 15px 16px;
  }
  .topbar {
    padding: 0 24px;
  }
  main {
    padding: 28px 24px;
  }
  .stats-grid {
    gap: 12px;
  }
  .stat-card {
    padding: 18px 16px;
  }
  .dashboard-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(250px, 1fr);
    gap: 16px;
  }
  .status-overview {
    gap: 12px;
  }
  .ring {
    width: 108px;
    height: 108px;
  }
  .panel-body {
    padding: 18px;
  }
  .panel-head {
    padding: 20px 18px 0;
  }
  th,
  td {
    padding-left: 18px;
    padding-right: 18px;
  }
  .profile-text {
    display: none;
  }
}
@media (max-width: 950px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .status-overview {
    max-width: 400px;
    margin: 0 auto 24px;
  }
  .settings-layout {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .topbar-actions {
    gap: 12px;
  }
  .date-tag {
    display: none;
  }
}
@media (max-width: 700px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: fixed;
    width: 236px;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.2s;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-shade {
    position: fixed;
    inset: 0;
    background: #17243b55;
    z-index: 24;
  }
  .mobile-only {
    display: grid;
    place-items: center;
  }
  .topbar {
    height: 65px;
    padding: 0 16px;
    gap: 10px;
  }
  .breadcrumb > span {
    display: none;
  }
  .breadcrumb {
    gap: 10px;
  }
  .breadcrumb strong {
    font-size: 11px;
  }
  .topbar-actions {
    gap: 10px;
  }
  .topbar select {
    min-width: 115px;
    font-size: 10px;
    padding: 7px;
    min-height: 35px;
  }
  .profile-button > span:last-child {
    display: none;
  }
  .avatar {
    width: 31px;
    height: 31px;
    font-size: 10px;
  }
  .demo-badge {
    font-size: 8px;
    padding: 3px 5px;
  }
  main {
    padding: 24px 16px 12px;
  }
  .page-head {
    margin-bottom: 21px;
    gap: 10px;
    align-items: flex-start;
  }
  h1 {
    font-size: 24px;
  }
  .page-head p {
    font-size: 11px;
    max-width: 250px;
  }
  .head-actions .secondary,
  .head-actions .primary {
    padding: 9px 11px;
    font-size: 10px;
  }
  .head-actions {
    gap: 6px;
  }
  .stat-card {
    padding: 16px;
  }
  .stat-value {
    font-size: 28px;
  }
  .stat-bottom {
    font-size: 9px;
    gap: 4px;
  }
  .stat-label {
    font-size: 10px;
  }
  .stat-icon {
    width: 28px;
    height: 28px;
  }
  .stat-top {
    margin-bottom: 9px;
  }
  .stats-grid {
    gap: 10px;
    margin-bottom: 17px;
  }
  .dashboard-grid {
    gap: 17px;
  }
  .panel {
    border-radius: 10px;
  }
  .panel-head {
    padding: 18px 16px 0;
  }
  .panel-head h2 {
    font-size: 13px;
  }
  .panel-body {
    padding: 18px 16px;
  }
  .legend {
    gap: 8px;
    font-size: 9px;
  }
  .filters {
    padding: 16px;
    gap: 12px;
  }
  .field {
    min-width: 0;
    flex: 1 1 140px;
  }
  .field input,
  .field select {
    width: 100%;
  }
  .search-input {
    width: 100%;
    min-width: 0;
  }
  .filters .spacer {
    display: none;
  }
  .filters > .primary,
  .filters > .secondary {
    flex: 1;
  }
  th,
  td {
    padding: 13px 16px;
  }
  .table-meta {
    padding: 13px 16px;
  }
  .attendance-info {
    padding: 16px;
    align-items: flex-start;
  }
  .attendance-table thead {
    display: none;
  }
  .attendance-table tbody {
    display: block;
  }
  .attendance-table tr {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 15px 16px;
    border-bottom: 1px solid var(--line);
    gap: 12px;
  }
  .attendance-table td {
    border: 0;
    padding: 0;
  }
  .attendance-table td:first-child {
    grid-column: 1/-1;
  }
  .attendance-table td:last-child {
    grid-column: 1/-1;
  }
  .note-input {
    max-width: none;
    font-size: 12px;
    min-height: 40px;
  }
  .segmented {
    gap: 8px;
  }
  .status-button {
    min-width: 44px;
    min-height: 44px;
  }
  .status-clear {
    margin-left: auto;
  }
  .sticky-save {
    bottom: 9px;
    padding: 13px 14px;
    flex-wrap: wrap;
  }
  .sticky-save .inline-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .sticky-save p {
    font-size: 10px;
  }
  .form-grid {
    gap: 13px;
  }
  .dialog-content {
    padding: 22px 20px;
  }
  .dialog-heading {
    padding: 22px 20px 18px;
  }
  .dialog-actions {
    padding: 16px 20px;
  }
  .dialog-heading h2 {
    font-size: 17px;
  }
  .page-footer {
    padding: 16px;
    font-size: 9px;
  }
  .auth-card {
    padding: 28px 24px;
  }
  .auth-card.setup .form-grid {
    grid-template-columns: 1fr;
  }
  .stat-bottom strong {
    font-size: 9px;
  }
  .chart {
    height: 185px;
  }
  .empty {
    padding: 30px 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
@media print {
  .sidebar,
  .topbar,
  .page-footer,
  .head-actions,
  .filters,
  .sticky-save,
  .toast,
  .no-print {
    display: none !important;
  }
  .shell {
    display: block;
  }
  main {
    padding: 0;
  }
  .panel {
    box-shadow: none;
    break-inside: avoid;
  }
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  body {
    background: var(--paper);
  }
  th,
  td {
    font-size: 9px;
    padding: 7px 10px;
  }
  .table-scroll {
    overflow: visible;
  }
  h1 {
    font-size: 22px;
  }
  .page-head p {
    max-width: none;
  }
  .report-status {
    display: block;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* RuangHadir 1.1: saturated solid accents, shared light/dark surfaces. */
:root {
  color-scheme: light;
  --blue: #1d4ed8; --blue-dark: #1e40af; --blue-soft: #e0e7ff;
  --ink: #0f172a; --muted: #475569; --line: #cbd5e1;
  --paper: #ffffff; --canvas: #f1f5f9;
  --green: #047857; --purple: #6d28d9; --amber: #92400e; --red: #be123c;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --blue: #93b4ff; --blue-dark: #bed0ff; --blue-soft: #233556;
  --ink: #f1f5f9; --muted: #bdcadd; --line: #384860;
  --paper: #162236; --canvas: #0b1220;
  --green: #6ee7b7; --purple: #c4b5fd; --amber: #fcd34d; --red: #fda4af;
}
.sidebar { background: #10213d; color: #fff; overflow-y: auto; padding-top:24px; }
.sidebar .brand, .sidebar .brand span span, .sidebar .school-badge strong { color:#fff; }
.sidebar .brand small, .sidebar .workspace-label, .sidebar .school-badge small, .sidebar .version {color:#b8c8e2;}
.sidebar nav button, .sidebar .logout {color:#d4e0f3;}
.sidebar nav button:hover {background:#203c63;color:#fff;}
.sidebar nav button.active {background:#1d4ed8;color:#fff;}
.sidebar nav button.active:after {background:#fff;}
.sidebar .school-badge {border-color:#334867;}
.sidebar .school-symbol {background:#1d4ed8;color:#fff;}
.workspace-label {margin-top:28px;}
nav {gap:4px;}
nav button {padding:10px 12px;}
.sidebar-bottom {padding-top:20px;}
.topbar {background:var(--paper);}
.breadcrumb strong, td, td strong, .field label, .stat-label, .stat-bottom, .table-meta, .panel-head p {color:var(--muted);}
td strong {color:var(--ink);font-size:12px;}
th {font-size:11px;}
.badge {font-size:11px;font-weight:650;padding:4px 9px;}
.badge.success {background:#047857;color:#fff;}
.badge.pending {background:#92400e;color:#fff;}
.badge.error {background:#be123c;color:#fff;}
.badge.neutral {background:#475569;color:#fff;}
.primary {background:#1d4ed8;color:#fff;box-shadow:none;}
.primary:hover {background:#1e40af;}
.secondary, .icon-button, .profile-button {background:var(--paper);color:var(--ink);border-color:var(--line);}
.secondary:hover, .profile-button:hover {background:var(--blue-soft);}
.quiet {color:var(--blue);}
.danger-text {color:var(--red);}
.stat-icon.blue {background:#1d4ed8;color:#fff;}
.stat-icon.green {background:#047857;color:#fff;}
.stat-icon.purple {background:#6d28d9;color:#fff;}
.stat-icon.amber {background:#92400e;color:#fff;}
.stat-card {border-top:3px solid #1d4ed8;}
.stat-label {font-size:12px;font-weight:600;}
.stat-bottom {font-size:11px;}
.panel {box-shadow:0 2px 6px #00000008;}
.panel-head h2 {font-size:16px;}
input, select, textarea {color:var(--ink);background:var(--paper);border-color:var(--line);min-width:0;}
input::placeholder, textarea::placeholder {color:var(--muted);opacity:1;}
input[type="color"] {min-height:44px;width:100%;padding:5px;cursor:pointer;}
.filters {flex-wrap:wrap;gap:16px;}
.search-input {flex:1;min-width:200px;max-width:420px;}
.class-chip {padding:5px 10px;height:auto;min-height:32px;max-width:240px;overflow-wrap:anywhere;background:#1d4ed8;color:#fff;}
.inline-actions {flex-wrap:wrap;gap:8px;}
.table-meta {gap:16px;flex-wrap:wrap;}
.table-tools {display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:16px 24px;}
.table-tools input {flex:1;min-width:160px;max-width:380px;}
.table-tools span {color:var(--muted);font-size:12px;margin-right:auto;}
.table-tools .secondary {padding:7px 10px;min-height:36px;}
.theme-switch {position:fixed;bottom:12px;right:16px;z-index:30;}
.theme-switch select {font-size:12px;min-height:38px;box-shadow:0 2px 10px #0002;}
.page-footer {padding-bottom:64px;}
.auth-screen {background:var(--canvas);}
.auth-card, dialog, .dialog-actions {background:var(--paper);color:var(--ink);}
.auth-card h1 {font-size:27px;}
.notice {background:var(--blue-soft);border-color:var(--line);color:var(--ink);}
.notice.warning {background:#92400e;color:#fff;border-color:#92400e;}
.notice.error {background:#9f1239;color:#fff;border-color:#9f1239;}
.notice.success {background:#047857;color:#fff;border-color:#047857;}
.status-button {background:var(--paper);border-color:var(--line);color:var(--muted);}
.status-button[aria-pressed="true"][data-status="H"] {background:#047857;color:#fff;}
.status-button[aria-pressed="true"][data-status="S"] {background:#6d28d9;color:#fff;}
.status-button[aria-pressed="true"][data-status="I"] {background:#92400e;color:#fff;}
.status-button[aria-pressed="true"][data-status="A"] {background:#be123c;color:#fff;}
.save-bar {background:var(--paper);border-color:var(--line);}
:root[data-theme="dark"] .avatar, :root[data-theme="dark"] .code,
:root[data-theme="dark"] .audit-detail {background:#233556;color:var(--ink);}
:root[data-theme="dark"] .chart-grid {stroke:var(--line);}
:root[data-theme="dark"] .chart-label {fill:var(--muted);}
@media(max-width:700px) {
  .page-head {flex-direction:column;gap:16px;}
  .head-actions {width:100%;flex-wrap:wrap;}
  .head-actions .primary,.head-actions .secondary {font-size:12px;min-height:40px;}
  .filters {padding:18px 16px;gap:12px;}
  .filters .field {flex:1;min-width:140px;}
  .search-input {max-width:none;width:100%;}
  .table-tools {padding:14px 16px;}
  .table-tools input {max-width:none;flex-basis:100%;}
  .theme-switch {bottom:8px;right:8px;}
  .theme-switch select {font-size:11px;}
  .demo-badge {display:none;}
  .panel-head {flex-wrap:wrap;}
}
@media print {
  :root {color-scheme:light;--paper:#fff;--canvas:#fff;--ink:#000;--muted:#333;--line:#bbb;}
  .no-print {display:none!important;}
  tbody tr[hidden] {display:table-row!important;}
}

.chart text {fill:var(--muted);}
.chart line {stroke:var(--line);}
.ring-label {background:var(--paper);}
:root[data-theme="dark"] .form-error {color:#fda4af;}

.topbar {position:sticky;top:0;z-index:20;}
.theme-switch {top:16px;bottom:auto;}
.theme-switch.in-workspace {position:static;}
.theme-switch.in-workspace select {box-shadow:none;max-width:120px;}
@media(max-width:700px) {
  table:not(.attendance-table) {min-width:760px;}
  #studentsTable table {min-width:950px;}
  #studentsTable .name-cell {min-width:180px;}
  #studentsTable .inline-actions {flex-wrap:nowrap;}
  #studentsTable td {white-space:nowrap;}
  .topbar-actions {gap:8px;}
  .theme-switch.in-workspace select {min-width:74px;max-width:85px;}
  .topbar #yearSelect {min-width:104px;max-width:116px;}
}
@media(max-width:400px) {.breadcrumb strong {display:none;}}
svg:not(.chart) {width:18px;height:18px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;}
.date-tag {display:flex;align-items:center;gap:8px;white-space:nowrap;}
