/* JachiON mobile-first interface, August 2026 */
:root {
  --brand: #33498f;
  --brand-deep: #26396f;
  --brand-bright: #5873cf;
  --brand-soft: #eef2ff;
  --accent: #138f83;
  --accent-soft: #e8f7f4;
  --warning: #b76d16;
  --warning-soft: #fff5e5;
  --danger: #c64d5a;
  --danger-soft: #fff0f2;
  --success: #157a58;
  --success-soft: #eaf7f1;
  --page: #f3f5f9;
  --surface: #ffffff;
  --surface-soft: #f7f8fb;
  --surface-raised: #ffffff;
  --ink: #152033;
  --muted: #687386;
  --line: #dfe4ec;
  --line-strong: #cdd5e1;
  --shadow-sm: 0 3px 12px rgba(31, 42, 68, 0.06);
  --shadow-md: 0 14px 38px rgba(31, 42, 68, 0.11);
  --focus: 0 0 0 3px rgba(51, 73, 143, 0.17);
  --radius-panel: 12px;
  --radius-card: 8px;
  --radius-control: 8px;
  --topbar-height: 72px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --brand: #728be0;
  --brand-deep: #425cae;
  --brand-bright: #91a5ef;
  --brand-soft: #202a48;
  --accent: #49b7aa;
  --accent-soft: #163c3a;
  --warning: #e1a95f;
  --warning-soft: #3d301e;
  --danger: #ec8390;
  --danger-soft: #42252d;
  --success: #53bd91;
  --success-soft: #183a31;
  --page: #0d121c;
  --surface: #151c29;
  --surface-soft: #1b2433;
  --surface-raised: #202a3a;
  --ink: #f3f6fb;
  --muted: #9ca8ba;
  --line: #2b3546;
  --line-strong: #3b475b;
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.16);
  --shadow-md: 0 18px 44px rgba(0, 0, 0, 0.3);
  --focus: 0 0 0 3px rgba(114, 139, 224, 0.24);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--page);
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--brand) 4%, transparent), transparent 260px),
    var(--page);
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

.app-icon {
  width: 1em;
  height: 1em;
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
  filter: invert(28%) sepia(20%) saturate(1832%) hue-rotate(190deg) brightness(91%) contrast(89%);
}

.inline-action-icon {
  display: inline-block;
  vertical-align: -0.14em;
  margin-right: 4px;
}

button,
a,
summary,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.safe-area-top {
  position: fixed;
  inset: 0 0 auto;
  z-index: 120;
  height: env(safe-area-inset-top);
  background: var(--surface);
  pointer-events: none;
}

/* Login */
.login-shell {
	min-height: 100dvh;
	display: grid;
	place-items: center;
	padding: calc(24px + env(safe-area-inset-top)) 18px calc(24px + env(safe-area-inset-bottom));
}

.login-panel {
  position: relative;
  width: min(100%, 410px);
  padding: 32px 28px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 16px;
  box-shadow: 0 28px 80px rgba(10, 18, 42, 0.28);
  text-align: center;
}

.login-theme-toggle {
  position: absolute;
  top: 14px;
  right: 14px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
}

.login-panel .hero-logo {
  width: 76px;
  height: 76px;
  margin: 0 auto 14px;
  object-fit: contain;
  filter: drop-shadow(0 7px 13px rgba(29, 45, 96, 0.15));
}

.login-panel .school-name {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.login-panel h1 {
  margin: 5px 0 8px;
  color: var(--ink);
  font-size: 32px;
  line-height: 1.2;
}

.login-panel > p {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.login-panel .stack {
  gap: 14px;
  text-align: left;
}

/* Shell */
.app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 226px minmax(0, 1fr);
  grid-template-rows: var(--topbar-height) minmax(0, 1fr);
  color: var(--ink);
  background: var(--page);
}

.topbar {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: 0;
  z-index: 90;
  width: 100%;
  max-width: none;
  min-height: var(--topbar-height);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 26px;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 91%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(1.2);
}

.topbar > div {
  min-width: 0;
}

.topbar-logo {
  display: none;
}

.topbar-title {
  min-width: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 7px 10px;
}

.topbar-school {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.topbar .kicker {
  color: var(--brand);
  font-size: 11px;
  font-weight: 900;
}

.topbar h2 {
  margin: 0;
  color: var(--ink);
  font-size: 21px;
  font-weight: 900;
  line-height: 1.1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.topbar .top-action-button {
  position: relative;
  min-width: 76px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 13px;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: none;
  font-size: 12px;
  font-weight: 850;
}

.topbar .top-action-button:hover {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand) 25%, var(--line));
}

.top-notification-badge,
.nav-badge {
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  color: #fff;
  background: var(--danger);
  border: 2px solid var(--surface);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
}

.top-notification-badge {
  position: absolute;
  top: -5px;
  right: -4px;
}

.sidebar {
  grid-column: 1;
  grid-row: 1 / 3;
  position: sticky;
  top: 0;
  z-index: 100;
  width: 226px;
  height: 100dvh;
  padding: 0;
  color: #eef3ff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 46%),
    #17213a;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.sidebar > div {
  width: 100%;
  height: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 14px 16px;
  overflow: hidden;
}

.app-brand {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.app-brand .school-logo {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  object-fit: contain;
}

.app-brand > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.app-brand strong {
  color: #fff;
  font-size: 14px;
  white-space: nowrap;
}

.app-brand span {
  color: #9eacd0;
  font-size: 11px;
  font-weight: 700;
}

.user-box {
  min-height: 74px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 12px;
  color: #fff;
  background: linear-gradient(145deg, rgba(116, 143, 224, 0.2), rgba(255, 255, 255, 0.055));
  border: 1px solid rgba(173, 190, 239, 0.18);
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
}

.user-box:hover {
  background: linear-gradient(145deg, rgba(116, 143, 224, 0.28), rgba(255, 255, 255, 0.08));
}

.user-box strong {
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
}

.user-box-detail {
  color: #aab7d7;
  font-size: 10px;
  font-weight: 750;
}

.nav-list {
  width: 100%;
  display: grid;
  align-content: start;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.nav-list button {
  position: relative;
  width: 100%;
  min-height: 46px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  justify-content: stretch;
  gap: 9px;
  padding: 7px 12px;
  color: #b8c2db;
  background: transparent;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.nav-list button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.nav-list button.active {
  color: #fff;
  background: linear-gradient(135deg, #3f57a3, #5873cf);
  box-shadow: 0 8px 20px rgba(29, 48, 109, 0.32);
}

.nav-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  color: currentColor;
  font-size: 16px;
}

.nav-icon .app-icon {
  width: 18px;
  height: 18px;
}

.nav-list button.active .nav-icon {
  background: rgba(255, 255, 255, 0.14);
}

.nav-label-full {
  display: block;
}

.nav-label-short {
  display: none;
}

.nav-list .nav-badge {
  position: static;
  border-color: #263457;
}

.sidebar-helper {
  width: 100%;
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding: 12px;
  color: #dce5fb;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
}

.sidebar-helper-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-helper-head span {
  color: #9caacc;
  font-size: 10px;
  font-weight: 800;
}

.sidebar-helper-head strong {
  color: #fff;
  font-size: 12px;
}

.sidebar-helper-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.sidebar-helper-grid button {
  min-width: 0;
  min-height: 46px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 5px;
  color: #cbd6f1;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 8px;
}

.sidebar-helper-grid span {
  font-size: 9px;
  font-weight: 750;
}

.sidebar-helper-grid strong {
  font-size: 14px;
}

.desktop-download-card {
  min-height: 52px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  color: #e5edff;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  text-decoration: none;
}

.desktop-download-card > span {
  grid-row: 1 / 3;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.desktop-download-card strong {
  font-size: 11px;
}

.desktop-download-card small {
  color: #99a8ca;
  font-size: 9px;
}

.content {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  max-width: none;
  min-width: 0;
  padding: 24px clamp(20px, 3vw, 44px) 48px;
  color: var(--ink);
  background: transparent;
}

.view {
  width: min(100%, 1240px);
  display: grid;
  gap: 16px;
  margin: 0 auto;
}

/* Reusable surfaces */
.panel,
.school-basic-card,
.budget-card,
.home-summary-card,
.approval-item,
.entity-card,
.date-group,
.student-card,
.detail-item,
.stat,
.status-group,
.teacher-table-wrap,
.student-grade-section,
.org-department,
.uniform-permit-panel,
.uniform-permit-form {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-sm);
}

.panel {
  position: relative;
  padding: 22px;
}

.panel::before,
.panel-head h3::before,
.quick-card::before,
.quick-card::after {
  display: none !important;
}

.panel-head {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 18px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
}

.panel-head > div {
  min-width: 0;
}

.panel h3,
.panel-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
  font-weight: 900;
  line-height: 1.35;
}

.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.muted,
.item-meta,
.item-body,
.empty,
.loading,
.detail-item span,
.stat span {
  color: var(--muted);
}

.empty,
.loading {
  min-height: 96px;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--surface-soft);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-card);
  text-align: center;
}

.grid {
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stack {
  gap: 14px;
}

label {
  min-width: 0;
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

input,
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 11px 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  box-shadow: none;
}

textarea {
  min-height: 112px;
  line-height: 1.55;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 78%, transparent);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: var(--focus);
}

input[type="date"],
input[type="time"] {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.primary,
.secondary,
.ghost,
.danger,
.text-button,
.icon-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: var(--radius-control);
  box-shadow: none;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
}

.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand-bright));
  border: 1px solid transparent;
  box-shadow: 0 7px 16px color-mix(in srgb, var(--brand) 24%, transparent);
}

.primary:hover {
  filter: brightness(1.05);
}

.secondary {
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line));
}

.ghost,
.text-button {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
}

.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid color-mix(in srgb, var(--danger) 28%, var(--line));
}

.actions,
.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar > input,
.toolbar > select {
  flex: 1 1 180px;
}

/* Tabs and filters */
.tabs,
.sub-tabs,
.panel > .tabs:first-child,
.duty-filter,
.theme-toggle {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 14px;
  padding: 5px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: none;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar,
.sub-tabs::-webkit-scrollbar {
  display: none;
}

.tabs button,
.sub-tabs button,
.duty-filter button,
.theme-toggle button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 14px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  box-shadow: none;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.tabs button.active,
.sub-tabs button.active,
.duty-filter button.active,
.theme-toggle button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand-bright));
  box-shadow: 0 5px 14px color-mix(in srgb, var(--brand) 20%, transparent);
}

.status-filter {
  display: grid;
  gap: 9px;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-row > span {
  min-width: 48px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.filter-row button {
  min-height: 34px;
  padding: 6px 11px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
}

.filter-row button.active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

/* Home */
.home-view {
  gap: 16px !important;
}

.school-home-top,
.school-home-top.home-overview {
  display: block !important;
}

.home-command-center {
  position: relative;
  min-height: 0 !important;
  display: grid;
  gap: 20px;
  padding: 26px !important;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 38%),
    linear-gradient(120deg, #26396f 0%, #33498f 52%, #5873cf 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(32, 50, 107, 0.22);
  overflow: hidden;
}

.home-command-center::before {
  content: "";
  position: absolute;
  right: -84px;
  top: -120px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 66%);
  pointer-events: none;
}

.home-command-center::after {
  display: none !important;
}

.home-command-center > * {
  position: relative;
  z-index: 1;
}

.home-command-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
}

.home-command-head .today-label {
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  color: rgba(255, 255, 255, 0.86) !important;
  background: rgba(13, 22, 54, 0.22) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
}

.home-command-head h3 {
  margin: 10px 0 5px;
  color: #fff;
  font-size: 30px;
  font-weight: 950;
  line-height: 1.2;
}

.home-command-head p {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
}

.home-command-head .home-welcome-logo {
  width: 92px !important;
  height: 92px !important;
  object-fit: contain;
  filter: drop-shadow(0 9px 18px rgba(16, 25, 59, 0.24));
}

.home-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px !important;
}

.home-metric {
  min-width: 0;
  min-height: 104px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-content: center;
  align-items: center;
  gap: 3px 9px;
  padding: 13px !important;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 9px;
  box-shadow: none;
  backdrop-filter: blur(8px);
  text-align: left;
}

.home-metric-icon {
  grid-row: 1 / 3;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  font-size: 17px;
}

.home-metric span:not(.home-metric-icon) {
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 800;
}

.home-metric strong {
  min-width: 0;
  color: #fff;
  font-size: 17px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-metric small {
  grid-column: 1 / -1;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.school-basic-card {
  padding: 22px;
}

.school-basic-head {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.school-basic-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--brand-soft);
  border-radius: 8px;
  font-size: 22px;
}

.school-basic-head small {
  color: var(--brand);
  font-size: 10px;
  font-weight: 850;
}

.school-basic-head h3 {
  margin: 2px 0 6px;
  color: var(--ink);
  font-size: 18px;
}

.school-basic-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.school-basic-tags span {
  padding: 3px 7px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 750;
}

.school-basic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 14px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.school-basic-grid > div {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 13px;
  background: var(--surface);
}

.school-basic-grid > div.wide {
  grid-column: span 4;
}

.school-basic-grid span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.school-basic-grid strong {
  min-width: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

/* Lists and approvals */
.notice-list,
.approval-list,
.entity-list,
.detail-list,
.stats,
.people-list {
  display: grid;
  gap: 9px;
}

.notice-item,
.approval-item,
.entity-card,
.date-group,
.student-card,
.detail-item,
.stat {
  padding: 14px;
}

.notice-item {
  border: 1px solid var(--line) !important;
}

.notice-item .list-row {
  min-height: 52px;
  padding: 0;
}

.item-title {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.item-body {
  font-size: 12px;
  line-height: 1.55;
}

.item-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 9px;
  font-size: 10px;
}

.badge {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
}

.badge.pending,
.badge.hold,
.badge.blue {
  color: var(--brand);
  background: var(--brand-soft);
}

.badge.approved {
  color: var(--success);
  background: var(--success-soft);
}

.badge.rejected {
  color: var(--danger);
  background: var(--danger-soft);
}

.approval-item .actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.approval-item .actions > button {
  width: 100%;
}

.entity-card summary {
  min-height: 50px;
  padding: 0;
  color: var(--ink);
  cursor: pointer;
}

.entity-edit {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* Tables */
.table-wrap,
.teacher-table-wrap {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: none;
  overflow: auto;
}

table {
  width: 100%;
  color: var(--ink);
  background: var(--surface);
  border-collapse: collapse;
}

th,
td {
  padding: 11px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  text-align: center;
  vertical-align: middle;
}

th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 10px;
  font-weight: 850;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: color-mix(in srgb, var(--brand-soft) 55%, var(--surface));
}

tr.selected td,
.student-card.selected {
  background: var(--brand-soft);
}

.student-grade-section {
  padding: 16px;
  box-shadow: none;
}

.student-grade-head,
.student-class-column header {
  color: var(--ink);
  background: var(--surface-soft);
  border-color: var(--line);
}

.student-class-grid {
  gap: 10px;
}

.student-class-column {
  border-color: var(--line);
  border-radius: 8px;
  overflow: hidden;
}

/* Calendar */
.duty-calendar-panel {
  overflow: hidden;
}

.duty-calendar-toolbar {
  gap: 8px;
}

.duty-calendar-nav,
.duty-calendar-today {
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.duty-calendar-weekdays,
.duty-calendar-grid {
  border-color: var(--line);
}

.duty-calendar-day {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.duty-calendar-day.is-outside {
  background: var(--surface-soft);
  opacity: 0.64;
}

.duty-calendar-day.is-selected {
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 2px var(--brand);
}

.calendar-legend > span,
.calendar-detail-item {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
  box-shadow: none;
}

/* Council organization */
.org-department {
  padding: 16px;
  box-shadow: none;
}

.org-member {
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.org-member.is-executive {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand-bright));
  border-color: transparent;
}

/* Popups and notification drawer */
.toast {
  z-index: 2600;
  max-width: min(420px, calc(100vw - 28px));
  padding: 12px 16px;
  color: #fff;
  background: #182237;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
}

.notification-layer,
.app-popup-layer,
.admin-reauth-layer {
  z-index: 2300;
}

.notification-panel,
.app-popup-panel,
.admin-reauth-panel {
  color: var(--ink);
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
}

.notification-item,
.popup-admin-item,
.inline-check {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.notification-item.unread {
  background: var(--brand-soft);
}

.app-popup-image {
  border-radius: 8px;
}

.app-popup-actions {
  gap: 8px;
}

.app-popup-content .content-link,
.popup-admin-preview .content-link {
  color: var(--brand);
  font-weight: 850;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.app-popup-content .content-link:hover,
.popup-admin-preview .content-link:hover {
  color: var(--brand-bright);
}

/* Dark normalization */
:root[data-theme="dark"] body,
:root[data-theme="dark"] .app-shell,
:root[data-theme="dark"] .content,
:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .school-basic-card,
:root[data-theme="dark"] .notice-item,
:root[data-theme="dark"] .approval-item,
:root[data-theme="dark"] .entity-card,
:root[data-theme="dark"] .date-group,
:root[data-theme="dark"] .student-card,
:root[data-theme="dark"] .detail-item,
:root[data-theme="dark"] .stat,
:root[data-theme="dark"] .status-group,
:root[data-theme="dark"] .student-grade-section,
:root[data-theme="dark"] .teacher-table-wrap,
:root[data-theme="dark"] table,
:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
  color: var(--ink);
  background-color: var(--surface);
  border-color: var(--line);
}

:root[data-theme="dark"] .safe-area-top,
:root[data-theme="dark"] .topbar {
  background-color: var(--surface);
}

:root[data-theme="dark"] .panel h3,
:root[data-theme="dark"] .panel-head h3,
:root[data-theme="dark"] .item-title,
:root[data-theme="dark"] .detail-item strong,
:root[data-theme="dark"] label,
:root[data-theme="dark"] th,
:root[data-theme="dark"] td {
  color: var(--ink);
}

:root[data-theme="dark"] th,
:root[data-theme="dark"] .status-filter,
:root[data-theme="dark"] .empty,
:root[data-theme="dark"] .loading {
  background: var(--surface-soft);
}

/* Tablet */
@media (max-width: 1040px) and (min-width: 761px) {
  .app-shell {
    grid-template-columns: 196px minmax(0, 1fr);
  }

  .sidebar {
    width: 196px;
  }

  .sidebar > div {
    padding-inline: 11px;
  }

  .content {
    padding-inline: 20px;
  }

  .home-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .school-basic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .school-basic-grid > div.wide {
    grid-column: span 2;
  }
}

/* Mobile app */
@media (max-width: 760px) {
  :root {
    --topbar-height: 66px;
  }

  html,
  body {
    background: var(--page);
  }

  body {
    padding: 0;
  }

  .app-shell {
    min-height: 100dvh;
    display: block;
    padding: 0;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 110;
    min-height: calc(var(--topbar-height) + env(safe-area-inset-top));
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: calc(8px + env(safe-area-inset-top)) calc(14px + env(safe-area-inset-right)) 8px calc(14px + env(safe-area-inset-left));
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(20px) saturate(1.25);
  }

  #menuButton,
  .topbar-logo,
  .topbar-school,
  .topbar .kicker {
    display: none !important;
  }

  .topbar-title {
    display: flex;
    align-items: center;
  }

  .topbar h2 {
    font-size: 20px;
    line-height: 1.2;
  }

  .topbar-actions {
    gap: 6px !important;
  }

  .topbar .top-action-button {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    border-radius: 999px;
    font-size: 0;
  }

  .topbar .top-action-button > span:first-child {
    font-size: 16px;
  }

  .topbar .top-action-button > span:nth-child(2) {
    display: none;
  }

  .top-notification-badge {
    top: -4px;
    right: -5px;
    border-color: var(--surface);
    font-size: 9px !important;
  }

  .content {
    width: 100%;
    padding: 14px calc(14px + env(safe-area-inset-right)) calc(84px + env(safe-area-inset-bottom)) calc(14px + env(safe-area-inset-left));
  }

  .view {
    width: 100%;
    gap: 12px;
  }

  .sidebar {
    position: fixed;
    inset: auto 0 0;
    z-index: 120;
    width: 100%;
    height: auto;
    padding: 6px calc(7px + env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) calc(7px + env(safe-area-inset-left));
    color: var(--muted);
    background: color-mix(in srgb, var(--surface) 95%, transparent);
    border: 0;
    border-top: 1px solid var(--line);
    box-shadow: 0 -10px 30px rgba(20, 29, 50, 0.1);
    backdrop-filter: blur(22px) saturate(1.3);
    overflow: visible;
  }

  .sidebar > div {
    width: 100%;
    height: auto;
    display: block;
    padding: 0;
    overflow: visible;
  }

  .app-brand,
  .user-box,
  .sidebar-helper,
  .desktop-download-card {
    display: none !important;
  }

  .nav-list {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
  }

  .nav-list button {
    width: 100%;
    min-width: 0;
    min-height: 54px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px 1px;
    color: var(--muted);
    background: transparent;
    border-radius: 9px;
    font-size: 9px;
    text-align: center;
  }

  .nav-list button:hover {
    color: var(--brand);
    background: transparent;
  }

  .nav-list button.active {
    color: #fff;
    background: linear-gradient(145deg, var(--brand-deep), var(--brand-bright));
    box-shadow: 0 6px 15px color-mix(in srgb, var(--brand) 24%, transparent);
  }

  .nav-icon {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    background: transparent !important;
    border-radius: 0;
    font-size: 17px;
    line-height: 1;
  }

  .nav-label-full {
    display: none;
  }

  .nav-label-short {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-list .nav-badge {
    position: absolute;
    top: 1px;
    right: max(1px, calc(50% - 24px));
    min-width: 17px;
    height: 17px;
    border-color: var(--surface);
  }

  .panel,
  .school-basic-card {
    padding: 16px;
    border-radius: 11px;
    box-shadow: none;
  }

  .panel-head {
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
  }

  .panel h3,
  .panel-head h3 {
    font-size: 17px;
  }

  .panel-head p {
    font-size: 11px;
  }

  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }

  .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .actions > button,
  .actions > a {
    width: 100%;
  }

  .actions > :only-child,
  .actions > .primary:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .toolbar > * {
    width: 100%;
  }

  input,
  select,
  textarea {
    min-height: 48px;
    font-size: 16px;
  }

  textarea {
    min-height: 106px;
  }

  .primary,
  .secondary,
  .ghost,
  .danger {
    min-height: 46px;
  }

  .tabs,
  .sub-tabs,
  .panel > .tabs:first-child,
  .duty-filter,
  .theme-toggle {
    min-height: 49px;
    margin-bottom: 12px;
    padding: 5px;
  }

  .tabs button,
  .sub-tabs button,
  .duty-filter button,
  .theme-toggle button {
    min-height: 38px;
    padding-inline: 13px;
  }

  .filter-row {
    flex-wrap: nowrap;
    padding-bottom: 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .filter-row::-webkit-scrollbar {
    display: none;
  }

  .filter-row > span {
    position: sticky;
    left: 0;
    z-index: 2;
    flex: 0 0 auto;
    padding-right: 6px;
    background: var(--surface-soft);
  }

  /* Mobile home */
  .home-view {
    gap: 12px !important;
  }

  .home-command-center {
    gap: 15px !important;
    padding: 18px !important;
    border-radius: 12px;
  }

  .home-command-head {
    grid-template-columns: minmax(0, 1fr) 62px !important;
    align-items: center;
    gap: 12px !important;
  }

  .home-command-head .today-label {
    min-height: 24px;
    padding: 4px 8px;
    font-size: 9px;
  }

  .home-command-head h3 {
    margin: 8px 0 4px;
    font-size: 23px !important;
    line-height: 1.28;
  }

  .home-command-head p {
    font-size: 11px;
  }

  .home-command-head .home-welcome-logo {
    width: 62px !important;
    height: 62px !important;
  }

  .home-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .home-metric {
    min-height: 82px;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 2px 8px;
    padding: 10px !important;
    border-radius: 8px;
    justify-items: stretch;
    text-align: left;
  }

  .home-metric-icon {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    font-size: 15px;
  }

  .home-metric span:not(.home-metric-icon) {
    font-size: 9px;
  }

  .home-metric strong {
    font-size: 14px;
  }

  .home-metric small {
    font-size: 8px;
  }

  .school-basic-head {
    align-items: flex-start;
  }

  .school-basic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .school-basic-grid > div {
    padding: 11px;
  }

  .school-basic-grid > div.wide {
    grid-column: span 2;
  }

  .notice-item,
  .approval-item,
  .entity-card,
  .date-group,
  .student-card,
  .detail-item,
  .stat {
    padding: 13px;
  }

  .approval-item .actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .approval-item .actions button {
    min-width: 0;
    padding-inline: 6px;
    font-size: 11px;
  }

  .student-grade-section {
    padding: 12px;
  }

  .student-class-grid {
    grid-template-columns: 1fr;
  }

  .student-card .text-button,
  .student-card .secondary {
    min-height: 38px;
  }

  .table-wrap,
  .teacher-table-wrap {
    border-radius: 8px;
  }

  th,
  td {
    padding: 10px 8px;
    font-size: 11px;
  }

  .duty-calendar-panel {
    padding-inline: 10px;
  }

  .duty-calendar-toolbar {
    grid-template-columns: 36px minmax(90px, auto) 36px 1fr;
  }

  .duty-calendar-day {
    min-height: 56px;
  }

  .notification-panel {
    top: auto;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 10px;
    width: auto;
    max-height: min(76dvh, 680px);
    border-radius: 14px;
  }

  .app-popup-layer {
    align-items: end;
    padding: 12px calc(12px + env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left));
  }

  .app-popup-panel,
  .admin-reauth-panel {
    width: 100%;
    max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding: 17px;
    border-radius: 14px;
  }

  .app-popup-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 390px) {
  .content {
    padding-inline: calc(10px + env(safe-area-inset-left));
  }

  .topbar {
    padding-inline: calc(10px + env(safe-area-inset-left));
  }

  .nav-list button {
    font-size: 8px;
  }

  .nav-icon {
    font-size: 15px;
  }

  .home-command-center {
    padding: 15px !important;
  }

  .home-command-head {
    grid-template-columns: minmax(0, 1fr) 52px !important;
  }

  .home-command-head h3 {
    font-size: 21px !important;
  }

  .home-command-head .home-welcome-logo {
    width: 52px !important;
    height: 52px !important;
  }
}

/* Attachment feedback fixes */
#menuButton {
  display: none !important;
}

.my-profile-panel-head {
  align-items: center;
}

.my-profile-head {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.my-profile-avatar {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  object-fit: cover;
  background: #1f2f5f;
  border: 3px solid var(--brand-soft);
  border-radius: 50%;
}

.home-profile-avatar {
  background: #1f2f5f;
  border-color: rgba(255, 255, 255, 0.3);
}

.home-profile-avatar img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.activity-toggle-row {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.activity-toggle-row button {
  min-width: 160px;
}

.uniform-permit-panel {
  padding: 18px !important;
  overflow: hidden;
}

.uniform-permit-panel > .panel-head {
  margin-bottom: 14px !important;
}

.uniform-permit-form,
:root[data-theme="dark"] .uniform-permit-form {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 13px !important;
  margin-top: 16px !important;
  padding: 16px 0 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-top: 1px solid var(--line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.uniform-permit-form .wrap,
.uniform-permit-form .actions {
  grid-column: 1 / -1 !important;
}

.uniform-permit-form label {
  align-content: start;
  text-align: left !important;
}

.uniform-permit-form .actions {
  justify-content: flex-start;
}

@media (min-width: 761px) {
  .topbar {
    grid-template-columns: 36px minmax(0, 1fr) auto !important;
  }

  .topbar-logo {
    grid-column: 1 !important;
    grid-row: 1 !important;
    justify-self: start !important;
  }

  .topbar-title {
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-self: start !important;
    gap: 10px !important;
    margin: 0 !important;
    text-align: left !important;
  }

  .topbar-school {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .topbar .kicker {
    display: none !important;
  }

  .topbar h2 {
    flex: 0 0 auto;
    padding-left: 10px;
    color: var(--muted);
    border-left: 1px solid var(--line);
    font-size: 12px;
    white-space: nowrap;
  }

  .topbar-actions {
    grid-column: 3 !important;
    grid-row: 1 !important;
    justify-self: end !important;
    margin: 0 !important;
  }
}

@media (max-width: 760px) {
  .home-metric:last-child strong {
    width: 100%;
    max-width: none;
    color: var(--ink);
    font-size: 10px !important;
    line-height: 1.2;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    word-break: keep-all;
    text-align: center;
  }

  .uniform-permit-panel {
    padding: 14px !important;
  }

  .uniform-permit-form,
  :root[data-theme="dark"] .uniform-permit-form {
    grid-template-columns: 1fr !important;
    padding-top: 14px !important;
  }

  .uniform-permit-form .wrap,
  .uniform-permit-form .actions {
    grid-column: 1 !important;
  }

  .uniform-permit-form .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .my-profile-avatar {
    width: 56px;
    height: 56px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* NEIS Plus-inspired composition requested for the final local preview */
@media (min-width: 761px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: 68px 56px minmax(0, 1fr) !important;
  }

  .topbar {
    grid-column: 1 !important;
    grid-row: 1 !important;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    min-height: 68px;
    padding: 9px clamp(24px, 4vw, 56px);
    background: var(--surface);
  }

  .topbar-logo {
    width: 36px;
    height: 36px;
    display: block;
    object-fit: contain;
  }

  .topbar-title {
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: 8px;
  }

  .topbar-school {
    grid-column: auto;
    color: var(--ink);
    font-size: 20px;
    font-weight: 950;
  }

  .topbar .kicker {
    color: var(--muted);
  }

  .topbar h2 {
    font-size: 13px;
    font-weight: 800;
  }

  .sidebar {
    grid-column: 1 !important;
    grid-row: 2 !important;
    position: sticky;
    top: 68px;
    width: 100% !important;
    max-width: none !important;
    height: 56px !important;
    min-height: 56px !important;
    display: block !important;
    padding: 0 !important;
    color: var(--ink);
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 5px 15px rgba(31, 42, 68, 0.035);
    backdrop-filter: blur(18px);
  }

  .sidebar > div {
    width: 100% !important;
    max-width: none !important;
    height: 56px !important;
    min-height: 56px !important;
    display: block !important;
    padding: 0 clamp(24px, 4vw, 56px);
    overflow: visible;
  }

  .sidebar .app-brand,
  .sidebar .user-box,
  .sidebar .sidebar-helper,
  .sidebar .desktop-download-card {
    display: none !important;
  }

  .nav-list {
    width: min(100%, 980px) !important;
    max-width: 980px !important;
    height: 56px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 auto !important;
    padding: 0 !important;
  }

  .nav-list button {
    width: auto !important;
    min-width: 106px !important;
    max-width: none !important;
    flex: 0 0 auto !important;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 13px;
    color: var(--ink);
    border-radius: 8px;
    font-size: 12px;
    text-align: center;
  }

  .nav-list button:hover {
    color: var(--brand);
    background: var(--brand-soft);
  }

  .nav-list button.active {
    color: var(--brand);
    background: var(--brand-soft);
    box-shadow: inset 0 -2px 0 var(--brand);
  }

  .nav-icon,
  .nav-list button.active .nav-icon {
    width: auto;
    height: auto;
    background: transparent;
    border-radius: 0;
    font-size: 16px;
  }

  .nav-list .nav-badge {
    border-color: var(--surface);
  }

  .content {
    grid-column: 1 !important;
    grid-row: 3 !important;
    width: 100% !important;
    max-width: none !important;
    padding-top: 28px;
  }
}

.home-portal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.8fr);
  align-items: stretch;
  gap: 18px;
}

.home-portal-side {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 14px;
}

.home-command-center {
  align-content: space-between;
  color: var(--ink);
  background:
    radial-gradient(circle at 92% 4%, color-mix(in srgb, var(--brand) 11%, transparent), transparent 25%),
    linear-gradient(135deg, color-mix(in srgb, var(--brand-soft) 70%, var(--surface)), var(--surface-soft));
  border-color: color-mix(in srgb, var(--brand) 16%, var(--line));
  box-shadow: none;
}

.home-command-center::before {
  right: -45px;
  top: -55px;
  width: 190px;
  height: 190px;
  background: transparent;
  border: 30px solid color-mix(in srgb, var(--brand) 5%, transparent);
  border-radius: 50%;
}

.home-command-head .today-label {
  color: var(--brand) !important;
  background: var(--surface) !important;
  border-color: color-mix(in srgb, var(--brand) 18%, var(--line)) !important;
}

.home-command-head h3 {
  color: var(--ink);
}

.home-command-head p {
  color: var(--muted);
}

.home-command-head .home-welcome-logo {
  filter: drop-shadow(0 9px 18px rgba(36, 52, 104, 0.12));
}

.home-metric-grid {
  gap: 0 !important;
  padding: 16px 4px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.home-metric {
  position: relative;
  min-height: 120px;
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  align-content: center;
  gap: 5px;
  padding: 10px 16px !important;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  text-align: center;
}

button.home-metric {
  cursor: pointer;
}

.home-metric + .home-metric::before {
  content: "";
  position: absolute;
  left: 0;
  top: 22%;
  width: 1px;
  height: 56%;
  background: var(--line-strong);
}

button.home-metric:hover {
  color: var(--brand);
  background: color-mix(in srgb, var(--brand-soft) 52%, transparent);
}

.home-metric-icon {
  grid-row: auto;
  width: 48px;
  height: 48px;
  color: var(--ink);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--brand) 24%, var(--line));
  border-radius: 8px;
  font-size: 23px;
}

.home-metric span:not(.home-metric-icon) {
  color: var(--muted);
  font-size: 11px;
}

.home-metric strong {
  color: var(--ink);
  font-size: 18px;
}

.home-metric small {
  grid-column: auto;
  width: 100%;
  color: var(--muted);
  font-size: 9px;
}

.home-profile-card {
  width: 100%;
  min-height: 116px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 74px;
  align-items: center;
  gap: 13px;
  padding: 18px;
  color: #fff;
  background: linear-gradient(120deg, #5667b5, #6553b7 68%, #4c4096);
  border: 0;
  border-radius: 12px;
  box-shadow: 0 14px 32px rgba(67, 65, 152, 0.2);
  text-align: left;
}

.home-profile-avatar {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 4px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  overflow: hidden;
}

.home-profile-avatar img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.home-profile-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.home-profile-copy small,
.home-profile-copy span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 750;
}

.home-profile-copy strong {
  color: #fff;
  font-size: 20px;
  font-weight: 900;
}

.home-profile-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-profile-manage {
  min-height: 76px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 21px;
  text-align: center;
}

.home-profile-manage small {
  color: rgba(255, 255, 255, 0.82);
  font-size: 9px;
  font-weight: 800;
}

.home-portal-side .school-basic-card {
  display: block !important;
  grid-template-columns: none !important;
  padding: 16px;
  box-shadow: none;
}

.home-portal-side .school-basic-head {
  padding-bottom: 12px;
}

.home-portal-side .school-basic-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-portal-side .school-basic-grid > div.wide {
  grid-column: span 2;
}

@media (max-width: 1100px) and (min-width: 761px) {
  .nav-list button {
    min-width: 92px;
    padding-inline: 9px;
  }

  .home-portal-grid {
    grid-template-columns: 1fr;
  }

  .home-portal-side {
    grid-template-columns: minmax(300px, 0.7fr) minmax(0, 1.3fr);
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 34px minmax(0, 1fr) auto;
  }

  .topbar-logo {
    width: 32px;
    height: 32px;
    display: block !important;
    object-fit: contain;
  }

  .topbar-title {
    min-width: 0;
    display: grid;
    gap: 1px;
  }

  .topbar-school {
    display: block !important;
    color: var(--muted);
    font-size: 9px;
  }

  .topbar h2 {
    font-size: 17px;
  }

  .home-portal-grid,
  .home-portal-side {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .home-command-center {
    gap: 16px !important;
    padding: 18px 16px !important;
  }

  .home-command-head {
    grid-template-columns: minmax(0, 1fr) 58px !important;
  }

  .home-command-head h3 {
    font-size: 24px !important;
  }

  .home-metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    padding: 10px 0;
  }

  .home-metric {
    min-height: 102px;
    gap: 4px;
    padding: 8px 4px !important;
  }

  .home-metric + .home-metric::before {
    top: 20%;
    height: 60%;
  }

  .home-metric-icon {
    width: 38px;
    height: 38px;
    font-size: 19px;
  }

  .home-metric span:not(.home-metric-icon) {
    font-size: 9px;
  }

  .home-metric strong {
    max-width: 100%;
    font-size: 13px;
  }

  .home-metric:last-child strong {
    font-size: 11px;
  }

  .home-metric small {
    display: none;
  }

  .home-profile-card {
    min-height: 104px;
    grid-template-columns: 56px minmax(0, 1fr) 62px;
    gap: 10px;
    padding: 14px;
  }

  .home-profile-avatar {
    width: 56px;
    height: 56px;
  }

  .home-profile-avatar img {
    width: 48px;
    height: 48px;
  }

  .home-profile-copy strong {
    font-size: 18px;
  }

  .home-profile-manage {
    min-height: 68px;
  }

  .home-portal-side .school-basic-card {
    padding: 15px;
  }
}

@media (max-width: 390px) {
  .home-command-head h3 {
    font-size: 21px !important;
  }

  .home-metric strong {
    font-size: 12px;
  }

  .home-profile-card {
    grid-template-columns: 50px minmax(0, 1fr) 54px;
  }

  .home-profile-avatar {
    width: 50px;
    height: 50px;
  }

  .home-profile-avatar img {
    width: 43px;
    height: 43px;
  }
}

/* Mobile portal refinement: NEIS Plus-inspired, desktop remains unchanged */
.home-mobile-kicker,
.home-mobile-service-title {
  display: none;
}

@media (max-width: 760px) {
  html,
  body {
    background: var(--page);
  }

  body {
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--brand-soft) 58%, var(--page)) 0 300px, var(--page) 520px);
  }

  .safe-area-top {
    background: color-mix(in srgb, var(--surface) 96%, transparent);
  }

  .topbar {
    min-height: calc(72px + env(safe-area-inset-top));
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 10px;
    padding: calc(11px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) 10px calc(16px + env(safe-area-inset-left));
    background: color-mix(in srgb, var(--surface) 97%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
    box-shadow: none;
    backdrop-filter: blur(24px) saturate(1.2);
  }

  .topbar-logo {
    width: 38px;
    height: 38px;
    filter: drop-shadow(0 4px 8px rgba(29, 48, 103, 0.12));
  }

  .topbar-title {
    min-width: 0;
    display: grid;
    align-content: center;
    gap: 0;
  }

  .topbar-school {
    color: var(--ink);
    font-size: 18px;
    font-weight: 950;
    line-height: 1.05;
  }

  .topbar-school::after {
    content: "+";
    margin-left: 2px;
    color: var(--brand-bright);
    font-weight: 950;
  }

  .topbar h2 {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    line-height: 1.1;
  }

  .topbar-actions {
    gap: 7px !important;
  }

  .topbar .top-action-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    color: var(--ink);
    background: var(--surface-soft);
    border: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
    box-shadow: none;
  }

  .content {
    padding: 16px calc(16px + env(safe-area-inset-right)) calc(94px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  }

  .view {
    gap: 15px;
  }

  .home-view {
    gap: 16px !important;
    margin-top: -16px;
  }

  .home-portal-grid,
  .home-portal-side {
    gap: 16px;
  }

  .home-command-center {
    width: auto;
    margin: 0 calc(-16px - env(safe-area-inset-right)) 0 calc(-16px - env(safe-area-inset-left));
    gap: 18px !important;
    padding: 28px calc(20px + env(safe-area-inset-right)) 24px calc(20px + env(safe-area-inset-left)) !important;
    color: var(--ink);
    background:
      linear-gradient(145deg, color-mix(in srgb, var(--brand-soft) 78%, var(--surface)), color-mix(in srgb, var(--accent-soft) 36%, var(--surface)));
    border: 0;
    border-radius: 0 0 28px 28px;
    box-shadow: none;
    overflow: hidden;
  }

  .home-command-center::before {
    display: none;
  }

  .home-command-head {
    grid-template-columns: minmax(0, 1fr) 76px !important;
    align-items: center;
    gap: 16px !important;
  }

  .home-mobile-kicker {
    display: block;
    margin-bottom: 8px;
    color: var(--brand);
    font-size: 11px;
    font-weight: 900;
  }

  .home-command-head .today-label {
    min-height: 0;
    padding: 0;
    color: var(--muted) !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0;
    font-size: 10px;
    font-weight: 800;
  }

  .home-command-head h3 {
    max-width: 230px;
    margin: 8px 0 6px;
    color: var(--ink);
    font-size: 27px !important;
    font-weight: 950;
    line-height: 1.24;
  }

  .home-command-head p {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
  }

  .home-command-head .home-welcome-logo {
    width: 76px !important;
    height: 76px !important;
    padding: 7px;
    background: color-mix(in srgb, var(--surface) 84%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand) 12%, transparent);
    border-radius: 22px;
    filter: drop-shadow(0 10px 20px rgba(36, 52, 104, 0.14));
  }

  .home-mobile-service-title {
    display: block;
    margin: 1px 0 -8px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 900;
  }

  .home-metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 0 !important;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
  }

  .home-metric {
    min-width: 0;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    padding: 10px 4px 6px !important;
    color: var(--ink);
    background: transparent;
    border: 0;
    border-radius: 12px;
    text-align: center;
  }

  .home-metric + .home-metric::before {
    top: 18px;
    height: 56px;
    background: color-mix(in srgb, var(--line-strong) 70%, transparent);
  }

  button.home-metric:active {
    background: color-mix(in srgb, var(--surface) 68%, transparent);
    transform: scale(0.98);
  }

  .home-metric-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    margin-bottom: 3px;
    color: var(--brand);
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand) 12%, var(--line));
    border-radius: 15px;
    box-shadow: 0 8px 18px color-mix(in srgb, var(--brand) 9%, transparent);
    font-size: 21px;
  }

  .home-metric span:not(.home-metric-icon) {
    width: 100%;
    color: var(--ink);
    font-size: 10px;
    font-weight: 850;
    line-height: 1.15;
  }

  .home-metric strong,
  .home-metric:last-child strong {
    max-width: 100%;
    color: var(--brand);
    font-size: 11px;
    font-weight: 950;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .home-metric small {
    display: none;
  }

  .home-profile-card {
    min-height: 116px;
    grid-template-columns: 64px minmax(0, 1fr) 64px;
    gap: 12px;
    padding: 17px 16px;
    background: linear-gradient(122deg, #5d66bc 0%, #6854b7 66%, #4c4096 100%);
    border-radius: 20px;
    box-shadow: 0 16px 34px rgba(72, 66, 159, 0.2);
  }

  .home-profile-avatar {
    width: 64px;
    height: 64px;
    border-width: 3px;
  }

  .home-profile-avatar img {
    width: 57px;
    height: 57px;
  }

  .home-profile-copy small {
    font-size: 9px;
  }

  .home-profile-copy strong {
    font-size: 20px;
  }

  .home-profile-copy span {
    font-size: 10px;
  }

  .home-profile-manage {
    min-height: 72px;
    font-size: 20px;
  }

  .home-portal-side .school-basic-card,
  .panel,
  .school-basic-card {
    padding: 18px;
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
    border-radius: 20px;
    box-shadow: 0 10px 28px color-mix(in srgb, var(--ink) 7%, transparent);
  }

  .panel-head {
    margin-bottom: 16px;
    padding-bottom: 14px;
  }

  .panel h3,
  .panel-head h3 {
    font-size: 18px;
  }

  .tabs,
  .sub-tabs,
  .panel > .tabs:first-child,
  .duty-filter,
  .theme-toggle {
    padding: 5px;
    background: color-mix(in srgb, var(--surface-soft) 82%, var(--page));
    border: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
    border-radius: 15px;
  }

  .tabs button,
  .sub-tabs button,
  .duty-filter button,
  .theme-toggle button {
    border-radius: 11px;
  }

  input,
  select,
  textarea {
    border-radius: 13px;
  }

  .primary,
  .secondary,
  .ghost,
  .danger {
    border-radius: 13px;
  }

  .sidebar {
    inset: auto 10px calc(8px + env(safe-area-inset-bottom));
    width: auto;
    padding: 7px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
    border-radius: 23px;
    box-shadow: 0 14px 36px rgba(20, 29, 50, 0.16);
    backdrop-filter: blur(24px) saturate(1.28);
  }

  .nav-list {
    gap: 3px;
  }

  .nav-list button {
    min-height: 56px;
    gap: 3px;
    padding: 5px 1px;
    border-radius: 17px;
    font-size: 9px;
    font-weight: 850;
  }

  .nav-list button.active {
    color: #fff;
    background: linear-gradient(145deg, var(--brand-bright), var(--brand));
    box-shadow: 0 8px 18px color-mix(in srgb, var(--brand) 28%, transparent);
  }

  .nav-icon {
    width: 25px;
    height: 25px;
    font-size: 17px;
  }

  .notification-panel {
    border-radius: 22px;
  }

  .login-shell {
    align-items: start;
    padding: calc(72px + env(safe-area-inset-top)) 22px calc(32px + env(safe-area-inset-bottom));
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--brand-soft) 70%, var(--surface)) 0 310px, var(--page) 620px);
  }

  .login-panel {
    width: 100%;
    padding: 26px 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .login-panel .hero-logo {
    width: 82px;
    height: 82px;
  }

  .login-panel h1 {
    font-size: 34px;
  }

  .login-panel form {
    margin-top: 30px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 14px 34px color-mix(in srgb, var(--ink) 8%, transparent);
  }
}

@media (max-width: 390px) {
  .home-command-head {
    grid-template-columns: minmax(0, 1fr) 66px !important;
  }

  .home-command-head h3 {
    font-size: 24px !important;
  }

  .home-command-head .home-welcome-logo {
    width: 66px !important;
    height: 66px !important;
  }

  .home-metric {
    min-height: 94px;
    padding-inline: 2px !important;
  }

  .home-metric-icon {
    width: 42px;
    height: 42px;
    font-size: 19px;
  }

  .home-profile-card {
    grid-template-columns: 56px minmax(0, 1fr) 54px;
  }

  .home-profile-avatar {
    width: 56px;
    height: 56px;
  }

  .home-profile-avatar img {
    width: 50px;
    height: 50px;
  }
}

/* JachiON horizontal CI. The round symbol remains reserved for app covers. */
.jachion-ci {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  content: url("/assets/jachion-ci-black.png?v=5");
}

:root[data-theme="dark"] .jachion-ci {
  content: url("/assets/jachion-ci-white.png?v=5");
}

.login-panel .login-ci {
  width: min(76%, 250px);
  margin: 4px auto 14px;
}

.migration-ci {
  width: min(72%, 260px);
  margin-inline: auto;
}

.home-command-head .home-welcome-logo {
  width: 142px !important;
  height: auto !important;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  filter: drop-shadow(0 8px 16px rgba(36, 52, 104, 0.13));
}

@media (min-width: 761px) {
  .topbar {
    grid-template-columns: 126px minmax(0, 1fr) auto !important;
  }

  .topbar-ci {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 118px;
    justify-self: start;
  }

  .topbar-title {
    grid-column: 2 !important;
  }

  .topbar-school {
    display: none !important;
  }

  .topbar h2 {
    padding-left: 0;
    border-left: 0;
  }

  .sidebar-ci {
    width: 124px;
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .topbar-ci {
    width: 112px;
    justify-self: start;
  }

  .topbar-title {
    display: none !important;
  }

  .home-command-head {
    grid-template-columns: minmax(0, 1fr) 112px !important;
  }

  .home-command-head .home-welcome-logo {
    width: 108px !important;
    height: auto !important;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
  }

  .login-panel .login-ci {
    width: min(72%, 230px);
    margin-bottom: 16px;
  }
}

@media (max-width: 390px) {
  .topbar-ci {
    width: 104px;
  }

  .home-command-head {
    grid-template-columns: minmax(0, 1fr) 96px !important;
  }

  .home-command-head .home-welcome-logo {
    width: 92px !important;
  }
}

/* Final mobile polish */
@media (max-width: 760px) {
  .topbar-actions,
  .topbar .top-theme-toggle,
  .top-theme-toggle {
    display: inline-flex !important;
  }

  .topbar .top-action-button {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
  }

  .home-command-center {
    gap: 14px !important;
    padding-top: 24px !important;
    padding-bottom: 18px !important;
    border-radius: 0 0 24px 24px;
  }

  .home-command-head,
  .home-command-head:last-child {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0 !important;
  }

  .home-command-head .home-welcome-logo {
    display: none !important;
  }

  .home-mobile-kicker {
    margin-bottom: 6px;
  }

  .home-command-head h3 {
    max-width: none;
    margin: 7px 0 5px;
    font-size: 25px !important;
    line-height: 1.2;
  }

  .home-mobile-service-title {
    margin: 2px 0 -5px;
    font-size: 13px;
  }

  .home-metric {
    min-height: 88px;
    gap: 3px;
    padding: 7px 3px 4px !important;
  }

  .home-metric + .home-metric::before {
    top: 14px;
    height: 52px;
  }

  .home-metric-icon {
    width: 42px;
    height: 42px;
    margin-bottom: 2px;
    border-radius: 14px;
    font-size: 19px;
  }

  .home-profile-card {
    min-height: 104px;
    grid-template-columns: 58px minmax(0, 1fr) 56px;
    padding: 14px 15px;
    border-radius: 18px;
  }

  .home-profile-avatar {
    width: 58px;
    height: 58px;
  }

  .home-profile-avatar img {
    width: 52px;
    height: 52px;
  }

  .home-profile-manage {
    min-height: 62px;
  }

  .home-portal-side .school-basic-card {
    padding: 16px;
    border-radius: 18px;
  }

  .home-portal-side .school-basic-head {
    align-items: center;
    padding-bottom: 11px;
  }

  .home-portal-side .school-basic-grid {
    margin-top: 11px;
    border-radius: 13px;
  }

  .home-portal-side .school-basic-grid > div {
    gap: 4px;
    padding: 10px;
  }

  .home-portal-side .school-basic-grid strong {
    font-size: 11px;
    line-height: 1.4;
  }

  .sidebar {
    padding: 6px;
    border-radius: 21px;
  }

  .nav-list button {
    min-height: 52px;
    border-radius: 15px;
  }

  .nav-icon {
    width: 23px;
    height: 23px;
    font-size: 16px;
  }
}

@media (max-width: 350px) {
  .topbar-ci {
    width: 96px;
  }

  .topbar {
    padding-inline: 12px;
  }

  .home-command-head h3 {
    font-size: 22px !important;
  }

  .home-metric-icon {
    width: 38px;
    height: 38px;
    font-size: 17px;
  }

  .home-profile-card {
    grid-template-columns: 52px minmax(0, 1fr) 48px;
    gap: 8px;
    padding-inline: 12px;
  }

  .home-profile-avatar {
    width: 52px;
    height: 52px;
  }

  .home-profile-avatar img {
    width: 46px;
    height: 46px;
  }
}

/* Unified NEIS+ inspired module screens */
.view:not(.home-view) {
  gap: 18px;
}

.section-intro {
  position: relative;
  min-height: 118px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px 30px;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 26%, color-mix(in srgb, var(--brand) 12%, transparent) 0 64px, transparent 65px),
    linear-gradient(120deg, color-mix(in srgb, var(--brand-soft) 76%, var(--surface)), color-mix(in srgb, var(--surface) 92%, var(--brand-soft)));
  border: 1px solid color-mix(in srgb, var(--brand) 17%, var(--line));
  border-radius: 12px;
}

.section-intro::after {
  content: "";
  position: absolute;
  right: 48px;
  bottom: -72px;
  width: 180px;
  height: 180px;
  border: 26px solid color-mix(in srgb, var(--brand) 7%, transparent);
  border-radius: 50%;
  pointer-events: none;
}

.section-intro-icon {
  position: relative;
  z-index: 1;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--surface) 84%, var(--brand-soft));
  border: 1px solid color-mix(in srgb, var(--brand) 14%, var(--line));
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  font-size: 27px;
}

/* Bulk duty registration */
.bulk-duty-panel {
  overflow: hidden;
}

.bulk-duty-form {
  display: grid;
  gap: 14px;
}

.bulk-duty-step {
  display: grid;
  gap: 13px;
  padding: 18px;
  background: color-mix(in srgb, var(--surface-soft) 68%, var(--surface));
  border: 1px solid var(--line);
  border-radius: 14px;
}

.bulk-duty-step-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bulk-duty-step-head > div:first-child {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, auto);
  align-items: center;
  justify-content: start;
  column-gap: 9px;
}

.bulk-duty-step-head > div:first-child > span {
  grid-row: 1 / 3;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--brand);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 900;
}

.bulk-duty-step-head strong {
  color: var(--ink);
  font-size: 15px;
}

.bulk-duty-step-head small {
  color: var(--muted);
  font-size: 11px;
}

.actions.compact {
  gap: 6px;
  flex-wrap: nowrap;
}

.actions.compact button,
.bulk-duty-quick-actions button {
  min-height: 34px;
  padding: 6px 11px;
  font-size: 11px;
}

.bulk-duty-user-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.bulk-duty-user {
  position: relative;
  min-width: 0;
  display: block;
  cursor: pointer;
}

.bulk-duty-user input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.bulk-duty-user > span {
  min-height: 54px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 9px 11px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  transition: 160ms ease;
}

.bulk-duty-user strong,
.bulk-duty-user small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bulk-duty-user strong {
  color: var(--ink);
  font-size: 13px;
}

.bulk-duty-user small {
  color: var(--muted);
  font-size: 10px;
}

.bulk-duty-user input:checked + span {
  background: var(--brand-soft);
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.bulk-duty-user input:checked + span::after {
  content: "선택";
  position: absolute;
  top: 7px;
  right: 8px;
  color: var(--brand);
  font-size: 9px;
  font-weight: 900;
}

.bulk-duty-quick-actions,
.bulk-duty-weekdays {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.bulk-duty-date-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bulk-duty-weekdays label {
  position: relative;
  cursor: pointer;
}

.bulk-duty-weekdays input {
  position: absolute;
  opacity: 0;
}

.bulk-duty-weekdays span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 850;
}

.bulk-duty-weekdays input:checked + span {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.bulk-duty-holiday {
  justify-self: start;
}

.bulk-duty-submit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--brand) 8%, transparent);
}

.bulk-duty-preview {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.bulk-duty-preview.ready {
  color: var(--brand);
  font-weight: 900;
}

.bulk-duty-submit-bar .primary {
  flex: 0 0 auto;
}

@media (max-width: 760px) {
  .bulk-duty-panel {
    padding: 16px !important;
  }

  .bulk-duty-step {
    gap: 11px;
    padding: 13px;
    border-radius: 13px;
  }

  .bulk-duty-step-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .bulk-duty-step-head .actions.compact {
    width: 100%;
  }

  .bulk-duty-step-head .actions.compact button {
    flex: 1 1 0;
  }

  .bulk-duty-user-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bulk-duty-date-grid,
  .bulk-duty-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .bulk-duty-detail-grid .wrap {
    grid-column: 1 / -1;
  }

  .bulk-duty-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
  }

  .bulk-duty-weekdays span {
    width: 100%;
    height: 36px;
    border-radius: 9px;
  }

  .bulk-duty-submit-bar {
    position: sticky;
    bottom: calc(76px + env(safe-area-inset-bottom));
    z-index: 4;
    align-items: stretch;
    flex-direction: column;
    padding: 12px;
  }

  .bulk-duty-preview {
    text-align: center;
  }

  .bulk-duty-submit-bar .primary {
    width: 100%;
  }
}

.section-intro-icon .app-icon {
  width: 28px;
  height: 28px;
}

.section-intro > div {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.section-intro-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--brand);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
}

.section-intro h3 {
  margin: 0;
  color: var(--ink);
  font-size: 27px;
  font-weight: 950;
  line-height: 1.25;
}

.section-intro p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.view > .sub-tabs {
  min-height: 58px;
  gap: 0;
  margin: 0;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.view > .sub-tabs button {
  position: relative;
  min-height: 56px;
  padding: 10px 20px;
  border-radius: 0;
  font-size: 13px;
}

.view > .sub-tabs button.active {
  color: var(--brand);
  background: transparent;
  box-shadow: none;
}

.view > .sub-tabs button.active::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: -1px;
  left: 18px;
  height: 3px;
  background: var(--brand);
  border-radius: 3px 3px 0 0;
}

.view:not(.home-view) > .panel,
.view:not(.home-view) > .split > .panel {
  padding: 24px;
  border-color: color-mix(in srgb, var(--line) 88%, transparent);
  box-shadow: 0 8px 30px color-mix(in srgb, var(--ink) 6%, transparent);
}

.panel-symbol {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  border-radius: 10px;
  font-size: 21px;
}

.panel-symbol .app-icon {
  width: 22px;
  height: 22px;
}

.button-icon {
  display: inline-flex;
  align-items: center;
  margin-right: 5px;
  vertical-align: middle;
}

.button-icon .app-icon {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
}

.home-metric-icon .app-icon {
  width: 20px;
  height: 20px;
}

.home-profile-manage .app-icon {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
}

.sub-tab-icon,
.notice-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.sub-tab-icon .app-icon,
.notice-title-icon .app-icon {
  width: 17px;
  height: 17px;
}

.sub-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.notice-list .row-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.calendar-category-tabs .app-icon,
.calendar-static-scope .app-icon,
.calendar-detail-icon .app-icon,
.calendar-duty-title .app-icon,
.calendar-legend .app-icon,
.attachment-box .app-icon,
.student-filter-tabs .app-icon {
  width: 18px;
  height: 18px;
}

.calendar-duty-title > span,
.calendar-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

@media (max-width: 760px) {
  .nav-list button.active .nav-icon .app-icon {
    filter: brightness(0) invert(1);
  }
}

.notification-item-icon .app-icon,
.budget-icon .app-icon,
.school-basic-icon .app-icon {
  width: 19px;
  height: 19px;
}

.top-action-icon .app-icon {
  width: 17px;
  height: 17px;
}

.desktop-download-card .app-icon {
  width: 19px;
  height: 19px;
  filter: brightness(0) invert(1);
}

.notices-view .notice-list,
.approvals-view .approval-list {
  gap: 0;
  border-top: 1px solid var(--line);
}

.notices-view .notice-item,
.approvals-view .approval-item {
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0;
  box-shadow: none;
}

.notices-view .notice-item:last-child,
.approvals-view .approval-item:last-child {
  border-bottom: 0 !important;
}

.notices-view .notice-item:hover,
.approvals-view .approval-item:hover {
  background: color-mix(in srgb, var(--brand-soft) 45%, var(--surface));
}

/* Document workflow */
.workflow-panel {
  width: 100%;
  margin-inline: auto;
}

.workflow-panel > .panel-head {
  align-items: center;
}

.workflow-form {
  display: grid;
}

.form-step {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.form-step:first-child {
  padding-top: 2px;
}

.form-step:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.form-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 59px;
  bottom: -10px;
  left: 19px;
  width: 2px;
  background: color-mix(in srgb, var(--brand) 18%, var(--line));
}

.form-step-index {
  position: relative;
  z-index: 1;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--brand-bright), var(--brand-deep));
  border: 4px solid var(--surface);
  border-radius: 50%;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 28%, var(--line));
  font-size: 12px;
  font-weight: 950;
}

.form-step-body {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.form-step-head {
  display: grid;
  gap: 3px;
}

.form-step-head strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 950;
}

.form-step-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.form-field-grid,
.guidance-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field-label-sr {
  font-size: 0;
}

.field-label-sr > input,
.field-label-sr > select,
.field-label-sr > textarea {
  font-size: 13px;
}

.workflow-form input,
.workflow-form select,
.workflow-form textarea {
  background: var(--surface-soft);
}

.workflow-form textarea {
  min-height: 132px;
}

.file-drop-field {
  position: relative;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 2px 10px;
  align-items: center;
  padding: 14px;
  background: var(--surface-soft);
  border: 1px dashed color-mix(in srgb, var(--brand) 35%, var(--line));
  border-radius: 10px;
}

.file-drop-field > span {
  grid-row: 1 / span 2;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  border-radius: 8px;
  font-size: 18px;
}

.file-drop-field strong {
  font-size: 12px;
}

.file-drop-field small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.file-drop-field input {
  grid-column: 1 / -1;
  min-height: 40px;
  margin-top: 8px;
  padding: 7px 9px;
  background: var(--surface);
  font-size: 11px;
}

.workflow-submit-actions {
  justify-content: flex-end;
}

.workflow-submit-actions .primary {
  min-width: 180px;
  min-height: 48px;
}

.reason-choice {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.reason-choice legend {
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.reason-choice > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.reason-choice label {
  position: relative;
  display: block;
}

.reason-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.reason-choice span {
  min-height: 46px;
  display: grid;
  place-items: center;
  padding: 8px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.reason-choice input:checked + span {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: var(--brand);
  box-shadow: var(--focus);
}

.guidance-picker {
  display: grid;
  gap: 9px;
}

.guidance-picker > label {
  font-size: 0;
}

.guidance-picker > label input {
  font-size: 13px;
}

.guidance-selected:not(.is-empty) {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 24%, var(--line));
  border-radius: 8px;
}

.guidance-results {
  display: grid;
  gap: 6px;
}

.guidance-results > button {
  min-height: 52px;
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
}

.guidance-results > button:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.guidance-results > button span {
  color: var(--muted);
  font-size: 10px;
}

.approval-inbox-panel .panel-head {
  align-items: center;
}

.approval-inbox-panel .toolbar {
  min-width: 250px;
}

.approval-clear-actions {
  justify-content: flex-end;
  padding-bottom: 12px;
}

/* Module-specific finishing */
.status-view > .panel:first-of-type .tabs {
  margin-bottom: 12px;
}

.my-view .my-profile-panel-head,
.admin-view .panel-head,
.duties-view .panel-head {
  align-items: center;
}

.my-view .my-profile-avatar {
  box-shadow: 0 8px 22px color-mix(in srgb, var(--brand) 18%, transparent);
}

.admin-view .entity-card,
.my-view .notice-item {
  background: var(--surface-soft);
  box-shadow: none;
}

@media (max-width: 760px) {
  .view:not(.home-view) {
    gap: 12px;
  }

  .section-intro {
    min-height: 94px;
    gap: 13px;
    padding: 17px 16px;
    border-radius: 0 0 18px 18px;
    border-width: 0 0 1px;
  }

  .section-intro::after {
    right: -26px;
    bottom: -78px;
    width: 154px;
    height: 154px;
    border-width: 22px;
  }

  .section-intro-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    font-size: 22px;
  }

  .section-intro-kicker {
    font-size: 9px;
  }

  .section-intro h3 {
    font-size: 22px;
  }

  .section-intro p {
    margin-top: 3px;
    font-size: 10px;
  }

  .view > .sub-tabs {
    min-height: 50px;
    margin-inline: 14px;
    width: calc(100% - 28px);
    padding-inline: 5px;
    border-radius: 10px;
  }

  .view > .sub-tabs button {
    flex: 1 0 auto;
    min-height: 48px;
    padding: 8px 12px;
    font-size: 11px;
  }

  .view > .sub-tabs button.active::after {
    right: 12px;
    left: 12px;
  }

  .view:not(.home-view) > .panel,
  .view:not(.home-view) > .split > .panel {
    margin-inline: 14px;
    width: calc(100% - 28px);
    padding: 16px;
    border-radius: 12px;
  }

  .view:not(.home-view) > .split {
    margin-inline: 0;
  }

  .workflow-panel {
    padding: 0 !important;
    overflow: hidden;
  }

  .workflow-panel > .panel-head {
    margin: 0;
    padding: 16px;
    background: color-mix(in srgb, var(--brand-soft) 44%, var(--surface));
  }

  .panel-symbol {
    width: 40px;
    height: 40px;
    font-size: 19px;
  }

  .workflow-form {
    padding: 0 16px 17px;
  }

  .form-step {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 11px;
    padding: 18px 0;
  }

  .form-step-index {
    width: 32px;
    height: 32px;
    border-width: 3px;
    font-size: 10px;
  }

  .form-step:not(:last-child)::after {
    top: 48px;
    bottom: -8px;
    left: 15px;
  }

  .form-step-head strong {
    font-size: 14px;
  }

  .form-step-head span {
    font-size: 10px;
    line-height: 1.45;
  }

  .form-field-grid,
  .guidance-info-grid {
    grid-template-columns: 1fr;
  }

  .workflow-form input,
  .workflow-form select,
  .workflow-form textarea {
    font-size: 16px;
  }

  .reason-choice > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reason-choice span {
    min-height: 44px;
    font-size: 11px;
  }

  .workflow-submit-actions {
    display: block;
  }

  .workflow-submit-actions .primary {
    width: 100%;
    min-height: 50px;
  }

  .approval-inbox-panel .panel-head {
    display: grid;
  }

  .approval-inbox-panel .toolbar {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .approval-inbox-panel .toolbar button {
    width: auto;
  }

  .approval-clear-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .notices-view .notice-list,
  .approvals-view .approval-list {
    margin-inline: -4px;
  }
}

@media (max-width: 350px) {
  .section-intro {
    padding-inline: 13px;
  }

  .section-intro-icon {
    width: 44px;
    height: 44px;
  }

  .section-intro h3 {
    font-size: 20px;
  }

  .view > .sub-tabs {
    margin-inline: 10px;
    width: calc(100% - 20px);
  }

  .view:not(.home-view) > .panel,
  .view:not(.home-view) > .split > .panel {
    margin-inline: 10px;
    width: calc(100% - 20px);
  }
}

/* Searchable approval recipient */
.approval-target-picker {
  display: grid;
  gap: 10px;
}

.approval-target-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.approval-target-tools .secondary {
  min-width: 132px;
}

.approval-target-value {
  display: none !important;
}

.approval-target-selected:not(.is-empty) {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  color: var(--ink);
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 26%, var(--line));
  border-radius: 8px;
}

.approval-target-selected strong {
  min-width: 0;
  flex: 1 1 auto;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.approval-target-selected button {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 50%;
  font-size: 18px;
}

.approval-target-results {
  max-height: 226px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding-right: 3px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.approval-target-results > button {
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
}

.approval-target-results > button:hover {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand) 55%, var(--line));
}

.approval-target-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 950;
}

.approval-target-results > button > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.approval-target-results strong {
  font-size: 12px;
}

.approval-target-results small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.approval-inbox-panel .toolbar {
  width: min(100%, 330px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.approval-inbox-panel .toolbar > select {
  min-width: 0;
}

.approval-inbox-panel .toolbar > button {
  width: auto;
}

@media (max-width: 760px) {
  .approval-target-tools {
    grid-template-columns: 1fr;
  }

  .approval-target-tools .secondary {
    width: 100%;
  }

  .approval-target-results {
    max-height: 220px;
    grid-template-columns: 1fr;
  }

  .approval-target-results > button {
    min-height: 54px;
  }

  .status-view .filter-row {
    flex-wrap: wrap;
    overflow: visible;
  }

  .status-view .filter-row > span {
    position: static;
    width: 100%;
    min-width: 0;
    padding: 0 0 2px;
    background: transparent;
  }
}

/* Stable schedule controls and matching document form dimensions */
.duty-calendar-panel > .panel-head {
  margin-bottom: 14px;
}

.duty-calendar-panel .calendar-category-tabs {
  margin-bottom: 10px;
}

.calendar-control-slot {
  min-height: 62px;
  margin-bottom: 14px;
}

.calendar-control-slot > .timetable-filter-bar,
.calendar-control-slot > .calendar-scope-filter,
.calendar-control-slot > .calendar-static-scope {
  width: 100%;
  min-height: 62px;
  margin: 0;
}

.calendar-scope-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 6px;
  padding: 12px;
  background: color-mix(in srgb, var(--brand) 5%, var(--surface));
  border: 1px solid var(--line);
  border-radius: 12px;
}

.calendar-scope-filter button {
  width: 100%;
  min-height: 38px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 900;
}

.calendar-scope-filter button.active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.calendar-static-scope {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  color: var(--ink);
  background: color-mix(in srgb, var(--brand) 5%, var(--surface));
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 12px;
}

.workflow-panel {
  width: 100%;
}

.workflow-panel > .panel-head,
.workflow-panel .form-step {
  width: 100%;
}

.workflow-form input:not([type="file"]):not([type="radio"]),
.workflow-form select {
  min-height: 50px;
  height: 50px;
}

.guidance-info-grid {
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  align-items: end;
}

.guidance-info-grid > label,
.guidance-info-grid > fieldset {
  width: 100%;
}

.guidance-info-grid .reason-choice > div {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.guidance-info-grid .reason-choice span {
  min-height: 50px;
}

@media (min-width: 980px) {
  .workflow-panel {
    max-width: none;
  }

  .approval-target-results {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .duty-calendar-panel > .panel-head {
    margin-bottom: 12px;
  }

  .calendar-control-slot {
    min-height: 58px;
    margin-bottom: 12px;
  }

  .calendar-control-slot > .timetable-filter-bar,
  .calendar-control-slot > .calendar-scope-filter,
  .calendar-control-slot > .calendar-static-scope {
    min-height: 58px;
  }

  .calendar-scope-filter {
    padding: 9px;
  }

  .guidance-info-grid .reason-choice > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guidance-info-grid {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .workflow-form input:not([type="file"]):not([type="radio"]),
  .workflow-form select {
    min-height: 50px;
    height: 50px;
  }

  /* Keep the default student roster compact instead of applying the global
     mobile card treatment to every table row. */
  .student-grade-roster {
    gap: 14px;
  }

  .student-grade-section {
    padding: 10px;
    border-radius: 12px;
  }

  .student-grade-head {
    margin-bottom: 10px;
    padding: 3px 2px 10px;
    background: transparent;
  }

  .student-grade-head h4 {
    font-size: 17px;
  }

  .student-class-grid {
    gap: 10px;
  }

  .student-class-column {
    border-radius: 10px;
  }

  .student-class-column header {
    min-height: 44px;
    padding: 9px 11px;
  }

  .student-class-table,
  .student-class-table tbody {
    width: 100%;
    display: block;
  }

  .student-class-table thead {
    display: none;
  }

  .student-class-table tbody {
    display: grid;
    gap: 0;
  }

  .student-class-table tr {
    min-height: 52px;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 26px 42px 42px;
    align-items: center;
    padding: 0 8px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }

  .student-class-table tr:last-child {
    border-bottom: 0;
  }

  .student-class-table td,
  .student-class-table td:nth-child(n) {
    width: auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 7px 3px;
    border: 0;
    color: var(--ink);
    font-size: 11px;
    text-align: center;
  }

  .student-class-table td::before {
    display: none;
    content: none;
  }

  .student-class-table .student-class-name {
    display: grid;
    justify-items: start;
    gap: 2px;
    text-align: left !important;
  }

  .student-class-name strong {
    max-width: 100%;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .student-class-name > span {
    margin: 0;
    gap: 2px;
  }

  .student-class-name > span:empty {
    display: none;
  }

  .student-class-name .badge,
  .student-class-table td:nth-child(4) .badge {
    min-height: 20px;
    padding: 2px 5px;
    font-size: 8px;
  }

  .student-class-table .text-button {
    min-width: 36px;
    min-height: 30px;
    padding: 4px;
    font-size: 10px;
  }
}

/* Mobile school-status workspace */
.student-mobile-roster,
.teacher-mobile-list {
  display: none;
}

@media (max-width: 760px) {
  .status-view {
    width: calc(100% + 16px);
    gap: 9px !important;
    margin-inline: -8px;
  }

  .status-view > .panel,
  .status-view > .split > .panel {
    width: 100% !important;
    margin-inline: 0 !important;
  }

  .status-view > .section-intro {
    min-height: 78px;
    padding-block: 12px;
  }

  .status-view > .section-intro .section-intro-icon {
    width: 42px;
    height: 42px;
    font-size: 19px;
  }

  .status-view > .section-intro h3 {
    font-size: 21px;
  }

  .status-view > .section-intro p {
    display: none;
  }

  .status-view > .status-control-panel {
    padding: 8px !important;
  }

  .status-type-tabs {
    min-height: 42px !important;
    margin-bottom: 8px !important;
    padding: 3px !important;
  }

  .status-type-tabs button {
    min-width: 0;
    min-height: 34px !important;
    flex: 1 1 0;
    padding: 6px 5px !important;
    font-size: 13px !important;
  }

  .status-search {
    position: relative;
    grid-template-columns: minmax(0, 1fr) 42px !important;
    gap: 6px;
  }

  .status-search input {
    min-height: 42px;
    height: 42px;
    padding: 9px 38px 9px 12px;
    font-size: 15px;
  }

  .status-search-clear {
    position: absolute;
    top: 5px;
    right: 48px;
    width: 32px !important;
    min-width: 32px;
    min-height: 32px;
    height: 32px;
    padding: 0;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 50%;
    font-size: 18px;
  }

  .status-search-submit {
    width: 42px !important;
    min-width: 42px;
    min-height: 42px;
    height: 42px;
    padding: 0;
    border-radius: 9px;
  }

  .status-search-submit span:last-child {
    display: none;
  }

  .student-status-split > .panel {
    padding: 8px !important;
  }

  .student-directory-head {
    align-items: center !important;
    margin-bottom: 10px;
    padding-bottom: 9px;
  }

  .student-directory-head h3 {
    font-size: 17px !important;
  }

  .student-directory-head p {
    display: none;
  }

  .status-result-count {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    padding: 5px 8px;
    color: var(--muted);
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
  }

  .status-result-count strong {
    color: var(--brand);
    font-size: 13px;
  }

  .student-primary-filters {
    gap: 7px;
    margin-bottom: 10px;
    padding: 8px;
  }

  .status-view .student-primary-filters .filter-row {
    display: grid;
    grid-template-columns: 35px repeat(5, minmax(0, 1fr));
    gap: 4px;
  }

  .status-view .student-primary-filters .filter-row > span {
    width: auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    font-size: 12px;
  }

  .student-primary-filters .filter-row button {
    min-width: 0;
    min-height: 30px;
    padding: 4px 2px;
    font-size: 12px;
    letter-spacing: 0;
  }

  .student-quick-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding-top: 7px;
    border-top: 1px solid var(--line);
  }

  .student-quick-filters button {
    min-width: 0;
    min-height: 32px;
    padding: 5px 2px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 7px;
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
  }

  .student-quick-filters button.active {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
  }

  .student-filter-reset {
    color: var(--muted) !important;
    background: transparent !important;
    border-style: dashed !important;
  }

  .student-mobile-roster {
    display: grid;
    gap: 10px;
  }

  .student-mobile-list,
  .student-table-wrap,
  .student-grade-roster {
    display: none !important;
  }

  .mobile-roster-grade {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
  }

  .mobile-roster-grade-head {
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    color: var(--ink);
    background: color-mix(in srgb, var(--brand-soft) 55%, var(--surface));
    border-bottom: 1px solid var(--line);
  }

  .mobile-roster-grade-head strong {
    font-size: 15px;
  }

  .mobile-roster-grade-head span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
  }

  .mobile-roster-class + .mobile-roster-class {
    border-top: 1px solid var(--line);
  }

  .mobile-roster-class-head {
    min-height: 30px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    color: var(--brand);
    background: var(--surface-soft);
  }

  .mobile-roster-class-head strong {
    font-size: 13px;
  }

  .mobile-roster-class-head span {
    min-width: 18px;
    min-height: 18px;
    display: inline-grid;
    place-items: center;
    color: var(--muted);
    background: var(--surface);
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
  }

  .mobile-student-row {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    display: grid;
    grid-template-columns: 24px minmax(96px, 1fr) 22px 35px minmax(31px, auto) 13px;
    align-items: center;
    gap: 5px;
    padding: 6px 8px;
    color: var(--ink);
    background: var(--surface);
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    text-align: left;
  }

  .mobile-student-row:first-child {
    border-top: 0;
  }

  .mobile-student-row.selected {
    background: color-mix(in srgb, var(--brand-soft) 68%, var(--surface));
    box-shadow: inset 3px 0 0 var(--brand);
  }

  .mobile-student-number,
  .mobile-student-gender {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-align: center;
  }

  .mobile-student-identity {
    min-width: 0;
    display: grid;
    gap: 1px;
  }

  .mobile-student-identity strong {
    overflow: hidden;
    font-size: 15px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-student-identity small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
  }

  .mobile-guidance-count {
    display: grid;
    justify-items: center;
    gap: 0;
    color: var(--muted);
  }

  .mobile-guidance-count strong {
    font-size: 14px;
    line-height: 1;
  }

  .mobile-guidance-count small {
    font-size: 9px;
  }

  .mobile-guidance-count.has-count {
    color: var(--brand);
  }

  .mobile-student-flags {
    min-width: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px;
  }

  .mobile-status-flag {
    min-height: 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 900;
    white-space: nowrap;
  }

  .mobile-status-flag.uniform {
    color: var(--brand);
    background: var(--brand-soft);
  }

  .mobile-status-flag.discipline {
    color: var(--danger);
    background: var(--danger-soft);
  }

  .mobile-status-flag.empty {
    color: color-mix(in srgb, var(--muted) 55%, transparent);
  }

  .mobile-row-chevron {
    color: var(--muted);
    font-size: 16px;
    text-align: center;
  }

  .mobile-student-detail {
    width: 100%;
    margin: 0;
    padding: 12px 9px 14px;
    background: color-mix(in srgb, var(--brand-soft) 32%, var(--surface));
    border-top: 1px solid color-mix(in srgb, var(--brand) 25%, var(--line));
  }

  .mobile-student-detail .student-detail-content > .panel-head {
    display: grid;
    gap: 7px;
    margin-bottom: 9px;
    padding-bottom: 9px;
  }

  .mobile-student-detail .student-detail-content > .panel-head h3 {
    font-size: 16px;
  }

  .mobile-student-detail .student-detail-content > .panel-head p {
    display: block;
    font-size: 11px;
  }

  .mobile-student-detail .student-badges {
    justify-content: flex-start;
    text-align: left;
  }

  .mobile-student-detail .detail-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .mobile-student-detail .detail-item {
    min-width: 0;
    min-height: 50px;
    padding: 8px;
  }

  .mobile-student-detail .detail-item span {
    font-size: 11px;
  }

  .mobile-student-detail .detail-item strong {
    overflow-wrap: anywhere;
    font-size: 13px;
  }

  .mobile-student-detail .uniform-permit-panel {
    padding-block: 10px;
  }

  .mobile-student-detail .uniform-permit-panel > .panel-head {
    margin-bottom: 8px;
    padding-bottom: 8px;
  }

  .mobile-student-detail .timeline {
    gap: 6px;
  }

  .mobile-student-detail .date-group {
    padding: 9px;
  }

  .teacher-mobile-list {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 9px;
  }

  .teacher-desktop-table {
    display: none !important;
  }

  .teacher-mobile-row {
    min-height: 62px;
    display: grid;
    grid-template-columns: 28px minmax(100px, 0.95fr) minmax(108px, 1.15fr);
    align-items: center;
    gap: 7px;
    padding: 7px 9px;
    background: var(--surface);
    border-top: 1px solid var(--line);
  }

  .teacher-mobile-row:first-child {
    border-top: 0;
  }

  .teacher-mobile-order {
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    color: var(--brand);
    background: var(--brand-soft);
    border-radius: 7px;
    font-size: 11px;
    font-weight: 900;
  }

  .teacher-mobile-person,
  .teacher-mobile-duty {
    min-width: 0;
    display: grid;
    gap: 2px;
  }

  .teacher-mobile-person strong,
  .teacher-mobile-duty strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 14px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .teacher-mobile-person small,
  .teacher-mobile-duty small {
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .status-view .council-org {
    gap: 10px;
  }

  .status-view .org-leadership h4 {
    font-size: 15px;
  }

  .status-view .org-leadership-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas: "left center right";
    gap: 5px;
    align-items: stretch;
  }

  .status-view .org-member.featured,
  .status-view .org-leader-center .org-member.featured {
    min-width: 0;
    min-height: 86px;
    gap: 3px;
    padding: 9px 4px;
    transform: none;
  }

  .status-view .org-member.featured strong {
    font-size: 15px;
  }

  .status-view .org-member.featured small {
    font-size: 10px;
  }

  .status-view .org-member.featured .org-position {
    min-height: 22px;
    padding: 3px 6px;
    font-size: 10px;
  }

  .status-view .org-connector {
    height: 12px;
  }

  .status-view .org-departments {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .status-view .org-department {
    gap: 6px;
    padding: 8px;
    border-radius: 9px;
  }

  .status-view .org-department h4 {
    min-height: 30px;
    font-size: 13px;
  }

  .status-view .org-role-group {
    gap: 4px;
  }

  .status-view .org-role-group + .org-role-group {
    margin-top: 2px;
  }

  .status-view .org-role-group h5 {
    min-height: 20px;
    padding: 3px 6px;
    font-size: 10px;
  }

  .status-view .org-member-list {
    gap: 4px;
  }

  .status-view .org-member,
  .status-view .org-member.executive:not(.featured) {
    min-width: 0;
    min-height: 48px;
    gap: 2px;
    padding: 6px 4px;
    border-radius: 7px;
  }

  .status-view .org-member strong,
  .status-view .org-member.executive:not(.featured) strong {
    font-size: 13px;
  }

  .status-view .org-member small,
  .status-view .org-member.executive:not(.featured) small {
    font-size: 10px;
  }

  .status-view .org-member .org-position,
  .status-view .org-member.executive:not(.featured) .org-position {
    min-height: 18px;
    padding: 2px 5px;
    font-size: 9px;
  }
}

@media (max-width: 350px) {
  .status-view > .panel,
  .status-view > .split > .panel {
    margin-inline: 0 !important;
    width: 100% !important;
  }

  .mobile-student-row {
    grid-template-columns: 22px minmax(82px, 1fr) 19px 31px minmax(27px, auto) 10px;
    gap: 3px;
    padding-inline: 6px;
  }

  .mobile-student-identity strong {
    font-size: 14px;
  }

  .mobile-status-flag {
    padding-inline: 3px;
    font-size: 8px;
  }

  .teacher-mobile-row {
    grid-template-columns: 25px minmax(88px, 0.95fr) minmax(92px, 1.05fr);
    gap: 4px;
    padding-inline: 6px;
  }
}
