:root {
  --ink: #132238;
  --ink-soft: #314158;
  --navy-2: #1e3654;
  --amber: #f2a900;
  --amber-soft: #fff3cf;
  --green: #138a72;
  --green-soft: #e7f6f1;
  --red: #d95d39;
  --red-soft: #fff0eb;
  --blue: #2475d0;
  --blue-soft: #eaf3ff;
  --canvas: #f5f6f3;
  --surface: #ffffff;
  --surface-2: #f9faf8;
  --line: #dfe4e2;
  --line-strong: #c9d0ce;
  --muted: #6d7888;
  --sidebar-width: 242px;
  --topbar-height: 72px;
  --banner-height: 38px;
  --context-banner-offset: 0px;
  --radius: 16px;
  --shadow: 0 12px 28px rgba(26, 42, 63, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
  color: var(--ink);
  font-family:
    Inter, "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui,
    sans-serif;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(36, 117, 208, 0.22);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3,
strong {
  letter-spacing: -0.02em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mobile-only,
.mobile-brand,
.mobile-navigation {
  display: none;
}

.app-shell {
  min-height: 100vh;
}

.app-shell.has-context-banner {
  --context-banner-offset: var(--banner-height);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 20% 0%, rgba(242, 169, 0, 0.16), transparent 28%),
    var(--ink);
  color: #fff;
  transition: width 180ms ease;
}

.brand {
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-mark {
  display: inline-grid;
  width: 40px;
  height: 40px;
  box-sizing: border-box;
  flex: 0 0 auto;
  object-fit: cover;
  place-items: center;
  border-radius: 12px;
  background: var(--amber);
  color: #1c2532;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: -0.04em;
  box-shadow: 0 6px 18px rgba(242, 169, 0, 0.24);
}

.brand div,
.mobile-brand div {
  min-width: 0;
}

.brand strong,
.mobile-brand strong {
  display: block;
  font-size: 15px;
  white-space: nowrap;
}

.brand small,
.mobile-brand small {
  display: block;
  margin-top: 2px;
  color: #aeb9c8;
  font-size: 11px;
  white-space: nowrap;
}

.main-navigation {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  padding: 16px 12px;
}

.main-navigation button,
.sidebar-collapse {
  display: flex;
  min-height: 46px;
  width: 100%;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #bdc8d6;
  text-align: left;
  transition:
    color 140ms ease,
    background 140ms ease,
    transform 140ms ease;
}

.main-navigation button {
  padding: 0 12px;
}

.main-navigation button:hover,
.sidebar-collapse:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.main-navigation button.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
}

.main-navigation button b {
  min-width: 24px;
  margin-left: auto;
  border-radius: 999px;
  background: var(--amber);
  color: var(--ink);
  font-size: 10px;
  line-height: 20px;
  text-align: center;
}

.nav-icon {
  display: inline-grid;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-collapse {
  padding: 0 12px;
}

.build-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.build-status > span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #35d2a2;
  box-shadow: 0 0 0 5px rgba(53, 210, 162, 0.12);
}

.build-status strong,
.build-status small {
  display: block;
}

.build-status strong {
  font-size: 12px;
}

.build-status small {
  margin-top: 2px;
  color: #aeb9c8;
  font-size: 10px;
}

.topbar {
  position: fixed;
  inset: 0 0 auto var(--sidebar-width);
  z-index: 25;
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  transition: left 180ms ease;
}

.context-controls,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.context-controls label > span {
  display: block;
  margin: 0 0 4px 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.context-controls select,
.role-switcher select,
.field select,
.route-selector select {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}

.context-controls select {
  min-width: 260px;
  max-width: 370px;
  padding: 0 34px 0 12px;
}

.year-control select {
  min-width: 180px;
}

.notification-button,
.icon-button {
  display: inline-grid;
  min-width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.notification-button {
  position: relative;
  color: var(--amber);
}

.notification-button b {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 9px;
}

.role-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.role-switcher select {
  border: 0;
  font-weight: 700;
}

.demo-banner {
  position: fixed;
  inset: var(--topbar-height) 0 auto var(--sidebar-width);
  z-index: 24;
  display: flex;
  min-height: var(--banner-height);
  align-items: center;
  gap: 9px;
  padding: 7px 28px;
  border-bottom: 1px solid #f0d994;
  background: #fff8df;
  color: #765500;
  transition: left 180ms ease;
}

.demo-banner > span:first-child {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid #d3aa2e;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}

.demo-banner p {
  margin: 0;
  font-size: 12px;
}

.demo-banner.is-historical {
  border-bottom-color: #b9d6ff;
  background: #edf6ff;
  color: #174d8f;
}

.demo-banner.is-historical > span:first-child {
  border-color: #6aa7ed;
}

.historical-year-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px 18px;
  border: 1px solid #b9d6ff;
  border-radius: 14px;
  background: linear-gradient(135deg, #f5faff 0%, #eaf4ff 100%);
  color: #153f73;
}

.historical-year-notice > span {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  background: #d9ebff;
  color: #1261bd;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.historical-year-notice strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.historical-year-notice p {
  margin: 0;
  color: #4e6d90;
  font-size: 13px;
  line-height: 1.55;
}

.banner-context {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(242, 169, 0, 0.18);
  font-size: 11px;
  font-weight: 800;
}

.main-content {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: calc(var(--topbar-height) + var(--context-banner-offset) + 30px) 30px 50px;
  transition: margin-left 180ms ease;
}

.main-content > * {
  width: min(1480px, 100%);
  margin-inline: auto;
}

.app-shell.is-sidebar-collapsed {
  --sidebar-width: 78px;
}

.is-sidebar-collapsed .brand {
  justify-content: center;
  padding-inline: 10px;
}

.is-sidebar-collapsed .brand div,
.is-sidebar-collapsed .main-navigation button > span:not(.nav-icon),
.is-sidebar-collapsed .main-navigation button b,
.is-sidebar-collapsed .sidebar-collapse span:last-child,
.is-sidebar-collapsed .build-status div {
  display: none;
}

.is-sidebar-collapsed .main-navigation button,
.is-sidebar-collapsed .sidebar-collapse {
  justify-content: center;
}

.view-stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 6px 2px;
}

.page-header h1 {
  margin-bottom: 8px;
  font-size: clamp(27px, 3vw, 38px);
  line-height: 1.08;
}

.page-header p:not(.eyebrow) {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-actions,
.action-row,
.drawer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 15px;
  font-weight: 750;
  white-space: nowrap;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    background 120ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 8px 18px rgba(19, 34, 56, 0.16);
}

.button-secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.button-success {
  background: var(--green);
  color: #fff;
}

.button-ghost-danger {
  border-color: #f0c1b4;
  background: var(--red-soft);
  color: #a43e24;
}

.button-block {
  width: 100%;
}

.text-button,
.table-link {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 750;
}

.table-link {
  padding: 0;
}

.badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 7px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-neutral {
  background: #eef1f0;
  color: #5f6b78;
}

.badge-success {
  background: var(--green-soft);
  color: #08705b;
}

.badge-warning {
  background: var(--amber-soft);
  color: #8a6200;
}

.badge-danger {
  background: var(--red-soft);
  color: #a64027;
}

.badge-info {
  background: var(--blue-soft);
  color: #1e65b5;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  position: relative;
  min-height: 158px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--surface);
  box-shadow: 0 5px 16px rgba(19, 34, 56, 0.035);
}

.metric-card::after {
  position: absolute;
  right: -34px;
  bottom: -50px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  opacity: 0.035;
}

.metric-topline,
.metric-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.metric-topline {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.metric-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 12%, transparent);
}

.metric-card > strong {
  display: block;
  margin-top: 18px;
  font-size: clamp(25px, 3vw, 34px);
}

.metric-detail {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.metric-blue {
  color: var(--blue);
}

.metric-green {
  color: var(--green);
}

.metric-amber {
  color: #b07900;
}

.metric-red {
  color: var(--red);
}

.metric-card > strong,
.metric-card .metric-topline > span:first-child {
  color: var(--ink);
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--surface);
  box-shadow: 0 7px 22px rgba(19, 34, 56, 0.04);
}

.panel-header,
.detail-section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-header {
  margin-bottom: 20px;
}

.panel-header h2,
.detail-section-title h3 {
  margin-bottom: 0;
  font-size: 18px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: 16px;
}

.dashboard-lower {
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.65fr);
}

.today-panel {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 249, 229, 0.96)),
    var(--surface);
}

.trip-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.trip-progress div {
  padding: 13px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.trip-progress strong,
.trip-progress span {
  display: block;
}

.trip-progress strong {
  font-size: 24px;
}

.trip-progress span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.progress-track {
  display: block;
  width: 100%;
  height: 9px;
  padding: 0;
  overflow: hidden;
  margin: 20px 0 16px;
  border: 0;
  border-radius: 999px;
  appearance: none;
  background: #eceeea;
}

.progress-track::-webkit-progress-bar {
  border-radius: inherit;
  background: #eceeea;
}

.progress-track::-webkit-progress-value,
.progress-track::-moz-progress-bar {
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #40b49b);
}

.load-error-shell {
  margin-left: 0;
}

.count-ladder {
  display: grid;
  gap: 9px;
}

.count-ladder button,
.count-ladder > div {
  display: flex;
  min-height: 49px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 13px;
  background: var(--surface-2);
  text-align: left;
}

.count-ladder button:hover {
  border-color: #acc6e4;
  background: var(--blue-soft);
}

.count-ladder span {
  color: var(--ink-soft);
  font-size: 12px;
}

.count-ladder strong {
  font-size: 18px;
}

.rank-list,
.issue-summary,
.plain-list,
.schedule-list,
.subscriber-list,
.channel-list,
.message-run-list {
  display: grid;
  gap: 9px;
}

.rank-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 11px;
  min-height: 54px;
  padding: 7px 0;
  border-bottom: 1px solid #edf0ef;
}

.rank-item:last-child {
  border-bottom: 0;
}

.rank-number {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.rank-item strong,
.rank-item small {
  display: block;
}

.rank-item small {
  max-width: 360px;
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.issue-summary button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 11px;
  background: var(--surface-2);
  text-align: left;
}

.issue-summary button:hover {
  border-color: #d1b363;
}

.issue-summary span:not(.badge) {
  font-size: 12px;
}

.toolbar {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  background: var(--surface);
}

.toolbar-wrap {
  flex-wrap: wrap;
}

.toolbar-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 8px;
  color: var(--muted);
  font-size: 11px;
}

.search-field {
  display: flex;
  min-width: min(100%, 370px);
  min-height: 42px;
  flex: 1;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  padding: 0 12px;
  background: #f2f4f2;
}

.search-field > span:not(.sr-only) {
  color: var(--muted);
  font-size: 18px;
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
}

.segmented {
  display: inline-flex;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  background: var(--surface-2);
}

.segmented button {
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  padding: 6px 12px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.segmented button.is-active {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 4px 10px rgba(19, 34, 56, 0.14);
}

.result-summary {
  display: flex;
  justify-content: space-between;
  padding: 0 3px;
  color: var(--muted);
  font-size: 11px;
}

.result-summary strong {
  color: var(--ink);
}

.table-shell {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 6px 20px rgba(19, 34, 56, 0.035);
}

.student-filterable-heading {
  display: inline-flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
}

.student-table-filter-control {
  position: relative;
  display: inline-grid;
  width: 24px;
  height: 32px;
  flex: 0 0 24px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.student-table-filter-control:hover,
.student-table-filter-control:focus-within {
  border-color: #a9c9f3;
  background: #eef6ff;
  color: var(--accent);
}

.student-table-filter-control:focus-within {
  outline: 3px solid rgba(37, 99, 235, 0.14);
  outline-offset: 1px;
}

.student-table-filter-control.is-active {
  border-color: #9fc5f8;
  background: #eaf4ff;
  color: var(--accent);
}

.student-table-filter-control.is-active::after {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
  content: "";
  pointer-events: none;
}

.student-table-filter-icon {
  width: 15px;
  height: 15px;
  fill: none;
  pointer-events: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.student-table-filter-control > select.student-table-filter {
  display: none;
}

.student-table-filter-toggle {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  border-radius: inherit;
}

.student-filter-menu {
  position: fixed;
  z-index: 26; /* Above .topbar (25), outside table overflow; below modal overlays. */
  min-width: 124px;
  max-width: calc(100vw - 8px);
  max-height: min(420px, 60vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid #c3d8ed;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(30, 77, 126, 0.18);
}

.student-filter-menu [role="option"] {
  display: block;
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  padding: 9px 12px;
  text-align: left;
  white-space: nowrap;
  background: #fff;
  color: #173457;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.student-filter-menu [role="option"]:hover,
.student-filter-menu [role="option"]:focus-visible {
  background: #eef6ff;
  color: #0d5fae;
  outline: 2px solid #9fc5f8;
  outline-offset: -2px;
}

.student-filter-menu [aria-selected="true"] {
  background: #e1efff;
  color: #0b63ce;
  font-weight: 760;
}

.student-master-table .student-finance-current-heading {
  width: 104px;
  padding-inline: 8px;
}

.student-mobile-filters {
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .student-mobile-filters.mobile-only { display: flex; }
}

.student-remark-preview {
  max-width: 10em;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-remark-preview:hover,
.student-remark-preview:focus-visible {
  color: var(--accent);
  outline: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.student-service-cell {
  min-width: 170px;
  max-width: 260px;
  vertical-align: top;
  white-space: normal;
}

.student-service-summary {
  display: grid;
  min-width: 150px;
  gap: 3px;
  white-space: normal;
}

.student-service-summary > strong {
  width: fit-content;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: #1e65b5;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.student-service-summary small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.student-service-summary small b {
  color: var(--ink-soft);
}

.student-service-cell .student-service-route-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.student-service-cell .student-service-route-heading > strong {
  flex-shrink: 0;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: #1e65b5;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.student-service-cell .student-service-route-name {
  display: block;
  flex: 1;
  min-width: 0;
  min-height: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-color: #c5d7eb;
  text-underline-offset: 3px;
}

.student-service-cell .student-service-route-name:hover,
.student-service-cell .student-service-route-name:focus-visible {
  color: var(--blue);
}

.student-service-cell .student-service-direction {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.student-service-cell .student-service-route-group {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.student-service-cell .student-service-route-group + .student-service-route-group {
  padding-top: 5px;
  margin-top: 2px;
  border-top: 1px dashed var(--line);
}

/* Student master finance visibility */
.student-finance-loading,
.student-finance-error {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
}

button.student-finance-error {
  color: #b42318;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.student-finance-current,
.student-finance-total {
  display: grid;
  min-width: 112px;
  gap: 4px;
}

.student-master-table .cell-person {
  min-width: 158px;
  gap: 8px;
}

.student-master-table th:first-child,
.student-master-table td:first-child {
  padding-inline: 10px;
}

.student-master-table .student-finance-current-cell,
.student-master-table .student-finance-total-cell {
  width: 104px;
  padding-inline: 8px;
}

.student-master-table .student-finance-current,
.student-master-table .student-finance-total {
  min-width: 88px;
}

.student-finance-current {
  justify-items: start;
}

.student-finance-current strong,
.student-finance-total strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}

.student-finance-current small,
.student-finance-total small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  white-space: nowrap;
}

.student-finance-total .student-finance-overdue,
.student-finance-balance-due {
  color: #b42318;
  font-weight: 750;
}

.student-finance-months {
  display: grid;
  width: 164px;
  min-width: 164px;
  grid-template-columns: repeat(6, 24px);
  grid-auto-rows: 36px;
  align-items: center;
  gap: 4px;
}

.student-finance-month {
  display: grid;
  width: 24px;
  min-width: 24px;
  min-height: 36px;
  place-items: center;
  gap: 3px;
  border: 1px solid #d8e3ef;
  border-radius: 8px;
  padding: 4px 2px;
  background: #f8fbff;
  color: #64748b;
  cursor: pointer;
  font: inherit;
  font-size: 9px;
  font-weight: 750;
}

.student-finance-month i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.student-finance-month:hover,
.student-finance-month:focus-visible {
  border-color: #75a8eb;
  outline: 3px solid rgba(37, 99, 235, 0.12);
}

.student-finance-month.is-paid,
.student-finance-paid {
  color: #08755f;
}

.student-finance-month.is-paid {
  border-color: #b9eadb;
  background: #effbf7;
}

.student-finance-month.is-open,
.student-finance-open {
  color: #9a6700;
}

.student-finance-month.is-open {
  border-color: #f2d38b;
  background: #fff9e9;
}

.student-finance-month.is-overdue,
.student-finance-overdue {
  color: #b42318;
}

.student-finance-month.is-overdue {
  border-color: #f1b9b6;
  background: #fff3f2;
}

.student-finance-month.is-unissued,
.student-finance-unissued {
  color: #7b8da3;
}

.student-finance-month.is-unissued {
  border-style: dashed;
  background: #f8fafc;
}

.student-finance-ledger-modal {
  width: min(1120px, 100%);
}

.student-finance-ledger-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.student-finance-ledger-summary > div {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px 16px;
  background: var(--surface);
}

.student-finance-ledger-summary span,
.student-finance-ledger-summary small {
  color: var(--muted);
  font-size: 11px;
}

.student-finance-ledger-summary strong {
  color: var(--ink);
  font-size: 21px;
}

.student-finance-ledger-summary .has-overdue strong {
  color: #b42318;
}

.student-finance-ledger-note {
  margin-bottom: 14px;
  border: 1px solid #c9ddf7;
  border-radius: 11px;
  padding: 10px 12px;
  background: #f2f7ff;
  color: #42617f;
  font-size: 12px;
}

.school-payment-portal-panel {
  display: grid;
  gap: 18px;
}

.school-payment-portal-form {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, #f8fbff, #eef7ff);
  padding: 18px;
}

.school-payment-portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.school-payment-portal-card {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 12px 32px rgba(36, 103, 180, 0.08);
}

.school-payment-portal-card .action-row {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.school-payment-portal-qr {
  display: grid;
  place-items: center;
  width: 148px;
  aspect-ratio: 1;
  border: 1px solid #c9def5;
  border-radius: 16px;
  background: #fff;
  padding: 10px;
}

.school-payment-portal-qr svg,
.school-payment-portal-qr img {
  width: 100%;
  height: 100%;
}

.school-payment-portal-copy h3 {
  margin: 4px 0 8px;
  font-size: 20px;
}

.school-payment-portal-copy p {
  color: var(--muted);
}

@media (max-width: 620px) {
  .school-payment-portal-card {
    grid-template-columns: 1fr;
  }

  .school-payment-portal-qr {
    width: min(220px, 100%);
    margin: auto;
  }
}

.student-finance-ledger-modal .table-shell {
  max-height: min(520px, 54dvh);
}

.student-finance-ledger-modal th,
.student-finance-ledger-modal td {
  white-space: nowrap;
}

.student-finance-invoices {
  display: grid;
  justify-items: start;
  gap: 4px;
  min-width: 150px;
}

.student-finance-invoice-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  text-align: left;
}

.student-finance-invoice-link:hover,
.student-finance-invoice-link:focus-visible {
  outline: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.student-mobile-card-wrap {
  display: grid;
  gap: 6px;
}

.student-mobile-finance {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 11px;
  background: #f8fbff;
  color: var(--ink-soft);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.student-mobile-finance strong {
  justify-self: end;
}

.student-mobile-finance small {
  grid-column: 1 / -1;
  color: var(--muted);
}

@media (max-width: 720px) {
  .student-finance-ledger-modal {
    width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
  }

  .student-finance-ledger-summary {
    grid-template-columns: 1fr;
  }

  .student-finance-ledger-modal .route-modal-body {
    padding: 14px;
  }
}

.student-contact-cell {
  min-width: 132px;
  max-width: 210px;
  white-space: normal;
}

.student-contact-list {
  display: grid;
  gap: 5px;
}

.student-contact-entry {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 0 6px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.student-contact-entry span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.student-remark-detail {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid #edf0ef;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  background: #f7f8f6;
  color: #697583;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

td {
  font-size: 12px;
}

tbody tr:hover {
  background: #fbfcfa;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.cell-person {
  display: flex;
  min-width: 210px;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  text-align: left;
}

.cell-person strong,
.cell-person small,
.cell-subtitle {
  display: block;
}

.cell-person small,
.cell-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.cell-person .student-list-primary-number,
.student-mobile-main .student-list-primary-number {
  color: var(--ink-soft);
  font-weight: 750;
}

.cell-person .student-list-secondary-number,
.student-mobile-main .student-list-secondary-number {
  margin-top: 0;
  color: var(--muted);
}

.avatar {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
}

.avatar-large {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  font-size: 16px;
}

.muted {
  color: var(--muted);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.pagination span {
  color: var(--muted);
  font-size: 11px;
}

.student-count-strip,
.route-summary-strip,
.attendance-metrics,
.route-detail-summary,
.quality-overview {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px;
  background: var(--surface);
}

.student-count-strip {
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
}

.student-count-strip > div {
  padding: 8px 14px;
}

.student-count-strip span,
.student-count-strip strong,
.student-count-strip small {
  display: block;
}

.student-count-strip > span {
  color: var(--line-strong);
  font-size: 24px;
}

.student-count-strip strong {
  margin: 5px 0;
  font-size: 25px;
}

.student-count-strip span {
  font-size: 11px;
  font-weight: 700;
}

.student-count-strip small {
  color: var(--muted);
  font-size: 9px;
}

.school-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.school-card,
.route-card,
.stop-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(19, 34, 56, 0.035);
}

.school-card {
  padding: 17px;
}

.school-card header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.school-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
  background: var(--ink);
  color: var(--amber);
  font-size: 10px;
  font-weight: 900;
}

.school-card header strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.school-card header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.school-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 17px 0;
}

.school-metrics div {
  padding: 10px;
  border-radius: 10px;
  background: var(--surface-2);
}

.school-metrics strong,
.school-metrics span {
  display: block;
}

.school-metrics strong {
  font-size: 19px;
}

.school-metrics span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.school-alert {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  padding: 8px 10px;
  background: var(--amber-soft);
  color: #795700;
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.school-alert > span:first-child {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-weight: 800;
}

.school-alert > span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.school-alert strong {
  font-size: 12px;
  line-height: 1.35;
}

.school-alert small {
  color: #8a6a17;
  font-size: 11px;
  line-height: 1.4;
}

.school-alert:hover,
.school-alert:focus-visible {
  background: #ffefba;
  outline: 2px solid rgb(184 127 0 / 24%);
  outline-offset: 2px;
}

.school-card footer,
.route-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}

.route-summary-strip {
  grid-template-columns: repeat(4, 1fr);
}

.route-summary-strip div,
.attendance-metrics .attendance-metric,
.route-detail-summary div {
  padding: 10px 14px;
  border-right: 1px solid var(--line);
}

.route-summary-strip div:last-child,
.attendance-metrics .attendance-metric:last-child,
.route-detail-summary div:last-child {
  border-right: 0;
}

.route-summary-strip strong,
.route-summary-strip span,
.attendance-metrics strong,
.attendance-metrics span,
.route-detail-summary strong,
.route-detail-summary span {
  display: block;
}

.route-summary-strip strong,
.attendance-metrics strong,
.route-detail-summary strong {
  font-size: 23px;
}

.route-summary-strip span,
.attendance-metrics span,
.route-detail-summary span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.route-card {
  padding: 17px;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    border 150ms ease;
}

.route-card:hover {
  transform: translateY(-2px);
  border-color: #b7c7da;
  box-shadow: var(--shadow);
}

.route-card-interactive {
  cursor: pointer;
}

.route-card-interactive:focus-visible {
  outline: 3px solid rgba(30, 112, 215, 0.42);
  outline-offset: 3px;
}

.route-card header,
.route-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.route-code > span {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  font-weight: 850;
}

.route-card h2 {
  margin: 19px 0 5px;
  font-size: 18px;
}

.route-card > p {
  overflow: hidden;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-card-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.route-card-metrics span {
  padding: 8px;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 9px;
}

.route-card-metrics strong {
  color: var(--ink);
  font-size: 14px;
}

.route-card footer {
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.route-card footer > span {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stop-list {
  display: grid;
  gap: 10px;
}

.stop-list-row {
  display: grid;
  grid-template-columns:
    auto minmax(230px, 1.35fr) minmax(240px, 1.1fr)
    minmax(190px, 0.85fr) minmax(210px, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid #cfe0f2;
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(34, 91, 148, 0.055);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.stop-list-row:hover {
  border-color: #9ec7ef;
  box-shadow: 0 14px 32px rgba(34, 91, 148, 0.09);
  transform: translateY(-1px);
}

.stop-list-pin {
  display: block;
  width: 14px;
  height: 14px;
  border: 4px solid #e8f2ff;
  border-radius: 999px;
  background: #237df0;
  box-shadow: 0 0 0 1px #bcd8f7;
}

.stop-list-main,
.stop-list-route,
.stop-list-fares,
.stop-list-students {
  min-width: 0;
}

.stop-list-main strong {
  display: block;
  overflow: hidden;
  color: #0d2948;
  font-size: 16px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stop-list-main p {
  overflow: hidden;
  margin: 4px 0 0;
  color: #5e7892;
  font-size: 13px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stop-list-route {
  display: grid;
  gap: 3px;
}

.stop-list-route span,
.stop-list-meta dt {
  color: #6b8198;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.stop-list-route strong {
  display: block;
  overflow: hidden;
  color: #173b63;
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stop-list-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(64px, 1fr));
  gap: 8px;
  margin: 0;
}

.stop-list-meta div {
  min-width: 0;
  border-radius: 12px;
  padding: 8px 10px;
  background: #f3f8ff;
}

.stop-list-meta dd {
  margin: 2px 0 0;
  color: #0d2948;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.1;
}

.stop-list-fares dd {
  color: #155ea8;
  font-size: 13px;
  white-space: nowrap;
}

.stop-list-students {
  grid-template-columns: repeat(3, minmax(54px, 1fr));
}

.stop-list-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 1080px) {
  .stop-list-row {
    grid-template-columns: auto minmax(180px, 1.2fr) minmax(190px, 1fr) auto;
  }

  .stop-list-meta {
    grid-column: 2 / -1;
    grid-template-columns: repeat(2, minmax(0, 120px));
  }

  .stop-list-students {
    grid-template-columns: repeat(3, minmax(0, 120px));
  }
}

@media (max-width: 719px) {
  .stop-list-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    padding: 14px;
  }

  .stop-list-pin {
    display: none;
  }

  .stop-list-meta {
    grid-column: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stop-list-students {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stop-list-actions {
    justify-content: space-between;
  }
}

.special-route-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 260px;
  border: 1px solid #ead79c;
  border-radius: 20px;
  padding: 30px;
  background:
    radial-gradient(circle at 100% 0%, rgba(242, 169, 0, 0.17), transparent 38%),
    #fffdf7;
}

.special-calendar {
  display: grid;
  width: 110px;
  height: 120px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #dfca89;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.special-calendar span {
  width: 100%;
  padding: 9px;
  background: var(--amber);
  text-align: center;
}

.special-calendar strong {
  font-size: 42px;
}

.special-route-panel h2 {
  margin: 12px 0 8px;
}

.special-route-panel p {
  max-width: 720px;
  color: var(--muted);
  line-height: 1.6;
}

.feature-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.feature-chips span {
  border: 1px solid #e2d39f;
  border-radius: 8px;
  padding: 6px 9px;
  background: #fff;
  font-size: 10px;
}

.callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid;
  border-radius: 13px;
  padding: 13px 15px;
}

.callout strong {
  min-width: max-content;
  font-size: 11px;
}

.callout p {
  margin: 0;
  font-size: 10px;
  line-height: 1.5;
}

.callout-info {
  border-color: #b7d3f2;
  background: var(--blue-soft);
  color: #1d568f;
}

.callout-warning {
  border-color: #e9d28b;
  background: var(--amber-soft);
  color: #765500;
}

.callout-danger {
  border-color: #e7b4a6;
  background: var(--red-soft);
  color: #8e3a26;
}

.drawer-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.drawer-scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(12, 24, 40, 0.46);
  backdrop-filter: blur(3px);
}

.drawer {
  position: absolute;
  inset: 0 0 0 auto;
  display: flex;
  width: min(560px, 94vw);
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: var(--canvas);
  box-shadow: -22px 0 50px rgba(11, 24, 40, 0.18);
  animation: drawer-in 180ms ease-out;
}

.drawer.drawer-no-enter {
  animation: none;
}

.route-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: clamp(16px, 3vw, 40px);
}

.route-modal-scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(12, 24, 40, 0.5);
  backdrop-filter: blur(3px);
}

.route-modal {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(1440px, 100%);
  max-height: calc(100dvh - 32px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--canvas);
  box-shadow: 0 28px 70px rgba(11, 24, 40, 0.28);
}

.route-modal.is-entering {
  animation: route-modal-in 180ms ease-out;
}

@keyframes route-modal-in {
  from {
    transform: translateY(12px) scale(0.99);
    opacity: 0;
  }
}

.route-modal-header,
.route-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 24px;
  background: var(--surface);
}

.route-modal-header {
  border-bottom: 1px solid var(--line);
}

.route-modal-header .eyebrow {
  margin-bottom: 5px;
}

.route-modal-header h2 {
  margin: 0;
  font-size: 24px;
}

.route-modal-header p:not(.eyebrow) {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.stop-manager-modal .stop-manager-school-name {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
}

.route-modal-body {
  min-height: 0;
  overflow: auto;
  padding: 24px;
}

.route-modal-stack {
  display: grid;
  gap: 16px;
}

.route-modal-footer {
  border-top: 1px solid var(--line);
}

.route-modal-footer .drawer-actions {
  width: 100%;
}

.confirm-input-dialog-form {
  display: grid;
  gap: 1rem;
}

.confirm-input-dialog-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line, #dbe3ef);
  border-radius: 12px;
  background: var(--surface-muted, #f8fafc);
}

.confirm-input-dialog-form label {
  display: grid;
  gap: 0.45rem;
}

.confirm-input-dialog-form textarea {
  width: 100%;
  min-height: 5rem;
  resize: vertical;
}

.confirm-input-dialog-error {
  margin: 0;
  color: var(--danger, #b42318);
}

.profile-modal {
  width: min(620px, 100%);
}

.student-management-modal {
  width: min(1080px, 100%);
}

.student-management-modal .student-management-actions {
  flex-wrap: wrap;
}

.student-management-modal .student-management-actions .student-management-save {
  flex: 0 0 auto;
  width: auto;
  margin-inline-start: auto;
}

.student-management-modal .student-management-record .catalog-form > .form-grid {
  align-items: start;
}

.student-management-modal .student-management-record input[name="name"] {
  min-height: 46px;
}

.student-management-modal .route-modal-body {
  background: #f8fbff;
}

.student-management-profile {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid #d7e6f7;
  border-radius: 16px;
  background: linear-gradient(135deg, #ffffff 0%, #eef7ff 100%);
}

.student-management-profile .student-detail-hero {
  flex: 1;
}

.student-management-profile-meta {
  display: grid;
  grid-template-columns: auto auto;
  align-content: center;
  gap: 6px 14px;
  min-width: 210px;
  padding-left: 18px;
  border-left: 1px solid #d7e6f7;
  color: var(--muted);
  font-size: 13px;
}

.student-management-profile-meta strong {
  color: var(--ink);
  text-align: right;
}

.student-management-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}

.student-management-grid .detail-card {
  height: auto;
  margin: 0;
  padding: 14px;
}

.student-management-grid .detail-card h3 {
  margin-bottom: 10px;
}

.student-management-grid .detail-card .plain-list li {
  padding: 6px 0;
}

.student-management-grid .detail-card .detail-value-row {
  margin-top: 10px;
  padding-top: 10px;
}

.student-management-academic,
.student-management-record {
  grid-column: 1 / -1;
}

@media (max-width: 980px) {
  .student-management-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .student-management-profile {
    align-items: flex-start;
    flex-direction: column;
  }

  .student-management-profile-meta {
    width: 100%;
    min-width: 0;
    padding-top: 14px;
    padding-left: 0;
    border-top: 1px solid #d7e6f7;
    border-left: 0;
  }

  .student-management-grid {
    grid-template-columns: 1fr;
  }
}

/* Shared select controls */
select:not([multiple]) {
  appearance: none;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid #c8d9ec;
  border-radius: 11px;
  padding-block: 0;
  padding-right: 44px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2358799d' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 18px 18px;
  color: #173457;
  line-height: 1.35;
  vertical-align: middle;
  box-shadow:
    0 4px 14px rgba(42, 83, 130, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.76);
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease;
}

select:not([multiple]):hover:not(:disabled) {
  border-color: #8eb5e6;
  background-color: #fbfdff;
  box-shadow:
    0 6px 18px rgba(42, 83, 130, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

select:not([multiple]):focus-visible {
  border-color: #2475d0;
  outline: none;
  box-shadow:
    0 0 0 4px rgba(36, 117, 208, 0.14),
    0 6px 18px rgba(42, 83, 130, 0.08);
}

select:not([multiple]):disabled {
  border-color: #d9e4ef;
  background-color: #eef4fa;
  color: #71859a;
  box-shadow: none;
}

select option,
select optgroup {
  background-color: #fff;
  color: #173457;
  font-weight: 600;
}

@supports (appearance: base-select) {
  select:not([multiple]),
  select:not([multiple])::picker(select) {
    appearance: base-select;
  }

  select:not([multiple])::picker-icon {
    display: none;
  }

  select:not([multiple])::picker(select) {
    max-height: min(420px, 70vh);
    margin-block: 6px;
    border: 1px solid #c3d8ed;
    border-radius: 14px;
    padding: 6px;
    background: #fff;
    box-shadow: 0 18px 46px rgba(30, 77, 126, 0.18);
  }

  select:not([multiple]) option {
    min-height: 40px;
    align-items: center;
    border-radius: 9px;
    padding: 9px 12px;
    color: #173457;
  }

  select:not([multiple]) option:hover {
    background: #eef6ff;
    color: #0d5fae;
  }

  select:not([multiple]) option:checked {
    background: #e1efff;
    color: #0b63ce;
    font-weight: 760;
  }

  select:not([multiple]) option::checkmark {
    color: #1675df;
  }
}

/* Route stop monthly fare controls */
.route-stop-fare-form .route-fare-version-fields :is(input, select) {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid #c8d9ec;
  border-radius: 11px;
  padding: 0 13px;
  background-color: #fff;
  color: #173457;
  font-weight: 650;
  box-shadow:
    0 4px 14px rgba(42, 83, 130, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.76);
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease;
}

.route-stop-fare-form .route-fare-version-fields select {
  padding-right: 44px;
  background-position: right 16px center;
}

.route-stop-fare-form .route-fare-version-fields :is(input, select):hover:not(:disabled) {
  border-color: #8eb5e6;
  background-color: #fbfdff;
}

.route-stop-fare-form .route-fare-version-fields :is(input, select):focus-visible {
  border-color: #2475d0;
  outline: none;
  box-shadow:
    0 0 0 4px rgba(36, 117, 208, 0.14),
    0 6px 18px rgba(42, 83, 130, 0.08);
}

.route-stop-fare-form .route-fare-version-fields :is(input, select):disabled {
  border-color: #d9e4ef;
  background-color: #eef4fa;
  color: #71859a;
  box-shadow: none;
}

.route-stop-fare-form input[type="date"] {
  color-scheme: light;
  font-variant-numeric: tabular-nums;
}

.route-stop-fare-form input[type="date"]::-webkit-calendar-picker-indicator {
  width: 18px;
  height: 18px;
  margin-left: 8px;
  padding: 4px;
  border-radius: 7px;
  cursor: pointer;
  opacity: 0.68;
  transition:
    background-color 140ms ease,
    opacity 140ms ease;
}

.route-stop-fare-form input[type="date"]::-webkit-calendar-picker-indicator:hover {
  background-color: #e8f2ff;
  opacity: 1;
}

.profile-modal .route-modal-body {
  background: #f8fbff;
}

.profile-modal-form {
  display: grid;
  gap: 18px;
}

.profile-form-grid {
  margin: 0;
}

.profile-modal .form-grid > label,
.profile-password-panel > label {
  display: grid;
  gap: 8px;
  color: #40566f;
  font-size: 13px;
  font-weight: 760;
}

.profile-modal input {
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid #c7d8ed;
  border-radius: 12px;
  background: #ffffff;
  color: #12304f;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: inset 0 1px 2px rgba(29, 63, 101, 0.04);
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background-color 150ms ease;
}

.profile-modal input:hover:not(:disabled) {
  border-color: #93b7e2;
}

.profile-modal input:focus {
  border-color: #2475d0;
  outline: none;
  box-shadow:
    0 0 0 4px rgba(36, 117, 208, 0.13),
    inset 0 1px 2px rgba(29, 63, 101, 0.04);
}

.profile-modal input:disabled {
  cursor: wait;
  background: #eef4fa;
  color: #7b8da1;
}

.profile-access-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-access-summary > div {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-subtle);
}

.profile-access-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.profile-password-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 13px 15px;
  border: 1px solid #c7d8ed;
  border-radius: 13px;
  background: #ffffff;
  color: #12304f;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background-color 150ms ease;
}

.profile-password-toggle:hover,
.profile-password-toggle:focus-visible,
.profile-password-toggle.is-open {
  border-color: #78a9df;
  background: #f4f9ff;
  box-shadow: 0 0 0 3px rgba(36, 117, 208, 0.1);
  outline: none;
}

.profile-password-toggle > span:first-child {
  display: grid;
  gap: 3px;
}

.profile-password-toggle strong {
  color: #1762b5;
  font-size: 14px;
}

.profile-password-toggle small {
  color: #637d96;
  font-size: 12px;
}

.profile-password-chevron {
  color: #2475d0;
  font-size: 22px;
  line-height: 1;
  transition: transform 150ms ease;
}

.profile-password-toggle.is-open .profile-password-chevron {
  transform: rotate(180deg);
}

.profile-password-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
  border: 1px solid #cfe0f2;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(43, 82, 126, 0.07);
}

.profile-password-panel[hidden] {
  display: none;
}

.profile-password-panel .form-span-2 {
  grid-column: 1 / -1;
}

.profile-modal .form-hint {
  color: #637d96;
  font-size: 13px;
  line-height: 1.55;
}

.profile-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@keyframes drawer-in {
  from {
    transform: translateX(40px);
    opacity: 0;
  }
}

.drawer-header,
.drawer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  background: var(--surface);
}

.drawer-header {
  border-bottom: 1px solid var(--line);
}

.drawer-header h2 {
  margin: 0;
  font-size: 20px;
}

.drawer-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.drawer-footer {
  border-top: 1px solid var(--line);
}

.drawer-footer > * {
  flex: 1;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
}

.drawer-stack {
  display: grid;
  gap: 14px;
}

.detail-card {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 16px;
  background: var(--surface);
}

.detail-card h3 {
  margin-bottom: 14px;
  font-size: 14px;
}

.detail-card > p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.detail-list > div,
.detail-value-row,
.invoice-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf0ef;
}

.detail-list > div:last-child,
.invoice-line:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.detail-list dt,
.detail-value-row span {
  color: var(--muted);
  font-size: 10px;
}

.detail-list dd {
  margin: 0;
  font-size: 11px;
  text-align: right;
}

.plain-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.plain-list li {
  padding: 8px 0;
  border-bottom: 1px solid #edf0ef;
  font-size: 11px;
}

.plain-list li:last-child {
  border-bottom: 0;
}

.detail-value-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.student-detail-hero {
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 15px;
  background: var(--surface);
}

.student-detail-hero p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.timeline-list > div,
.subscriber-list > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border-bottom: 1px solid #edf0ef;
}

.timeline-list > div:last-child,
.subscriber-list > div:last-child {
  border-bottom: 0;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border: 2px solid var(--blue);
  border-radius: 50%;
}

.timeline-list strong,
.timeline-list p,
.subscriber-list strong,
.subscriber-list small {
  display: block;
}

.timeline-list strong,
.subscriber-list strong {
  font-size: 11px;
}

.timeline-list p,
.subscriber-list small {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.route-detail-summary {
  grid-template-columns: repeat(3, 1fr);
}

.stop-timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.stop-timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 11px;
  min-height: 60px;
}

.stop-timeline li::after {
  position: absolute;
  top: 30px;
  bottom: 0;
  left: 14px;
  width: 1px;
  background: var(--line-strong);
  content: "";
}

.stop-timeline li:last-child::after {
  display: none;
}

.stop-timeline li > span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}

.stop-timeline strong,
.stop-timeline p {
  display: block;
}

.stop-timeline strong {
  font-size: 11px;
}

.stop-timeline p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.schedule-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #edf0ef;
}

.schedule-list > div:last-child {
  border-bottom: 0;
}

.schedule-list strong {
  font-size: 10px;
}

.schedule-list span {
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}

.attendance-command {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.5fr);
  gap: 15px;
}

.route-selector,
.scan-button {
  min-height: 156px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--surface);
}

.route-selector label {
  display: block;
  margin-bottom: 9px;
  font-size: 11px;
  font-weight: 800;
}

.route-selector select {
  width: 100%;
  padding: 0 12px;
}

.route-selector p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.scan-button {
  display: grid;
  place-items: center;
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.scan-button > span {
  font-size: 32px;
}

.scan-button strong,
.scan-button small {
  display: block;
}

.scan-button small {
  color: #b9c5d3;
  font-size: 9px;
}

.online-switch {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  background: var(--surface);
  font-size: 11px;
  font-weight: 700;
}

.online-switch input {
  width: 17px;
  height: 17px;
  accent-color: var(--green);
}

.attendance-metrics {
  grid-template-columns: repeat(4, 1fr);
}

.attendance-metric-button {
  width: 100%;
  appearance: none;
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  transition:
    background 140ms ease,
    box-shadow 140ms ease;
}

.attendance-metric-button:hover,
.attendance-metric-button.is-active {
  background: var(--blue-soft);
  box-shadow: inset 0 0 0 1px rgba(36, 117, 208, 0.2);
}

.attendance-metric-button.is-active strong,
.attendance-metric-button.is-active span {
  color: var(--blue);
}

.attendance-metric-button:focus-visible {
  position: relative;
  z-index: 1;
  outline: 3px solid rgba(36, 117, 208, 0.28);
  outline-offset: 2px;
}

.attendance-filter-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #b9d6ff;
  border-radius: 12px;
  padding: 9px 12px;
  background: var(--blue-soft);
  color: var(--ink-soft);
  font-size: 12px;
}

.attendance-filter-status strong {
  color: var(--blue);
}

.attendance-roster-region {
  scroll-margin-top: calc(var(--topbar-height) + var(--context-banner-offset) + 18px);
}

.roster-list {
  display: grid;
  gap: 9px;
}

.roster-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 11px 14px;
  background: var(--surface);
}

.roster-person strong,
.roster-person small {
  display: block;
}

.roster-person small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.roster-person p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
}

.roster-contact-trigger,
.roster-contact-empty {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 44px;
  margin-top: 0;
  border: 1px solid #cfe0f4;
  border-radius: 11px;
  padding: 8px 10px;
  background: #f7fbff;
  color: var(--ink-soft);
  font-size: 11px;
  text-align: left;
}

.roster-contact-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

.roster-contact-trigger:hover {
  border-color: #91bdf0;
  background: #edf6ff;
  box-shadow: 0 5px 14px rgba(36, 117, 208, 0.1);
}

.roster-contact-copy {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.roster-contact-copy strong {
  display: inline;
  color: var(--blue);
}

.roster-contact-phone-icon {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: #e5f8f1;
  color: #0f9f74;
}

.roster-contact-phone-icon svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.roster-contact-empty {
  display: flex;
  align-items: center;
  color: var(--muted);
  border-style: dashed;
  background: var(--surface-2);
}

.attendance-contact-modal {
  width: min(520px, 100%);
  max-height: min(680px, calc(100dvh - 32px));
  grid-template-rows: auto minmax(0, 1fr);
}

.attendance-contact-modal .route-modal-body {
  display: grid;
  gap: 10px;
  background: #f3f8fe;
}

.attendance-contact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--surface);
}

.attendance-contact-details {
  min-width: 0;
}

.attendance-contact-details strong,
.attendance-contact-details span {
  display: block;
}

.attendance-contact-details strong {
  font-size: 14px;
}

.attendance-contact-details span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.attendance-contact-call {
  display: inline-flex;
  min-width: 76px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: linear-gradient(135deg, #14b88a, #0f9f74);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.attendance-contact-call.is-disabled {
  background: #e8edf3;
  color: #8b96a5;
  cursor: not-allowed;
}

.attendance-contact-empty-state {
  padding: 28px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.roster-status {
  min-width: 80px;
  text-align: center;
}

.roster-status small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

.roster-actions {
  display: flex;
  gap: 6px;
}

.roster-actions .button {
  min-height: 38px;
  padding-inline: 11px;
  font-size: 10px;
}

.invoice-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 14px;
  padding: 18px;
  background: var(--ink);
  color: #fff;
}

.invoice-total span,
.invoice-total strong {
  display: block;
}

.invoice-total span {
  color: #b9c4d1;
  font-size: 10px;
}

.invoice-total strong {
  margin-top: 5px;
  font-size: 28px;
}

.finance-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 7px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.finance-tabs button {
  min-height: 36px;
  padding: 7px 13px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.finance-tabs button.is-active {
  color: #fff;
  background: var(--blue);
}

.finance-month-control {
  display: grid;
  gap: 4px;
  min-width: 156px;
}

.finance-page-actions {
  align-items: flex-end;
}

.finance-month-control > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.finance-month-control select {
  min-height: 42px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
}

.finance-entry-panel {
  overflow: hidden;
  border-color: #cfe1f7;
  background:
    radial-gradient(circle at 100% 0%, rgba(36, 117, 208, 0.1), transparent 34%),
    var(--surface);
}

.finance-entry-balance {
  min-width: 180px;
  padding: 13px 16px;
  border: 1px solid #cfe1f7;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  text-align: right;
}

.finance-entry-balance span,
.finance-entry-balance strong {
  display: block;
}

.finance-entry-balance span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.finance-entry-balance strong {
  margin-top: 3px;
  color: var(--ink);
  font-size: 23px;
  font-variant-numeric: tabular-nums;
}

.finance-entry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.finance-entry-card {
  display: flex;
  min-height: 168px;
  padding: 20px;
  flex-direction: column;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  text-align: left;
  box-shadow: 0 8px 20px rgba(26, 42, 63, 0.04);
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.finance-entry-card:hover {
  transform: translateY(-2px);
  border-color: #9fc5ef;
  box-shadow: 0 12px 24px rgba(26, 42, 63, 0.09);
}

.finance-entry-card:active {
  transform: translateY(0);
}

.finance-entry-card-primary {
  border-color: var(--blue);
  background: linear-gradient(145deg, #1768c5, #2988e8);
  color: #fff;
}

.finance-entry-kicker {
  margin-bottom: 13px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.finance-entry-card-primary .finance-entry-kicker,
.finance-entry-card-primary .finance-entry-description {
  color: rgba(255, 255, 255, 0.82);
}

.finance-entry-card > strong {
  font-size: 19px;
  line-height: 1.3;
}

.finance-entry-description {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.finance-entry-action {
  display: inline-flex;
  margin-top: auto;
  padding-top: 16px;
  align-items: center;
  gap: 7px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 800;
}

.finance-entry-card-primary .finance-entry-action {
  color: #fff;
}

.billing-primary-action-panel {
  border-color: #cfe1f7;
  background: linear-gradient(145deg, var(--surface), #f3f8ff);
}

.release-history-view {
  gap: 22px;
}

.release-history-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 18px 22px;
}

.release-history-summary > div {
  display: grid;
  gap: 5px;
}

.release-history-summary span,
.release-history-card time,
.release-history-card footer {
  color: var(--muted);
  font-size: 13px;
}

.release-history-summary strong {
  font-size: 22px;
}

.release-timeline {
  position: relative;
  display: grid;
  gap: 18px;
  padding-left: 26px;
}

.release-timeline::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 7px;
  width: 2px;
  content: "";
  background: var(--line-strong);
}

.release-history-card {
  position: relative;
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.release-history-card::before {
  position: absolute;
  top: 27px;
  left: -25px;
  width: 12px;
  height: 12px;
  border: 3px solid var(--canvas);
  border-radius: 50%;
  content: "";
  background: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}

.release-history-card-header,
.release-history-version-line,
.release-history-verification li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.release-history-card-header h2 {
  margin: 8px 0 6px;
}

.release-history-card-header p,
.release-history-followUp p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.65;
}

.release-history-changes h3,
.release-history-excluded h3,
.release-history-followUp h3 {
  margin-bottom: 10px;
  font-size: 15px;
}

.release-history-changes ul,
.release-history-excluded ul,
.release-history-verification ul {
  display: grid;
  gap: 9px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.release-history-changes li {
  display: grid;
  grid-template-columns: minmax(90px, 0.25fr) minmax(0, 1fr);
  gap: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--surface-2);
}

.release-history-changes li span {
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.release-history-verification {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.release-history-verification summary {
  cursor: pointer;
  font-weight: 750;
}

.release-history-verification ul {
  padding-top: 14px;
}

.release-history-verification li {
  flex-wrap: wrap;
}

.release-history-verification li small {
  flex-basis: 100%;
  color: var(--muted);
}

.release-history-excluded,
.release-history-followUp {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--amber-soft);
}

.release-history-excluded li::before {
  margin-right: 8px;
  content: "—";
}

.release-history-card footer {
  padding-top: 2px;
  overflow-wrap: anywhere;
}

@media (max-width: 719px) {
  .release-history-summary {
    grid-template-columns: 1fr;
  }

  .release-timeline {
    padding-left: 18px;
  }

  .release-history-card {
    padding: 17px;
  }

  .release-history-card::before {
    left: -17px;
  }

  .release-history-card-header {
    display: grid;
  }

  .release-history-changes li {
    grid-template-columns: 1fr;
  }
}

.billing-scope-form .form-grid > label > :is(input, select, textarea),
.school-payment-portal-form .form-grid > label > :is(input, select, textarea) {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid #c8d9ec;
  border-radius: 11px;
  padding: 0 13px;
  background-color: #fff;
  color: #173457;
  font: inherit;
  font-weight: 650;
  box-shadow:
    0 4px 14px rgba(42, 83, 130, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.76);
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease;
}

.billing-scope-form .form-grid > label > select,
.school-payment-portal-form .form-grid > label > select {
  padding-right: 44px;
}

.billing-scope-form
  .form-grid
  > label
  > :is(input, select, textarea):hover:not(:disabled),
.school-payment-portal-form
  .form-grid
  > label
  > :is(input, select, textarea):hover:not(:disabled) {
  border-color: #8eb5e6;
  background-color: #fbfdff;
}

.billing-scope-form
  .form-grid
  > label
  > :is(input, select, textarea):focus-visible,
.school-payment-portal-form
  .form-grid
  > label
  > :is(input, select, textarea):focus-visible {
  border-color: #2475d0;
  outline: none;
  box-shadow:
    0 0 0 4px rgba(36, 117, 208, 0.14),
    0 6px 18px rgba(42, 83, 130, 0.08);
}

.billing-scope-form
  .form-grid
  > label
  > :is(input, select, textarea):disabled,
.school-payment-portal-form
  .form-grid
  > label
  > :is(input, select, textarea):disabled {
  border-color: #d9e4ef;
  background-color: #eef4fa;
  color: #71859a;
  box-shadow: none;
}

.billing-scope-form input[type="month"],
.school-payment-portal-form input[type="month"],
.school-payment-portal-form input[type="date"] {
  color-scheme: light;
  font-variant-numeric: tabular-nums;
}

.billing-plain-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.billing-plain-summary > span {
  padding: 14px 16px;
  border: 1px solid #d9e7f7;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.88);
}

.billing-plain-summary small,
.billing-plain-summary strong {
  display: block;
}

.billing-plain-summary small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.billing-plain-summary strong {
  margin-top: 5px;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}

.billing-advanced-workbench {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.billing-advanced-workbench > summary {
  display: flex;
  min-height: 72px;
  padding: 16px 20px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  cursor: pointer;
  list-style: none;
}

.billing-advanced-workbench > summary::-webkit-details-marker {
  display: none;
}

.billing-advanced-workbench > summary span:first-child,
.billing-advanced-workbench > summary strong,
.billing-advanced-workbench > summary small {
  display: block;
}

.billing-advanced-workbench > summary small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.billing-advanced-indicator {
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 14px;
  font-weight: 800;
}

.billing-advanced-workbench[open] .billing-advanced-indicator {
  font-size: 0;
}

.billing-advanced-workbench[open] .billing-advanced-indicator::after {
  content: "收起";
  font-size: 14px;
}

.billing-advanced-content {
  display: grid;
  gap: 16px;
  padding: 0 16px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.billing-advanced-content > .panel,
.billing-advanced-content > .billing-review-checklist {
  margin-top: 16px;
  box-shadow: none;
}

@media screen and (max-width: 1180px) {
  .finance-entry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 719px) {
  .finance-page-actions {
    width: 100%;
    align-items: flex-end;
  }

  .finance-month-control {
    min-width: 0;
    flex: 1 1 auto;
  }

  .finance-month-control select {
    width: 100%;
  }

  .finance-entry-panel .panel-header {
    align-items: stretch;
  }

  .finance-entry-balance {
    width: 100%;
    text-align: left;
  }

  .finance-entry-grid,
  .billing-plain-summary {
    grid-template-columns: 1fr;
  }

  .finance-entry-card {
    min-height: 148px;
    padding: 18px;
  }

  .finance-tabs {
    width: 100%;
  }

  .finance-tabs button {
    min-height: 44px;
    flex: 1 1 auto;
  }

  .billing-advanced-workbench > summary {
    min-height: 76px;
    padding: 14px 16px;
  }

  .billing-advanced-content {
    padding: 0 10px 10px;
  }
}

.receipt-list,
.finance-channel-list {
  display: grid;
  gap: 10px;
}

.receipt-row,
.finance-channel-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.receipt-row strong,
.receipt-row small,
.finance-channel-list strong,
.finance-channel-list p {
  display: block;
}

.receipt-row p,
.finance-channel-list p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.receipt-row > div:last-child {
  text-align: right;
}

button.receipt-row {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

button.receipt-row:hover {
  border-color: #8bbcff;
  background: #f7fbff;
  box-shadow: 0 8px 20px rgb(30 91 159 / 8%);
}

button.receipt-row:focus-visible {
  outline: 3px solid rgb(37 99 235 / 32%);
  outline-offset: 2px;
}

.receipt-row-action {
  display: block;
  margin-top: 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.receipt-document {
  display: grid;
  gap: 14px;
  max-width: 720px;
  padding: 20px;
  border: 1px solid #d3e3f3;
  border-radius: 18px;
  background: linear-gradient(145deg, #ffffff, #f7fbff);
}

.receipt-document-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.receipt-document-header p,
.receipt-document-header h3,
.receipt-document-header span,
.receipt-document-header strong {
  display: block;
}

.receipt-document-header p,
.receipt-document-header span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.receipt-document-header h3 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 22px;
}

.receipt-document-header > div:last-child {
  min-width: 128px;
  text-align: right;
}

.receipt-document-header strong {
  margin-top: 5px;
  color: var(--ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.receipt-document-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0f766e, #119b8e);
  color: #fff;
}

.receipt-document-total span,
.receipt-document-total strong {
  display: block;
}

.receipt-document-total span {
  font-size: 12px;
}

.receipt-document-total strong {
  font-size: 25px;
}

.receipt-document .detail-card {
  padding: 16px;
}

.receipt-document .detail-card h3 {
  margin-bottom: 12px;
}

.receipt-reference dd {
  overflow-wrap: anywhere;
}

.receipt-unallocated {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e3b253;
  color: #9a6700;
}

.receipt-document-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
}

/* Finance batch receipts: keep the immutable company header and every
   allocation readable in the drawer, on a phone, and in print. */
.finance-batch-receipt-document {
  width: 100%;
  max-width: 920px;
}

.finance-batch-receipt-branding {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 4px 8px 12px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.finance-batch-receipt-branding strong {
  color: var(--ink);
  font-size: 19px;
}

.finance-batch-receipt-branding span {
  max-width: 700px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.finance-batch-receipt-logo {
  display: block;
  width: min(260px, 80vw);
  height: auto;
  max-height: 72px;
  object-fit: contain;
}

.finance-batch-receipt-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 2px;
  color: var(--ink);
  font-size: 18px;
}

.finance-batch-receipt-title strong {
  font-size: 13px;
  overflow-wrap: anywhere;
  text-align: right;
}

.finance-batch-receipt-meta .detail-list dd,
.finance-batch-receipt-meta .receipt-reference-value {
  overflow-wrap: anywhere;
}

.finance-batch-receipt-groups {
  display: grid;
  gap: 10px;
}

.finance-batch-receipt-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.finance-batch-receipt-group > div,
.finance-batch-receipt-group strong,
.finance-batch-receipt-group span {
  display: block;
}

.finance-batch-receipt-group > div {
  min-width: 0;
}

.finance-batch-receipt-group strong {
  overflow-wrap: anywhere;
}

.finance-batch-receipt-group > div span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.finance-batch-receipt-group > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.finance-batch-receipt-lines-wrap {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.finance-batch-receipt-lines {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 12px;
}

.finance-batch-receipt-lines th,
.finance-batch-receipt-lines td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

.finance-batch-receipt-lines th {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.finance-batch-receipt-lines td:last-child,
.finance-batch-receipt-lines th:last-child {
  text-align: right;
  white-space: nowrap;
}

.finance-batch-receipt-footer {
  align-items: flex-start;
  line-height: 1.5;
}

/* Approved bilingual company receipt. Transaction values are supplied by the
   receipt/payment projections; this block only owns the presentation. */
.finance-receipt-template-document {
  display: block;
  width: 100%;
  max-width: 760px;
  box-sizing: border-box;
  padding: 24px 26px;
  border: 1.5px solid #111827;
  border-radius: 0;
  background: #fff;
  color: #111827;
  font-family: Arial, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

.finance-receipt-template-branding {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 0 8px 18px;
  text-align: center;
}

.finance-receipt-template-branding p {
  max-width: 650px;
  margin: 0;
  color: #111827;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.finance-receipt-template-logo {
  display: block;
  width: min(100%, 526px);
  height: auto;
  max-height: 94px;
  margin: 0 auto 6px;
  object-fit: contain;
}

.finance-receipt-template-title {
  margin: 0 -26px 20px;
  padding: 12px 20px;
  border-top: 1.5px solid #111827;
  border-bottom: 1.5px solid #111827;
  color: #111827;
  font-size: 19px;
  line-height: 1.2;
  text-align: center;
}

.finance-receipt-template-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  font-size: 12px;
}

.finance-receipt-template-meta span,
.finance-receipt-template-meta strong {
  overflow-wrap: anywhere;
}

.finance-receipt-template-meta strong {
  margin-left: 5px;
}

.finance-receipt-template-field {
  display: grid;
  grid-template-columns: 165px minmax(0, 1fr);
  min-height: 66px;
  margin-bottom: 20px;
  border: 1px solid #374151;
  background: #fff;
}

.finance-receipt-template-label {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  padding: 11px 12px;
  border-right: 1px solid #374151;
  text-align: center;
}

.finance-receipt-template-label strong,
.finance-receipt-template-label span {
  display: block;
  font-size: 11px;
  line-height: 1.25;
}

.finance-receipt-template-value {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.finance-receipt-template-payment-field {
  grid-template-columns: 165px minmax(0, 1fr) 145px;
  min-height: 86px;
}

.finance-receipt-template-lines {
  display: grid;
  align-content: center;
  gap: 8px;
  border-right: 1px solid #374151;
}

.finance-receipt-template-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: start;
  gap: 12px;
  font-size: 12px;
}

.finance-receipt-template-line > div,
.finance-receipt-template-line span,
.finance-receipt-template-line strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.finance-receipt-template-line span {
  margin-top: 2px;
  color: #374151;
}

.finance-receipt-template-line > strong {
  white-space: nowrap;
}

.finance-receipt-template-grand-total {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

.finance-receipt-template-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  align-items: end;
  gap: 24px;
  min-height: 180px;
  padding-top: 20px;
}

.finance-receipt-template-notes {
  align-self: end;
  padding-bottom: 8px;
}

.finance-receipt-template-notes p {
  margin: 4px 0;
  color: #111827;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.finance-receipt-template-signature {
  display: grid;
  justify-items: center;
  text-align: center;
}

.finance-receipt-template-signature img {
  display: block;
  width: 92px;
  height: 96px;
  margin-bottom: -9px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.finance-receipt-template-signature > div {
  width: 100%;
  border-top: 1px solid #111827;
}

.finance-receipt-template-signature strong,
.finance-receipt-template-signature span {
  display: block;
  max-width: 100%;
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .finance-receipt-template-document {
    padding: 18px 16px;
  }

  .finance-receipt-template-title {
    margin-right: -16px;
    margin-left: -16px;
  }

  .finance-receipt-template-meta {
    display: grid;
    gap: 6px;
  }

  .finance-receipt-template-field,
  .finance-receipt-template-payment-field {
    grid-template-columns: 118px minmax(0, 1fr);
  }

  .finance-receipt-template-payment-field .finance-receipt-template-lines {
    border-right: 0;
  }

  .finance-receipt-template-grand-total {
    grid-column: 1 / -1;
    border-top: 1px solid #374151;
  }

  .finance-receipt-template-line {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .finance-receipt-template-footer {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .finance-receipt-template-signature {
    width: min(230px, 100%);
    justify-self: end;
  }
}

.finance-reconciliation {
  display: grid;
  gap: 12px;
}

.finance-reconciliation-cases {
  display: grid;
  gap: 12px;
}

.finance-reconciliation-case {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.finance-reconciliation-case > header,
.finance-reconciliation-case > header > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.finance-reconciliation-case > header > div {
  min-width: 0;
  align-items: flex-start;
  flex-direction: column;
}

.finance-reconciliation-case > header span {
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.finance-reconciliation-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface);
}

.finance-reconciliation-summary span {
  color: var(--muted);
  font-size: 12px;
}

.finance-reconciliation-summary strong {
  overflow-wrap: anywhere;
  text-align: right;
}

.finance-reconciliation-form,
.finance-reconciliation-lines {
  display: grid;
  gap: 10px;
}

.finance-reconciliation-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 220px);
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.finance-reconciliation-line-readonly {
  grid-template-columns: minmax(0, 1fr);
}

.finance-reconciliation-line-copy,
.finance-reconciliation-line-copy span {
  display: block;
}

.finance-reconciliation-line-copy {
  min-width: 0;
}

.finance-reconciliation-line-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.finance-reconciliation-allocation,
.finance-reconciliation-note {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.finance-reconciliation-allocation input,
.finance-reconciliation-note textarea {
  min-height: 44px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
}

.finance-reconciliation-note textarea {
  min-height: 76px;
  resize: vertical;
}

.finance-reconciliation-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--ink);
}

.finance-reconciliation-total span,
.finance-reconciliation-total strong {
  overflow-wrap: anywhere;
}

.finance-reconciliation-total span {
  color: var(--muted);
  font-size: 12px;
}

.finance-reconciliation-form > button {
  min-height: 44px;
}

.finance-batch-receipt-loading,
.finance-batch-receipt-empty,
.finance-reconciliation-loading,
.finance-reconciliation-empty {
  padding: 24px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}

.finance-batch-receipt-empty strong,
.finance-reconciliation-empty strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
}

.finance-batch-receipt-empty p,
.finance-reconciliation-empty p {
  margin: 0;
}

@media (max-width: 560px) {
  .receipt-document {
    padding: 16px;
  }

  .receipt-document-header,
  .receipt-document-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .receipt-document-header > div:last-child {
    min-width: 0;
    text-align: left;
  }

  .finance-batch-receipt-title,
  .finance-batch-receipt-footer,
  .finance-reconciliation-total {
    align-items: flex-start;
    flex-direction: column;
  }

  .finance-batch-receipt-title strong {
    text-align: left;
  }

  .finance-batch-receipt-lines {
    min-width: 0;
  }

  .finance-batch-receipt-lines thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .finance-batch-receipt-lines,
  .finance-batch-receipt-lines tbody,
  .finance-batch-receipt-lines tr,
  .finance-batch-receipt-lines td {
    display: block;
    width: 100%;
  }

  .finance-batch-receipt-lines tr {
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
  }

  .finance-batch-receipt-lines td {
    display: grid;
    grid-template-columns: 7em minmax(0, 1fr);
    gap: 8px;
    padding: 5px 0;
    border: 0;
    text-align: left !important;
  }

  .finance-batch-receipt-lines td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
  }

  .finance-reconciliation-line {
    grid-template-columns: 1fr;
  }

  .finance-reconciliation-allocation input {
    font-size: 16px;
  }
}

.finance-channel-list article > div:last-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.payment-channel-form {
  display: grid;
  gap: 18px;
}

.payment-channel-form .form-grid {
  gap: 18px 14px;
  margin: 0;
  border: 1px solid #d4e3f3;
  border-radius: 18px;
  padding: 18px;
  background:
    linear-gradient(145deg, rgb(255 255 255 / 96%), rgb(245 250 255 / 94%));
  box-shadow: 0 12px 30px rgb(30 91 159 / 7%);
}

.payment-channel-form .form-grid > label {
  gap: 8px;
  min-width: 0;
  color: #536982;
  font-size: 13px;
  font-weight: 780;
}

.payment-channel-form .form-grid > label > span {
  line-height: 1.35;
}

.payment-channel-form .form-grid > label > :is(input, select, textarea) {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid #bfd3e8;
  border-radius: 12px;
  padding: 10px 13px;
  background-color: #fff;
  color: #142d4d;
  font-size: 14px;
  font-weight: 620;
  line-height: 1.4;
  outline: none;
  box-shadow: 0 1px 2px rgb(20 67 112 / 3%);
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background-color 150ms ease;
}

.payment-channel-form .form-grid > label > select {
  padding-right: 42px;
}

.payment-channel-form
  .form-grid
  > label
  > :is(input, select, textarea):hover:not(:disabled) {
  border-color: #8fb9e3;
  background-color: #fbfdff;
}

.payment-channel-form
  .form-grid
  > label
  > :is(input, select, textarea):focus-visible {
  border-color: #2475d0;
  box-shadow: 0 0 0 4px rgb(36 117 208 / 13%);
}

.payment-channel-form input::placeholder {
  color: #8a99aa;
  font-weight: 550;
  opacity: 1;
}

.payment-channel-form .drawer-actions {
  justify-content: flex-end;
  padding: 0 2px 4px;
}

.payment-channel-form .drawer-actions .button-primary {
  min-width: 124px;
  min-height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, #246dd4, #138fe5);
  box-shadow: 0 12px 24px rgb(31 114 214 / 22%);
}

.manual-invoice-form {
  display: grid;
  gap: 18px;
}

.manual-invoice-form .form-grid {
  gap: 18px 14px;
  margin: 0;
  border: 1px solid #d4e3f3;
  border-radius: 18px;
  padding: 18px;
  background:
    linear-gradient(145deg, rgb(255 255 255 / 96%), rgb(245 250 255 / 94%));
  box-shadow: 0 12px 30px rgb(30 91 159 / 7%);
}

.manual-invoice-form .form-grid > label {
  gap: 8px;
  min-width: 0;
  color: #40566f;
  font-size: 13px;
  font-weight: 760;
}

.manual-invoice-form :is(
    input,
    select,
    textarea
  ) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid #bfd3e8;
  border-radius: 12px;
  padding: 10px 13px;
  background-color: #fff;
  color: #142d4d;
  font: inherit;
  font-size: 14px;
  font-weight: 620;
  line-height: 1.4;
  outline: none;
  box-shadow: inset 0 1px 2px rgb(20 67 112 / 4%);
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background-color 150ms ease;
}

.manual-invoice-form :is(
    input,
    select,
    textarea
  ):hover:not(:disabled) {
  border-color: #8fb9e3;
  background-color: #fbfdff;
}

.manual-invoice-form :is(
    input,
    select,
    textarea
  ):focus-visible {
  border-color: #2475d0;
  box-shadow:
    0 0 0 4px rgb(36 117 208 / 13%),
    inset 0 1px 2px rgb(20 67 112 / 4%);
}

.manual-invoice-form select {
  padding-right: 42px;
}

.manual-invoice-form textarea {
  min-height: 96px;
  resize: vertical;
}

.manual-invoice-form :is(input, textarea)::placeholder {
  color: #8a99aa;
  font-weight: 520;
  opacity: 1;
}

.manual-invoice-form :is(input, select, textarea):disabled {
  background-color: #eef4fa;
  color: #7b8da1;
}

.manual-invoice-form .drawer-actions {
  justify-content: flex-end;
  padding: 0 2px 4px;
}

.manual-invoice-form .drawer-actions .button-primary {
  min-width: 136px;
  min-height: 46px;
  border-radius: 12px;
  box-shadow: 0 12px 24px rgb(31 114 214 / 22%);
}

@media (max-width: 560px) {
  .payment-channel-form .form-grid {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .payment-channel-form .form-grid .form-span-2 {
    grid-column: auto;
  }

  .payment-channel-form .drawer-actions .button-primary {
    width: 100%;
  }

  .manual-invoice-form .form-grid {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .manual-invoice-form .form-grid .form-span-2 {
    grid-column: auto;
  }

  .manual-invoice-form .drawer-actions .button-primary {
    width: 100%;
  }
}

.invoice-line strong,
.invoice-line small {
  display: block;
}

.invoice-line strong {
  font-size: 11px;
}

.invoice-line small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

.allocation-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 7px;
}

.allocation-flow > div {
  padding: 10px;
  border-radius: 10px;
  background: var(--surface-2);
}

.allocation-flow span,
.allocation-flow strong {
  display: block;
}

.allocation-flow span {
  color: var(--muted);
  font-size: 8px;
}

.allocation-flow strong {
  margin-top: 4px;
  font-size: 13px;
}

.message-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 16px;
}

.message-composer {
  display: grid;
  gap: 13px;
}

.message-create-form .form-grid {
  gap: 18px 16px;
  margin: 0;
}

.message-create-form .form-grid > label,
.message-create-form .message-channel-field {
  display: grid;
  gap: 8px;
}

.message-create-form .form-grid > label > span,
.message-create-form .message-channel-field > .message-channel-label {
  display: flex;
  min-height: 18px;
  align-items: center;
  margin: 0;
  padding: 0;
  color: #40566f;
  font-size: 13px;
  font-weight: 760;
  line-height: 18px;
  letter-spacing: 0.01em;
}

.message-create-form :is(
    input:not([type="checkbox"]),
    select,
    textarea
  ) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid #c7d8ed;
  border-radius: 12px;
  background-color: #ffffff;
  color: #12304f;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: inset 0 1px 2px rgba(29, 63, 101, 0.04);
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background-color 150ms ease;
}

.message-create-form :is(
    input:not([type="checkbox"]),
    select,
    textarea
  ):hover:not(:disabled) {
  border-color: #93b7e2;
}

.message-create-form :is(
    input:not([type="checkbox"]),
    select,
    textarea
  ):focus-visible {
  border-color: #2475d0;
  outline: none;
  box-shadow:
    0 0 0 4px rgba(36, 117, 208, 0.13),
    inset 0 1px 2px rgba(29, 63, 101, 0.04);
}

.message-create-form :is(input, select, textarea):disabled {
  cursor: wait;
  background-color: #eef4fa;
  color: #7b8da1;
}

.message-create-form select {
  padding-right: 42px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2358799d' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}

.message-create-form textarea {
  min-height: 124px;
  resize: vertical;
}

.message-create-form :is(input, textarea)::placeholder {
  color: #8a9caf;
  font-weight: 500;
  opacity: 1;
}

.message-create-form .checkbox-row {
  gap: 9px;
}

.message-channel-field {
  align-self: start;
}

.message-channel-field .checkbox-row {
  min-height: 56px;
  align-items: stretch;
}

.message-create-form .checkbox-row label {
  min-height: 48px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid #d3e1f1;
  border-radius: 11px;
  background: #f7fbff;
  color: #294866;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    box-shadow 150ms ease;
}

.message-channel-field .checkbox-row label {
  height: 56px;
  min-height: 56px;
}

.message-create-form input[type="date"] {
  height: 56px;
  min-height: 56px;
}

.message-create-form .checkbox-row label:hover {
  border-color: #8db4e2;
  background: #eef6ff;
}

.message-create-form input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: 20px;
  margin: 0;
  accent-color: #2475d0;
  cursor: pointer;
}

.message-create-form .drawer-actions {
  margin-top: 20px;
}

.message-create-form .drawer-actions .button-primary {
  min-height: 46px;
  padding-inline: 20px;
  box-shadow: 0 10px 24px rgba(36, 117, 208, 0.18);
}

.field > span {
  display: block;
  margin: 0 0 6px 2px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
}

.field select {
  width: 100%;
  padding: 0 12px;
}

.message-preview,
.recipient-preview {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: var(--surface-2);
}

.message-preview-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.message-preview-header strong {
  font-size: 12px;
}

.message-preview-header span {
  color: var(--blue);
  font-size: 9px;
  font-weight: 750;
}

.message-preview p,
.recipient-preview p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.recipient-preview {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.recipient-preview strong,
.recipient-preview span {
  display: block;
}

.recipient-preview strong {
  font-size: 24px;
}

.recipient-preview span {
  color: var(--muted);
  font-size: 9px;
}

.channel-list > div,
.message-run-list > div {
  display: grid;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid #edf0ef;
}

.channel-list > div {
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 62px;
}

.channel-list > div:last-child,
.message-run-list > div:last-child {
  border-bottom: 0;
}

.channel-icon,
.message-run-mark {
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  border-radius: 10px;
  background: var(--ink);
  color: var(--amber);
  font-size: 11px;
  font-weight: 900;
}

.channel-list strong,
.channel-list small,
.message-run-list strong,
.message-run-list small {
  display: block;
}

.channel-list strong,
.message-run-list strong {
  font-size: 11px;
}

.channel-list small,
.message-run-list small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.delivery-chart {
  display: flex;
  height: 160px;
  align-items: flex-end;
  justify-content: space-around;
  gap: 12px;
  margin-top: 22px;
  padding: 16px 12px 0;
  border-top: 1px solid var(--line);
}

.delivery-chart > div {
  position: relative;
  width: 36px;
  min-height: 24px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, var(--blue), #8eb9ec);
}

.delivery-chart span {
  position: absolute;
  bottom: -20px;
  left: 50%;
  color: var(--muted);
  font-size: 8px;
  transform: translateX(-50%);
}

.message-run-list > div {
  grid-template-columns: auto minmax(0, 1fr) 70px 70px auto;
  min-height: 62px;
}

.message-run-list > div > span:not(.message-run-mark) {
  text-align: center;
}

.empty-inline {
  padding: 24px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.quality-overview {
  grid-template-columns: 1.2fr repeat(3, 1fr);
}

.quality-overview > div {
  display: flex;
  min-height: 120px;
  flex-direction: column;
  justify-content: center;
  padding: 16px;
  border-right: 1px solid var(--line);
}

.quality-overview > div:last-child {
  border-right: 0;
}

.quality-overview strong {
  margin: 10px 0 5px;
  font-size: 28px;
}

.quality-overview span:not(.badge),
.quality-overview p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.quality-score {
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
}

.quality-score > span,
.quality-score p {
  color: #c0c9d5;
}

.quality-score strong {
  color: var(--amber);
  font-size: 40px;
}

.quality-score strong small {
  font-size: 14px;
}

.quality-list {
  display: grid;
  gap: 8px;
}

.quality-list article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px 14px;
  background: var(--surface);
}

.quality-list article.is-resolved {
  opacity: 0.68;
}

.quality-severity {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  font-weight: 900;
}

.severity-high {
  background: var(--red-soft);
  color: var(--red);
}

.severity-medium {
  background: var(--amber-soft);
  color: #9b6d00;
}

.quality-main > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quality-main strong {
  font-size: 12px;
}

.quality-main p {
  margin: 5px 0;
  color: var(--muted);
  font-size: 10px;
}

.quality-main small {
  color: var(--ink-soft);
  font-size: 9px;
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.person-role-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 130px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px;
  background: var(--surface);
}

.person-role-card .badge {
  grid-column: 1 / -1;
  width: max-content;
}

.person-role-card strong,
.person-role-card p {
  display: block;
}

.person-role-card strong {
  font-size: 12px;
}

.person-role-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.permission-list {
  display: grid;
  gap: 8px;
}

.permission-list > div {
  display: grid;
  grid-template-columns: 140px 150px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 55px;
  border-bottom: 1px solid #edf0ef;
}

.permission-list > div:last-child {
  border-bottom: 0;
}

.permission-list strong,
.permission-list span,
.permission-list p {
  font-size: 10px;
}

.permission-list span,
.permission-list p {
  color: var(--muted);
}

.permission-list p {
  margin: 0;
}

.year-rollover,
.demo-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.year-rollover > div:first-child,
.demo-control > div:first-child {
  max-width: 560px;
}

.year-rollover p,
.demo-control p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.assignment-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.assignment-flow span {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 11px;
  background: var(--surface-2);
  font-size: 9px;
}

.assignment-flow b {
  color: var(--amber);
}

.academic-timeline {
  position: relative;
  display: grid;
  gap: 12px;
  padding-left: 15px;
}

.academic-timeline::before {
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 29px;
  width: 2px;
  background: var(--line);
  content: "";
}

.academic-timeline article {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 17px;
  background: var(--surface);
}

.academic-timeline article.is-current {
  border-color: #87cbbb;
  background: linear-gradient(90deg, #f0fbf7, #fff);
}

.academic-node {
  position: relative;
  z-index: 1;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--green);
}

.academic-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.academic-title h2 {
  margin: 0;
  font-size: 16px;
}

.academic-timeline article p {
  margin: 7px 0 13px;
  color: var(--muted);
  font-size: 10px;
}

.year-rollover ol {
  display: flex;
  max-width: 570px;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rollover;
}

.year-rollover li {
  counter-increment: rollover;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 10px;
  background: var(--surface-2);
  font-size: 9px;
}

.year-rollover li::before {
  margin-right: 5px;
  color: var(--blue);
  content: counter(rollover);
  font-weight: 850;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.settings-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 128px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--surface);
  text-align: left;
}

.settings-card:hover {
  border-color: #b2c7df;
  box-shadow: var(--shadow);
}

.settings-grid .settings-card > span:first-child {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 14px;
  font-weight: 850;
}

.settings-grid .settings-card strong {
  display: block;
  font-size: 16px;
  line-height: 1.35;
}

.settings-grid .settings-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.settings-grid .settings-card b {
  color: var(--muted);
  font-size: 18px;
}

.parent-hero {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  align-items: center;
  gap: 30px;
  min-height: 250px;
  border-radius: 22px;
  padding: 32px;
  background:
    radial-gradient(circle at 90% 0%, rgba(242, 169, 0, 0.32), transparent 35%),
    var(--ink);
  color: #fff;
}

.parent-hero h2 {
  margin: 16px 0 8px;
  font-size: 30px;
}

.parent-hero p {
  color: #bdc9d6;
  line-height: 1.6;
}

.parent-timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.parent-timeline span {
  position: relative;
  padding-top: 35px;
  color: #99a8ba;
  font-size: 9px;
  text-align: center;
}

.parent-timeline span::before {
  position: absolute;
  top: 10px;
  left: 50%;
  z-index: 1;
  width: 15px;
  height: 15px;
  border: 3px solid #52647a;
  border-radius: 50%;
  background: var(--ink);
  content: "";
  transform: translateX(-50%);
}

.parent-timeline span::after {
  position: absolute;
  top: 18px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: #52647a;
  content: "";
}

.parent-timeline span:first-child::after {
  display: none;
}

.parent-timeline .is-done,
.parent-timeline .is-current {
  color: #fff;
}

.parent-timeline .is-done::before,
.parent-timeline .is-done::after {
  border-color: var(--green);
  background: var(--green);
}

.parent-timeline .is-current::before {
  border-color: var(--amber);
  box-shadow: 0 0 0 6px rgba(242, 169, 0, 0.16);
}

.empty-state,
.load-error {
  display: grid;
  min-height: 260px;
  place-items: center;
  align-content: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 30px;
  background: var(--surface);
  text-align: center;
}

.empty-symbol {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 900;
}

.empty-state p,
.load-error p {
  max-width: 520px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.skeleton-view {
  display: grid;
  gap: 18px;
}

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: #e7eae7;
}

.skeleton::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  content: "";
  transform: translateX(-100%);
  animation: skeleton 1.5s infinite;
}

@keyframes skeleton {
  to {
    transform: translateX(100%);
  }
}

.skeleton-title {
  width: 42%;
  height: 74px;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.skeleton-card {
  height: 158px;
}

.skeleton-panel {
  height: 360px;
}

@media (max-width: 1180px) {
  :root {
    --sidebar-width: 78px;
  }

  .brand {
    justify-content: center;
    padding-inline: 10px;
  }

  .brand div,
  .main-navigation button > span:not(.nav-icon),
  .main-navigation button b,
  .sidebar-collapse span:last-child,
  .build-status div {
    display: none;
  }

  .main-navigation button,
  .sidebar-collapse {
    justify-content: center;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .school-grid,
  .route-grid,
  .stop-grid,
  .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .people-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .context-controls select {
    min-width: 210px;
    max-width: 280px;
  }

  .year-control select {
    min-width: 160px;
  }

  .dashboard-grid,
  .dashboard-lower,
  .message-layout {
    grid-template-columns: 1fr;
  }

  .quality-overview {
    grid-template-columns: repeat(2, 1fr);
  }

  .quality-overview > div:nth-child(2) {
    border-right: 0;
  }

  .permission-list > div {
    grid-template-columns: 110px 130px minmax(0, 1fr);
  }

  .permission-list .text-button {
    grid-column: 3;
  }
}

@media (max-width: 820px) {
  .year-control {
    display: none;
  }

  .topbar {
    padding-inline: 18px;
  }

  .demo-banner,
  .main-content {
    padding-inline: 18px;
  }

  .attendance-command {
    grid-template-columns: 1fr;
  }

  .roster-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .roster-actions {
    grid-column: 2 / -1;
  }

  .special-route-panel {
    grid-template-columns: auto 1fr;
  }

  .special-route-panel > .button {
    grid-column: 1 / -1;
  }

  .year-rollover,
  .demo-control {
    align-items: flex-start;
    flex-direction: column;
  }

  .assignment-flow,
  .year-rollover ol {
    justify-content: flex-start;
  }
}

@media (max-width: 719px) {
  :root {
    --topbar-height: 64px;
    --banner-height: 48px;
  }

  body {
    padding-bottom: 74px;
  }

  .desktop-only,
  .sidebar {
    display: none;
  }

  .mobile-only,
  .mobile-brand {
    display: flex;
  }

  .topbar {
    inset: 0 0 auto 0;
    min-height: var(--topbar-height);
    gap: 10px;
    padding: 8px 12px;
  }

  .mobile-brand {
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  .mobile-brand .brand-mark {
    width: 35px;
    height: 35px;
    border-radius: 10px;
    font-size: 11px;
  }

  .mobile-brand strong {
    font-size: 12px;
  }

  .mobile-brand small {
    font-size: 8px;
  }

  .context-controls {
    display: none;
  }

  .topbar-actions {
    gap: 6px;
    margin-left: auto;
  }

  .notification-button {
    min-width: 38px;
    height: 38px;
  }

  .role-switcher {
    padding: 3px;
  }

  .role-switcher .avatar {
    display: none;
  }

  .role-switcher select {
    max-width: 100px;
    min-height: 32px;
    padding: 0 3px;
    font-size: 10px;
  }

  .demo-banner {
    inset: var(--topbar-height) 0 auto 0;
    min-height: var(--banner-height);
    padding: 7px 12px;
  }

  .demo-banner p {
    overflow: hidden;
    font-size: 9px;
    line-height: 1.35;
  }

  .banner-context {
    flex: 0 0 auto;
  }

  .main-content {
    width: 100%;
    margin-left: 0;
    padding: calc(var(--topbar-height) + var(--context-banner-offset) + 18px) 12px 30px;
  }

  .mobile-navigation {
    position: fixed;
    inset: auto 0 0;
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: 68px;
    padding: 6px max(6px, env(safe-area-inset-right))
      calc(6px + env(safe-area-inset-bottom))
      max(6px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 -8px 24px rgba(19, 34, 56, 0.08);
  }

  .mobile-navigation button {
    display: grid;
    min-width: 0;
    min-height: 50px;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
  }

  .mobile-navigation button.is-active {
    background: var(--blue-soft);
    color: var(--blue);
  }

  .mobile-navigation button > span {
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 850;
  }

  .mobile-navigation small {
    font-size: 8px;
    font-weight: 750;
  }

  .view-stack {
    gap: 15px;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }

  .page-header h1 {
    font-size: 27px;
  }

  .page-header p:not(.eyebrow) {
    font-size: 11px;
    line-height: 1.55;
  }

  .page-actions,
  .action-row {
    width: 100%;
  }

  .page-actions .button,
  .action-row .button {
    flex: 1;
  }

  .metric-grid,
  .school-grid,
  .route-grid,
  .stop-grid,
  .settings-grid,
  .people-grid,
  .skeleton-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 132px;
    padding: 17px;
  }

  .metric-card > strong {
    margin-top: 13px;
    font-size: 27px;
  }

  .panel {
    padding: 16px;
  }

  .dashboard-grid,
  .dashboard-lower {
    grid-template-columns: 1fr;
  }

  .trip-progress {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .trip-progress div {
    padding: 10px;
  }

  .trip-progress strong {
    font-size: 20px;
  }

  .rank-item {
    grid-template-columns: 26px minmax(0, 1fr) auto;
  }

  .rank-item > strong:last-child {
    grid-column: 2 / -1;
    font-size: 11px;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-summary {
    justify-content: space-between;
    padding: 2px 6px;
  }

  .search-field {
    min-width: 0;
    width: 100%;
    flex: none;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
    padding-inline: 9px;
  }

  .student-count-strip {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .student-count-strip > span {
    height: 18px;
    transform: rotate(90deg);
    text-align: center;
  }

  .student-count-strip > div {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--surface-2);
  }

  .student-count-strip strong {
    grid-row: 1 / span 2;
    grid-column: 2;
    margin: 0;
  }

  .student-mobile-list,
  .invoice-mobile-list {
    display: grid;
    gap: 8px;
  }

  .student-mobile-card,
  .invoice-mobile-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 74px;
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 11px;
    background: var(--surface);
    text-align: left;
  }

  .student-mobile-main strong,
  .student-mobile-main small,
  .student-mobile-main > span {
    display: block;
  }

  .student-mobile-main strong {
    font-size: 12px;
  }

  .student-mobile-main small {
    margin: 3px 0;
    color: var(--muted);
    font-size: 8px;
  }

  .student-mobile-main > span {
    color: var(--ink-soft);
    font-size: 9px;
  }

  .route-summary-strip,
  .attendance-metrics,
  .route-detail-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .route-summary-strip div:nth-child(2),
  .attendance-metrics .attendance-metric:nth-child(2),
  .route-detail-summary div:nth-child(2) {
    border-right: 0;
  }

  .route-summary-strip div:nth-child(-n + 2),
  .attendance-metrics .attendance-metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .route-card {
    padding: 15px;
  }

  .special-route-panel {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .special-calendar {
    width: 88px;
    height: 96px;
  }

  .special-route-panel > .button {
    grid-column: auto;
  }

  .stop-grid {
    grid-template-columns: 1fr;
  }

  .callout {
    align-items: flex-start;
    flex-direction: column;
  }

  .drawer {
    inset: 5vh 0 0;
    width: 100%;
    max-height: 95vh;
    border-top: 1px solid var(--line);
    border-left: 0;
    border-radius: 18px 18px 0 0;
  }

  .route-modal-layer {
    padding: 0;
  }

  .route-modal {
    width: 100%;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .route-modal-header,
  .route-modal-footer {
    padding: 14px;
  }

  .route-modal-header h2 {
    font-size: 20px;
  }

  .route-modal-body {
    padding: 14px;
  }

  .drawer-actions {
    width: 100%;
  }

  .drawer-actions .button {
    flex: 1;
  }

  .attendance-command {
    grid-template-columns: 1fr;
  }

  .scan-button {
    min-height: 130px;
  }

  .attendance-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .roster-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 11px;
  }

  .roster-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-column: 1 / -1;
  }

  .roster-actions .button {
    min-height: 44px;
  }

  .invoice-mobile-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .invoice-mobile-card span,
  .invoice-mobile-card strong,
  .invoice-mobile-card small {
    display: block;
  }

  .invoice-mobile-card small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 8px;
  }

  .invoice-mobile-money {
    text-align: right;
  }

  .invoice-mobile-money .badge {
    margin-top: 5px;
  }

  .allocation-flow {
    grid-template-columns: 1fr;
  }

  .allocation-flow > span {
    transform: rotate(90deg);
    text-align: center;
  }

  .message-layout {
    grid-template-columns: 1fr;
  }

  .message-run-list > div {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 10px 0;
  }

  .message-run-list > div > span:not(.message-run-mark) {
    display: none;
  }

  .quality-overview {
    grid-template-columns: 1fr 1fr;
  }

  .quality-overview > div {
    min-height: 100px;
    padding: 12px;
  }

  .quality-overview strong {
    font-size: 24px;
  }

  .quality-score strong {
    font-size: 34px;
  }

  .quality-list article {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .quality-list article > .button {
    grid-column: 2;
    min-height: 40px;
    width: max-content;
  }

  .permission-list > div {
    grid-template-columns: 1fr auto;
    gap: 7px;
    padding: 10px 0;
  }

  .permission-list p,
  .permission-list .text-button {
    grid-column: 1 / -1;
  }

  .assignment-flow {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .assignment-flow b {
    transform: rotate(90deg);
    text-align: center;
  }

  .academic-timeline {
    padding-left: 0;
  }

  .academic-timeline::before {
    display: none;
  }

  .academic-timeline article {
    grid-template-columns: 22px minmax(0, 1fr);
    padding: 14px;
  }

  .academic-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-card {
    min-height: 116px;
  }

  .parent-hero {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .parent-timeline {
    grid-template-columns: 1fr;
  }

  .parent-timeline span {
    min-height: 44px;
    padding: 14px 0 0 38px;
    text-align: left;
  }

  .parent-timeline span::before {
    top: 10px;
    left: 8px;
  }

  .parent-timeline span::after {
    top: auto;
    right: auto;
    bottom: 18px;
    left: 15px;
    width: 2px;
    height: 100%;
  }
}

@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;
  }
}

.static-loading-shell {
  min-height: 100vh;
  padding: 38px;
  background:
    radial-gradient(circle at 85% 10%, rgba(242, 169, 0, 0.12), transparent 30%),
    var(--canvas);
}

.static-loading-main {
  width: min(720px, 100%);
  margin: 12vh auto 0;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.static-loading-main h1 {
  margin: 14px 0 8px;
  font-size: clamp(28px, 5vw, 48px);
  letter-spacing: -0.04em;
}

.static-loading-main p {
  margin: 0;
  color: var(--muted);
}

.toast {
  position: fixed;
  z-index: 80;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 13px 16px;
  border: 1px solid color-mix(in srgb, var(--green) 28%, var(--line));
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 18px 46px rgba(19, 34, 56, 0.24);
  animation: toast-in 180ms ease-out;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (max-width: 640px) {
  .static-loading-shell {
    padding: 18px;
  }

  .static-loading-main {
    margin-top: 18vh;
    padding: 24px;
  }

  .toast {
    right: 16px;
    bottom: 82px;
  }
}

/* 2026-07-24 crew operations, account scopes, QR and print */

.service-date-control {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.nanny-dashboard {
  max-width: 1120px;
}

.nanny-task-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.nanny-task-summary > div {
  display: grid;
  gap: 4px;
  min-height: 92px;
  padding: 18px 20px;
  border-right: 1px solid var(--line);
}

.nanny-task-summary > div:last-child {
  border-right: 0;
}

.nanny-task-summary strong {
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.nanny-task-summary span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.nanny-task-list {
  display: grid;
  gap: 14px;
}

.nanny-task-card {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid #c8dcf5;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(239, 247, 255, 0.92), rgba(255, 255, 255, 0.98) 52%),
    var(--surface);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.08);
}

.nanny-task-time {
  display: grid;
  place-items: center;
  gap: 5px;
  min-height: 86px;
  border-radius: 14px;
  color: #0759bb;
  background: #e8f2ff;
}

.nanny-task-time strong {
  font-size: 25px;
  line-height: 1;
}

.nanny-task-time span {
  font-weight: 800;
}

.nanny-task-main,
.nanny-task-title > div {
  min-width: 0;
}

.nanny-task-main {
  display: grid;
  gap: 10px;
}

.nanny-task-title {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.nanny-task-title strong {
  color: var(--ink);
  font-size: 19px;
}

.nanny-task-title p,
.nanny-task-route {
  margin: 4px 0 0;
  color: var(--muted);
}

.nanny-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nanny-task-meta span {
  padding: 5px 9px;
  border-radius: 999px;
  color: #31577f;
  font-size: 13px;
  font-weight: 700;
  background: #f1f6fc;
}

.nanny-task-action {
  min-width: 128px;
}

.crew-view .page-header .action-row {
  align-items: flex-end;
}

.crew-view .online-switch {
  min-height: 44px;
}

.service-date-control input,
.trip-selector select,
.scan-controls select,
.override-form input,
.override-form select {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.service-date-control input:focus,
.trip-selector select:focus,
.scan-controls select:focus,
.override-form input:focus,
.override-form select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(19, 138, 114, 0.12);
}

.trip-command-card {
  display: grid;
  grid-template-columns: minmax(280px, 1.4fr) minmax(250px, 1fr) minmax(210px, 0.7fr);
  gap: 18px;
  align-items: stretch;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(19, 34, 56, 0.02), rgba(242, 169, 0, 0.06)),
    var(--surface);
  box-shadow: var(--shadow);
}

.trip-command-card > * {
  min-width: 0;
}

.trip-selector,
.scan-controls {
  display: grid;
  gap: 9px;
  align-content: start;
}

.trip-selector {
  row-gap: 5px;
}

.trip-selector > label {
  margin-bottom: 0;
}

.trip-selector .trip-meta {
  margin-top: 4px;
}

.trip-selector label,
.scan-controls label,
.trip-selector select,
.scan-controls select {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.trip-selector > label,
.scan-controls label > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.scan-controls label > span {
  margin-bottom: 5px;
}

.trip-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.trip-meta span,
.account-scopes span {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--canvas);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.scan-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--canvas);
}

.scan-mode button {
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.scan-mode button.is-active {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 4px 12px rgba(19, 34, 56, 0.16);
}

.roster-card.is-temporary {
  border-color: rgba(242, 169, 0, 0.48);
  background:
    linear-gradient(90deg, rgba(242, 169, 0, 0.08), transparent 24%),
    var(--surface);
}

.roster-card.is-not-riding {
  border-color: #f0c36c;
  background: #fff9e8;
  opacity: 0.86;
}

.roster-card.is-not-riding .avatar {
  filter: grayscale(0.45);
}

.not-riding-flag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fff0c2;
  color: #8a5a00;
  font-weight: 800;
}

.roster-name-line {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.route-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.route-card-manage {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--blue);
  font-size: inherit;
  font-weight: 750;
  white-space: nowrap;
}

.route-detail-tabs {
  display: flex;
  gap: 8px;
  margin: 18px 0;
  padding-bottom: 10px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.route-detail-tab {
  flex: 0 0 auto;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.route-detail-tab.is-active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

.route-workbench-panel {
  display: grid;
  gap: 14px;
}

.route-operations-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.route-operations-overview article {
  display: grid;
  gap: 5px;
  min-height: 105px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.route-operations-overview span,
.route-operations-overview small,
.route-daily-status span,
.route-daily-status small {
  color: var(--muted);
  font-size: 12px;
}

.route-operations-overview strong {
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-readiness-card {
  margin-top: 14px;
}

.route-readiness-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.route-readiness-list li {
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13px;
}

.route-workbench-table-wrap {
  overflow-x: auto;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.route-pricing-workbench {
  display: grid;
  gap: 14px;
  margin-top: 0;
}

.route-stop-fare-form {
  display: grid;
  gap: 14px;
}

.route-fare-version-fields {
  display: grid;
  grid-template-columns: minmax(150px, 0.6fr) minmax(260px, 1.4fr);
  gap: 12px;
}

.route-fare-version-fields > label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.route-fare-version-fields input,
.route-fare-version-fields select {
  width: 100%;
  min-width: 0;
}

.route-stop-fare-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 13px;
}

.route-stop-fare-table th,
.route-stop-fare-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.route-stop-fare-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.route-stop-fare-table tr:last-child td {
  border-bottom: 0;
}

.route-stop-fare-table td > strong,
.route-stop-fare-table td > small {
  display: block;
}

.route-stop-fare-table td > small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.route-fare-money-input {
  display: inline-flex;
  width: 100%;
  min-height: 44px;
  min-width: 132px;
  align-items: center;
  gap: 0;
  overflow: hidden;
  border: 1px solid #c8d9ec;
  border-radius: 11px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  box-shadow:
    0 4px 14px rgba(42, 83, 130, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.76);
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease;
}

.route-fare-money-input > span {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  align-self: stretch;
  padding: 0 10px;
  border-right: 1px solid #d8e5f2;
  background: #f1f7fd;
  color: #476986;
  letter-spacing: 0.01em;
}

.route-fare-money-input input {
  min-width: 96px;
  width: 100%;
  min-height: 42px;
  border: 0;
  padding: 0 12px;
  outline: 0;
  background: transparent;
  color: #173457;
  font-size: 15px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.route-fare-money-input:hover {
  border-color: #8eb5e6;
}

.route-fare-money-input:focus-within {
  border-color: #2475d0;
  box-shadow:
    0 0 0 4px rgba(36, 117, 208, 0.14),
    0 6px 18px rgba(42, 83, 130, 0.08);
}

.route-fare-money-input:has(input:disabled) {
  border-color: #d9e4ef;
  background: #eef4fa;
  box-shadow: none;
  opacity: 0.72;
}

.route-fare-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.route-fare-actions p {
  margin: 0;
}

.route-stop-load-table,
.route-student-workbench-table {
  width: 100%;
  min-width: 570px;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 13px;
}

.route-student-workbench-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.route-student-workbench-actions .button {
  white-space: nowrap;
}

.route-student-workbench-table {
  min-width: 1040px;
}

.ride-weekday-chips {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.ride-weekday-chip {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid #d8e3ef;
  border-radius: 8px;
  background: #f4f7fa;
  color: #91a0b1;
  font-size: 12px;
  font-weight: 800;
}

.ride-weekday-chip.is-active {
  border-color: #9bc5fb;
  background: #eaf3ff;
  color: #1766c2;
  box-shadow: 0 3px 9px rgba(36, 117, 208, 0.12);
}

.ride-weekday-follow-route {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.route-weekday-edit {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
}

.route-student-monthly-fee,
.route-student-arrears {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.route-student-pricing-issue {
  display: flex;
  max-width: 190px;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.route-student-pricing-issue-detail {
  margin-top: 0 !important;
  line-height: 1.35;
  white-space: normal;
}

.route-student-arrears.is-clear {
  color: var(--green);
}

.route-student-arrears.is-overdue {
  color: var(--red);
}

.route-stop-student-link-layer {
  z-index: 140;
}

.route-stop-student-link-modal {
  width: min(980px, calc(100vw - 36px));
}

.route-stop-student-link-modal .route-modal-body {
  display: grid;
  gap: 16px;
}

.route-stop-student-link-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.route-stop-student-link-summary article {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 15px;
  border: 1px solid #d9e6f4;
  border-radius: 15px;
  background: #f8fbff;
}

.route-stop-student-link-summary article.is-ready {
  border-color: #b8e6d4;
  background: #f0fbf6;
}

.route-stop-student-link-summary article.is-conflict {
  border-color: #f0d89f;
  background: #fff9eb;
}

.route-stop-student-link-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.route-stop-student-link-summary strong {
  color: var(--ink);
  font-size: 25px;
  font-variant-numeric: tabular-nums;
}

.route-stop-student-link-table-wrap {
  max-height: min(48vh, 440px);
  border: 1px solid #d9e6f4;
  border-radius: 15px;
}

.route-stop-student-link-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: #fff;
}

.route-stop-student-link-table th,
.route-stop-student-link-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e4edf6;
  text-align: left;
  vertical-align: top;
}

.route-stop-student-link-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: #eef5fd;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.route-stop-student-link-table tr:last-child td {
  border-bottom: 0;
}

.route-stop-student-link-table td strong,
.route-stop-student-link-table td small {
  display: block;
}

.route-stop-student-link-table td small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.route-stop-student-link-conflict {
  max-width: 220px;
  color: #8b6114 !important;
}

.route-stop-student-link-loading {
  display: grid;
  min-height: 260px;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 28px;
  border: 1px dashed #b9d4ef;
  border-radius: 18px;
  background: #f7fbff;
  text-align: center;
}

.route-stop-student-link-loading > span {
  width: 34px;
  height: 34px;
  border: 4px solid #d9eaff;
  border-top-color: #2475d0;
  border-radius: 50%;
  animation: route-stop-student-spin 720ms linear infinite;
}

.route-stop-student-link-loading small {
  color: var(--muted);
}

@keyframes route-stop-student-spin {
  to {
    transform: rotate(360deg);
  }
}

.route-stop-student-link-empty {
  min-height: 190px;
}

.ride-weekday-modal {
  width: min(760px, calc(100vw - 36px));
}

.ride-weekday-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.ride-weekday-summary > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 15px;
  border: 1px solid #dce8f4;
  border-radius: 14px;
  background: #f8fbff;
}

.ride-weekday-summary span,
.ride-weekday-summary small {
  color: var(--muted);
  font-size: 12px;
}

.ride-weekday-summary strong {
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ride-weekday-selector {
  margin: 16px 0 0;
  border: 1px solid #cfe0f3;
  border-radius: 16px;
  padding: 16px;
  background-color: #fbfdff;
}

.ride-weekday-selector legend {
  padding: 0 7px;
  font-size: 14px;
  font-weight: 850;
}

.ride-weekday-selector > p {
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.ride-weekday-selector > div {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.ride-weekday-selector label {
  position: relative;
  cursor: pointer;
}

.ride-weekday-selector input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ride-weekday-selector label > span {
  display: grid;
  min-height: 72px;
  place-items: center;
  align-content: center;
  gap: 3px;
  border: 1px solid #d8e3ef;
  border-radius: 13px;
  background: #fff;
  color: #718197;
  transition:
    border-color 120ms ease,
    background 120ms ease,
    color 120ms ease,
    box-shadow 120ms ease;
}

.ride-weekday-selector label > span b {
  font-size: 18px;
}

.ride-weekday-selector label > span small {
  font-size: 10px;
}

.ride-weekday-selector input:checked + span {
  border-color: #62a2ee;
  background: #eaf3ff;
  color: #155fae;
  box-shadow: 0 7px 16px rgba(36, 117, 208, 0.13);
}

.ride-weekday-selector input:focus-visible + span {
  outline: 3px solid rgba(36, 117, 208, 0.22);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .route-student-workbench-actions {
    width: 100%;
    justify-content: space-between;
  }

  .route-student-workbench-actions .button {
    flex: 1;
  }

  .route-workbench-panel .detail-section-title {
    flex-wrap: wrap;
  }

  .route-stop-student-link-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ride-weekday-summary {
    grid-template-columns: 1fr;
  }

  .ride-weekday-selector > div {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.route-stop-load-table th,
.route-stop-load-table td,
.route-student-workbench-table th,
.route-student-workbench-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.route-stop-load-table th,
.route-student-workbench-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.route-stop-load-table tr:last-child td,
.route-student-workbench-table tr:last-child td {
  border-bottom: 0;
}

.route-stop-load-table strong,
.route-student-workbench-table strong,
.route-stop-load-table small,
.route-student-workbench-table small {
  display: block;
}

.route-stop-load-table small,
.route-student-workbench-table small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.route-schedule-workbench {
  margin-top: 0;
}

.route-trip-form {
  margin-top: 14px;
}

.route-trip-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.route-trip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.route-trip-row > div {
  display: grid;
  gap: 3px;
}

.route-trip-row > div:last-child {
  justify-items: end;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.route-trip-row small {
  color: var(--muted);
  font-size: 11px;
}

.override-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
}

.override-summary > div {
  display: grid;
  gap: 3px;
  min-height: 92px;
  padding: 18px;
  border-right: 1px solid var(--line);
}

.override-summary > div:last-child {
  border-right: 0;
}

.override-summary strong {
  font-size: 28px;
}

.override-summary span {
  color: var(--muted);
  font-size: 12px;
}

.override-layout {
  display: grid;
  grid-template-columns: minmax(430px, 0.95fr) minmax(420px, 1.05fr);
  gap: 18px;
  align-items: start;
}

.override-form {
  position: sticky;
  top: 112px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 18px 0;
}

.form-grid > label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.form-grid .form-span-2 {
  grid-column: 1 / -1;
}

.form-grid > fieldset.field {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
}

.checkbox-row label {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: var(--ink);
  font-weight: 650;
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.company-signature-preview {
  display: block;
  width: min(100%, 280px);
  max-height: 96px;
  margin-top: 8px;
  padding: 8px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.weekday-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.weekday-checks label {
  display: flex;
  gap: 6px;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--canvas);
  color: var(--ink);
}

.weekday-checks input,
.check-row input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.check-row {
  display: flex !important;
  grid-template-columns: auto 1fr;
  flex-direction: row !important;
  gap: 9px !important;
  align-items: center;
}

.override-preview {
  display: grid;
  grid-template-columns: 1.5fr 0.7fr 0.8fr auto;
  gap: 10px;
  align-items: center;
  margin: 0 0 16px;
  padding: 12px;
  border: 1px dashed color-mix(in srgb, var(--blue) 35%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--blue) 4%, var(--surface));
}

.override-preview > div {
  display: grid;
  gap: 3px;
}

.override-preview span {
  color: var(--muted);
  font-size: 11px;
}

.override-list {
  display: grid;
}

.override-list > article {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.override-list > article:last-child {
  border-bottom: 0;
}

.override-date {
  display: grid;
  gap: 3px;
  padding: 9px;
  border-radius: 11px;
  background: rgba(242, 169, 0, 0.12);
  text-align: center;
}

.override-date strong {
  color: #8a5e00;
  font-size: 16px;
}

.override-date span,
.override-list small {
  color: var(--muted);
  font-size: 11px;
}

.override-list p {
  margin: 5px 0;
}

.override-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.override-activation-error {
  max-width: 260px;
  color: #8a5e00;
  line-height: 1.45;
  text-align: right;
}

.danger-text {
  color: var(--red) !important;
}

.account-session-banner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--blue) 35%, var(--line));
  border-radius: 16px;
  background:
    linear-gradient(110deg, rgba(19, 138, 114, 0.08), transparent 55%),
    var(--surface);
}

.account-session-banner > div {
  display: flex;
  gap: 13px;
  align-items: center;
}

.account-session-banner h2,
.account-session-banner p {
  margin: 2px 0;
}

.account-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-card {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

.account-card.is-current {
  border-color: color-mix(in srgb, var(--blue) 48%, var(--line));
  box-shadow: 0 0 0 3px rgba(19, 138, 114, 0.08);
}

.account-card-main {
  display: grid;
  gap: 6px;
}

.account-card-main > div:first-child {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.account-card-main p {
  margin: 0;
}

.account-scopes {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.qr-credential-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0, rgba(242, 169, 0, 0.16), transparent 36%),
    var(--surface);
  text-align: center;
}

.qr-brand {
  display: flex;
  gap: 9px;
  align-items: center;
  justify-self: start;
  text-align: left;
}

.qr-brand div {
  display: grid;
}

.qr-brand small,
.qr-credential-card > small {
  color: var(--muted);
}

.qr-code {
  width: min(270px, 82vw);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.qr-code svg {
  display: block;
  width: 100%;
  height: auto;
}

.qr-credential-card h2,
.qr-credential-card p {
  margin: 0;
}

.human-code {
  padding: 8px 13px;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.12em;
}

.monospace {
  overflow-wrap: anywhere;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

.qr-fallback {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 220px;
}

.qr-fallback span {
  font-size: 90px;
}

.scanner-panel,
.quick-scan-list,
.scan-result {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.scanner-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.camera-frame {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 270px;
  overflow: hidden;
  border-radius: 14px;
  background: #0b1421;
  color: #fff;
}

.camera-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}

.camera-frame.is-live video {
  opacity: 1;
}

.camera-placeholder {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 5px;
  text-align: center;
}

.camera-frame.is-live .camera-placeholder {
  display: none;
}

.camera-target {
  position: absolute;
  z-index: 2;
  width: 180px;
  height: 180px;
}

.camera-target span {
  position: absolute;
  width: 34px;
  height: 34px;
  border-color: var(--yellow);
  border-style: solid;
}

.camera-target span:nth-child(1) {
  top: 0;
  left: 0;
  border-width: 3px 0 0 3px;
}

.camera-target span:nth-child(2) {
  top: 0;
  right: 0;
  border-width: 3px 3px 0 0;
}

.camera-target span:nth-child(3) {
  right: 0;
  bottom: 0;
  border-width: 0 3px 3px 0;
}

.camera-target span:nth-child(4) {
  bottom: 0;
  left: 0;
  border-width: 0 0 3px 3px;
}

.scan-toast-host {
  position: absolute;
  z-index: 4;
  top: 12px;
  right: 12px;
  left: 12px;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.scan-toast-host.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.scan-toast {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 68px;
  padding: 11px 13px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 15px 36px rgba(3, 18, 43, 0.3);
  color: var(--ink);
  text-align: left;
}

.scan-toast-success {
  border-color: rgba(19, 138, 114, 0.62);
  box-shadow: 0 15px 36px rgba(19, 138, 114, 0.24);
}

.scan-toast-warning {
  border-color: rgba(242, 169, 0, 0.72);
  box-shadow: 0 15px 36px rgba(242, 169, 0, 0.2);
}

.scan-toast-danger {
  border-color: rgba(217, 93, 57, 0.68);
  box-shadow: 0 15px 36px rgba(217, 93, 57, 0.24);
}

.scan-toast strong {
  font-size: 15px;
}

.scan-toast p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.scanner-support {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.scan-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
}

.scan-result-success {
  border-color: rgba(19, 138, 114, 0.42);
  background: rgba(19, 138, 114, 0.07);
}

.scan-result-warning {
  border-color: rgba(242, 169, 0, 0.48);
  background: rgba(242, 169, 0, 0.09);
}

.scan-result-danger {
  border-color: rgba(217, 93, 57, 0.48);
  background: rgba(217, 93, 57, 0.08);
}

.scan-result-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  font-size: 22px;
  font-weight: 900;
}

.scan-toast-success .scan-result-icon {
  background: #138a72;
  color: #fff;
}

.scan-toast-warning .scan-result-icon,
.scan-toast-danger .scan-result-icon {
  background: #d95d39;
  color: #fff;
}

.scan-result p {
  margin: 4px 0;
}

.scan-result small {
  color: var(--muted);
}

.exception-override {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 1fr auto;
  gap: 9px;
}

.exception-override input {
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.quick-scan-list {
  padding: 14px;
}

.quick-scan-list > button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.quick-scan-list > button:last-child {
  border-bottom: 0;
}

.quick-scan-list > button > span:nth-child(2) {
  display: grid;
  gap: 3px;
}

.quick-scan-list small {
  color: var(--muted);
}

.print-layer {
  display: none;
}

.print-preview-stack {
  display: grid;
  gap: 18px;
  overflow-x: auto;
}

.print-service-date-control {
  margin-bottom: 16px;
}

.roster-range-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  margin-bottom: 0;
  background: #f5f9ff;
  border: 1px solid #d3e2f5;
  border-radius: 14px;
}

.roster-range-intro,
.roster-range-fields label {
  display: grid;
  gap: 4px;
}

.roster-range-intro span,
.roster-range-panel small,
.roster-range-summary span,
.roster-range-day small {
  color: var(--muted);
}

.roster-range-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.roster-range-date-field { display: grid; gap: 4px; min-width: 0; }
.roster-range-date-control { position: relative; }
.roster-range-fields input[type="date"] {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 42px 0 14px;
  border: 1px solid #c7dbf4;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(18, 52, 92, 0.05);
  color: #193657;
  color-scheme: light;
  font: inherit;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.roster-range-fields input[type="date"]:hover { border-color: #8db9f0; }
.roster-range-fields input[type="date"]:focus-visible { outline: 2px solid #2584ed; outline-offset: 2px; }
.roster-range-fields input[type="date"]:disabled { background-color: #f3f7fc; color: var(--muted); }
.roster-range-fields input[type="date"]::-webkit-calendar-picker-indicator { display: none; }
.roster-range-date-control button {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 7px;
  background: #eaf3ff;
  color: #186fce;
  cursor: pointer;
}
.roster-range-date-control button:hover { background: #dcecff; }
.roster-range-date-control button:focus-visible { outline: 2px solid #2584ed; outline-offset: 2px; }
.roster-range-date-control button:disabled { cursor: default; opacity: 0.5; }
.roster-range-error { color: #b42318; margin: 0; }
.roster-range-summary { display: flex; gap: 10px; align-items: baseline; margin: 0; }
.roster-range-days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 0; }
.roster-range-day { display: grid; gap: 3px; flex: 0 0 auto; min-width: 100px; padding: 9px 11px; text-align: left; background: #fff; border: 1px solid #d3e2f5; border-radius: 10px; color: #193657; cursor: pointer; }
.roster-range-day.is-selected { background: #eaf3ff; border-color: #1677d2; }

@media (max-width: 650px) {
  .roster-range-fields { grid-template-columns: 1fr 1fr; }
  .roster-range-fields .button { grid-column: 1 / -1; }
}

.print-sheet {
  width: 100%;
  color: #101820;
  background: #fff;
}

.print-sheet-preview {
  min-width: 960px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  transform-origin: top left;
}

.print-sheet-header {
  padding-bottom: 8px;
  border-bottom: 2px solid #1677d2;
}

.roster-sheet-header {
  display: grid;
  gap: 3px;
}

.roster-sheet-route-name {
  color: #0f2e55;
  font-size: 18pt;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.roster-sheet-school-title {
  color: #0f2e55;
  font-size: 14pt;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.roster-sheet-service-date,
.roster-sheet-counts {
  color: #334155;
  font-size: 11pt;
  line-height: 1.25;
}

.print-schedule-warning {
  margin: 6px 0 8px;
  padding: 6px 8px;
  border: 1px solid #d79b24;
  border-radius: 5px;
  background: #fff8df;
  color: #704a00;
  font-size: 10pt;
  font-weight: 700;
  line-height: 1.35;
}

.print-roster {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 11pt;
}

.print-roster th,
.print-roster td {
  padding: 4px 5px;
  border: 1px solid #94a3b8;
  min-width: 0;
  vertical-align: middle;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}

.print-roster th {
  background: #1677d2;
  color: #fff;
  font-size: 10pt;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.print-sheet-am-station .print-roster-am-station,
.print-sheet-pm-station .print-roster-pm-station {
  table-layout: fixed;
}

.print-roster [data-roster-column="number"],
.print-roster [data-roster-column="className"],
.print-roster [data-roster-column="monday"],
.print-roster [data-roster-column="tuesday"],
.print-roster [data-roster-column="wednesday"],
.print-roster [data-roster-column="thursday"],
.print-roster [data-roster-column="friday"] {
  text-align: center;
}

.print-roster [data-roster-column="mondayToThursdayTime"],
.print-roster [data-roster-column="fridayTime"] {
  font-weight: 700;
  text-align: center;
}

.print-roster [data-roster-column="contactNames"],
.print-roster [data-roster-column="contactPhones"] {
  font-size: 11pt;
  line-height: 1.3;
}

.print-roster .roster-stop-cell {
  vertical-align: middle;
  text-align: center;
}

.print-roster .roster-student-name,
.print-roster .roster-student-remark,
.print-roster .roster-contact {
  line-height: 1.3;
}

.print-roster .paper-check {
  height: 24px;
}

.drawer.drawer-print {
  width: min(1280px, 96vw);
}

.drawer.drawer-print .print-sheet-preview {
  min-width: 1200px;
}
@media (max-width: 720px) {
  .drawer.drawer-print {
    width: 100%;
  }
}

.print-roster .is-missing-schedule {
  background: #fff3c4;
  color: #8a4b00;
  font-weight: 900;
}

.print-roster tbody tr:nth-child(even) {
  background: #f5f7f8;
}

.print-roster .temporary-row {
  background: #fff3cf !important;
}

.print-roster .not-riding-row {
  background: #f2f4f7 !important;
  color: #596779;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.print-roster .not-riding-row .not-riding-print-flag {
  text-decoration: none;
}

.paper-check {
  width: 24px;
  font-size: 20px;
  line-height: 1;
  text-align: center;
}

.paper-write-line {
  min-width: 74px;
  box-shadow: inset 0 -1px #5d6570;
}

.temporary-flag {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-left: 5px;
  border-radius: 50%;
  background: #f2a900;
  font-size: 10px;
}

.print-sheet footer {
  padding-top: 7px;
  font-size: 9px;
}

.preview-more {
  margin: 8px 0;
  font-size: 11px;
}

@media (max-width: 1100px) {
  .trip-command-card {
    grid-template-columns: 1fr 1fr;
  }

  .trip-command-card .scan-button {
    grid-column: 1 / -1;
    min-height: 110px;
  }

  .override-layout {
    grid-template-columns: 1fr;
  }

  .override-form {
    position: static;
  }

  .account-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 719px) {
  .trip-command-card {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .trip-command-card .scan-button {
    grid-column: auto;
  }

  .override-summary {
    grid-template-columns: 1fr 1fr;
  }

  .override-summary > div:nth-child(2) {
    border-right: 0;
  }

  .override-summary > div {
    min-height: 76px;
    padding: 13px;
    border-bottom: 1px solid var(--line);
  }

  .override-summary > div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .form-grid,
  .override-preview {
    grid-template-columns: 1fr;
  }

  .form-grid .form-span-2 {
    grid-column: auto;
  }

  .override-list > article {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .override-actions {
    grid-column: 2;
    grid-template-columns: auto auto;
    justify-content: start;
    justify-items: start;
  }

  .override-activation-error {
    grid-column: 1 / -1;
    max-width: none;
    text-align: left;
  }

  .account-session-banner,
  .account-card {
    align-items: stretch;
    flex-direction: column;
  }

  .account-session-banner {
    display: grid;
  }

  .account-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .account-card > .button {
    grid-column: 1 / -1;
  }

  .exception-override {
    grid-template-columns: 1fr;
  }

  .camera-frame {
    min-height: 240px;
  }
}

@page {
  size: A4 landscape;
  margin: 8mm;
}

@media screen {
  /* Receipt drawers use a viewport-sized shell; the page keeps print geometry. */
  body:not(.print-finance-receipt-mode) .drawer.drawer-finance-receipt {
    width: min(744px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
  }

  body:not(.print-finance-receipt-mode) .drawer.drawer-finance-receipt .drawer-header > div {
    min-width: 0;
  }

  body:not(.print-finance-receipt-mode) .drawer.drawer-finance-receipt .drawer-header h2 {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  body:not(.print-finance-receipt-mode) .drawer.drawer-finance-receipt .finance-receipt-preview {
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 0;
    overflow: visible;
  }

  body:not(.print-finance-receipt-mode) .drawer.drawer-finance-receipt .finance-receipt-preview-page {
    --finance-receipt-preview-page-width: 182mm;
    box-sizing: border-box;
    position: absolute;
    top: 0;
    left: calc(50% - 91mm);
    width: var(--finance-receipt-preview-page-width);
    min-width: var(--finance-receipt-preview-page-width);
    max-width: var(--finance-receipt-preview-page-width);
    min-height: 269mm;
    margin: 0;
    transform: scale(var(--finance-receipt-preview-scale, 1));
    transform-origin: top center;
  }

  body:not(.print-finance-receipt-mode) .drawer.drawer-finance-receipt .finance-receipt-preview-page .finance-receipt-template-document {
    display: block;
    width: 100%;
    min-width: 100%;
    max-width: none;
    min-height: 260mm;
    box-sizing: border-box;
    padding: 8mm 10mm;
    border: 0.35mm solid #111;
    background: #fff;
    color: #111;
  }

  body:not(.print-finance-receipt-mode) .drawer.drawer-finance-receipt .finance-receipt-preview-page .finance-receipt-template-logo {
    width: 110mm;
    max-height: 20mm;
  }

  body:not(.print-finance-receipt-mode) .drawer.drawer-finance-receipt .finance-receipt-preview-page .finance-receipt-template-title {
    margin-right: -10mm;
    margin-left: -10mm;
  }

  body:not(.print-finance-receipt-mode) .drawer.drawer-finance-receipt .finance-receipt-preview-page .finance-receipt-template-meta {
    display: flex;
    gap: 18px;
  }

  body:not(.print-finance-receipt-mode) .drawer.drawer-finance-receipt .finance-receipt-preview-page .finance-receipt-template-field {
    grid-template-columns: 165px minmax(0, 1fr);
  }

  body:not(.print-finance-receipt-mode) .drawer.drawer-finance-receipt .finance-receipt-preview-page .finance-receipt-template-payment-field {
    grid-template-columns: 165px minmax(0, 1fr) 145px;
  }

  body:not(.print-finance-receipt-mode) .drawer.drawer-finance-receipt .finance-receipt-preview-page .finance-receipt-template-payment-field .finance-receipt-template-lines {
    border-right: 1px solid #374151;
  }

  body:not(.print-finance-receipt-mode) .drawer.drawer-finance-receipt .finance-receipt-preview-page .finance-receipt-template-grand-total {
    grid-column: auto;
    border-top: 0;
  }

  body:not(.print-finance-receipt-mode) .drawer.drawer-finance-receipt .finance-receipt-preview-page .finance-receipt-template-line {
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 12px;
  }

  body:not(.print-finance-receipt-mode) .drawer.drawer-finance-receipt .finance-receipt-preview-page .finance-receipt-template-payment-field-multipage {
    display: block;
  }

  body:not(.print-finance-receipt-mode) .drawer.drawer-finance-receipt .finance-receipt-preview-page .finance-receipt-template-payment-field-multipage .finance-receipt-template-label {
    border-right: 0;
    border-bottom: 1px solid #374151;
  }

  body:not(.print-finance-receipt-mode) .drawer.drawer-finance-receipt .finance-receipt-preview-page .finance-receipt-template-payment-field-multipage .finance-receipt-template-lines {
    display: block;
    padding: 5mm;
    border-right: 0;
  }

  body:not(.print-finance-receipt-mode) .drawer.drawer-finance-receipt .finance-receipt-preview-page .finance-receipt-template-payment-field-multipage .finance-receipt-template-line + .finance-receipt-template-line {
    margin-top: 2.5mm;
  }

  body:not(.print-finance-receipt-mode) .drawer.drawer-finance-receipt .finance-receipt-preview-page .finance-receipt-template-payment-field-multipage .finance-receipt-template-grand-total {
    justify-content: flex-end;
    border-top: 1px solid #374151;
  }

  body:not(.print-finance-receipt-mode) .drawer.drawer-finance-receipt .finance-receipt-preview-page .finance-receipt-template-footer {
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 24px;
    min-height: 48mm;
  }

  body:not(.print-finance-receipt-mode) .drawer.drawer-finance-receipt .finance-receipt-preview-page .finance-receipt-template-document-multipage .finance-receipt-template-footer {
    min-height: 34mm;
    padding-top: 4mm;
  }

  body:not(.print-finance-receipt-mode) .drawer.drawer-finance-receipt .finance-receipt-preview-page .finance-receipt-template-signature {
    width: 230px;
    justify-self: end;
  }
}

@media print {
  html,
  body {
    margin: 0;
    background: #fff !important;
  }

  body:not(.print-qr-mode):not(.print-ride-cards-mode):not(.print-finance-receipt-mode)
    .app-shell
    > *:not(.print-layer) {
    display: none !important;
  }

  body:not(.print-qr-mode):not(.print-ride-cards-mode) .print-layer {
    display: block !important;
    position: static;
  }

  .print-sheet {
    page: roster;
    break-after: page;
    page-break-after: always;
  }

  .print-sheet:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .print-roster thead {
    display: table-header-group;
  }

  .print-roster tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.print-qr-mode .app-shell > * {
    display: none !important;
  }

  body.print-qr-mode .drawer-layer {
    display: block !important;
    position: static;
    background: #fff;
  }

  body.print-qr-mode .drawer-scrim,
  body.print-qr-mode .drawer-header,
  body.print-qr-mode .drawer-footer,
  body.print-qr-mode .drawer-stack > *:not(.qr-credential-card) {
    display: none !important;
  }

  body.print-qr-mode .drawer,
  body.print-qr-mode .drawer-body,
  body.print-qr-mode .drawer-stack {
    position: static;
    width: auto;
    max-width: none;
    height: auto;
    overflow: visible;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  body.print-qr-mode .qr-credential-card {
    width: 86mm;
    margin: 10mm auto;
    border: 1px solid #111;
    box-shadow: none;
  }
}

/* Phase 1: authenticated production shell */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(circle at 15% 10%, rgba(56, 189, 248, 0.22), transparent 35%),
    radial-gradient(circle at 88% 82%, rgba(37, 99, 235, 0.18), transparent 36%),
    linear-gradient(145deg, #f8fcff 0%, #eef7ff 48%, #f8fbff 100%);
}

.auth-card {
  width: min(100%, 480px);
  padding: 34px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 28px 80px rgba(37, 99, 235, 0.15);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
}

.auth-brand > div,
.account-session > span:last-child {
  display: grid;
  gap: 2px;
}

.auth-brand small,
.account-session small {
  color: var(--muted);
}

.auth-card h1 {
  margin: 6px 0 10px;
  font-size: clamp(1.75rem, 5vw, 2.35rem);
  letter-spacing: -0.04em;
}

.auth-card > p {
  color: var(--muted);
  line-height: 1.7;
}

.auth-form {
  display: grid;
  gap: 16px;
  margin: 26px 0 18px;
}

.auth-form label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.auth-form input {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.auth-form input:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.2);
  border-color: var(--blue);
}

.auth-note {
  display: grid;
  gap: 4px;
  padding: 15px 16px;
  border-radius: 14px;
  background: #eff8ff;
  color: #1e40af;
}

.auth-note span {
  font-size: 0.86rem;
  line-height: 1.5;
}

.account-session {
  display: flex;
  height: 42px;
  align-items: center;
  gap: 8px;
  min-width: 160px;
  padding: 4px 10px;
  border: 1px solid #cfe0f5;
  border-radius: 13px;
  background: linear-gradient(135deg, #f8fbff, #fff);
  box-shadow: 0 3px 10px rgba(47, 89, 140, 0.05);
}

.account-profile-button {
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.account-profile-button:hover,
.account-profile-button:focus-visible {
  border-color: #76a8e4;
  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.12),
    0 6px 16px rgba(47, 89, 140, 0.1);
  outline: none;
}

.topbar .account-session .avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 11px;
}

.topbar .account-session > span:last-child {
  min-width: 0;
  gap: 1px;
  line-height: 1.1;
}

.topbar .account-session strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar .account-session small {
  overflow: hidden;
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 719px) {
  .auth-shell {
    align-items: start;
    padding-top: 56px;
  }

  .auth-card {
    padding: 26px 22px;
    border-radius: 22px;
  }

  .account-session {
    min-width: 0;
    padding: 6px;
    border: 0;
  }

  .account-session > span:last-child {
    display: none;
  }

  .profile-modal-layer {
    align-items: end;
    padding: 12px;
  }

  .profile-modal {
    width: 100%;
    height: auto;
    max-height: calc(100dvh - 24px);
    border: 1px solid var(--line);
    border-radius: 18px;
  }

  .profile-access-summary {
    grid-template-columns: 1fr;
  }

  .profile-password-panel {
    grid-template-columns: 1fr;
  }

  .profile-password-panel > label,
  .profile-password-panel .form-span-2 {
    grid-column: 1;
  }

  .profile-modal-actions {
    position: sticky;
    bottom: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding-top: 4px;
    background: var(--canvas);
  }
}

/* 2026-07-24 formal release: bright, modern, multi-device visual system */
@media screen {
  :root {
    --ink: #10233f;
    --ink-soft: #334e68;
    --navy-2: #1d4ed8;
    --amber: #f59e0b;
    --amber-soft: #fff7df;
    --green: #0f9f82;
    --green-soft: #e9fbf5;
    --red: #dc4c64;
    --red-soft: #fff0f3;
    --blue: #2563eb;
    --blue-soft: #eaf2ff;
    --canvas: #f3f8ff;
    --surface: #ffffff;
    --surface-2: #f7faff;
    --line: #dce8f7;
    --line-strong: #bfd1e8;
    --muted: #64748b;
    --radius: 18px;
    --shadow: 0 18px 44px rgba(37, 99, 235, 0.1);
  }

  html,
  body {
    background:
      radial-gradient(circle at 76% -10%, rgba(14, 165, 233, 0.11), transparent 30rem),
      radial-gradient(circle at 16% 92%, rgba(20, 184, 166, 0.08), transparent 36rem),
      var(--canvas);
  }

  ::selection {
    background: rgba(37, 99, 235, 0.2);
    color: var(--ink);
  }

  button,
  select,
  input,
  textarea {
    touch-action: manipulation;
  }

  button:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible {
    outline-color: rgba(37, 99, 235, 0.34);
  }

  .sidebar {
    border-right: 1px solid var(--line);
    background:
      radial-gradient(circle at 10% 0%, rgba(14, 165, 233, 0.12), transparent 15rem),
      linear-gradient(180deg, #ffffff 0%, #f8fbff 58%, #f1f7ff 100%);
    color: var(--ink);
    box-shadow: 12px 0 38px rgba(55, 95, 145, 0.06);
  }

  .brand {
    border-bottom-color: var(--line);
  }

  .brand-mark {
    border: 1px solid rgba(255, 255, 255, 0.72);
    background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 62%, #22c7a7 100%);
    color: #fff;
    box-shadow:
      0 10px 24px rgba(37, 99, 235, 0.22),
      inset 0 1px 0 rgba(255, 255, 255, 0.28);
  }

  .brand strong,
  .mobile-brand strong {
    color: var(--ink);
    font-weight: 820;
  }

  .brand small,
  .mobile-brand small {
    color: #71839b;
  }

  .main-navigation {
    gap: 6px;
    padding: 17px 12px;
  }

  .main-navigation button,
  .sidebar-collapse {
    color: #52677f;
  }

  .main-navigation button {
    min-height: 48px;
    border: 1px solid transparent;
    border-radius: 13px;
  }

  .main-navigation button:hover,
  .sidebar-collapse:hover {
    background: #eaf2ff;
    color: var(--blue);
  }

  .main-navigation button.is-active {
    border-color: rgba(255, 255, 255, 0.5);
    background: linear-gradient(135deg, #2563eb 0%, #1689eb 100%);
    color: #fff;
    box-shadow: 0 11px 24px rgba(37, 99, 235, 0.22);
  }

  .nav-icon {
    border-color: #c8d7ec;
    background: #f4f8ff;
    color: #41617f;
  }

  .main-navigation button:hover .nav-icon {
    border-color: #b8cef0;
    background: #fff;
    color: var(--blue);
  }

  .main-navigation button.is-active .nav-icon {
    border-color: rgba(255, 255, 255, 0.42);
    background: rgba(255, 255, 255, 0.17);
    color: #fff;
  }

  .main-navigation button b {
    background: #fff;
    color: var(--blue);
    box-shadow: 0 4px 12px rgba(11, 48, 108, 0.14);
  }

  .sidebar-footer {
    border-top-color: var(--line);
  }

  .build-status {
    border: 1px solid #d9e8fb;
    background: linear-gradient(135deg, #eef5ff 0%, #f0fffb 100%);
    color: var(--ink);
  }

  .build-status > span {
    background: #16b88f;
    box-shadow: 0 0 0 5px rgba(22, 184, 143, 0.13);
  }

  .build-status small {
    color: #638092;
  }

  .topbar {
    border-bottom-color: rgba(191, 209, 232, 0.82);
    background: rgba(255, 255, 255, 0.89);
    box-shadow: 0 8px 28px rgba(48, 92, 145, 0.07);
    backdrop-filter: blur(20px) saturate(145%);
  }

  .context-controls select,
  .role-switcher,
  .route-selector select,
  .field input,
  .field select,
  .field textarea,
  .search-field {
    border-color: #ccdaec;
    background: #fff;
    box-shadow: 0 4px 14px rgba(42, 83, 130, 0.04);
  }

  .context-controls select:hover,
  .role-switcher:hover,
  .field input:hover,
  .field select:hover,
  .field textarea:hover,
  .search-field:hover {
    border-color: #94b7e8;
  }

  .notification-button {
    border-color: #d3e1f1;
    background: #fff;
    box-shadow: 0 6px 18px rgba(47, 89, 140, 0.07);
  }

  .notification-button > span {
    color: #f59e0b;
  }

  .avatar {
    border-color: #cfe0f5;
    background: linear-gradient(135deg, #e9f2ff, #e9fffa);
    color: var(--blue);
  }

  .demo-banner {
    border-bottom-color: #c9dcfb;
    background:
      linear-gradient(90deg, rgba(37, 99, 235, 0.08), rgba(14, 165, 233, 0.07) 58%, rgba(20, 184, 166, 0.07)),
      #f8fbff;
    color: #24476f;
  }

  .demo-banner > span:first-child {
    border-color: #7da8e7;
    background: #fff;
    color: var(--blue);
  }

  .banner-context {
    background: #dfeaff;
    color: #1d4ed8;
  }

  .main-content {
    position: relative;
  }

  .main-content::before {
    position: fixed;
    z-index: -1;
    inset: calc(var(--topbar-height) + var(--context-banner-offset)) 0 0 var(--sidebar-width);
    background:
      linear-gradient(rgba(255, 255, 255, 0.2), rgba(243, 248, 255, 0.1)),
      radial-gradient(circle at 86% 15%, rgba(37, 99, 235, 0.07), transparent 24rem);
    content: "";
    pointer-events: none;
  }

  .page-header {
    padding-block: 10px 7px;
  }

  .page-header h1 {
    color: #0f2748;
    font-weight: 850;
    letter-spacing: -0.045em;
  }

  .eyebrow {
    color: var(--blue);
    font-weight: 850;
  }

  .button {
    min-height: 44px;
    border-radius: 12px;
    transition:
      transform 150ms ease,
      box-shadow 150ms ease,
      border-color 150ms ease,
      background 150ms ease;
  }

  .button:hover:not(:disabled) {
    transform: translateY(-1px);
  }

  .button:active:not(:disabled) {
    transform: translateY(0) scale(0.985);
  }

  .button-primary {
    background: linear-gradient(135deg, #2563eb 0%, #0f8fe8 100%);
    color: #fff;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
  }

  .button-primary:hover:not(:disabled) {
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.29);
  }

  .button-secondary {
    border-color: #c7d8ed;
    background: #fff;
    color: #234466;
    box-shadow: 0 5px 14px rgba(49, 88, 134, 0.05);
  }

  .button-secondary:hover:not(:disabled) {
    border-color: #91b7e9;
    background: #f7faff;
    color: var(--blue);
  }

  .button-success {
    background: linear-gradient(135deg, #0f9f82, #18b998);
    box-shadow: 0 10px 22px rgba(15, 159, 130, 0.2);
  }

  .metric-card,
  .panel,
  .table-shell,
  .route-card,
  .stop-card,
  .school-card,
  .person-role-card,
  .settings-card,
  .detail-card,
  .trip-command-card,
  .override-summary,
  .scanner-panel,
  .quick-scan-list,
  .scan-result {
    border-color: rgba(203, 218, 237, 0.86);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 12px 32px rgba(45, 85, 132, 0.07);
  }

  .metric-card {
    min-height: 162px;
    border-top: 3px solid currentColor;
  }

  .metric-card::after {
    right: -28px;
    bottom: -56px;
    width: 155px;
    height: 155px;
    opacity: 0.055;
  }

  .metric-card > strong {
    color: #102c54;
    font-weight: 830;
    letter-spacing: -0.045em;
  }

  .metric-detail {
    color: #657c93;
    font-size: 11px;
  }

  .panel,
  .table-shell {
    backdrop-filter: blur(8px);
  }

  .panel:hover,
  .school-card:hover,
  .person-role-card:hover,
  .settings-card:hover {
    border-color: #b8cfea;
  }

  .today-panel {
    border-color: #c9dbf4;
    background:
      linear-gradient(135deg, rgba(235, 244, 255, 0.96), rgba(239, 255, 250, 0.96)),
      #fff;
  }

  .progress-track {
    background: #e7eff9;
  }

  .progress-track::-webkit-progress-value,
  .progress-track::-moz-progress-bar {
    background: linear-gradient(90deg, #2563eb, #0ea5e9 55%, #14b8a6);
  }

  .count-ladder button,
  .issue-summary button,
  .rank-item,
  .plain-list > *,
  .route-card-metrics span,
  .roster-card,
  .override-list > article {
    border-color: #e0eaf6;
    background: #f8fbff;
  }

  .count-ladder button:hover,
  .issue-summary button:hover,
  .roster-card:hover,
  .override-list > article:hover {
    border-color: #b9d1ee;
    background: #f1f7ff;
  }

  .table-shell thead,
  th {
    background: #f0f6ff;
    color: #49627d;
  }

  tbody tr:hover {
    background: #f6faff;
  }

  .badge-info {
    background: #e5efff;
    color: #1d57c9;
  }

  .badge-success {
    background: #e5faf3;
    color: #08755f;
  }

  .badge-warning {
    background: #fff3d5;
    color: #8a5a00;
  }

  .badge-danger {
    background: #ffedf1;
    color: #b62d46;
  }

  .callout-info {
    border-color: #bdd5fa;
    background: linear-gradient(135deg, #edf5ff, #f8fbff);
  }

  .callout-warning {
    border-color: #f4d991;
    background: linear-gradient(135deg, #fff8e5, #fffdf7);
  }

  .callout-danger {
    border-color: #fac6cf;
    background: linear-gradient(135deg, #fff1f4, #fff9fa);
  }

  .route-card,
  .school-card,
  .stop-card,
  .settings-card {
    transition:
      transform 170ms ease,
      box-shadow 170ms ease,
      border-color 170ms ease;
  }

  .route-card:hover,
  .school-card:hover,
  .stop-card:hover,
  .settings-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
  }

  .school-mark,
  .rank-number,
  .channel-icon {
    background: linear-gradient(135deg, #e5efff, #e6fbf6);
    color: var(--blue);
  }

  .route-code > span,
  .human-code,
  .monospace {
    color: #1e5cc8;
  }

  .scan-button {
    border-color: rgba(255, 255, 255, 0.46);
    background:
      radial-gradient(circle at 88% 8%, rgba(255, 255, 255, 0.23), transparent 8rem),
      linear-gradient(135deg, #2563eb 0%, #0ea5e9 58%, #0fae91 100%);
    color: #fff;
    box-shadow: 0 18px 34px rgba(37, 99, 235, 0.24);
  }

  .scan-button:hover {
    box-shadow: 0 22px 42px rgba(37, 99, 235, 0.3);
  }

  .trip-command-card,
  .override-form {
    background:
      linear-gradient(145deg, rgba(240, 247, 255, 0.92), rgba(255, 255, 255, 0.96) 42%),
      #fff;
  }

  .account-session-banner,
  .parent-hero,
  .qr-credential-card {
    border-color: #bad5f6;
    background:
      radial-gradient(circle at 94% 12%, rgba(14, 165, 233, 0.13), transparent 13rem),
      linear-gradient(120deg, #edf5ff, #effffb 72%, #fff);
    box-shadow: 0 14px 36px rgba(37, 99, 235, 0.09);
  }

  .account-card.is-current {
    border-color: #7faef0;
    box-shadow:
      0 0 0 3px rgba(37, 99, 235, 0.09),
      0 14px 30px rgba(37, 99, 235, 0.09);
  }

  .scanner-panel {
    background: linear-gradient(155deg, #f4f9ff, #fff);
  }

  .camera-frame {
    background:
      radial-gradient(circle at center, rgba(37, 99, 235, 0.18), transparent 9rem),
      linear-gradient(145deg, #173a72, #0e2346);
  }

  .camera-target {
    border-color: #55e6cb;
    box-shadow:
      0 0 0 999px rgba(8, 28, 60, 0.2),
      0 0 30px rgba(85, 230, 203, 0.32);
  }

  .drawer {
    border-left-color: #c8d8eb;
    background:
      radial-gradient(circle at 90% 0%, rgba(14, 165, 233, 0.1), transparent 18rem),
      var(--canvas);
    box-shadow: -28px 0 64px rgba(32, 71, 119, 0.16);
  }

  .drawer-header,
  .drawer-footer {
    background: rgba(255, 255, 255, 0.93);
    backdrop-filter: blur(18px);
  }

  .drawer-scrim {
    background: rgba(20, 48, 82, 0.34);
  }

  .toast {
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: linear-gradient(135deg, #153e7b, #2563eb);
    box-shadow: 0 16px 34px rgba(20, 55, 106, 0.26);
  }

  .mobile-navigation {
    border-top-color: #cbdced;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 -12px 32px rgba(42, 83, 130, 0.11);
    backdrop-filter: blur(18px);
  }

  .mobile-navigation button.is-active {
    background: linear-gradient(145deg, #e5efff, #e8fbf6);
    color: var(--blue);
  }

  .static-loading-shell {
    background:
      radial-gradient(circle at 76% 15%, rgba(14, 165, 233, 0.13), transparent 25rem),
      linear-gradient(145deg, #f5f9ff, #edf6ff);
  }

  .static-loading-main {
    border-color: #cadcf1;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 26px 70px rgba(37, 99, 235, 0.12);
  }

  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      scroll-behavior: auto !important;
      transition-duration: 0.01ms !important;
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
    }
  }
}

@media screen and (max-width: 719px) {
  html,
  body {
    background:
      radial-gradient(circle at 92% 0%, rgba(14, 165, 233, 0.11), transparent 18rem),
      var(--canvas);
  }

  .topbar {
    background: rgba(255, 255, 255, 0.94);
  }

  .demo-banner {
    background: linear-gradient(90deg, #edf5ff, #f0fffb);
  }

  .page-header h1 {
    letter-spacing: -0.035em;
  }

  .metric-card,
  .panel,
  .table-shell,
  .trip-command-card,
  .route-card,
  .school-card,
  .stop-card {
    box-shadow: 0 9px 24px rgba(45, 85, 132, 0.07);
  }

  .button {
    min-height: 46px;
  }

  .main-content::before {
    inset: calc(var(--topbar-height) + var(--context-banner-offset)) 0 0 0;
  }
}

/* Service-date control shared by nanny, attendance, and print workspaces. */
.service-date-field {
  display: grid;
  gap: 6px;
  min-width: 220px;
}

.service-date-field > span {
  color: #69829d;
  font-size: 11px;
  font-weight: 760;
}

.service-date-field input {
  min-height: 42px;
  border: 1px solid #cbdced;
  border-radius: 11px;
  background: #fff;
  color: #173457;
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 680;
}

@media screen and (max-width: 719px) {
  .service-date-field {
    width: 100%;
    min-width: 0;
  }
}
/* 2026-07-24 school identity and contact details */
.school-logo {
  display: inline-grid;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  overflow: hidden;
  place-items: center;
  border: 1px solid #d9e5f3;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 7px 18px rgba(45, 85, 132, 0.1);
}

.school-logo-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.school-logo-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  background: linear-gradient(135deg, #e5efff, #e6fbf6);
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.school-logo-large {
  width: 88px;
  height: 88px;
  border-radius: 21px;
}

.school-card {
  display: flex;
  min-height: 370px;
  flex-direction: column;
}

.school-card header {
  align-items: flex-start;
}

.school-heading {
  min-width: 0;
  padding-top: 3px;
}

.school-card header .school-heading strong {
  overflow: visible;
  font-size: 14px;
  line-height: 1.42;
  text-overflow: clip;
  white-space: normal;
}

.school-contact-list {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
}

.school-contact-list > div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.school-contact-list dt,
.school-contact-list dd {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
}

.school-contact-list dt {
  color: #7890a7;
  font-weight: 750;
}

.school-contact-list dd {
  min-width: 0;
  color: #2d425b;
  overflow-wrap: anywhere;
}

.school-contact-list a,
.detail-list a {
  color: #1e64c8;
  font-weight: 680;
  text-decoration: none;
  text-underline-offset: 2px;
}

.school-contact-list a:hover,
.detail-list a:hover {
  text-decoration: underline;
}

.school-card .school-metrics {
  margin-top: auto;
}

.school-detail-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  border: 1px solid #d7e5f5;
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(135deg, #edf5ff 0%, #f2fffb 100%);
}

.school-detail-hero strong,
.school-detail-hero p {
  display: block;
}

.school-detail-hero strong {
  margin-top: 10px;
  color: #173457;
  font-size: 17px;
  line-height: 1.35;
}

.school-detail-hero p {
  margin: 5px 0 0;
  color: #688098;
  font-size: 11px;
  line-height: 1.5;
}

@media screen and (max-width: 719px) {
  .school-card {
    min-height: 0;
  }

  .school-logo {
    width: 54px;
    height: 54px;
  }

  .school-logo-large {
    width: 76px;
    height: 76px;
  }

  .school-contact-list > div {
    grid-template-columns: 38px minmax(0, 1fr);
  }
}

/* UI readability baseline: start */
@media screen {
  body {
    font-size: 14px;
    line-height: 1.55;
  }

  small {
    font-size: 12px;
    line-height: 1.5;
  }

  button,
  input,
  select,
  textarea {
    font-size: 14px;
  }

  th {
    font-size: 12px;
    line-height: 1.45;
  }

  td {
    font-size: 14px;
    line-height: 1.5;
  }

  .toolbar-summary,
  .result-summary {
    font-size: 13px;
    line-height: 1.5;
  }

  .cell-person small,
  .cell-subtitle {
    font-size: 12px;
    line-height: 1.45;
  }

  .route-card footer > span {
    font-size: 12px;
    line-height: 1.5;
  }

  .school-contact-list dt,
  .school-contact-list dd {
    font-size: 13px;
    line-height: 1.55;
  }

  .callout strong {
    font-size: 13px;
    line-height: 1.5;
  }

  .callout p {
    font-size: 13px;
    line-height: 1.6;
  }

  .brand small,
  .mobile-brand small,
  .main-navigation button b,
  .nav-icon,
  .build-status small,
  .context-controls label > span,
  .notification-button b,
  .demo-banner > span:first-child,
  .banner-context,
  .eyebrow,
  .badge,
  .metric-detail,
  .trip-progress span,
  .rank-number,
  .rank-item small,
  .student-count-strip small,
  .school-mark,
  .school-metrics span,
  .route-summary-strip span,
  .attendance-metrics span,
  .route-detail-summary span,
  .route-card-metrics span,
  .stop-card small,
  .feature-chips span,
  .detail-list dt,
  .detail-value-row span,
  .timeline-list p,
  .subscriber-list small,
  .stop-timeline li > span,
  .stop-timeline p,
  .schedule-list span,
  .scan-button small,
  .roster-person small,
  .roster-status small,
  .invoice-line small,
  .allocation-flow span,
  .field > span,
  .message-preview-header span,
  .recipient-preview span,
  .channel-list small,
  .message-run-list small,
  .delivery-chart span,
  .quality-overview span:not(.badge),
  .quality-overview p,
  .quality-main small,
  .person-role-card p,
  .assignment-flow span,
  .academic-timeline article p,
  .year-rollover li,
  .settings-card p,
  .parent-timeline span,
  .mobile-navigation small,
  .student-mobile-main small,
  .student-mobile-main > span,
  .invoice-mobile-card small,
  .print-meta,
  .print-roster,
  .temporary-flag,
  .print-sheet footer,
  .service-date-field > span,
  .school-detail-hero p {
    font-size: 12px;
    line-height: 1.5;
  }

  .demo-banner p,
  .search-field input,
  .segmented button,
  .pagination span,
  .student-count-strip span,
  .school-card header p,
  .school-alert,
  .route-code > span,
  .route-card > p,
  .stop-card p,
  .drawer-header p,
  .detail-card > p,
  .detail-list dd,
  .plain-list li,
  .student-detail-hero p,
  .timeline-list strong,
  .subscriber-list strong,
  .stop-timeline strong,
  .schedule-list strong,
  .route-selector label,
  .route-selector p,
  .online-switch,
  .roster-person p,
  .roster-actions .button,
  .invoice-total span,
  .invoice-line strong,
  .message-preview p,
  .recipient-preview p,
  .channel-icon,
  .message-run-mark,
  .channel-list strong,
  .message-run-list strong,
  .empty-inline,
  .quality-main p,
  .permission-list strong,
  .permission-list span,
  .permission-list p,
  .year-rollover p,
  .demo-control p,
  .empty-state p,
  .load-error p,
  .mobile-brand .brand-mark,
  .role-switcher select,
  .demo-banner p,
  .mobile-navigation button > span,
  .page-header p:not(.eyebrow),
  .rank-item > strong:last-child,
  .trip-meta span,
  .account-scopes span,
  .override-preview span,
  .override-date span,
  .override-list small,
  .preview-more {
    font-size: 13px;
    line-height: 1.55;
  }

  .school-contact-list a,
  .detail-list a {
    font-weight: 720;
  }
}

@media screen and (max-width: 719px) {
  body {
    font-size: 15px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .search-field input,
  .field input,
  .field select,
  .field textarea,
  .context-controls select,
  .role-switcher select,
  .route-selector select,
  .service-date-control input,
  .service-date-field input {
    font-size: 16px;
  }

  .toolbar-summary,
  .result-summary,
  .callout strong,
  .callout p,
  .school-contact-list dt,
  .school-contact-list dd {
    line-height: 1.6;
  }
}
/* UI readability baseline: end */

/* Phase 2B core records */
.catalog-create-panel,
.catalog-inline-edit {
  border: 1px solid #d9e6f4;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(38, 88, 130, 0.07);
}

.catalog-create-panel > summary,
.catalog-inline-edit > summary {
  cursor: pointer;
  list-style: none;
  padding: 15px 18px;
  color: #0b63ce;
  font-size: 14px;
  font-weight: 780;
}

.catalog-create-panel > summary::-webkit-details-marker,
.catalog-inline-edit > summary::-webkit-details-marker {
  display: none;
}

.catalog-create-panel[open] > summary,
.catalog-inline-edit[open] > summary {
  border-bottom: 1px solid #e6eef7;
}

.catalog-create-panel > .catalog-form,
.catalog-inline-edit > .catalog-form {
  padding: 18px;
}

.catalog-form {
  display: grid;
  gap: 16px;
}

.catalog-form .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.catalog-form label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: #26435f;
  font-size: 13px;
  font-weight: 700;
}

.catalog-form input,
.catalog-form select,
.catalog-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #cddceb;
  border-radius: 11px;
  background-color: #fbfdff;
  color: #122b44;
  font: inherit;
  font-size: 14px;
  font-weight: 560;
  line-height: 1.45;
  padding: 10px 11px;
}

.catalog-form select[multiple] {
  min-height: 180px;
}

.catalog-form textarea {
  min-height: 86px;
  resize: vertical;
}

.catalog-form input:focus-visible,
.catalog-form select:focus-visible,
.catalog-form textarea:focus-visible {
  border-color: #1675df;
  outline: 3px solid rgba(22, 117, 223, 0.14);
}

.catalog-form .form-span-2 {
  grid-column: 1 / -1;
}

.catalog-form .form-help {
  margin: -4px 0 0;
  color: #637d96;
  font-size: 12px;
  font-weight: 560;
  line-height: 1.55;
}

.catalog-form .inline-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.student-number-auto,
.student-number-readonly {
  min-height: 46px;
  box-sizing: border-box;
}

.student-number-auto {
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px 11px;
  border: 1px solid #bdd7f5;
  border-radius: 11px;
  background: linear-gradient(135deg, #f4f9ff, #eef7ff);
  color: #175eae;
}

.student-number-auto strong {
  font-size: 14px;
  line-height: 1.3;
}

.student-number-auto small {
  color: #6683a3;
  font-size: 12px;
  font-weight: 560;
  line-height: 1.35;
}

.student-number-readonly {
  background: #f3f7fb !important;
  color: #55718d !important;
  cursor: not-allowed;
}

.catalog-form .catalog-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: #26435f;
  font-size: 13px;
  font-weight: 700;
}

.student-number-override-control {
  display: flex;
  align-items: stretch;
  gap: 9px;
  min-width: 0;
}

.student-number-override-control input {
  flex: 1 1 auto;
}

.student-number-override-control .button {
  min-height: 46px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.student-number-editable {
  background: #fff !important;
  color: #17324d !important;
  cursor: text !important;
  border-color: #5aa3f4 !important;
}

.student-number-override-hint {
  color: #647f9b;
  font-size: 12px;
  font-weight: 560;
  line-height: 1.4;
}

@media (max-width: 560px) {
  .student-number-override-control {
    flex-direction: column;
  }

  .student-number-override-control .button {
    width: 100%;
  }
}

.student-contact-section {
  display: grid;
  gap: 13px;
}

.student-contact-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.student-contact-section-header p {
  margin: 0;
  color: #607991;
  font-size: 12px;
  font-weight: 560;
  line-height: 1.5;
}

.button-compact {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}

.student-contact-table {
  overflow-x: auto;
  border: 1px solid #d9e7f5;
  border-radius: 12px;
  background: #fbfdff;
}

.student-contact-header,
.student-contact-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(180px, 1fr) 42px;
  align-items: center;
  min-width: 460px;
}

.student-contact-header {
  min-height: 36px;
  padding: 0 9px;
  border-bottom: 1px solid #dce8f4;
  background: #f1f7fe;
  color: #637d98;
  font-size: 12px;
  font-weight: 760;
}

.student-contact-row {
  gap: 8px;
  padding: 8px 9px;
}

.student-contact-row + .student-contact-row {
  border-top: 1px solid #edf3f9;
}

.student-contact-row label {
  display: block;
  min-width: 0;
}

.student-contact-row input:not([type="hidden"]) {
  min-height: 40px;
  padding: 8px 9px;
}

.student-contact-remove {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-color: #f2c9ca;
  color: #bd4950;
  background: #fffafa;
}

.student-contact-remove:hover {
  border-color: #e59ba0;
  background: #fff1f1;
}

.fps-proof-link {
  display: grid;
  gap: 8px;
  width: min(100%, 420px);
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.fps-proof-preview {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted, #f6f9fc);
}

.finance-payment-form {
  display: grid;
  gap: 18px;
}

.finance-payment-form .form-grid {
  gap: 18px 14px;
  margin: 0;
  border: 1px solid #d4e3f3;
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(145deg, rgb(255 255 255 / 96%), rgb(245 250 255 / 94%));
  box-shadow: 0 12px 30px rgb(30 91 159 / 7%);
}

.finance-payment-form .form-grid > label {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: #40566f;
  font-size: 13px;
  font-weight: 760;
}

.finance-payment-form .form-grid > label > :is(input, select, textarea) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid #bfd3e8;
  border-radius: 12px;
  padding: 10px 13px;
  background: #fff;
  color: #142d4d;
  font: inherit;
  font-size: 14px;
  font-weight: 620;
  line-height: 1.4;
  outline: none;
  box-shadow: inset 0 1px 2px rgb(20 67 112 / 4%);
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.finance-payment-form .form-grid > label > :is(input, select, textarea):hover:not(:disabled) {
  border-color: #8fb9e3;
  background: #fbfdff;
}

.finance-payment-form .form-grid > label > :is(input, select, textarea):focus-visible {
  border-color: #2475d0;
  box-shadow: 0 0 0 4px rgb(36 117 208 / 13%);
}

.finance-payment-form .form-grid > label > select {
  padding-right: 42px;
}

.finance-payment-form textarea {
  min-height: 96px;
  resize: vertical;
}

.finance-payment-form .drawer-actions {
  justify-content: flex-end;
  padding: 0 2px 4px;
}

.finance-payment-form .drawer-actions .button-primary {
  min-width: 136px;
  min-height: 46px;
  border-radius: 12px;
  box-shadow: 0 12px 24px rgb(31 114 214 / 22%);
}

.finance-payment-proof-upload {
  display: grid;
  gap: 12px;
  border: 1px solid #d4e3f3;
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(145deg, #fff, #f5faff);
}

.finance-payment-proof-upload-header,
.finance-payment-proof-preview,
.finance-payment-proof-file-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.finance-payment-proof-upload-header {
  justify-content: space-between;
}

.finance-payment-proof-upload-header h3 {
  margin: 0;
  font-size: 15px;
}

.finance-payment-proof-upload-header p,
.finance-payment-proof-file-meta small {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.finance-payment-proof-dropzone {
  display: grid;
  min-height: 116px;
  place-items: center;
  gap: 4px;
  border: 1px dashed #8fb9e3;
  border-radius: 14px;
  padding: 18px;
  background: #f8fbff;
  color: #315b84;
  text-align: center;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.finance-payment-proof-dropzone:hover,
.finance-payment-proof-dropzone.is-dragging {
  border-color: #2475d0;
  background: #edf6ff;
}

.finance-payment-proof-dropzone small {
  color: var(--muted);
  font-size: 12px;
}

.finance-payment-proof-dropzone-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #d9ebff;
  color: #1261bd;
  font-weight: 900;
}

.finance-payment-proof-file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.finance-payment-proof-preview {
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 10px;
  border: 1px solid #d4e3f3;
  border-radius: 14px;
  background: #fff;
}

.finance-payment-proof-preview img {
  display: block;
  width: min(180px, 100%);
  height: 120px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f6f9fc;
}

.finance-payment-proof-file-meta {
  min-width: 0;
  flex: 1 1 120px;
  align-items: flex-start;
  flex-direction: column;
}

.finance-payment-proof-file-meta strong {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-payment-proof-error {
  margin: 0;
  color: #bd4950;
  font-size: 13px;
  font-weight: 700;
}

.finance-payment-proof-link {
  display: block;
  width: min(100%, 460px);
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  cursor: zoom-in;
}

.finance-payment-proof-link:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

.finance-payment-proof-link img {
  display: block;
  width: 100%;
  max-height: 460px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-muted, #f6f9fc);
}

.finance-payment-proof-state {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.finance-payment-proof-state strong {
  color: var(--ink);
}

.finance-payment-proof-state p {
  margin: 0;
}

.finance-payment-proof-state.is-error strong {
  color: var(--red);
}

@media (max-width: 560px) {
  .finance-payment-form .form-grid {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .finance-payment-form .form-grid .form-span-2 {
    grid-column: auto;
  }

  .finance-payment-form .drawer-actions .button-primary {
    width: 100%;
  }

  .finance-payment-proof-upload-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .finance-payment-proof-preview {
    align-items: stretch;
  }

  .finance-payment-proof-preview img {
    width: 100%;
    height: 180px;
  }
}

.student-contact-delete-password-modal {
  width: min(520px, 100%);
}

.student-contact-delete-password-field {
  display: grid;
  gap: 8px;
  color: #26435f;
  font-size: 13px;
  font-weight: 700;
}

.student-contact-delete-password-field input {
  width: 100%;
  border: 1px solid #cddceb;
  border-radius: 11px;
  background: #fbfdff;
  color: #122b44;
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
  padding: 10px 11px;
}

.student-contact-delete-password-field input:focus-visible {
  border-color: #1675df;
  outline: 3px solid rgba(22, 117, 223, 0.14);
}

.student-contact-delete-password-help {
  margin: 10px 0 0;
  color: #637d96;
  font-size: 12px;
  line-height: 1.55;
}

.student-create-modal {
  width: min(860px, calc(100vw - 32px));
  max-height: min(860px, calc(100dvh - 32px));
}

.student-create-modal .route-modal-body {
  padding: 22px 24px 26px;
}

.student-create-modal .catalog-form {
  gap: 18px;
}

@media (max-width: 720px) {
  .student-create-modal {
    width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
  }

  .student-create-modal .catalog-form .form-grid {
    grid-template-columns: 1fr;
  }

  .student-create-modal .catalog-form .form-span-2 {
    grid-column: auto;
  }

  .student-contact-section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .student-contact-section-header .button-compact {
    width: 100%;
  }
}

.school-create-modal {
  width: min(820px, calc(100vw - 32px));
  max-height: min(860px, calc(100dvh - 32px));
}

.school-create-modal .route-modal-body {
  padding: 22px 24px 26px;
}

.school-create-modal .catalog-form {
  gap: 18px;
}

.school-create-modal .school-logo-upload-preview {
  min-height: 120px;
}

.school-create-modal .route-modal-footer .drawer-actions {
  justify-content: flex-end;
}

@media (max-width: 720px) {
  .school-create-modal {
    width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
  }

  .school-create-modal .catalog-form .form-grid {
    grid-template-columns: 1fr;
  }

  .school-create-modal .catalog-form .form-span-2 {
    grid-column: auto;
  }

  .school-create-modal .route-modal-footer .drawer-actions {
    flex-wrap: wrap;
  }

  .school-create-modal .route-modal-footer .button {
    flex: 1 1 140px;
  }
}

.route-create-modal {
  width: min(1120px, 100%);
  gap: 0;
}

.route-create-form-stack {
  display: grid;
  gap: 16px;
}

.route-create-section {
  margin: 0;
}

.route-create-section .detail-section-title {
  margin-bottom: 16px;
}

.route-create-section .detail-section-title h3 {
  margin-bottom: 4px;
}

.route-create-section .detail-section-title p {
  margin: 0;
  color: #657f99;
  font-size: 12px;
  font-weight: 550;
}

.route-create-stop-heading {
  align-items: center;
}

.route-create-stop-list {
  display: grid;
  gap: 10px;
}

.route-create-stop-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #dce8f4;
  border-radius: 13px;
  background: #fbfdff;
}

.route-create-stop-row[data-route-stop-drag-row],
.route-schedule-stop-row[data-route-stop-drag-row] {
  cursor: grab;
  touch-action: none;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.route-create-stop-row[data-route-stop-drag-row]:hover,
.route-schedule-stop-row[data-route-stop-drag-row]:hover {
  border-color: #bdd9f7;
  background: #f7fbff;
}

.route-create-stop-row[data-route-stop-drag-row]:active,
.route-schedule-stop-row[data-route-stop-drag-row]:active {
  cursor: grabbing;
}

.route-create-stop-row:focus-within {
  position: relative;
  z-index: 35;
}

.route-create-stop-order {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: #e8f2ff;
  color: #0b63ce;
  font-size: 14px;
  font-weight: 800;
}

.route-stop-drag-handle {
  appearance: none;
  border: 0;
  padding: 0;
  box-shadow: inset 0 0 0 1px #cfe3fb;
  cursor: grab;
  font-family: inherit;
  line-height: 1;
  touch-action: none;
  user-select: none;
  transition:
    background 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.route-stop-drag-handle:hover,
.route-stop-drag-handle:focus-visible {
  background: #dbeeff;
  box-shadow:
    inset 0 0 0 1px #89baf0,
    0 8px 18px rgba(35, 125, 240, 0.16);
  outline: none;
}

.route-stop-drag-handle:active {
  cursor: grabbing;
  transform: scale(0.96);
}

.route-create-stop-list.is-drag-over,
.route-schedule-stop-list.is-drag-over {
  border-radius: 14px;
}

.route-create-stop-row.is-dragging,
.route-schedule-stop-row.is-dragging {
  border-color: #7fb8f5;
  background: #eef7ff;
  box-shadow: 0 14px 32px rgba(35, 125, 240, 0.18);
  opacity: 0.72;
}

.route-create-stop-combobox {
  position: relative;
  min-width: 0;
}

.route-create-stop-combobox > input[type="search"] {
  width: 100%;
  padding-right: 38px;
}

.route-create-stop-results {
  top: calc(100% + 6px);
  max-height: 260px;
  z-index: 45;
}

.route-create-stop-actions {
  display: flex;
  gap: 6px;
}

.route-create-stop-actions .icon-button {
  width: 36px;
  height: 36px;
  min-height: 36px;
}

.route-create-stop-remove {
  border-color: #ffc9c9;
  color: #d52f2f;
}

.route-create-stop-actions .icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.route-create-footer-actions {
  justify-content: flex-end;
}

.route-create-error {
  margin: 0;
}

.route-create-error[hidden] {
  display: none;
}

@media (max-width: 719px) {
  .route-create-stop-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .route-create-stop-heading .button {
    width: 100%;
  }

  .route-create-stop-row {
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: start;
  }

  .route-create-stop-actions {
    grid-column: 2;
    justify-content: flex-end;
  }
}

.school-logo-upload {
  display: grid;
  gap: 9px;
  min-width: 0;
  color: #26435f;
  font-size: 13px;
  font-weight: 700;
}

.school-logo-upload > small,
.school-logo-current > small {
  color: #657f99;
  font-size: 12px;
  font-weight: 560;
  line-height: 1.5;
}

.school-logo-upload input[type="file"] {
  cursor: pointer;
  padding: 8px;
}

.school-logo-upload input[type="file"]::file-selector-button {
  margin-right: 10px;
  border: 0;
  border-radius: 8px;
  background: #e7f2ff;
  color: #075fc3;
  cursor: pointer;
  font: inherit;
  font-weight: 760;
  padding: 7px 11px;
}

.school-logo-upload-preview,
.school-logo-current {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  border: 1px dashed #bdd3e8;
  border-radius: 13px;
  background: #f7fbff;
  padding: 10px 12px;
}

.school-logo-upload-preview img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: #fff;
  object-fit: contain;
}

.school-logo-upload-placeholder {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: 12px;
  background: #e7f2ff;
  color: #075fc3;
  font-size: 22px;
  font-weight: 850;
}

.catalog-subform {
  margin: 0;
  border: 1px solid #e0eaf4;
  border-radius: 14px;
  padding: 14px;
}

.catalog-subform legend {
  padding: 0 6px;
  color: #42627f;
  font-size: 13px;
  font-weight: 760;
}

.checkbox-line {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
}

.checkbox-line input {
  width: 18px;
  height: 18px;
}

.weekday-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.weekday-checks label {
  display: flex;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 5px;
  padding: 7px 9px;
  border: 1px solid #dce8f4;
  border-radius: 10px;
  background: #f7fbff;
}

.weekday-checks input {
  width: 16px;
  height: 16px;
}

.schedule-editor-list {
  display: grid;
  max-height: 420px;
  overflow: auto;
  border: 1px solid #dce8f4;
  border-radius: 13px;
}

.schedule-editor-list > label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 112px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #edf3f8;
}

.schedule-editor-list > label:last-child {
  border-bottom: 0;
}

.schedule-editor-list input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.schedule-editor-list span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.schedule-editor-list strong {
  font-size: 13px;
}

.schedule-editor-list small {
  overflow: hidden;
  color: #657f98;
  font-size: 12px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-stop-workbench {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid #dce8f4;
  border-radius: 14px;
  background: #fbfdff;
}

.schedule-stop-workbench-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.schedule-stop-workbench-toolbar > div {
  display: grid;
  gap: 4px;
}

.schedule-stop-workbench-toolbar strong {
  font-size: 16px;
}

.schedule-stop-workbench-toolbar span,
.schedule-stop-workbench-hint,
.schedule-stop-editor p {
  color: #657f98;
  font-size: 13px;
  line-height: 1.55;
}

.schedule-bulk-time {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.schedule-bulk-time > span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}

.schedule-bulk-time input {
  min-height: 40px;
  min-width: 112px;
  padding: 6px 10px;
  border: 1px solid #c7dcee;
  border-radius: 10px;
  background: #fff;
}

.schedule-bulk-time .button {
  min-height: 40px;
  padding: 7px 12px;
}

.schedule-route-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.schedule-interval-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  border: 1px solid #d6e7f7;
  border-radius: 11px;
  background: #f6faff;
}

.schedule-interval-controls > span {
  color: #244f77;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.schedule-interval-controls label {
  display: grid;
  gap: 2px;
}

.schedule-interval-controls small {
  color: #657f98;
  font-size: 10px;
  font-weight: 750;
}

.schedule-interval-controls input {
  width: 86px;
  min-height: 34px;
  padding: 5px 7px;
  border: 1px solid #c7dcee;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}

.schedule-interval-controls input[type="number"] {
  width: 62px;
}

.schedule-interval-controls .button {
  min-height: 34px;
  padding: 5px 9px;
  font-size: 12px;
}

.schedule-stop-workbench-hint {
  margin: -2px 0 0;
}

.route-schedule-stop-manager {
  display: grid;
  gap: 14px;
}

.route-schedule-stop-manager .record-form {
  display: grid;
  gap: 12px;
}

.route-schedule-stop-add {
  display: flex;
  align-items: end;
  gap: 10px;
}

.route-schedule-stop-add > label {
  display: grid;
  flex: 1;
  gap: 5px;
  min-width: 0;
}

.route-schedule-stop-add > label > span {
  color: #365c80;
  font-size: 12px;
  font-weight: 800;
}

.route-schedule-stop-combobox {
  position: relative;
  min-width: 0;
}

.route-schedule-stop-combobox > input[type="search"] {
  width: 100%;
  min-height: 42px;
}

.direct-student-results.route-schedule-stop-results {
  top: calc(100% + 6px);
  max-height: 260px;
  z-index: 45;
}

.route-schedule-stop-list {
  display: grid;
  gap: 8px;
}

.route-schedule-stop-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid #dce8f4;
  border-radius: 11px;
  background: #fbfdff;
}

.route-schedule-stop-order {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: #e8f2ff;
  color: #0b63ce;
  font-size: 13px;
  font-weight: 800;
}

.route-schedule-stop-identity {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.route-schedule-stop-identity strong,
.route-schedule-stop-identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-schedule-stop-identity strong {
  color: #223f5d;
  font-size: 14px;
}

.route-schedule-stop-identity small {
  color: #657f98;
  font-size: 12px;
}

.route-schedule-stop-actions {
  display: flex;
  gap: 6px;
}

.route-schedule-stop-actions .icon-button {
  width: 35px;
  height: 35px;
  min-height: 35px;
}

.route-schedule-stop-remove {
  border-color: #ffc9c9;
  color: #d52f2f;
}

.route-schedule-stop-actions .icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.route-schedule-stop-manager-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.route-schedule-stop-manager-actions p {
  margin: 0;
}

.schedule-stop-editor-list {
  display: grid;
  min-width: 0;
  max-width: 100%;
  max-height: 520px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid #dce8f4;
  border-radius: 12px;
  background: #fff;
}

.schedule-stop-card {
  position: relative;
  min-width: 0;
  max-width: 100%;
  border-bottom: 1px solid #e9f0f6;
}

.schedule-stop-card:last-child {
  border-bottom: 0;
}

.schedule-editor-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.schedule-stop-picker-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 10px 12px;
  background: #fff;
  transition: background 140ms ease;
}

.schedule-editor-radio:focus-visible ~ .schedule-stop-picker-card {
  outline: 3px solid rgba(36, 117, 208, 0.22);
  outline-offset: -3px;
}

.schedule-editor-radio:checked ~ .schedule-stop-picker-card {
  background: #f1f7ff;
}

.schedule-stop-selection,
.schedule-stop-selection > span,
.schedule-stop-selection > span > span {
  display: flex;
  min-width: 0;
  align-items: center;
}

.schedule-stop-selection {
  gap: 11px;
  cursor: pointer;
}

.schedule-stop-selection > input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.schedule-stop-selection > span {
  gap: 10px;
}

.schedule-stop-selection b {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: #edf4fb;
  color: #39719f;
  font-size: 11px;
}

.schedule-stop-selection > span > span {
  display: grid;
  gap: 2px;
}

.schedule-stop-selection strong,
.schedule-stop-selection small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-stop-selection strong {
  font-size: 14px;
}

.schedule-stop-selection small {
  color: #657f98;
  font-size: 12px;
}

.schedule-stop-focus {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--blue);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.schedule-stop-editor {
  display: none;
  grid-template-columns: minmax(0, 1fr) 168px;
  align-items: end;
  gap: 12px 18px;
  padding: 14px 18px 16px 53px;
  border-top: 1px solid #d8e9f8;
  background: #f8fbff;
}

.schedule-stop-card > .schedule-editor-radio:checked ~ .schedule-stop-editor {
  display: grid;
}

.schedule-stop-editor .eyebrow {
  margin-bottom: 3px;
  font-size: 10px;
}

.schedule-stop-editor h4 {
  margin: 0;
  font-size: 16px;
}

.schedule-stop-editor p {
  margin: 3px 0 0;
}

.schedule-stop-time-field {
  display: grid;
  gap: 5px;
}

.schedule-stop-time-field > span {
  color: #3d5d7a;
  font-size: 12px;
  font-weight: 800;
}

.schedule-stop-time-field input {
  min-height: 43px;
  padding: 8px 10px;
  border: 1px solid #9fc8ed;
  border-radius: 10px;
  background: #fff;
  font-size: 16px;
  font-weight: 750;
}

.schedule-weekday-section,
.schedule-exception-section {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid #dceaf6;
}

.schedule-weekday-section h5,
.schedule-exception-section h5 {
  margin: 0;
  color: #284c6f;
  font-size: 13px;
}

.schedule-weekday-section p,
.schedule-exception-section p {
  margin-top: 2px;
  font-size: 12px;
}

.schedule-weekday-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.schedule-weekday-grid label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 5px 6px;
  padding: 8px;
  border: 1px solid #d8e8f6;
  border-radius: 9px;
  background: #fff;
}

.schedule-weekday-grid input[type="checkbox"] {
  width: 15px;
  height: 15px;
}

.schedule-weekday-grid span {
  color: #365c80;
  font-size: 12px;
  font-weight: 800;
}

.schedule-weekday-grid input[data-route-schedule-time] {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 34px;
  padding: 4px 6px;
  border: 1px solid #c7dcee;
  border-radius: 7px;
  background: #fff;
  font-size: 13px;
}

.schedule-weekday-grid label:has(input[type="checkbox"]:not(:checked)) {
  opacity: 0.56;
}

.schedule-exception-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.schedule-exception-heading .button {
  min-height: 34px;
  padding: 5px 9px;
  font-size: 12px;
}

.schedule-exception-list {
  display: grid;
  gap: 7px;
}

.schedule-exception-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 38px;
  align-items: end;
  gap: 8px;
  padding: 8px;
  border: 1px solid #dce8f4;
  border-radius: 9px;
  background: #fff;
}

.schedule-exception-row label {
  display: grid;
  gap: 4px;
}

.schedule-exception-row label > span {
  color: #657f98;
  font-size: 11px;
  font-weight: 750;
}

.schedule-exception-row input {
  min-height: 35px;
  padding: 5px 7px;
  border: 1px solid #c7dcee;
  border-radius: 7px;
  background: #fff;
}

.schedule-exception-remove {
  min-width: 38px;
  width: 38px;
  height: 35px;
  min-height: 35px;
  border-color: #f0c1b4;
  color: #a43e24;
}

.schedule-stop-editor-help {
  grid-column: 1 / -1;
  margin-top: -3px !important;
  padding-top: 10px;
  border-top: 1px dashed #c4dcef;
}

.special-route-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 16px;
}

.special-route-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid #dce8f4;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(38, 88, 130, 0.07);
}

.special-route-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.special-route-card h2 {
  margin: 8px 0 4px;
  color: #102c47;
  font-size: 17px;
}

.special-route-card p {
  margin: 0;
  color: #607a93;
  font-size: 13px;
  line-height: 1.55;
}

.stop-card-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

@media screen and (max-width: 719px) {
  .route-grid,
  .stop-grid,
  .settings-grid,
  .people-grid,
  .skeleton-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .route-card,
  .stop-card,
  .special-route-card {
    min-width: 0;
  }

  .catalog-form .form-grid,
  .catalog-form .inline-fields {
    grid-template-columns: 1fr;
  }

  .catalog-form .form-span-2 {
    grid-column: auto;
  }

  .catalog-form input,
  .catalog-form select,
  .catalog-form textarea {
    font-size: 16px;
  }

  .schedule-editor-list > label {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .schedule-editor-list > label > input[type="time"] {
    grid-column: 2;
  }

  .schedule-stop-workbench-toolbar,
  .schedule-route-controls,
  .schedule-bulk-time,
  .schedule-interval-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .schedule-route-controls .button {
    width: 100%;
  }

  .route-schedule-stop-add,
  .route-schedule-stop-manager-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .route-schedule-stop-add .button,
  .route-schedule-stop-manager-actions .button {
    width: 100%;
  }

  .route-schedule-stop-row {
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: start;
  }

  .route-schedule-stop-actions {
    grid-column: 2;
    justify-content: flex-end;
  }

  .schedule-interval-controls input,
  .schedule-interval-controls input[type="number"] {
    width: 100%;
  }

  .schedule-stop-picker-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
  }

  .schedule-stop-focus {
    margin-left: 29px;
  }

  .schedule-stop-editor {
    grid-template-columns: 1fr;
    padding: 13px 14px 15px 53px;
  }

  .schedule-weekday-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .schedule-exception-row {
    grid-template-columns: minmax(0, 1fr) 38px;
  }

  .schedule-exception-row label:last-of-type {
    grid-column: 1;
  }

  .schedule-exception-remove {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .special-route-grid {
    grid-template-columns: 1fr;
  }
}
/* Phase 2B core records: end */

/* Phase 2C data operations */
.data-operations-view {
  --data-blue: #1677e8;
  --data-blue-soft: #eef7ff;
}

.data-operations-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 7px;
  border: 1px solid #d8e6f5;
  border-radius: 18px;
  background: #f6faff;
}

.data-operations-tabs button {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: #49647f;
  font-size: 14px;
}

.data-operations-tabs button > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: #e7f2ff;
  color: #1269c8;
  font-size: 12px;
  font-weight: 850;
}

.data-operations-tabs button.is-active {
  border-color: #c9e2ff;
  background: #fff;
  color: #0e4f96;
  box-shadow: 0 9px 24px rgba(30, 108, 187, 0.12);
}

.data-ops-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
}

.import-upload-panel,
.export-panel,
.ride-card-setup > .panel,
.history-filter-panel {
  border-color: #d8e8f7;
  box-shadow: 0 14px 34px rgba(40, 106, 168, 0.07);
}

.import-upload-panel .field,
.ride-card-setup .field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.import-upload-panel .field select,
.ride-card-setup .field input,
.ride-card-setup .field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cbddec;
  border-radius: 11px;
  background: #fbfdff;
  padding: 0 12px;
}

.import-drop {
  display: grid;
  min-height: 210px;
  place-items: center;
  align-content: center;
  gap: 7px;
  margin: 14px 0 18px;
  border: 2px dashed #9cc8f4;
  border-radius: 17px;
  background:
    radial-gradient(circle at 50% 0%, rgba(59, 150, 244, 0.13), transparent 55%),
    #f8fcff;
  color: #294a6a;
  text-align: center;
}

.import-drop:hover,
.import-drop:focus-within {
  border-color: #1677e8;
  background-color: #f1f8ff;
}

.import-drop-icon {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(145deg, #17a56f, #087a53);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(8, 122, 83, 0.2);
}

.import-drop small,
.form-hint {
  color: #637d96;
  font-size: 12px;
  line-height: 1.55;
}

.import-drop input {
  width: min(100%, 330px);
  margin-top: 8px;
  border: 1px solid #cbddec;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  font-size: 13px;
}

.export-choice-grid {
  display: grid;
  gap: 10px;
}

.export-choice {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid #dfebf5;
  border-radius: 13px;
  background: #fbfdff;
  padding: 12px;
  text-align: left;
}

.export-choice:hover:not(:disabled) {
  border-color: #a8d0f7;
  background: #f3f9ff;
}

.export-choice > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: #e9f4ff;
  color: #1266bc;
  font-weight: 850;
}

.export-choice div {
  display: grid;
  gap: 3px;
}

.export-choice small {
  color: #71869a;
}

.export-choice b {
  color: #1677e8;
  font-size: 20px;
}

.import-preview-card {
  border: 1px solid #cfe4f8;
  border-radius: 18px;
  padding: 22px;
  background: linear-gradient(145deg, #fff, #f8fcff);
  box-shadow: 0 14px 34px rgba(40, 106, 168, 0.07);
}

.import-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.import-summary > div,
.import-summary > button {
  display: grid;
  gap: 4px;
  border: 1px solid #deebf7;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  color: inherit;
  font: inherit;
  text-align: left;
}

.import-summary > button {
  min-height: 82px;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.import-summary > button:hover {
  border-color: #83bced;
  background: #f6fbff;
  transform: translateY(-1px);
}

.import-summary > button:focus-visible {
  outline: 3px solid rgba(22, 119, 232, 0.24);
  outline-offset: 2px;
}

.import-summary > button.is-active {
  border-color: #1677e8;
  background: #edf6ff;
  box-shadow: 0 0 0 2px rgba(22, 119, 232, 0.12);
}

.import-summary span {
  color: #657f98;
  font-size: 12px;
}

.import-summary strong {
  color: #123e68;
  font-size: 22px;
}

.import-preview-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.import-row-filter-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 0 0 12px;
  padding: 8px 12px;
  border: 1px solid #d5e7f7;
  border-radius: 999px;
  background: #f1f7fd;
  color: #315f89;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.35;
}

.import-filter-empty {
  display: grid;
  gap: 5px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px dashed #a9c9e7;
  border-radius: 12px;
  background: #f7fbff;
  color: #315f89;
}

.import-filter-empty p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
}

.import-confirmation-section {
  scroll-margin-top: 96px;
}

.import-confirmation-section:focus {
  outline: 3px solid rgba(22, 119, 232, 0.3);
  outline-offset: 5px;
  border-radius: 16px;
}

.import-contact-impact-panel {
  display: grid;
  gap: 14px;
  margin: 0 0 18px;
  padding: 18px;
  border: 2px solid #efb64c;
  border-radius: 16px;
  background: linear-gradient(145deg, #fffaf0, #fff5e2);
  box-shadow: 0 12px 28px rgba(143, 88, 0, 0.09);
}

.import-contact-impact-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.import-contact-impact-heading h3,
.import-contact-impact-heading p,
.import-contact-impact p {
  margin: 0;
}

.import-contact-impact-hash {
  max-width: 360px;
  color: #76591d;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.import-contact-impact-warning {
  color: #7c4b00;
  line-height: 1.55;
}

.import-contact-impact-list {
  display: grid;
  gap: 12px;
}

.import-contact-impact {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #e6bd6d;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.9);
}

.import-contact-impact.is-conflict {
  border-color: #df6a61;
  background: #fff7f6;
  box-shadow: inset 4px 0 0 #d84a41;
}

.import-contact-impact header,
.import-contact-impact-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.import-contact-impact-values {
  color: #263f57;
  line-height: 1.65;
}

.import-contact-impact-choice {
  color: #176b52;
  font-weight: 700;
}

.import-contact-impact .field {
  margin: 0;
}

.import-contact-transfer-confirmation {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #e9a29c;
  border-radius: 10px;
  background: #fff0ef;
  color: #8f2922;
  line-height: 1.45;
}

.import-contact-transfer-confirmation input {
  flex: 0 0 auto;
  margin-top: 3px;
}

.import-contact-resolution-hint {
  flex-basis: 100%;
  color: #a13b2c;
  font-weight: 700;
  line-height: 1.45;
}

.import-route-binding-panel {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 18px;
  border: 2px solid #e7ad43;
  border-radius: 16px;
  background: linear-gradient(145deg, #fffaf0, #fff4dc);
  box-shadow: 0 12px 28px rgba(143, 88, 0, 0.09);
}

.import-route-binding-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.import-route-binding-heading > div,
.import-route-binding-list {
  display: grid;
  gap: 10px;
}

.import-route-binding-heading p,
.import-route-binding-panel > p,
.import-route-binding-impact p {
  margin: 0;
}

.import-route-binding-panel > p {
  color: #76501a;
  line-height: 1.55;
}

.import-route-binding-hash {
  max-width: 360px;
  color: #76591d;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.import-route-binding-impact {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e4bd76;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.92);
}

.import-route-binding-impact header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.import-route-binding-stop-change {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #243f58;
  font-weight: 750;
}

.import-route-binding-stop-change b {
  color: #a46813;
}

.import-route-binding-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.import-route-binding-controls .field,
.import-route-binding-route-choice {
  margin: 0;
}

.import-route-binding-choice {
  color: #176b52;
  font-weight: 700;
}

.import-route-binding-resolution-hint {
  flex-basis: 100%;
  color: #8a550c;
  font-weight: 700;
  line-height: 1.45;
}

.import-row-route-binding-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}

.import-row-route-binding-summary li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid #c6dcf0;
  border-radius: 999px;
  background: #f4f9fe;
  color: #315c84;
  font-size: 12px;
}

.import-directional-stop-summary {
  display: grid;
  gap: 14px;
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid #b9dafa;
  border-radius: 16px;
  background: linear-gradient(135deg, #f4f9ff, #eef8ff);
}

.import-directional-stop-summary > div:first-child {
  display: grid;
  gap: 5px;
}

.import-directional-stop-summary > div:first-child > strong {
  color: #123e68;
  font-size: 16px;
}

.import-directional-stop-summary > div:first-child > small {
  color: #56738f;
  line-height: 1.55;
}

.import-directional-stop-summary > .import-summary {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin-bottom: 0;
}

.import-new-stop-confirmation {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #e7b458;
  border-radius: 16px;
  background: linear-gradient(135deg, #fffaf0, #fff4d8);
  box-shadow: 0 10px 24px rgba(167, 103, 13, 0.08);
}

.import-new-stop-confirmation__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.import-new-stop-confirmation__heading > div {
  display: grid;
  gap: 4px;
}

.import-new-stop-confirmation__heading .eyebrow {
  color: #99610f;
}

.import-new-stop-confirmation__heading strong {
  color: #6e4309;
  font-size: 17px;
}

.import-new-stop-count {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: #8b580e;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.finance-month-control select,
.finance-page-actions > .button {
  height: 42px;
  min-height: 42px;
}

.import-new-stop-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.import-new-stop-list li {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid rgba(196, 130, 28, 0.24);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.76);
}

.import-new-stop-list strong {
  color: #66400b;
}

.import-new-stop-list span,
.import-new-stop-confirmation > p {
  color: #7d5b29;
  font-size: 12px;
  line-height: 1.55;
}

.import-new-stop-confirmation > p {
  margin: 0;
}

.import-new-stop-acknowledgement {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(154, 96, 14, 0.32);
  border-radius: 12px;
  background: #fff;
  color: #5f3c09;
  font-weight: 750;
  cursor: pointer;
}

.import-new-stop-acknowledgement input {
  width: 20px;
  height: 20px;
  min-height: 20px;
  margin: 0;
  accent-color: #1c6fc4;
}

.import-row-list,
.import-job-list,
.approval-list {
  display: grid;
  gap: 10px;
}

.import-row {
  display: grid;
  gap: 5px;
  border: 1px solid #e0eaf4;
  border-radius: 12px;
  padding: 11px 13px;
  background: #fff;
}

.import-row > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.import-row > div > strong {
  color: #173f67;
  font-size: 17px;
}

.import-row p,
.import-row small {
  margin: 0;
  overflow-wrap: anywhere;
  color: #5e7790;
  font-size: 16px;
  line-height: 1.5;
}

.import-row small {
  color: #a45b12;
}

.import-row-detail {
  font-size: 16px;
  line-height: 1.65;
}

.import-stop-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  margin-top: 2px;
}

.import-stop-pair {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 5px 9px;
  min-width: 0;
}

.import-stop-label {
  font-weight: 800;
}

.import-new-stop-list .import-stop-label--boarding {
  color: #1e65b5;
}

.import-new-stop-list .import-stop-label--alighting {
  color: #6f3ca3;
}

.import-stop-value {
  min-width: 0;
  color: #5e7790;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.import-new-stop-list .import-stop-value {
  color: #5e7790;
}

.import-stop-note {
  grid-column: 2;
}

.import-change-list {
  display: grid;
  gap: 6px;
  margin: 3px 0 0;
  padding: 0;
  list-style: none;
}

.import-change-list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 9px;
  background: #f1f7fd;
  color: #315f89;
  font-size: 16px;
  line-height: 1.55;
}

.import-change-list strong {
  flex: 0 0 auto;
  color: #164f82;
}

.import-preview-actions {
  flex-wrap: wrap;
  margin-top: 18px;
}

.import-preview-actions > span {
  color: #637d96;
  font-size: 12px;
}

.import-preview-filter-summary {
  margin-top: 14px;
}

.import-job {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(130px, 0.45fr) auto;
  align-items: center;
  gap: 16px;
  border: 1px solid #e0eaf4;
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}

.import-job-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  border: 0;
  background: transparent;
  text-align: left;
}

.import-job-main > div {
  min-width: 0;
}

.import-job-main strong,
.import-job-main p {
  display: block;
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-job-main p {
  margin-top: 4px;
  color: #6c8297;
  font-size: 12px;
}

.import-job-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background: #eaf4ff;
  color: #1169c6;
  font-weight: 850;
}

.import-job-progress progress {
  display: block;
  width: 100%;
  height: 10px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #e7eff7;
}

.import-job-progress progress::-webkit-progress-bar {
  background: #e7eff7;
}

.import-job-progress progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, #2687ed, #22b58a);
}

.import-job-progress progress::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, #2687ed, #22b58a);
}

.import-job-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.import-job-actions small {
  color: #6d8295;
  white-space: nowrap;
}

.student-picker-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 8px;
  color: #607a92;
  font-size: 12px;
}

.student-picker-toolbar .text-button {
  margin-left: auto;
}

.student-picker {
  display: grid;
  max-height: 390px;
  overflow: auto;
  margin-bottom: 16px;
  border: 1px solid #dce8f4;
  border-radius: 14px;
}

.student-picker label {
  display: grid;
  grid-template-columns: auto 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  border-bottom: 1px solid #edf3f8;
  padding: 9px 11px;
  background: #fff;
}

.student-picker label:last-child {
  border-bottom: 0;
}

.student-picker input {
  width: 18px;
  height: 18px;
}

.student-picker label > span:last-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.student-picker small {
  overflow: hidden;
  color: #6b8196;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ride-card-controls {
  align-self: start;
}

.ride-card-custom-print-modal {
  width: min(760px, 100%);
}

.ride-card-custom-print-modal .route-modal-body {
  display: grid;
  min-height: 0;
  gap: 14px;
  overflow: hidden;
  padding: 20px 24px;
}

.ride-card-custom-print-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #607a92;
  font-size: 12px;
}

.ride-card-custom-print-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ride-card-custom-print-list {
  display: grid;
  min-height: 180px;
  max-height: min(52vh, 520px);
  overflow: auto;
  border: 1px solid #dce8f4;
  border-radius: 14px;
  background: #fff;
}

.ride-card-custom-print-row {
  display: grid;
  grid-template-columns: auto 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border-bottom: 1px solid #edf3f8;
  padding: 10px 12px;
  cursor: pointer;
}

.ride-card-custom-print-row:last-child {
  border-bottom: 0;
}

.ride-card-custom-print-row:hover {
  background: #f6faff;
}

.ride-card-custom-print-row input {
  width: 18px;
  height: 18px;
}

.ride-card-custom-print-student {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.ride-card-custom-print-student strong,
.ride-card-custom-print-student small,
.ride-card-custom-print-number {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ride-card-custom-print-student small,
.ride-card-custom-print-number {
  color: #6b8196;
  font-size: 12px;
}

.ride-card-custom-print-empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 24px;
  color: #6b8196;
  text-align: center;
}

.ride-card-custom-print-empty.is-error {
  color: var(--danger);
}

.card-control-summary {
  display: grid;
  gap: 7px;
  margin: 20px 0;
  border: 1px solid #dceaf7;
  border-radius: 15px;
  background: #f5faff;
  padding: 18px;
}

.card-control-summary span {
  color: #627b93;
  font-size: 11px;
}

.card-control-summary strong {
  color: #0f4d88;
  font-size: 30px;
}

.card-control-summary p {
  margin: 0;
  color: #55718d;
  font-size: 13px;
  line-height: 1.6;
}

.ride-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  justify-content: start;
  gap: 17px;
}

.ride-card-grid > .empty-state {
  grid-column: 1 / -1;
}

.ride-card {
  display: grid;
  gap: 12px;
  border: 1px solid #bfdcf6;
  border-radius: 21px;
  padding: 14px;
  background: #fff;
  color: #12314f;
  box-shadow: 0 16px 38px rgba(35, 103, 164, 0.11);
}

.ride-card-face {
  position: relative;
  isolation: isolate;
  aspect-ratio: 85 / 52;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d8e4ee;
  border-radius: 16px;
  background: #fff;
}

.ride-card.is-revoked .ride-card-face {
  border-color: #d9dee4;
  filter: grayscale(0.75);
  opacity: 0.78;
}

.ride-card.is-closed .ride-card-face {
  border-color: #e5a6a6;
  box-shadow: inset 0 0 0 1px rgba(190, 42, 42, 0.08);
  filter: grayscale(0.35);
}

.ride-card-closed-label {
  position: absolute;
  top: 5%;
  right: 5%;
  z-index: 3;
  border: 1px solid rgba(185, 28, 28, 0.18);
  border-radius: 999px;
  background: rgba(254, 226, 226, 0.96);
  padding: 4px 9px;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.ride-card-brand-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.ride-card-brand-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.ride-card-print-background-preload {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.ride-card-content {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 27%;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px 13px;
  padding: 4% 9% 25% 6%;
}

.ride-card-school {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.ride-card-school small {
  color: #1871c8;
  font-size: 10px;
  font-weight: 800;
}

.ride-card-school strong {
  display: block;
  color: #0d2d4b;
  font-size: 20.1px;
  line-height: 1.12;
  white-space: nowrap;
}

.ride-card-details {
  display: grid;
  min-width: 0;
  min-height: 0;
  align-content: start;
  gap: 5px;
}

.ride-card-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
}


.ride-card-identity > div {
  min-width: 0;
}

.ride-card-name-line {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 7px;
}

.ride-card-identity h3 {
  font-size: 22px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: visible;
  margin: 0;
  line-height: 1.12;
  text-overflow: clip;
  white-space: nowrap;
}

.ride-card-identity p {
  flex: 0 0 auto;
  overflow: visible;
  margin: 0;
  color: #617991;
  font-size: 13px;
  font-weight: 750;
  text-overflow: clip;
  white-space: nowrap;
}

.ride-card.has-long-student-name .ride-card-identity h3 {
  font-size: 19px;
}

.ride-card.has-very-long-student-name .ride-card-name-line {
  align-items: flex-start;
}

.ride-card.has-very-long-student-name .ride-card-identity h3 {
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.02;
  white-space: normal;
  word-break: break-word;
}

.ride-card.has-very-long-student-name .ride-card-details {
  gap: 3px;
}

.ride-card-qr {
  display: grid;
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  justify-self: end;
  width: 100%;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid #d9e6f1;
  border-radius: 10px;
  background: #fff;
  padding: 4px;
}

.ride-card-qr svg {
  width: 100%;
  height: 100%;
}

.qr-unavailable {
  color: #8b96a1;
  font-size: 11px;
  text-align: center;
}

.ride-card-closed-qr {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  border: 1px dashed #e5a6a6;
  border-radius: 8px;
  background: rgba(254, 242, 242, 0.92);
  padding: 8px;
  color: #b91c1c;
  font-weight: 800;
}

.ride-card-route {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 1px solid rgba(187, 216, 242, 0.82);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  padding: 4px 6px;
  color: #294e70;
  font-size: 14px;
  line-height: 1.22;
}

.ride-card.route-state-needs-review .ride-card-route {
  border-color: #ead69d;
  background: rgba(255, 249, 227, 0.92);
  color: #73520c;
}

.ride-card.route-state-unlinked .ride-card-route {
  border-color: #d6dfe7;
  background: rgba(244, 247, 249, 0.92);
  color: #687b8d;
}

.ride-card-route-line {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: start;
  gap: 1px 4px;
}

.ride-card-route-line > b {
  align-self: baseline;
  color: #1266b8;
  font-size: 14px;
  white-space: nowrap;
  word-break: keep-all;
}

.ride-card-stop-name {
  min-width: 0;
  color: #294e70;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.ride-card-fixed-route-line {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  gap: 4px;
  margin-top: 1px;
  padding-top: 3px;
  border-top: 1px dashed rgba(140, 174, 205, 0.72);
  color: #294e70;
  font-size: 11px;
  line-height: 1.25;
}

.ride-card-fixed-route-line > b {
  display: inline-block;
  inline-size: max-content;
  min-inline-size: max-content;
  color: #294e70;
  font-weight: 750;
  white-space: nowrap;
  word-break: keep-all;
}

.ride-card-fixed-route-line > span {
  min-width: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.route-review-note {
  grid-column: 2;
  overflow: hidden;
  color: #9a6500;
  font-size: 8px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ride-card-remark {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  border: 1px solid rgba(187, 216, 242, 0.82);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  padding: 4px 6px;
  color: #294e70;
  font-size: 14px;
  line-height: 1.22;
}

.ride-card-remark > b {
  color: #1266b8;
  font-size: 14px;
}

.ride-card-remark > span {
  min-width: 0;
  overflow: visible;
  font-size: 11px;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: pre-wrap;
  word-break: break-word;
}

.ride-card.has-very-long-student-name .ride-card-route {
  gap: 2px;
  padding: 4px 6px;
  font-size: 12px;
  line-height: 1.08;
}

.ride-card.has-very-long-student-name .ride-card-remark {
  gap: 6px;
  padding: 4px 6px;
  font-size: 12px;
  line-height: 1.08;
}

.ride-card-admin {
  display: grid;
  gap: 7px;
}

.ride-card-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ride-card-admin-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 14px;
  color: #627b93;
  font-size: 11px;
}

.ride-card-admin-meta strong {
  color: #284d70;
}

.ride-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid #e1eaf2;
  padding-top: 13px;
}

.student-ride-card-preview {
  width: min(100%, 560px);
  margin: 0 auto;
}

.student-ride-card-preview .ride-card-presentation {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.student-ride-card-loading {
  display: grid;
  min-height: 230px;
  place-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
}

.student-ride-card-loading p {
  max-width: 310px;
  margin: 0;
  color: #627b93;
  line-height: 1.55;
}

.approval-queue {
  border-color: #d7e7f6;
}

.approval-item {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border: 1px solid #dfeaf4;
  border-radius: 15px;
  background: #fff;
  padding: 14px;
}

.approval-type {
  display: grid;
  min-height: 44px;
  place-items: center;
  border-radius: 12px;
  background: #edf6ff;
  color: #155faa;
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.approval-copy {
  min-width: 0;
}

.approval-copy p,
.approval-copy small {
  margin: 4px 0 0;
  color: #637b91;
  font-size: 12px;
  line-height: 1.5;
}

.approval-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-filters {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.history-filters input,
.history-filters select {
  width: 100%;
  min-width: 0;
  min-height: 43px;
  border: 1px solid #cbddec;
  border-radius: 11px;
  background: #fbfdff;
  padding: 0 11px;
}

.history-timeline {
  display: grid;
  position: relative;
  gap: 0;
}

.history-timeline::before {
  position: absolute;
  inset: 24px auto 24px 21px;
  width: 2px;
  background: #d7e7f5;
  content: "";
}

.history-item {
  display: grid;
  position: relative;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  padding: 11px 0;
}

.history-node {
  display: grid;
  z-index: 1;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 5px solid #fff;
  border-radius: 50%;
  background: #287ed4;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.history-node.is-attendance {
  background: #17a27b;
}

.history-item > div:last-child {
  min-width: 0;
  border: 1px solid #e1ebf4;
  border-radius: 13px;
  background: #fbfdff;
  padding: 12px 14px;
}

.history-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.history-filter-panel .panel-header > div > p:last-child:not(.eyebrow) {
  max-width: 680px;
  margin: 6px 0 0;
  color: #647c92;
  line-height: 1.55;
}

.log-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.log-heading strong {
  color: #173653;
  font-size: 15px;
}

.log-kind {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #eaf4ff;
  padding: 4px 8px;
  color: #236cae;
  font-size: 11px;
  font-weight: 800;
}

.history-node.is-attendance + .log-card .log-kind {
  background: #e7f7f1;
  color: #11785d;
}

.history-item .log-subject {
  margin-top: 9px;
  color: #2e506e;
  font-size: 14px;
  font-weight: 700;
}

.log-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 11px;
}

.log-meta span {
  display: grid;
  gap: 2px;
  min-width: 0;
  border-radius: 9px;
  background: #f2f7fb;
  padding: 8px 10px;
  color: #48677f;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.log-meta b {
  color: #7890a4;
  font-size: 10px;
  letter-spacing: 0.06em;
}

.log-technical-details {
  margin-top: 11px;
  border-top: 1px solid #e5eef5;
  padding-top: 9px;
}

.log-technical-details summary {
  width: fit-content;
  cursor: pointer;
  color: #52738e;
  font-size: 12px;
  font-weight: 700;
}

.log-technical-details dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 0;
}

.log-technical-details dl > div {
  min-width: 0;
  border: 1px solid #e3edf5;
  border-radius: 9px;
  background: #f8fbfd;
  padding: 8px 10px;
}

.log-technical-details dt {
  color: #7890a4;
  font-size: 10px;
  font-weight: 700;
}

.log-technical-details dd {
  margin: 3px 0 0;
  color: #35556f;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.log-technical-details code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.history-item p,
.history-item small {
  margin: 5px 0 0;
  color: #647c92;
  font-size: 12px;
  line-height: 1.5;
}

.history-more {
  display: flex;
  margin: 18px auto 0;
}

@media screen and (max-width: 980px) {
  .data-ops-grid,
  .import-job {
    grid-template-columns: 1fr;
  }

  .import-job-actions {
    justify-content: flex-start;
  }

  .history-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .log-meta {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media screen and (max-width: 1023px) {
  .ride-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 719px) {
  .ride-card-custom-print-modal {
    width: 100%;
  }

  .ride-card-custom-print-modal .route-modal-body {
    padding: 16px;
  }

  .ride-card-custom-print-toolbar,
  .ride-card-custom-print-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .ride-card-custom-print-row {
    grid-template-columns: auto 32px minmax(0, 1fr);
  }

  .ride-card-custom-print-number {
    grid-column: 3;
  }

  .ride-card-custom-print-modal input[type="search"] {
    font-size: 16px;
  }

  .data-operations-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .data-operations-tabs button {
    justify-content: flex-start;
    padding: 8px 10px;
  }

  .data-ops-grid,
  .ride-card-grid,
  .history-filters,
  .import-summary,
  .import-directional-stop-summary > .import-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .history-title,
  .log-heading {
    align-items: flex-start;
  }

  .history-title {
    flex-direction: column;
  }

  .log-heading {
    flex-wrap: wrap;
  }

  .log-technical-details dl {
    grid-template-columns: minmax(0, 1fr);
  }

  .import-drop {
    min-height: 190px;
  }

  .import-stop-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .import-route-binding-heading,
  .import-route-binding-stop-change {
    align-items: flex-start;
    flex-direction: column;
  }

  .import-route-binding-controls {
    grid-template-columns: minmax(0, 1fr);
  }

  .import-preview-actions,
  .import-job-actions,
  .student-picker-toolbar,
  .approval-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .student-picker-toolbar .text-button {
    min-height: 38px;
    margin-left: 0;
    text-align: left;
  }

  .ride-card {
    min-width: 0;
    padding: 10px;
  }

  .ride-card-admin-meta {
    display: grid;
    justify-content: start;
  }

  .approval-item {
    grid-template-columns: 1fr;
  }

  .approval-type {
    min-height: 38px;
    justify-self: start;
    padding: 0 14px;
  }

  .history-filters input,
  .history-filters select,
  .import-upload-panel .field select,
  .ride-card-setup .field input,
  .ride-card-setup .field select {
    font-size: 16px;
  }
}

.ride-card-print-layer {
  display: none;
}

.finance-receipt-print-layer {
  display: none;
}

@media print {
  body.print-ride-cards-mode .app-shell > *:not(.ride-card-print-layer) {
    display: none !important;
  }

  body.print-ride-cards-mode .app-shell,
  body.print-ride-cards-mode .ride-card-print-layer {
    display: block !important;
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    background: #fff;
  }

  body.print-ride-cards-mode .ride-card-print-grid {
    display: grid !important;
    grid-template-columns: 85mm 85mm;
    grid-auto-rows: 52mm;
    justify-content: center;
    gap: 4mm;
    page: ride-cards;
  }

  body.print-ride-cards-mode .ride-card.is-selected-for-print {
    display: block !important;
    width: 85mm;
    height: 52mm;
    break-inside: avoid;
    page-break-inside: avoid;
    overflow: visible;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  body.print-ride-cards-mode .ride-card-face {
    width: 85mm;
    height: 52mm;
    aspect-ratio: auto;
    border: 0.2mm solid #d8e4ee;
    border-radius: 2.8mm;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body.print-ride-cards-mode .ride-card-content {
    grid-template-columns: minmax(0, 1fr) 23.5mm;
    gap: 1.5mm 2.5mm;
    padding: 2.4mm 7.5mm 14mm 5mm;
  }

  body.print-ride-cards-mode .ride-card-school {
    gap: 0.25mm;
  }

body.print-ride-cards-mode .ride-card-school strong {
  font-size: 13pt;
  line-height: 1.08;
}

  body.print-ride-cards-mode .ride-card-details {
    gap: 0.8mm;
  }


  body.print-ride-cards-mode .ride-card-name-line {
    gap: 1.2mm;
  }

  body.print-ride-cards-mode .ride-card-identity h3 {
    font-size: 14pt;
    line-height: 1.1;
  }

  body.print-ride-cards-mode .ride-card-identity p {
    font-size: 8.8pt;
  }

  body.print-ride-cards-mode .ride-card.has-long-student-name .ride-card-identity h3 {
    font-size: 12pt;
  }

  body.print-ride-cards-mode .ride-card.has-very-long-student-name .ride-card-identity h3 {
    overflow-wrap: anywhere;
    font-size: 10.5pt;
    line-height: 1.02;
    white-space: normal;
    word-break: break-word;
  }

  body.print-ride-cards-mode .ride-card.has-very-long-student-name .ride-card-details {
    gap: 0.5mm;
  }

  body.print-ride-cards-mode .ride-card.has-very-long-student-name .ride-card-route {
    gap: 0.25mm;
    padding: 0.55mm 0.9mm;
    font-size: 8.3pt;
    line-height: 1.08;
  }

  body.print-ride-cards-mode .ride-card.has-very-long-student-name .ride-card-remark {
    gap: 0.6mm;
    padding: 0.55mm 0.9mm;
    font-size: 8.3pt;
    line-height: 1.08;
  }

  body.print-ride-cards-mode .ride-card-qr {
    width: 23.5mm;
    border-radius: 1.8mm;
    padding: 0.8mm;
  }

  body.print-ride-cards-mode .ride-card-route {
    gap: 0.35mm;
    padding: 0.75mm 1.1mm;
    font-size: 9pt;
    line-height: 1.15;
  }

  body.print-ride-cards-mode .ride-card-route-line {
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 0.2mm 0.65mm;
  }

  body.print-ride-cards-mode .ride-card-route-line > b {
    font-size: 9pt;
  }

  body.print-ride-cards-mode .ride-card-fixed-route-line {
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 0.8mm;
    margin-top: 0.4mm;
    padding-top: 0.5mm;
    font-size: 7.5pt;
  }

  body.print-ride-cards-mode .ride-card-fixed-route-line > b {
    display: inline-flex;
    width: max-content;
    min-width: max-content;
    overflow-wrap: normal;
  }

  body.print-ride-cards-mode .ride-card-remark {
    grid-template-columns: 6.5mm minmax(0, 1fr);
    gap: 0.8mm;
    padding: 0.75mm 1.1mm;
    font-size: 9pt;
    line-height: 1.15;
  }

  body.print-ride-cards-mode .ride-card-remark > b {
    font-size: 9pt;
  }

  body.print-ride-cards-mode .ride-card-remark > span {
    min-width: 0;
    overflow: visible;
    font-size: 7.5pt;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: pre-wrap;
    word-break: break-word;
  }

  body.print-ride-cards-mode .route-review-note {
    font-size: 5.5pt;
  }
}

@media print {
  body.print-finance-receipt-mode .app-shell > *:not(.finance-receipt-print-layer) {
    display: none !important;
  }

  body.print-finance-receipt-mode .app-shell,
  body.print-finance-receipt-mode .finance-receipt-print-layer {
    display: block !important;
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    background: #fff;
  }

  body.print-finance-receipt-mode .receipt-document {
    page: finance-receipt;
    max-width: none;
    border-color: #cddded;
    border-radius: 0;
    box-shadow: none;
    break-inside: avoid;
    page-break-inside: avoid;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body.print-finance-receipt-mode .receipt-document .detail-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.print-finance-receipt-mode .finance-batch-receipt-document,
  body.print-finance-receipt-mode .finance-batch-receipt-lines-card {
    break-inside: auto;
    page-break-inside: auto;
  }

  body.print-finance-receipt-mode .finance-batch-receipt-branding {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.print-finance-receipt-mode .finance-batch-receipt-lines-wrap {
    overflow: visible;
  }

  body.print-finance-receipt-mode .finance-batch-receipt-lines {
    display: table;
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  body.print-finance-receipt-mode .finance-batch-receipt-lines thead {
    display: table-header-group;
  }

  body.print-finance-receipt-mode .finance-batch-receipt-lines tbody {
    display: table-row-group;
  }

  body.print-finance-receipt-mode .finance-batch-receipt-lines tr {
    display: table-row;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.print-finance-receipt-mode .finance-batch-receipt-lines th,
  body.print-finance-receipt-mode .finance-batch-receipt-lines td {
    display: table-cell;
    overflow-wrap: anywhere;
  }

  body.print-finance-receipt-mode .finance-batch-receipt-lines td::before {
    content: none;
  }

  body.print-finance-receipt-mode .finance-receipt-template-document {
    display: block;
    width: 100%;
    min-height: 260mm;
    box-sizing: border-box;
    padding: 8mm 10mm;
    border: 0.35mm solid #111;
    background: #fff;
    color: #111;
    break-inside: auto;
    page-break-inside: auto;
  }

  body.print-finance-receipt-mode .finance-receipt-template-title {
    margin-right: -10mm;
    margin-left: -10mm;
  }

  body.print-finance-receipt-mode .finance-receipt-template-field,
  body.print-finance-receipt-mode .finance-receipt-template-line,
  body.print-finance-receipt-mode .finance-receipt-template-signature {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.print-finance-receipt-mode .finance-receipt-template-payment-field-multipage {
    display: block;
    break-inside: auto;
    page-break-inside: auto;
  }

  body.print-finance-receipt-mode .finance-receipt-template-payment-field-multipage .finance-receipt-template-label {
    border-right: 0;
    border-bottom: 1px solid #374151;
  }

  body.print-finance-receipt-mode .finance-receipt-template-payment-field-multipage .finance-receipt-template-lines {
    display: block;
    padding: 5mm;
    border-right: 0;
  }

  body.print-finance-receipt-mode .finance-receipt-template-payment-field-multipage .finance-receipt-template-line + .finance-receipt-template-line {
    margin-top: 2.5mm;
  }

  body.print-finance-receipt-mode .finance-receipt-template-payment-field-multipage .finance-receipt-template-grand-total {
    justify-content: flex-end;
    border-top: 1px solid #374151;
  }

  body.print-finance-receipt-mode .finance-receipt-template-logo {
    width: 110mm;
    max-height: 20mm;
  }

  body.print-finance-receipt-mode .finance-receipt-template-footer {
    min-height: 48mm;
  }

  body.print-finance-receipt-mode .finance-receipt-template-document-multipage .finance-receipt-template-footer {
    min-height: 34mm;
    padding-top: 4mm;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.print-finance-receipt-mode .finance-reconciliation {
    display: none !important;
  }
}

@page roster {
  size: A4 landscape;
  margin: 8mm;
}

@page ride-cards {
  size: A4 portrait;
  margin: 8mm;
}

@page finance-receipt {
  size: A4 portrait;
  margin: 14mm;
}
/* Phase 2C data operations: end */

.access-management-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}

.access-record-list {
  display: grid;
  gap: 12px;
}

.access-record {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.access-record > div:first-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.access-record > div:last-child {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.access-record strong,
.access-record span,
.access-record small {
  overflow-wrap: anywhere;
}

.access-record span {
  color: var(--text);
}

.access-record small {
  color: var(--muted);
}

.session-logout {
  min-height: 40px;
  white-space: nowrap;
}

@media (max-width: 960px) {
  .access-management-grid {
    grid-template-columns: 1fr;
  }

  .session-logout {
    padding-inline: 12px;
  }
}

@media (max-width: 620px) {
  .access-record {
    align-items: stretch;
    flex-direction: column;
  }

  .access-record > div:last-child {
    justify-content: space-between;
  }

  .route-operations-overview {
    grid-template-columns: 1fr;
  }

  .route-detail-tab {
    min-height: 40px;
    padding-inline: 13px;
  }


  .route-fare-version-fields {
    grid-template-columns: 1fr;
  }

  .route-fare-note {
    grid-column: auto;
  }

  .route-fare-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .route-fare-actions .button {
    width: 100%;
  }
}

.direct-assignment-modal {
  width: min(980px, calc(100vw - 32px));
  max-height: min(880px, calc(100vh - 32px));
}

.direct-assignment-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 20px;
}

.direct-assignment-form > .form-span-2 {
  grid-column: 1 / -1;
}

.direct-assignment-form > label,
.direct-assignment-direction label {
  display: grid;
  gap: 8px;
  color: var(--ink, #102a4c);
  font-weight: 700;
}

.direct-assignment-form input,
.direct-assignment-form select,
.direct-assignment-form textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid #bfd4ee;
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  color: #102a4c;
  font: inherit;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.direct-assignment-form textarea {
  min-height: 96px;
  resize: vertical;
}

.direct-assignment-form input:focus,
.direct-assignment-form select:focus,
.direct-assignment-form textarea:focus {
  border-color: #2878f0;
  box-shadow: 0 0 0 4px rgb(40 120 240 / 14%);
}

.direct-assignment-form input:disabled,
.direct-assignment-form select:disabled {
  cursor: not-allowed;
  background: #edf3fa;
  color: #71839a;
}

.direct-student-combobox {
  position: relative;
}

.direct-stop-combobox {
  position: relative;
  z-index: 2;
}

.direct-stop-combobox:focus-within {
  z-index: 35;
}

.direct-stop-combobox > input[type="search"] {
  width: 100%;
  padding-right: 38px;
}

.direct-student-results.direct-stop-results {
  top: calc(100% + 6px);
  max-height: 240px;
  z-index: 40;
}

.direct-student-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 30;
  border: 1px solid #d3e1f2;
  border-radius: 12px;
  background: #fff;
}

.direct-student-results[hidden] {
  display: none !important;
}

.direct-student-results.has-options {
  display: grid;
  max-height: 220px;
  overflow: auto;
  padding: 6px;
  box-shadow: 0 14px 32px rgb(26 70 120 / 12%);
}

.direct-student-results.is-empty {
  display: flex;
  min-height: 48px;
  align-items: center;
  padding: 0 12px;
  background: #f8fbff;
  box-shadow: none;
}

.direct-student-results.is-empty .muted {
  margin: 0;
}

.direct-student-results button {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  padding: 9px 11px;
  color: #102a4c;
  text-align: left;
  cursor: pointer;
}

.direct-student-results button:hover,
.direct-student-results button:focus-visible,
.direct-student-results button.is-selected {
  background: #eaf3ff;
  outline: none;
}

.direct-student-results button span {
  color: #60758f;
  font-size: 13px;
}

.direct-student-selected {
  color: #1263ce;
}

.direct-assignment-direction {
  display: grid;
  align-self: stretch;
  gap: 14px;
  margin: 0;
  border-color: #d4e4f5;
  background: linear-gradient(180deg, #fbfdff, #f4f9ff);
}

.direct-assignment-direction h3 {
  margin: 0;
}

.direct-assignment-quote {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border: 1px solid #b9d6f7;
  border-radius: 16px;
  background: linear-gradient(135deg, #f5faff 0%, #eef7ff 100%);
  padding: 14px;
}

.direct-assignment-quote-item {
  display: grid;
  gap: 5px;
  min-width: 0;
  border-radius: 12px;
  background: rgb(255 255 255 / 84%);
  padding: 13px 15px;
  box-shadow: inset 0 0 0 1px rgb(55 126 210 / 10%);
}

.direct-assignment-quote-item span {
  color: #60758f;
  font-size: 13px;
  font-weight: 750;
}

.direct-assignment-quote-item strong {
  color: #125fbd;
  font-size: 21px;
  line-height: 1.2;
}

.direct-assignment-quote-item small {
  color: #60758f;
  line-height: 1.45;
}

.direct-assignment-quote-item.is-warning strong {
  color: #9a5b00;
}

.direct-assignment-modal .route-modal-footer .drawer-actions {
  justify-content: flex-end;
}

.direct-assignment-confirm {
  display: grid;
  gap: 16px;
}

.direct-assignment-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.direct-assignment-summary > div,
.direct-assignment-price {
  display: grid;
  gap: 5px;
  border: 1px solid #d5e4f4;
  border-radius: 14px;
  background: #f7fbff;
  padding: 14px;
}

.direct-assignment-summary span,
.direct-assignment-price span {
  color: #60758f;
  font-size: 13px;
  font-weight: 700;
}

.direct-assignment-summary small,
.direct-assignment-price small {
  color: #60758f;
}

.direct-assignment-price strong {
  color: #1263ce;
  font-size: 26px;
}

.supplemental-billing-modal {
  width: min(900px, calc(100vw - 32px));
  max-height: min(860px, calc(100vh - 32px));
}

.supplemental-billing-form {
  gap: 16px;
}

.supplemental-billing-result {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  border: 1px solid #b9d6f7;
  border-radius: 18px;
  background: linear-gradient(135deg, #f7fbff 0%, #edf7ff 100%);
  padding: 16px;
}

.supplemental-billing-metrics {
  display: grid;
  grid-template-columns: 0.8fr 0.9fr 1.3fr;
  gap: 10px;
}

.supplemental-billing-metrics > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  border-radius: 13px;
  background: rgb(255 255 255 / 88%);
  padding: 14px;
  box-shadow: inset 0 0 0 1px rgb(55 126 210 / 10%);
}

.supplemental-billing-metrics span {
  color: #60758f;
  font-size: 13px;
  font-weight: 750;
}

.supplemental-billing-metrics strong {
  color: #125fbd;
  font-size: 18px;
  line-height: 1.3;
}

.supplemental-billing-metrics > div:nth-child(2) strong {
  font-size: 24px;
}

.supplemental-billing-note {
  margin: 0;
  color: #526b88;
  font-size: 13px;
  line-height: 1.5;
}

.supplemental-billing-success {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  border: 1px solid #a7dfca;
  border-radius: 18px;
  background: linear-gradient(135deg, #f3fff9 0%, #e9fbf4 100%);
  padding: 22px;
}

.supplemental-success-icon {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  border-radius: 50%;
  background: #0d9b69;
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgb(13 155 105 / 20%);
}

.supplemental-billing-success h3,
.supplemental-billing-success p {
  margin: 4px 0;
}

.supplemental-billing-success h3 {
  color: #0a6f4c;
  font-size: 24px;
}

.supplemental-billing-success small {
  display: block;
  margin-top: 10px;
  color: #526b68;
  line-height: 1.5;
}

.supplemental-billing-modal .route-modal-footer .drawer-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 720px) {
  .direct-assignment-modal {
    width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
  }

  .direct-assignment-form,
  .direct-assignment-summary,
  .direct-assignment-quote {
    grid-template-columns: 1fr;
  }

  .direct-assignment-form > .form-span-2 {
    grid-column: auto;
  }

  .direct-assignment-modal .route-modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
  }

  .direct-assignment-modal .button,
  .direct-student-results button {
    min-height: 44px;
  }

  .supplemental-billing-modal {
    width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
  }

  .supplemental-billing-metrics {
    grid-template-columns: 1fr;
  }

  .supplemental-billing-success {
    padding: 18px;
  }

  .supplemental-billing-modal .route-modal-footer .drawer-actions,
  .supplemental-billing-modal .route-modal-footer .button {
    width: 100%;
  }
}

/* Company messaging P0 layout */
.message-run-list > div { grid-template-columns: auto minmax(0, 1fr) 76px auto; }

/* Route and stop workspace */
.route-workspace-shell {
  display: grid;
  gap: 16px;
}

.route-workspace-tabs {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  gap: 6px;
  border: 1px solid #cbdced;
  border-radius: 16px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 24px rgba(19, 74, 134, 0.06);
}

.route-workspace-tab {
  display: inline-flex;
  min-width: 154px;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 0;
  border-radius: 11px;
  padding: 10px 14px;
  background: transparent;
  color: #50677f;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.route-workspace-tab strong {
  display: inline-grid;
  min-width: 34px;
  min-height: 28px;
  place-items: center;
  border-radius: 9px;
  padding: 3px 8px;
  background: #eaf3fd;
  color: #176bc0;
  font-size: 13px;
  line-height: 1;
}

.route-workspace-tab:hover {
  background: #f0f7ff;
  color: #124f8d;
}

.route-workspace-tab:focus-visible {
  outline: 3px solid rgba(31, 120, 218, 0.3);
  outline-offset: 2px;
}

.route-workspace-tab.is-active {
  background: linear-gradient(135deg, #1675df, #258cf2);
  color: #fff;
  box-shadow: 0 8px 18px rgba(24, 112, 209, 0.24);
}

.route-workspace-tab.is-active strong {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.route-workspace-panel {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.route-workspace-toolbar {
  margin: 0;
}

.route-workspace-create-panel {
  display: grid;
  gap: 18px;
  border: 1px solid #bfd6ed;
  border-radius: 18px;
  padding: 20px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(25, 83, 145, 0.08);
}

.route-workspace-create-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.route-workspace-create-header h2 {
  margin: 3px 0 5px;
  font-size: 21px;
}

.route-workspace-create-header p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.route-workspace-school-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: end;
  gap: 14px;
}

.route-workspace-school-form > label {
  display: grid;
  gap: 8px;
}

.route-workspace-school-form > label > span {
  color: #4f6881;
  font-size: 13px;
  font-weight: 800;
}

.route-workspace-school-form select {
  width: 100%;
  min-height: 46px;
}

@media (max-width: 719px) {
  .route-workspace-tabs {
    width: 100%;
  }

  .route-workspace-tab {
    min-width: 0;
    flex: 1;
    gap: 10px;
  }

  .route-workspace-create-panel {
    padding: 16px;
  }

  .route-workspace-school-form {
    grid-template-columns: 1fr;
  }

  .route-workspace-school-form .button {
    width: 100%;
  }
}

/* Sidebar readability */
.main-navigation {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.main-navigation::-webkit-scrollbar {
  display: none;
}

.main-navigation button {
  font-size: 15px;
}

/* School stop manager */
.route-create-stop-heading-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.stop-manager-layer {
  z-index: 80;
}

.stop-manager-modal {
  width: min(1180px, 100%);
}

.stop-manager-body {
  display: grid;
  grid-template-columns: minmax(250px, 350px) minmax(0, 1fr);
  gap: 0;
  padding: 0;
  background: #f8fbff;
}

.stop-manager-list {
  display: grid;
  min-height: min(610px, calc(100dvh - 178px));
  grid-template-rows: auto auto minmax(0, 1fr);
  border-right: 1px solid var(--line);
  background: #fff;
}

.stop-manager-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.stop-manager-list-header > div {
  display: grid;
  gap: 3px;
}

.stop-manager-list-header strong {
  color: #17324f;
}

.stop-manager-list-header small,
.stop-manager-list-item small {
  color: var(--muted);
  font-size: 12px;
}

.stop-manager-search {
  position: relative;
  display: block;
  padding: 10px 12px 8px;
  border-bottom: 1px solid #edf3f9;
}

.stop-manager-search > span {
  position: absolute;
  top: 50%;
  left: 26px;
  z-index: 1;
  color: #6482a0;
  font-size: 17px;
  transform: translateY(-46%);
  pointer-events: none;
}

.stop-manager-search input {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px 9px 38px;
  border: 1px solid #c9dcef;
  border-radius: 12px;
  outline: 0;
  background: #f8fbff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.stop-manager-search input:focus {
  border-color: #6da9f1;
  background: #fff;
  box-shadow: 0 0 0 3px rgb(64 143 232 / 14%);
}

.stop-manager-list-scroll {
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
  padding: 12px;
}

.stop-manager-search-empty {
  display: grid;
  gap: 5px;
  justify-items: center;
  padding: 34px 14px;
  color: #6a8299;
  text-align: center;
}

.stop-manager-search-empty[hidden] {
  display: none;
}

.stop-manager-search-empty strong {
  color: #294966;
}

.stop-manager-search-empty small {
  font-size: 12px;
}

.stop-manager-list-item {
  display: grid;
  width: 100%;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.stop-manager-list-item[hidden] {
  display: none !important;
}

.stop-manager-list-item:hover {
  border-color: #c7dcf2;
  background: #f4f9ff;
}

.stop-manager-list-item.is-active {
  border-color: #9cc8f9;
  background: #eaf4ff;
}

.stop-manager-list-item > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.stop-manager-list-item strong,
.stop-manager-list-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stop-manager-list-thumb {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #d4e2f0;
  border-radius: 10px;
  background: #edf5fd;
  color: #4c78a8;
  font-size: 11px;
  font-weight: 800;
}

.stop-manager-list-thumb img,
.stop-image-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stop-manager-form {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 22px 24px 24px;
  overflow: auto;
  background: #f8fbff;
}

.stop-manager-form .detail-section-title h3 {
  margin: 0 0 5px;
}

.stop-manager-form > .form-grid {
  gap: 18px 16px;
  margin: 0;
}

.stop-manager-form .form-grid > label {
  gap: 8px;
  min-width: 0;
  color: #385674;
  font-size: 13px;
  font-weight: 780;
}

.stop-manager-form .form-grid > label > :is(input, select, textarea) {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid #c7d9eb;
  border-radius: 12px;
  background: #fff;
  color: #173451;
  box-shadow: 0 1px 2px rgba(25, 67, 107, 0.04);
  font: inherit;
  font-size: 14px;
  font-weight: 580;
  line-height: 1.45;
  padding: 11px 13px;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.stop-manager-form .form-grid > label > :is(input, select, textarea):hover:not(:disabled) {
  border-color: #91b9e1;
  background: #fff;
}

.stop-manager-form .form-grid > label > :is(input, select, textarea):focus-visible {
  border-color: #1977dc;
  outline: 0;
  box-shadow:
    0 0 0 4px rgba(25, 119, 220, 0.13),
    0 5px 16px rgba(26, 91, 158, 0.08);
}

.stop-manager-form .form-grid > label > :is(input, select, textarea):disabled {
  background: #edf3f8;
  color: #71859a;
}

.stop-manager-form select {
  appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2358799d' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}

.stop-manager-form textarea {
  min-height: 88px;
  resize: vertical;
}

.stop-manager-form .detail-section-title p,
.stop-default-fares p,
.stop-image-upload small {
  margin: 0;
  color: #647d96;
  font-size: 13px;
  line-height: 1.55;
}

.stop-image-upload {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #d5e5f4;
  border-radius: 15px;
  background: #fff;
}

.stop-image-upload > span:first-child {
  color: #183a5d;
  font-size: 14px;
  font-weight: 800;
}

.stop-image-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px dashed #9fc4e9;
  border-radius: 15px;
  background:
    linear-gradient(135deg, rgba(229, 242, 255, 0.88), rgba(249, 252, 255, 0.94)),
    #f6faff;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.6);
}

.stop-image-carousel-stage {
  position: absolute;
  inset: 0;
}

.stop-image-upload-preview {
  position: absolute;
  inset: 0;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: #4c78a8;
  cursor: zoom-in;
  appearance: none;
  padding: 0;
  font: inherit;
  text-align: inherit;
}

.stop-image-upload-preview[hidden] {
  display: none;
}

.stop-image-upload-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stop-image-upload-preview:disabled {
  cursor: default;
}

.stop-image-carousel-nav {
  position: absolute;
  z-index: 2;
  top: 50%;
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: rgba(8, 42, 74, 0.7);
  color: #fff;
  cursor: pointer;
  line-height: 1;
  box-shadow: 0 8px 22px rgba(3, 28, 52, 0.28);
  backdrop-filter: blur(8px);
}

.stop-image-carousel-nav[hidden],
.stop-image-carousel-counter[hidden],
.stop-image-remove[hidden] {
  display: none;
}

.stop-image-carousel-nav svg {
  display: block;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.stop-image-carousel-nav:hover {
  background: rgba(5, 91, 176, 0.9);
}

.stop-image-carousel-nav.is-previous {
  left: 14px;
}

.stop-image-carousel-nav.is-next {
  right: 14px;
}

.stop-image-carousel-counter {
  position: absolute;
  z-index: 2;
  right: 14px;
  bottom: 12px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(8, 42, 74, 0.74);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.stop-image-upload-placeholder {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 18px;
  background: #fff;
  color: #397cbf;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(38, 103, 166, 0.12);
}

.stop-image-upload-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stop-image-upload-actions input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.stop-image-add {
  cursor: pointer;
}

.stop-image-add.is-disabled {
  cursor: default;
  opacity: 0.5;
  pointer-events: none;
}

.stop-image-upload-actions > small {
  margin-left: auto;
  color: #647d96;
  font-size: 13px;
}

.stop-image-lightbox {
  position: fixed;
  z-index: 1600;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.stop-image-lightbox-scrim {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(8, 29, 52, 0.78);
  backdrop-filter: blur(6px);
}

.stop-image-lightbox-dialog {
  position: relative;
  width: min(1120px, 90vw);
  max-width: 90vw;
  max-height: 92vh;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(3, 23, 43, 0.34);
}

.stop-image-lightbox-dialog > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
}

.stop-image-lightbox-dialog > header h2 {
  margin: 0;
  color: #123252;
  font-size: 20px;
}

.stop-image-lightbox-stage {
  display: grid;
  min-height: 240px;
  max-height: 85vh;
  place-items: center;
  overflow: auto;
  padding: 16px;
  background: #edf5fc;
}

.stop-image-lightbox-image {
  display: block;
  max-width: 100%;
  max-height: calc(85vh - 76px);
  object-fit: contain;
}

.stop-image-lightbox-error {
  color: #b42318;
  font-weight: 700;
}

.stop-default-fares {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 16px 18px 18px;
  border: 1px solid #bfdaf4;
  border-radius: 15px;
  background: linear-gradient(135deg, #f4f9ff 0%, #fbfdff 58%, #f2f8ff 100%);
  box-shadow: 0 8px 22px rgba(31, 96, 161, 0.05);
}

.stop-default-fares legend {
  padding: 0 7px;
  color: #0e4f8c;
  font-size: 14px;
  font-weight: 800;
}

.stop-default-fares > .form-grid {
  gap: 14px;
  margin: 0;
}

.stop-manager-form > .drawer-actions {
  position: sticky;
  bottom: -24px;
  z-index: 2;
  justify-content: flex-end;
  margin: 2px -24px -24px;
  padding: 16px 24px 20px;
  border-top: 1px solid #d8e6f3;
  background: rgba(248, 251, 255, 0.94);
  box-shadow: 0 -10px 24px rgba(28, 72, 114, 0.06);
  backdrop-filter: blur(12px);
}

@media (max-width: 720px) {
  .stop-image-lightbox {
    padding: 8px;
  }

  .stop-image-lightbox-dialog {
    width: calc(100vw - 16px);
    max-width: none;
    max-height: calc(100vh - 16px);
    border-radius: 16px;
  }
}

@media (max-width: 760px) {
  .route-create-stop-heading-actions {
    width: 100%;
  }

  .route-create-stop-heading-actions .button {
    flex: 1;
  }

  .stop-manager-body {
    grid-template-columns: 1fr;
  }

  .stop-manager-list {
    min-height: 0;
    max-height: 285px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .stop-manager-form {
    padding: 18px;
  }

  .stop-manager-form .form-grid {
    grid-template-columns: 1fr;
  }

  .stop-manager-form .form-grid .form-span-2 {
    grid-column: auto;
  }

  .stop-image-upload {
    grid-template-columns: 1fr;
  }

  .stop-image-carousel-nav {
    width: 38px;
    height: 38px;
  }

  .stop-image-upload-actions > small {
    width: 100%;
    margin-left: 0;
  }

  .stop-manager-form > .drawer-actions {
    bottom: -18px;
    margin: 2px -18px -18px;
    padding: 14px 18px 18px;
  }
}
.profile-nanny-route-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid #c9ddfb;
  border-radius: 16px;
  background: linear-gradient(135deg, #f7fbff 0%, #edf6ff 100%);
}

.profile-nanny-route-entry p {
  margin: 5px 0 0;
  color: #526a86;
  font-size: 14px;
}

.nanny-assignment-workbench {
  display: grid;
  gap: 18px;
}

.nanny-access-modal {
  width: min(1160px, calc(100vw - 40px));
}

.nanny-access-form {
  display: grid;
  gap: 16px;
}

.nanny-access-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  padding: 13px 16px;
  border: 1px solid #cbdff7;
  border-radius: 14px;
  background: linear-gradient(135deg, #f8fbff 0%, #edf6ff 100%);
  color: #365674;
}

.nanny-access-summary strong {
  color: #1265c4;
  font-size: 18px;
}

.nanny-access-summary small {
  margin-left: auto;
  color: #66809a;
}

.nanny-access-layout {
  display: grid;
  grid-template-columns: minmax(270px, 0.72fr) minmax(0, 1.28fr);
  min-height: 430px;
  overflow: hidden;
  border: 1px solid #c9dcef;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(35, 86, 139, 0.06);
}

.nanny-access-pane {
  min-width: 0;
  background: #fff;
}

.nanny-access-schools {
  border-right: 1px solid #d6e4f2;
  background: #f7faff;
}

.nanny-access-pane > header {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid #dce8f4;
  background: rgba(255, 255, 255, 0.92);
}

.nanny-access-pane > header h3 {
  margin: 0;
  color: #163652;
  font-size: 17px;
}

.nanny-access-pane > header p {
  margin: 4px 0 0;
  color: #66809a;
  font-size: 13px;
}

.nanny-access-school-list,
.nanny-access-route-list {
  display: grid;
  align-content: start;
  gap: 9px;
  max-height: 470px;
  overflow-y: auto;
  padding: 14px;
}

.nanny-access-school-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  border: 1px solid #d7e3ef;
  border-radius: 13px;
  background: #fff;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.nanny-access-school-item:hover {
  border-color: #96bde7;
  transform: translateY(-1px);
}

.nanny-access-school-item.is-active {
  border-color: #2e83e8;
  box-shadow: 0 0 0 3px rgba(46, 131, 232, 0.11);
}

.nanny-access-school-item.is-checked {
  background: #f6fbff;
}

.nanny-access-school-item > label {
  display: grid;
  min-width: 48px;
  min-height: 64px;
  place-items: center;
  cursor: pointer;
}

.nanny-access-school-item input,
.nanny-access-route-item input {
  width: 19px;
  height: 19px;
  margin: 0;
  accent-color: #1877df;
}

.nanny-access-school-item > button {
  display: grid;
  min-width: 0;
  min-height: 64px;
  align-content: center;
  gap: 5px;
  padding: 10px 14px 10px 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.nanny-access-school-item strong {
  overflow: hidden;
  color: #173754;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nanny-access-school-item small {
  color: #6b8299;
}

.nanny-access-route-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  min-height: 68px;
  padding: 12px 15px;
  border: 1px solid #d7e3ef;
  border-radius: 13px;
  background: #fff;
  cursor: pointer;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

.nanny-access-route-item:hover {
  border-color: #96bde7;
  background: #fbfdff;
}

.nanny-access-route-item.is-checked {
  border-color: #75abe5;
  background: #f2f8ff;
  box-shadow: 0 7px 18px rgba(35, 101, 173, 0.07);
}

.nanny-access-route-item:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.55;
}

.nanny-access-route-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.nanny-access-route-copy strong {
  overflow: hidden;
  color: #173754;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nanny-access-route-copy small {
  color: #617a94;
}

.nanny-access-bulk-actions {
  display: flex;
  gap: 7px;
}

.nanny-access-bulk-actions button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #bfd6ee;
  border-radius: 9px;
  background: #f7fbff;
  color: #1967ba;
  font-size: 13px;
  font-weight: 750;
}

.nanny-access-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.nanny-access-route-grants {
  display: grid;
  gap: 10px;
}

.nanny-access-route-grants article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid #d5e3f1;
  border-radius: 14px;
  background: #fff;
}

.nanny-access-route-grants article > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.nanny-access-route-grants small {
  overflow: hidden;
  color: #657d94;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .nanny-access-layout {
    grid-template-columns: 1fr;
  }

  .nanny-access-schools {
    border-right: 0;
    border-bottom: 1px solid #d6e4f2;
  }

  .nanny-access-school-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 240px;
  }

  .profile-nanny-route-entry {
    align-items: stretch;
    flex-direction: column;
  }


}


@media (max-width: 560px) {
  .nanny-access-modal {
    width: calc(100vw - 16px);
  }

  .nanny-access-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .nanny-access-summary small {
    margin-left: 0;
  }

  .nanny-access-school-list {
    grid-template-columns: 1fr;
  }

  .nanny-access-pane > header {
    align-items: flex-start;
    flex-direction: column;
  }

  .nanny-access-bulk-actions {
    width: 100%;
  }

  .nanny-access-bulk-actions button {
    flex: 1;
  }

  .nanny-access-actions .button {
    flex: 1;
  }


  .nanny-task-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .nanny-task-summary > div:nth-child(2) {
    border-right: 0;
  }

  .nanny-task-summary > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .nanny-task-card {
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }

  .nanny-task-time {
    min-height: 76px;
  }

  .nanny-task-time strong {
    font-size: 21px;
  }

  .nanny-task-action {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 720px) {
  .roster-contact-trigger,
  .roster-contact-empty {
    order: 1;
  }

  .roster-actions {
    order: 2;
  }

  .attendance-contact-layer {
    place-items: center;
    padding: 16px;
  }

  .attendance-contact-modal {
    width: 100%;
    max-width: 420px;
    height: auto;
    max-height: min(78dvh, 640px);
    border: 1px solid var(--line);
    border-radius: 22px;
  }

  .attendance-contact-modal .route-modal-header {
    padding: 17px 18px;
  }

  .attendance-contact-modal .route-modal-body {
    padding: 14px;
  }
}

/* 2026-08-05: senior-friendly readability for the nanny attendance flow. */
.crew-view {
  font-size: 16px;
  line-height: 1.6;
}

.crew-view .page-header h1 {
  font-size: clamp(32px, 4vw, 42px);
}

.crew-view .page-header .eyebrow {
  font-size: 15px;
  line-height: 1.45;
}

.crew-view .page-header p:not(.eyebrow) {
  font-size: 16px;
}

.crew-view .service-date-control {
  font-size: 15px;
}

.crew-view .service-date-control input,
.crew-view .trip-selector select {
  min-height: 50px;
  font-size: 17px;
}

.crew-view .online-switch {
  min-height: 50px;
  font-size: 16px;
}

.crew-view .online-switch input {
  width: 21px;
  height: 21px;
}

.crew-view .trip-selector > label,
.crew-view .scan-controls label > span {
  font-size: 15px;
  letter-spacing: 0.03em;
}

.crew-view .trip-meta span {
  padding: 7px 10px;
  font-size: 14px;
}

.crew-view .scan-button strong {
  font-size: 20px;
}

.crew-view .scan-button small {
  font-size: 14px;
  line-height: 1.5;
}

.crew-view .attendance-metrics .attendance-metric {
  min-height: 88px;
  padding: 15px 16px;
}

.crew-view .attendance-metrics strong {
  font-size: 30px;
  line-height: 1.15;
}

.crew-view .attendance-metrics span {
  font-size: 15px;
  line-height: 1.45;
}

.crew-view .search-field input {
  min-height: 50px;
  font-size: 16px;
}

.crew-view .toolbar .button,
.crew-view .attendance-filter-status .button {
  min-height: 48px;
  font-size: 16px;
}

.crew-view .attendance-filter-status {
  padding: 12px 14px;
  font-size: 16px;
  line-height: 1.55;
}

.crew-view .roster-card {
  min-height: 104px;
  padding: 15px 16px;
}

.crew-view .roster-person strong {
  font-size: 18px;
  line-height: 1.45;
}

.crew-view .roster-person small {
  font-size: 14px;
  line-height: 1.5;
}

.crew-view .roster-person p {
  font-size: 15px;
  line-height: 1.5;
}

.crew-view .roster-status .badge {
  padding: 6px 9px;
  font-size: 14px;
}

.crew-view .roster-status small {
  font-size: 14px;
  line-height: 1.45;
}

.crew-view .roster-actions .button {
  min-height: 48px;
  padding-inline: 15px;
  font-size: 16px;
}

.crew-view .roster-contact-trigger,
.crew-view .roster-contact-empty {
  min-height: 52px;
  padding: 10px 12px;
  font-size: 16px;
  line-height: 1.5;
}

.crew-view .roster-contact-phone-icon {
  width: 38px;
  height: 38px;
}

.attendance-contact-modal .route-modal-header h2 {
  font-size: 26px;
}

.attendance-contact-modal .route-modal-header p {
  font-size: 15px;
  line-height: 1.5;
}

.attendance-contact-row {
  min-height: 82px;
}

.attendance-contact-details strong {
  font-size: 18px;
}

.attendance-contact-details span {
  font-size: 16px;
  line-height: 1.5;
}

.attendance-contact-call {
  min-height: 48px;
  padding-inline: 16px;
  font-size: 16px;
}

.drawer:has(.scanner-panel) .drawer-header h2 {
  font-size: 26px;
}

.drawer:has(.scanner-panel) .drawer-header p {
  font-size: 16px;
  line-height: 1.5;
}

.camera-placeholder strong {
  font-size: 18px;
}

.camera-placeholder small,
.scanner-support {
  font-size: 15px;
  line-height: 1.5;
}

.scanner-panel .button,
.drawer:has(.scanner-panel) .drawer-footer .button {
  min-height: 50px;
  font-size: 16px;
}

.scan-toast strong {
  font-size: 18px;
}

.scan-toast p {
  font-size: 15px;
  line-height: 1.5;
}

.scan-result p {
  font-size: 16px;
  line-height: 1.5;
}

.scan-result small {
  font-size: 14px;
  line-height: 1.5;
}

.quick-scan-list .detail-section-title h3 {
  font-size: 19px;
}

.quick-scan-list > button {
  min-height: 66px;
  font-size: 16px;
}

.quick-scan-list > button strong {
  font-size: 17px;
}

.quick-scan-list small,
.quick-scan-list > button b {
  font-size: 14px;
}

@media (max-width: 719px) {
  .crew-view {
    gap: 18px;
  }

  .crew-view .page-header h1 {
    font-size: 34px;
  }

  .crew-view .trip-command-card {
    gap: 14px;
    padding: 16px;
  }

  .crew-view .attendance-metrics {
    gap: 0;
  }

  .crew-view .roster-card {
    gap: 12px;
    padding: 14px;
  }

  .crew-view .toolbar,
  .crew-view .toolbar .action-row {
    align-items: stretch;
  }

  .crew-view .toolbar .button {
    width: 100%;
  }
}
/* Bounded second-round activity workspace. */
.button-danger {
  background: var(--red);
  color: #fff;
}

.local-activity-test-banner strong {
  letter-spacing: 0.02em;
}

.activity-management-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
  min-width: 0;
}

.activity-list-panel,
.activity-editor-panel {
  min-width: 0;
  width: 100%;
}

.activity-list-panel > .search-field {
  min-height: 48px;
  border: 1px solid #a9c7f5;
  background: #edf4ff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.activity-list-panel > .search-field:hover {
  border-color: #709de0;
}

.activity-list-panel > .search-field:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.activity-list-panel > .search-field > span:not(.sr-only) {
  color: #2563eb;
}

.activity-list-panel > .search-field input {
  min-width: 0;
  color: #183153;
}

.activity-list-panel > .search-field input::placeholder {
  color: #526886;
  opacity: 1;
}

.activity-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  width: 100%;
  min-width: 0;
  gap: 16px;
  margin-top: 16px;
}

.activity-list-item {
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
  min-width: 0;
  min-height: 180px;
  gap: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(38, 88, 130, 0.07);
}

/* Share the five content rows across each visual row of cards. Long names or
   wrapped weekdays grow naturally without shifting neighbouring metadata. */
@supports (grid-template-rows: subgrid) {
  .activity-list-item {
    grid-row: span 5;
    grid-template-rows: subgrid;
    row-gap: 0;
  }
}

.activity-list-item.is-selected {
  border-color: #75a9df;
  box-shadow: 0 0 0 2px rgb(64 133 208 / 12%);
}

.activity-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.activity-card-name,
.activity-card-school,
.activity-card-dates,
.activity-card-weekdays {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.activity-card-name {
  flex: 1 1 auto;
  min-height: 2.7em;
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.35;
}

.activity-card-status {
  flex: 0 0 auto;
  white-space: nowrap;
}

.activity-card-school,
.activity-card-dates,
.activity-card-weekdays {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.activity-card-school {
  margin-top: 16px;
  color: var(--ink-soft);
  font-weight: 700;
}

/* Emphasize second-round weekdays without changing secondary school/date text. */
.activity-card-weekdays {
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.activity-card-dates,
.activity-card-weekdays {
  margin-top: 5px;
}

.activity-card-footer {
  display: flex;
  align-self: end;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #e8eef5;
}

.activity-card-footer > :first-child {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.activity-card-footer > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.activity-card-footer .button,
.activity-card-footer .text-button {
  flex: 0 0 auto;
}

.activity-form {
  display: grid;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.activity-editor-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
}

body:has(.activity-editor-layer),
body:has(.activity-publish-confirmation-layer) {
  overflow: hidden;
}

.activity-editor-scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(12, 24, 40, 0.5);
  backdrop-filter: blur(3px);
}

.activity-editor-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(1440px, calc(100vw - 48px));
  max-height: calc(100dvh - 48px);
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--canvas);
  box-shadow: 0 28px 70px rgba(11, 24, 40, 0.28);
}

.activity-editor-dialog > .activity-form {
  min-height: 0;
}

.activity-editor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.activity-editor-header h2 {
  margin: 0;
  font-size: 24px;
}

.activity-editor-header p:not(.eyebrow) {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.activity-editor-body {
  display: grid;
  grid-row: 1;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: max-content;
  align-content: start;
  gap: 16px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 24px;
}

.activity-editor-body > section,
.activity-editor-body > .detail-card {
  min-width: 0;
  margin: 0;
}

.activity-form .detail-card {
  min-width: 0;
  margin: 0;
}

.activity-editor-body .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.activity-editor-body .form-grid > label {
  display: grid;
  min-width: 0;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.activity-editor-body .form-grid > label > span {
  min-width: 0;
}

.activity-form :is(input:not([type="hidden"]):not([type="checkbox"]), select, textarea) {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  padding: 9px 12px;
}

.activity-form textarea {
  min-height: 44px;
  resize: vertical;
}

.activity-form :is(input:not([type="hidden"]):not([type="checkbox"]), select, textarea):focus-visible {
  border-color: var(--blue);
  outline: 3px solid rgba(37, 99, 235, 0.16);
  outline-offset: 1px;
}

.activity-form input[type="hidden"],
.activity-form input[type="checkbox"] {
  min-height: 0;
  width: auto;
  padding: 0;
}

.activity-weekday-fieldset {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.activity-weekday-fieldset legend {
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
}

.activity-service-date-preview {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #c9def2;
  border-radius: 13px;
  background: #f5faff;
}

.activity-service-date-preview h3 {
  margin: 0;
}

.activity-date-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.activity-date-chips span {
  padding: 5px 9px;
  border: 1px solid #bed7ee;
  border-radius: 999px;
  background: #fff;
  color: #1d5d98;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.activity-date-controls {
  display: grid;
  min-width: 0;
  max-width: 100%;
  gap: 16px;
  margin-top: 16px;
}

.activity-date-matches,
.activity-extra-dates {
  display: grid;
  min-width: 0;
  gap: 10px;
  padding: 14px;
  border: 1px solid #c9def2;
  border-radius: 13px;
  background: #f5faff;
}

.activity-extra-dates {
  grid-template-columns: minmax(0, 1fr) auto;
}

.activity-date-matches h4 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.activity-date-matches > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.activity-extra-dates h4 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.activity-extra-dates > h4 {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.activity-extra-dates > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  grid-column: 1;
  grid-row: 2;
}

.activity-date-count,
.activity-date-match-count,
.activity-date-matches > output,
.activity-date-matches > strong {
  display: block;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 750;
}

.activity-date-options {
  display: flex;
  min-width: 0;
  max-height: 240px;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  overflow: auto;
  margin: 0;
  padding: 2px;
  list-style: none;
}

/* Keep second-round matched-date tiles aligned even in sparse final rows. */
.activity-date-matches > .activity-date-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  scrollbar-gutter: stable;
}

.activity-date-option {
  display: flex;
  min-width: 0;
  max-width: 100%;
  flex: 1 1 220px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #c9def2;
  border-radius: 10px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.4;
  white-space: normal;
}

.activity-date-option > :first-child,
.activity-date-option .activity-date-chip-date {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

.activity-date-option.is-excluded {
  border-color: #d9ddda;
  background: #f0f2f1;
  color: #7b8582;
}

.activity-date-option.is-excluded .activity-date-chip-date {
  color: #7b8582;
  text-decoration: line-through;
}

.activity-date-option button {
  min-height: 36px;
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid #b8d2eb;
  border-radius: 8px;
  background: #f5faff;
  color: #1d5d98;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.activity-date-option button:hover,
.activity-date-option button:focus-visible {
  border-color: #79aee0;
  background: #eaf3ff;
}

.activity-date-option button[data-action="exclude-activity-date"] {
  border-color: #f0c1b4;
  background: var(--red-soft);
  color: var(--red);
}

.activity-date-option button[data-action="restore-activity-date"] {
  border-color: #a6d8b5;
  background: var(--green-soft);
  color: var(--green);
}

.activity-date-chip-date {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

.activity-extra-date-toolbar {
  display: flex;
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  min-width: 0;
  max-width: 100%;
  width: 320px;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.activity-extra-date-toolbar > label {
  display: grid;
  min-width: 0;
  flex: 1 1 160px;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.activity-extra-date-toolbar > label > span {
  color: var(--muted);
}

.activity-extra-date-toolbar > label input {
  min-width: 0;
  width: 100%;
}

.activity-extra-date-toolbar > button {
  min-height: 44px;
  flex: 0 0 auto;
}

.activity-extra-date-list,
.activity-extra-dates > .activity-extra-date-list {
  display: flex;
  grid-column: 1 / -1;
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-extra-date-list:empty {
  display: none;
}

.activity-extra-date-list > .activity-date-options {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  flex: 1 1 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
  max-height: 240px;
  overflow: auto;
  padding: 0;
}

.activity-extra-date-list > .activity-date-options > * {
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
  flex: 0 1 auto;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid #c4d7ec;
  border-radius: 10px;
  background: #fff;
  color: #23476f;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.activity-extra-date-list button {
  width: 32px;
  min-height: 32px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #64748b;
  font-size: 18px;
  line-height: 1;
}

.activity-extra-date-list button:hover,
.activity-extra-date-list button:focus-visible {
  background: var(--red-soft);
  color: var(--red);
}

.activity-participants-card > .detail-section-title h3 {
  font-size: 20px;
  font-weight: 750;
  line-height: 1.4;
}

.activity-date-error,
.activity-extra-dates > .activity-date-error {
  margin: 0;
  grid-column: 1 / -1;
  grid-row: auto;
  min-width: 0;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid #f0c1b4;
  border-radius: 10px;
  background: var(--red-soft);
  color: #a43e24;
  font-size: 12px;
  line-height: 1.45;
}

.activity-participant-list {
  display: table-row-group;
}

.activity-participant-row {
  display: table-row;
}

.activity-participant-table-scroll {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: auto;
  max-height: none;
  overflow: visible;
  -webkit-overflow-scrolling: touch;
}

.activity-participant-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  white-space: nowrap;
}

.activity-participant-table thead th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-strong);
  background: #f5faff;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}

.activity-participant-table th,
.activity-participant-table td {
  min-width: 0;
  padding: 12px;
  border-bottom: 1px solid #e8eef5;
  vertical-align: top;
  text-align: left;
  white-space: nowrap;
}

.activity-participant-table td {
  overflow: visible;
  white-space: nowrap;
}

.activity-participant-table tbody tr:last-child > td {
  border-bottom: 0;
}

.activity-participant-table th:nth-child(1),
.activity-participant-table col.activity-participant-student,
.activity-participant-table td.activity-participant-student {
  width: 16%;
  min-width: 0;
  vertical-align: top;
}

.activity-participant-table th:nth-child(2),
.activity-participant-table col.activity-participant-route,
.activity-participant-table td.activity-participant-route {
  width: 24%;
  min-width: 0;
  vertical-align: top;
}

.activity-participant-table th:nth-child(3),
.activity-participant-table col.activity-participant-stop,
.activity-participant-table td.activity-participant-stop {
  width: 24%;
  min-width: 0;
  vertical-align: top;
}

.activity-participant-table th:nth-child(4),
.activity-participant-table col.activity-participant-fee,
.activity-participant-table td.activity-participant-fee {
  width: 15%;
  min-width: 0;
  vertical-align: top;
}

.activity-participant-table th:nth-child(5),
.activity-participant-table col.activity-participant-remark,
.activity-participant-table td.activity-participant-remark {
  width: 21%;
  min-width: 0;
  vertical-align: top;
}

.activity-participant-table td > label {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.activity-participant-table label > span:first-child,
.activity-participant-table .activity-participant-field-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.activity-participant-remark-controls {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 8px;
}

.activity-participant-remark-controls > label {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
}

.activity-participant-remark-controls textarea {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  min-height: 44px;
  white-space: normal;
}

.activity-participant-remark-controls .button,
.activity-participant-remark-controls button {
  flex: 0 0 auto;
  min-height: 44px;
}

.activity-participant-subtotal {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.activity-charge-summary {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-weight: 750;
}

.activity-charge-summary strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.activity-student-combobox {
  position: relative;
  z-index: 2;
}

.activity-student-combobox:focus-within {
  z-index: 20;
}

.activity-student-results {
  left: 0;
  right: 0;
  z-index: 35;
}

.activity-participant-table .activity-student-combobox {
  position: relative;
  z-index: 2;
}

.activity-participant-table .activity-student-combobox:focus-within {
  z-index: 20;
}

.activity-participant-table .activity-student-results {
  position: static;
  max-height: none;
  overflow-y: visible;
  z-index: 35;
  overflow-x: clip;
}

.activity-participant-table .activity-student-results button {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  width: 100%;
  min-width: 0;
  text-align: left;
  white-space: normal;
}

.activity-participant-table .activity-student-results button > * {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.activity-fee-input {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
  align-items: center;
}

.activity-fee-input > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.activity-form-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  grid-row: 2;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.override-normal-layer-command {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #e8d4a3;
  border-radius: 11px;
  background: #fffaf0;
}

.override-normal-layer-command span,
.override-layer-help {
  color: var(--muted);
  font-size: 13px;
}

.override-normal-layer-command .button {
  justify-self: start;
  margin-top: 4px;
}

/* Read-only second-round activity conflict details, above the retained editor. */
.activity-conflict-notice-layer { z-index: 85; padding: 16px; }
.activity-conflict-notice-modal { width: min(900px, 100%); max-height: calc(100dvh - 32px); }
.activity-conflict-notice-modal .route-modal-header > div { min-width: 0; }
.activity-conflict-notice-modal .route-modal-header h2 { font-size: 22px; overflow-wrap: anywhere; }
.activity-conflict-notice-modal .route-modal-header p { overflow-wrap: anywhere; }
.activity-conflict-notice-modal #activity-conflict-notice-description { font-size: 14px; line-height: 1.65; }
.activity-conflict-list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.activity-conflict-card { min-width: 0; padding: 16px; border: 1px solid #d3e1f3; border-radius: 13px; background: #fff; }
.activity-conflict-card > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.activity-conflict-card > header > div { display: grid; gap: 4px; min-width: 0; }
.activity-conflict-card > header strong { color: #173457; overflow-wrap: anywhere; }
.activity-conflict-card > header small { color: #627a9a; font-size: 12px; overflow-wrap: anywhere; }
.activity-conflict-count { padding: 4px 8px; border-radius: 7px; background: #fff0eb; color: #a33d27; font-size: 12px; font-weight: 700; }
.activity-conflict-assignments { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.activity-conflict-assignment { min-width: 0; padding: 12px; border: 1px solid #dce7f6; border-radius: 10px; background: #f5f9ff; overflow-wrap: anywhere; }
.activity-conflict-assignment:last-child { background: #fffaf2; border-color: #efdfbd; }
.activity-conflict-assignment > span { display: block; margin-bottom: 7px; color: #627a9a; font-size: 12px; font-weight: 700; }
.activity-conflict-assignment > strong { font-size: 14px; }
.activity-conflict-assignment > p { margin: 7px 0 0; font-size: 13px; line-height: 1.65; color: #314b70; }
.activity-conflict-dates { margin-top: 12px; font-size: 12px; color: #4b6487; }
.activity-conflict-dates > summary { padding: 5px 0; cursor: pointer; overflow-wrap: anywhere; }
.activity-conflict-dates > summary:focus-visible { outline: 2px solid #2475d0; outline-offset: 3px; border-radius: 4px; }
.activity-conflict-dates > div { display: flex; flex-wrap: wrap; gap: 6px; max-height: 160px; margin-top: 8px; overflow: auto; }
.activity-conflict-dates > div > span { padding: 4px 7px; border-radius: 6px; background: #eef5ff; }
.activity-conflict-help, .activity-conflict-row-note { margin: 14px 0 0; color: #627a9a; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.activity-conflict-notice-modal .route-modal-body > .activity-conflict-row-note { margin: 0 0 14px; }
.activity-conflict-notice-modal .route-modal-footer { justify-content: flex-end; }
@media (max-width: 640px) {
  .activity-conflict-assignments { grid-template-columns: minmax(0, 1fr); }
  .activity-conflict-card { padding: 12px; }
  .activity-conflict-notice-modal .route-modal-header, .activity-conflict-notice-modal .route-modal-body, .activity-conflict-notice-modal .route-modal-footer { padding: 16px; }
  .activity-conflict-notice-modal .route-modal-header h2 { font-size: 20px; }
}

.activity-publish-confirmation-modal {
  width: min(720px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
}

.activity-publish-conflict-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-publish-conflict-row {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid #e8d4a3;
  border-radius: 10px;
  background: #fffaf0;
}

.activity-publish-conflict-row span {
  color: var(--muted);
  font-size: 13px;
}

.activity-publish-confirmation-modal .route-modal-footer .drawer-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.print-name-notes {
  display: block;
  margin-top: 2px;
  color: #4a5f75;
  font-size: 11px;
  line-height: 1.35;
}

.activity-name-print,
.ride-remark-print,
.student-remark-print {
  display: block;
}

.activity-name-print {
  color: #155f9c;
  font-weight: 700;
}

.ride-remark-print,
.student-remark-print {
  color: #5f7183;
}

.print-roster .print-roster-remark {
  white-space: normal;
}

@media (max-width: 720px) {
  .activity-management-layout {
    grid-template-columns: 1fr;
    gap: 16px;
    overflow-x: hidden;
  }

  .activity-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .activity-editor-layer {
    padding: 16px;
  }

  .activity-editor-dialog {
    width: calc(100vw - 32px);
    max-height: calc(100dvh - 32px);
  }

  .activity-editor-header {
    padding: 16px;
  }

  .activity-editor-body {
    padding: 16px;
  }

  .activity-date-controls {
    gap: 12px;
    margin-top: 12px;
  }

  .activity-date-matches,
  .activity-extra-dates {
    padding: 12px;
  }

  .activity-date-option {
    flex-basis: 100%;
  }

  .activity-extra-dates {
    grid-template-columns: minmax(0, 1fr);
  }

  .activity-extra-date-toolbar {
    grid-column: 1 / -1;
    grid-row: 3;
    width: 100%;
    max-width: 100%;
    align-items: center;
  }

  .activity-extra-date-toolbar > label {
    flex: 1 1 140px;
  }

  .activity-extra-date-toolbar > button {
    width: auto;
  }

  .activity-editor-body .form-grid {
    grid-template-columns: 1fr;
  }
.activity-form-actions {
    align-items: stretch;
    padding: 12px 16px;
    flex-wrap: wrap;
  }

  .activity-form-actions .button {
    width: 100%;
    flex: 1 1 100%;
  }
}

/* Second-round roster only: one activity per table row keeps its stop,
   dates, amount and billing state aligned even when long names wrap. */
.route-modal-stack:has(.route-activity-students),
.route-workbench-panel:has(> .route-activity-students) {
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

.route-activity-students,
.route-activity-students > .route-workbench-table-wrap {
  min-width: 0;
}

.route-activity-student-table {
  width: 100%;
  min-width: 980px;
  table-layout: fixed;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 13px;
}

.route-activity-student-table .route-activity-col-student { width: 12%; }
.route-activity-student-table .route-activity-col-class { width: 6%; }
.route-activity-student-table .route-activity-col-assignment { width: 26%; }
.route-activity-student-table .route-activity-col-dates { width: 34%; }
.route-activity-student-table .route-activity-col-amount { width: 14%; }
.route-activity-student-table .route-activity-col-balance { width: 8%; }

.route-activity-student-table th,
.route-activity-student-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
}

.route-activity-student-table thead th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.route-activity-student-table tbody + tbody {
  border-top: 2px solid var(--line);
}

.route-activity-student-table tr:last-child td {
  border-bottom: 1px solid var(--line);
}

.route-activity-student-table tbody:last-child tr:last-child td {
  border-bottom: 0;
}

.route-activity-student-table .route-activity-student-cell > strong,
.route-activity-student-table .route-activity-student-cell > small {
  display: block;
}

.route-activity-student-table .route-activity-student-cell > small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.route-activity-student-table .route-activity-assignment,
.route-activity-student-table .route-activity-charge {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 5px;
}

.route-activity-student-table .route-activity-assignment > strong {
  color: #155f9c;
  font-weight: 800;
  line-height: 1.4;
}

.route-activity-student-table .route-activity-assignment > p {
  margin: 0;
  color: #52677e;
  font-size: 12px;
  line-height: 1.5;
}

.route-activity-student-table .route-activity-assignment > *,
.route-activity-student-table .route-activity-charge > *,
.route-activity-student-table .route-activity-billing > * {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.route-activity-student-table .route-activity-date-list {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.route-activity-student-table .activity-date-chip {
  display: inline-flex;
  min-height: 25px;
  max-width: 100%;
  align-items: center;
  padding: 3px 7px;
  border: 1px solid #d5e2ef;
  border-radius: 999px;
  background: #f5f8fb;
  color: #466076;
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
}

.route-activity-student-table .route-activity-amount-cell,
.route-activity-student-table .route-activity-balance-cell {
  text-align: right;
}

.route-activity-student-table .route-activity-charge small {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.route-activity-student-table .route-activity-charge strong,
.route-activity-student-table .route-activity-total {
  color: #173457;
  font-size: 15px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

.route-activity-student-table .route-activity-billing {
  color: var(--muted);
  line-height: 1.5;
}

.route-activity-student-table .route-activity-summary-row td {
  padding-block: 9px;
  background: #f5f8fc;
  color: var(--muted);
  font-size: 12px;
  vertical-align: middle;
}

@media (max-width: 720px) {
  .route-activity-student-table th,
  .route-activity-student-table td {
    padding: 10px;
  }
}

/* Search only the temporary-ride student selector. */
.override-student-combobox { position: relative; }
.override-student-combobox:focus-within { z-index: 40; }
.override-student-results button.is-active { background: #eaf3ff; outline: 2px solid #2563eb; outline-offset: -2px; }

/* Student route editor only: keep it above its parent student dialog. */
.student-route-editor-layer {
  z-index: 71;
}

body:has(.student-route-editor-layer) {
  overflow: hidden;
}

.student-route-editor-layer .prototype-current-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.student-route-editor-layer .prototype-current-strip > div {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.student-route-editor-layer .prototype-current-strip span,
.student-route-editor-layer .prototype-change-card span {
  color: var(--muted);
  font-size: 12px;
}

.student-route-editor-layer .prototype-current-strip strong,
.student-route-editor-layer .prototype-change-card strong {
  white-space: pre-line;
  overflow-wrap: anywhere;
  line-height: 1.6;
}

.student-route-editor-layer .prototype-route-form,
.student-route-editor-layer .prototype-change-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.student-route-editor-layer .prototype-route-form > .prototype-impact-note {
  grid-column: 1 / -1;
}

.student-route-editor-layer .direct-assignment-direction,
.student-route-editor-layer .direct-assignment-direction label,
.student-route-editor-layer .direct-assignment-direction select {
  min-width: 0;
  max-width: 100%;
}

.student-route-editor-layer .direct-assignment-direction select {
  width: 100%;
}

.student-route-editor-layer .prototype-change-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.student-route-editor-layer .prototype-change-card > div {
  display: grid;
  gap: 6px;
}

.student-route-editor-layer .prototype-change-arrow {
  color: var(--muted);
  text-align: center;
}

@media (max-width: 720px) {
  .student-route-editor-layer .prototype-current-strip,
  .student-route-editor-layer .prototype-route-form,
  .student-route-editor-layer .prototype-change-summary {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Second-round per-service stop pricing, isolated local candidate. */
.second-round-stop-pricing .route-fare-money-input{max-width:240px}.activity-price-readonly{display:flex;flex-direction:column;gap:4px;padding:8px 0 0}.activity-price-readonly small{font-size:12px;color:#627897}.activity-price-refresh-actions{display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin:14px 0}.activity-form [aria-label="更新價格預覽"] li{margin:6px 0}.second-round-stop-pricing .route-fare-actions{margin-top:14px;gap:12px;justify-content:flex-end}

.activity-cancel-layer{position:fixed;inset:0;z-index:1500;display:grid;place-items:center;padding:24px}
.activity-cancel-scrim{position:absolute;inset:0;background:rgba(15,35,57,.48);backdrop-filter:blur(3px)}
body:has(.activity-cancel-layer){overflow:hidden}
.activity-cancel-dialog{position:relative;width:min(760px,100%);max-height:calc(100dvh - 48px);display:flex;flex-direction:column;background:#fff;border:1px solid #d2e2f5;border-radius:22px;box-shadow:0 24px 80px #17345433;overflow:hidden;color:#173454}
.activity-cancel-dialog>header{display:flex;align-items:flex-start;justify-content:space-between;padding:22px 24px 14px;gap:16px}
.activity-cancel-dialog h2{margin:4px 0 8px;font-size:24px}.activity-cancel-dialog p{margin:8px 0;line-height:1.6}
.activity-cancel-tabs{display:flex;gap:8px;padding:0 24px 16px;border-bottom:1px solid #dbe8f8}
.activity-cancel-body{padding:20px 24px;overflow:auto;background:#f4f9ff;min-height:180px}
.activity-cancel-body input{display:block;width:100%;min-height:44px;border:1px solid #bad3f2;border-radius:10px;background:white;padding:10px 12px;font:inherit;color:inherit;margin:6px 0 12px}
.activity-cancel-body input:focus{outline:2px solid #267cff;outline-offset:1px}
.activity-cancel-preview,.activity-cancel-history{background:white;border:1px solid #d5e4f7;border-radius:12px;padding:16px;margin:10px 0}.activity-cancel-preview h3{margin:0}.activity-cancel-preview li,.activity-cancel-history li{margin:8px 0}.activity-cancel-history summary{cursor:pointer;line-height:1.7}
.activity-cancel-error{padding:12px;border-radius:10px;background:#fff0ee;color:#ad3526}.activity-cancel-success{padding:12px;border-radius:10px;background:#e6f8f2;color:#08765d}.activity-cancel-empty{padding:12px;color:#617b9d}
.activity-cancel-dialog>footer{display:flex;justify-content:flex-end;gap:12px;padding:16px 24px;border-top:1px solid #dbe8f8;background:white}.activity-cancel-dialog .button:disabled{opacity:.5;cursor:default}
@media(max-width:600px){.activity-cancel-layer{padding:10px}.activity-cancel-dialog{max-height:calc(100dvh - 20px)}.activity-cancel-dialog>header,.activity-cancel-body{padding:16px}.activity-cancel-tabs{padding:0 16px 12px}}

/* Keep the activity header actions visually balanced without changing global buttons. */
.activity-management > .page-header > .page-actions > .button:is([data-action="open-activity-student-cancel"], [data-action="open-activity-create"]) {
  box-sizing: border-box;
  min-width: 100px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  line-height: 22px;
}

/* Activity cancellation: use the existing temporary-adjustment dropdown style. */
.activity-cancel-picker{position:relative;margin:6px 0 14px}
.activity-cancel-body .activity-cancel-picker input{margin:0;padding-right:40px;font-weight:600}
.activity-cancel-picker input::-webkit-search-cancel-button{display:none}
.activity-cancel-clear{position:absolute;right:6px;top:6px;width:32px;height:32px;border:0;border-radius:8px;background:transparent;color:#476d9f;font:inherit;font-weight:700;cursor:pointer}
.activity-cancel-clear[hidden]{display:none}
.activity-cancel-clear:hover{background:#eaf3ff}
.activity-cancel-clear:focus-visible{outline:2px solid #2563eb}
.activity-cancel-dropdown{z-index:5}
.activity-cancel-dialog:has(.activity-cancel-dropdown:not([hidden])) .activity-cancel-body{min-height:min(var(--activity-cancel-menu-space,320px),55dvh)}

.activity-cancel-muted{color:#617b9d;font-size:13px}

.activity-cancel-dropdown button{font:inherit;font-weight:600}

.roster-range-progress { display:flex; align-items:center; gap:12px; margin:10px 0; color:var(--text); }
.roster-range-progress .button { min-height:34px; padding:6px 12px; }


/* Parent account recovery, isolated from student contact deletion. */
.student-contact-table:has(.student-contact-reset) .student-contact-header,
.student-contact-table:has(.student-contact-reset) .student-contact-row{grid-template-columns:minmax(100px,1fr) minmax(100px,1fr) 76px 42px}
.student-contact-table:has(.student-contact-reset) .student-contact-row:not(:has(.student-contact-reset)) .student-contact-remove{grid-column:3 / -1;width:100%}
.student-contact-table:has(.student-contact-reset) .student-contact-reset{padding-inline:8px;white-space:nowrap}
.parent-reset-dialog{max-width:560px;width:calc(100% - 32px);border:1px solid #CADDF5;border-radius:18px;padding:26px;color:#0B2A4A;box-shadow:0 20px 70px #0B2A4A30}
.parent-reset-dialog::backdrop{background:#0B2A4A66}.parent-reset-dialog p{line-height:1.6}.parent-reset-dialog input{width:100%;padding:12px;border:1px solid #CADDF5;border-radius:8px}.parent-reset-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}.parent-reset-dialog [hidden]{display:none!important}
@media(max-width:600px){.student-contact-table:has(.student-contact-reset) .student-contact-row{grid-template-columns:minmax(0,1fr) 76px 42px}.student-contact-table:has(.student-contact-reset) .student-contact-row>label:first-of-type{grid-column:1 / -1}.student-contact-table:has(.student-contact-reset) .student-contact-row:not(:has(.student-contact-reset)) .student-contact-remove{grid-column:2 / -1}}

.edit-conflict-notice { position: sticky; top: 0; z-index: 3; grid-column: 1 / -1; margin: 12px 0; padding: 14px 16px; border: 1px solid #e5ad45; border-radius: 12px; background: #fff8e8; color: #573b0c; }
.edit-conflict-notice p { margin: 0 0 10px; line-height: 1.6; font-size: 15px; }
.edit-conflict-notice .button { white-space: normal; }
/* Compact shared confirmation, independent of wide route editors. */
.route-modal.confirm-input-dialog { width: min(580px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
.confirm-input-dialog-form textarea { font: inherit; color: #153453; padding: 12px; border: 1px solid #bed2ed; border-radius: 10px; resize: vertical; }
.confirm-input-dialog-form .route-modal-footer { padding: 12px 0 0; background: transparent; }
.confirm-input-dialog-form .drawer-actions { justify-content: flex-end; }

/* Browser-independent billing month control. */
.billing-month-field { display: grid; gap: 8px; min-width: 0; }
.billing-month-field > span { font-weight: 600; }
[data-billing-month-control] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
[data-billing-month-control] select { width: 100%; min-width: 0; }

/* Payment review controls stay visible even when the selected list is empty. */
.payment-review-header { flex-wrap: wrap; gap: 16px; }
.payment-review-tools { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; max-width: 100%; }
.payment-review-tools .search-field { width: 280px; max-width: 100%; min-width: 0; }
.payment-review-tools .segmented { flex-wrap: wrap; }
@media (max-width: 760px) {
  .payment-review-tools { width: 100%; margin-left: 0; justify-content: flex-start; }
  .payment-review-tools .search-field { width: 100%; }
  .payment-review-tools .segmented { width: 100%; }
}

/* Student-only pager: ten page numbers, without changing other list pagers. */
.student-pagination {
  gap: 12px;
  flex-wrap: wrap;
}

.student-pagination-pages {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.student-pagination .student-page-number {
  min-width: 40px;
  min-height: 44px;
  padding: 8px;
  font-variant-numeric: tabular-nums;
}

.student-pagination .student-page-number[aria-current="page"] {
  opacity: 1;
  cursor: default;
}

.student-pagination button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

@media (max-width: 760px) {
  .student-pagination {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-items: center;
  }

  .student-pagination-pages {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(5, minmax(40px, auto));
  }
}

/* Second-round invoices: scoped UI, separate from ordinary monthly billing. */
.second-round-billing-workbench { display: grid; gap: 18px; min-width: 0; }
.second-round-billing-workbench > .panel { min-width: 0; max-width: 100%; }
.second-round-billing-workbench .panel-header { min-width: 0; flex-wrap: wrap; }
.second-round-billing-workbench .panel-header > div { min-width: 0; flex: 1 1 220px; }
.second-round-billing-workbench .panel-header p { overflow-wrap: anywhere; }
.second-round-billing-scope .form-grid > label { min-width: 0; }
.second-round-billing-scope input, .second-round-billing-scope select { min-width: 0; max-width: 100%; }
.second-round-billing-scope .form-grid > label > :is(input, select) {
  width: 100%;
  height: 44px;
  min-height: 44px;
  box-sizing: border-box;
  padding: 0 13px;
  border: 1px solid #c8d9ec;
  border-radius: 11px;
  background-color: #fff;
  color: #173457;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  box-shadow: 0 4px 14px rgba(42, 83, 130, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.76);
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}
.second-round-billing-scope .form-grid > label > select { padding-right: 44px; }
.second-round-billing-scope .form-grid > label > :is(input, select):hover:not(:disabled) {
  border-color: #8eb5e6;
  background-color: #fbfdff;
}
.second-round-billing-scope .form-grid > label > :is(input, select):focus-visible:not(:disabled) {
  border-color: #2475d0;
  outline: none;
  box-shadow: 0 0 0 4px rgba(36, 117, 208, 0.14), 0 6px 18px rgba(42, 83, 130, 0.08);
}
.second-round-billing-scope .form-grid > label > :is(input, select):disabled {
  border-color: #d9e4ef;
  background-color: #eef4fa;
  color: #71859a;
  box-shadow: none;
}
.second-round-billing-scope input[type="date"] { color-scheme: light; font-variant-numeric: tabular-nums; }
.second-round-billing-scope input[type="date"]::-webkit-datetime-edit { padding: 0; }
.second-round-billing-scope input[type="date"]::-webkit-calendar-picker-indicator {
  width: 18px;
  height: 18px;
  margin-left: 8px;
  padding: 4px;
  border-radius: 7px;
  cursor: pointer;
  opacity: 0.68;
}
.second-round-billing-scope input[type="date"]::-webkit-calendar-picker-indicator:hover { background-color: #e8f2ff; opacity: 1; }
.second-round-billing-scope .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 16px 20px; }
.second-round-billing-scope input[readonly] { background: #f3f7fd; box-shadow: none; }
.second-round-billing-scope label > span > small { margin-left: 5px; font-size: 12px; font-weight: 400; }
.second-round-billing-scope .form-grid > label > small { font-size: 12px; line-height: 1.5; margin-top: 2px; }
.second-round-run-title { display: block; max-width: 420px; color: #173457; line-height: 1.5; overflow-wrap: anywhere; }
.second-round-runs-table td:first-child { white-space: normal; min-width: 180px; }
.second-round-billing-scope .action-row { margin-top: 12px; flex-wrap: wrap; }
.second-round-billing-scope .action-row > .button { max-width: 100%; }
.second-round-preview-students { display: grid; gap: 14px; }
.second-round-student-card { min-width: 0; border: 1px solid var(--line, #d5e3f9); border-radius: 14px; overflow: hidden; background: #fff; }
.second-round-student-card > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 16px; background: #f4f8ff; border-bottom: 1px solid var(--line, #d5e3f9); }
.second-round-student-card > header > div { display: grid; gap: 5px; min-width: 0; }
.second-round-student-card > header > div > strong { font-size: 15px; color: #142c4e; }
.second-round-student-card small, .second-round-items-table small, .second-round-excluded small { display: block; color: #627a9a; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.second-round-student-total { text-align: right; flex-shrink: 0; }
.second-round-student-total > span { font-size: 12px; color: #627a9a; }
.second-round-student-card > header .second-round-student-total > strong { font-size: 20px; color: #0a5db7; }
.second-round-items-wrap { min-width: 0; overflow-x: auto; }
.second-round-items-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.second-round-items-table th, .second-round-items-table td { padding: 12px 16px; border-bottom: 1px solid #e6edf7; text-align: left; vertical-align: top; overflow-wrap: anywhere; white-space: normal; }
.second-round-items-table th { background: #fbfcff; font-size: 12px; color: #627a9a; }
.second-round-items-table th:first-child { width: 48%; }
.second-round-items-table th:nth-child(2) { width: 18%; }
.second-round-items-table th:nth-child(3) { width: 16%; }
.second-round-items-table th:last-child, .second-round-items-table td:last-child { text-align: right; }
.second-round-items-table td > strong { color: #153a65; }
.second-round-items-table tbody tr:last-child td { border-bottom: 0; }
.second-round-items-table td small { margin-top: 5px; }
.second-round-excluded ul, .second-round-adjustment-history { list-style: none; margin: 0; padding: 0; }
.second-round-excluded li { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid #e6edf7; }
.second-round-excluded li > div { min-width: 0; }
.second-round-excluded li > div:last-child { text-align: right; }
.second-round-excluded .table-link { display: inline-block; margin: 6px 0 0 8px; }
.second-round-invoice-breakdown { min-width: 0; }
.drawer:has(.second-round-invoice-breakdown) > .drawer-header,
.drawer:has(.second-round-invoice-breakdown) > .drawer-footer { flex-shrink: 0; }
.drawer:has(.second-round-invoice-breakdown) > .drawer-body { min-width: 0; min-height: 0; }
.drawer:has(.second-round-invoice-breakdown) > .drawer-footer > .drawer-actions { min-width: 0; flex-wrap: wrap; }
.second-round-activity-context { padding: 12px 16px; color: #546e91; font-size: 13px; line-height: 1.7; }
.second-round-activity-context ul { margin: 6px 0; padding-left: 20px; }
.second-round-activity-context li { overflow-wrap: anywhere; }
.second-round-activity-context li > span { margin-left: 6px; white-space: nowrap; }
.second-round-activity-context > small { display: block; font-size: 12px; }
.second-round-invoice-breakdown .second-round-items-table th, .second-round-invoice-breakdown .second-round-items-table td, .second-round-adjustment-form .second-round-items-table th, .second-round-adjustment-form .second-round-items-table td { padding: 10px 7px; }
.second-round-invoice-breakdown .second-round-items-table th:first-child, .second-round-adjustment-form .second-round-items-table th:first-child { width: 40%; }
.second-round-invoice-breakdown .second-round-items-table th:nth-child(2), .second-round-adjustment-form .second-round-items-table th:nth-child(2) { width: 20%; }
.second-round-invoice-breakdown .second-round-items-table th:nth-child(3), .second-round-adjustment-form .second-round-items-table th:nth-child(3) { width: 20%; }
.second-round-invoice-total { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0 0; margin-top: 10px; border-top: 1px solid #d5e3f9; }
.second-round-invoice-total > span { color: #546e91; font-size: 13px; }
.second-round-invoice-total > strong { color: #0d4f94; font-size: 21px; }
.drawer:has(.second-round-adjustment-form) > .drawer-header,
.drawer:has(.second-round-adjustment-form) > .drawer-footer { flex-shrink: 0; }
.drawer:has(.second-round-adjustment-form) > .drawer-body { min-width: 0; min-height: 0; }
.drawer:has(.second-round-adjustment-form) .drawer-stack > .callout { display: grid; gap: 6px; }
.drawer:has(.second-round-adjustment-form) .drawer-stack > .callout strong { min-width: 0; font-size: 13px; line-height: 1.5; }
.drawer:has(.second-round-adjustment-form) .drawer-stack > .callout p { font-size: 13px; line-height: 1.7; }
.second-round-adjustment-form { display: grid; min-width: 0; gap: 18px; }
.second-round-adjustment-form .second-round-items-wrap { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.second-round-adjustment-form .second-round-items-table { min-width: 480px; }
.second-round-adjustment-form .second-round-items-table tbody tr:last-child td { border-bottom: 0; }
.second-round-adjustment-form > .second-round-invoice-total { margin-top: 0; padding: 14px 16px; flex-wrap: wrap; gap: 8px 16px; border: 1px solid var(--line); border-radius: 12px; background: #eef5ff; }
.second-round-adjustment-form > label { display: grid; min-width: 0; gap: 8px; color: var(--ink); font-size: 13px; font-weight: 700; line-height: 1.5; }
.second-round-adjustment-form :is(input[data-second-round-count], input[data-second-round-activity-count], textarea) {
  box-sizing: border-box;
  max-width: 100%;
  border: 1px solid #c8d9ec;
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.second-round-adjustment-form :is(input[data-second-round-count], input[data-second-round-activity-count]) { width: 80px; min-width: 0; height: 44px; padding: 8px 10px; border-radius: 10px; font-size: 16px; font-weight: 700; }
.second-round-adjustment-form textarea { display: block; width: 100%; min-height: 112px; padding: 12px; resize: vertical; font-weight: 400; line-height: 1.6; }
.second-round-adjustment-form :is(input[data-second-round-count], input[data-second-round-activity-count], textarea):hover:not(:disabled) { border-color: #8eb5e6; }
.second-round-adjustment-form :is(input[data-second-round-count], input[data-second-round-activity-count], textarea):focus-visible:not(:disabled) { border-color: #2475d0; outline: none; box-shadow: 0 0 0 4px rgba(36, 117, 208, 0.14); }
.second-round-adjustment-form :is(input[data-second-round-count], input[data-second-round-activity-count], textarea):disabled { border-color: #d9e4ef; background: #eef4fa; color: #71859a; box-shadow: none; cursor: not-allowed; }
.second-round-adjustment-form > button { align-self: start; justify-self: end; max-width: 100%; height: 44px; min-height: 44px; }
.second-round-adjustment-history > li { display: grid; gap: 5px; padding: 10px 0; border-bottom: 1px solid #e6edf7; font-size: 13px; }
.second-round-adjustment-history small { color: #627a9a; }
.route-activity-billing > small { display: block; margin-top: 6px; }
.route-activity-billing > .table-link { display: block; margin: 5px 0 0 auto; }
@media (max-width: 760px) {
  .second-round-billing-workbench .panel-header { flex-direction: column; align-items: stretch; }
  .second-round-billing-workbench .panel-header > div { flex-basis: auto; }
  .second-round-billing-workbench .panel-header > .button { align-self: flex-start; }
  .second-round-billing-scope .form-grid { grid-template-columns: 1fr; }
  .second-round-billing-scope .form-grid > label > :is(input, select) { font-size: 16px; }
  .second-round-student-card > header { align-items: flex-start; padding: 12px; gap: 10px; }
  .second-round-student-card > header .second-round-student-total > strong { font-size: 17px; }
  .second-round-items-table th, .second-round-items-table td { padding: 9px 8px; font-size: 12px; }
  .second-round-items-table th:first-child { width: 43%; }
  .second-round-items-table th:nth-child(2) { width: 19%; }
  .second-round-items-table th:nth-child(3) { width: 18%; }
  .second-round-excluded li { flex-direction: column; gap: 7px; }
  .second-round-excluded li > div:last-child { text-align: left; }
  .second-round-adjustment-form :is(input[data-second-round-count], input[data-second-round-activity-count]) { width: 60px; }
  .second-round-invoice-breakdown .second-round-items-table th, .second-round-invoice-breakdown .second-round-items-table td, .second-round-adjustment-form .second-round-items-table th, .second-round-adjustment-form .second-round-items-table td { padding: 8px 4px; font-size: 11px; }
}
.second-round-excluded-details { margin-top: 8px; max-width: 780px; text-align: left; }
.second-round-excluded-details > summary { cursor: pointer; color: #1764ab; font-size: 12px; }
.second-round-excluded-details .second-round-items-table { margin-top: 8px; }
.second-round-student-status { display: block; margin-top: 5px; max-width: 100%; font-size: 10px; line-height: 1.45; font-weight: 500; white-space: normal; overflow-wrap: anywhere; color: #667b98; }
.second-round-student-status-warning { color: #92600b; }
.second-round-student-status-danger { color: #a03b3b; }
.second-round-student-status-success { color: #087c67; }
.second-round-student-status-info { color: #1763a2; }
.second-round-student-status .table-link { margin-left: 5px; font-size: inherit; }
@media (max-width: 760px) {
  .second-round-adjustment-form textarea { font-size: 16px; }
  .second-round-adjustment-form > button { width: 100%; justify-self: stretch; }
  .second-round-adjustment-form .second-round-items-table th { font-size: 12px; }
  .second-round-adjustment-form .second-round-items-table td { font-size: 13px; }
}
.student-mobile-card-wrap > .second-round-student-status { padding: 0 16px 12px; margin-top: -3px; }

/* Independent activity display counts; ride-day pricing remains a separate section. */
.second-round-activity-adjustments, .second-round-ride-adjustments { display: grid; min-width: 0; gap: 10px; }
.second-round-adjustment-form :is(.second-round-activity-adjustments, .second-round-ride-adjustments) h3 { margin: 0; font-size: 15px; }
.second-round-activity-adjustments > p { margin: 0; font-size: 13px; }
.second-round-activity-count-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.second-round-activity-count-row > span { display: grid; min-width: 0; gap: 4px; overflow-wrap: anywhere; font-size: 13px; }
.second-round-activity-count-row small { color: #627a9a; font-size: 12px; font-weight: 400; }

/* Parent phone correction uses the existing profile controls and button system. */
.parent-phone-dialog { border:1px solid #d3e2f5; border-radius:22px; padding:28px; width:min(520px,calc(100vw - 32px)); color:#123252; box-shadow:0 24px 80px #12325230; }
.parent-phone-dialog::backdrop { background:#18365166; backdrop-filter:blur(3px); }
.parent-phone-dialog form { display:grid; gap:16px; }
.parent-phone-dialog h2,.parent-phone-dialog p { margin:0; }
.parent-phone-dialog label { display:grid; gap:8px; font-weight:600; }
.parent-phone-dialog input { box-sizing:border-box; width:100%; border:1px solid #b9cfea; border-radius:12px; padding:12px; font:inherit; }
.parent-phone-dialog [data-summary] { background:#eef5ff; padding:14px; border-radius:12px; line-height:1.7; }
.parent-phone-dialog [data-error] { color:#b42318; }
.parent-phone-dialog footer { display:flex; justify-content:flex-end; gap:10px; }

.student-contact-account-actions{display:flex;gap:6px;flex-wrap:wrap}
.student-contact-account-actions:not(:has(button)){display:none}
.student-contact-table:has([data-action="change-parent-phone"]) .student-contact-header,
.student-contact-table:has([data-action="change-parent-phone"]) .student-contact-row{grid-template-columns:minmax(100px,1fr) minmax(120px,1fr) 156px 42px;gap:8px}
.student-contact-table:has([data-action="change-parent-phone"]) .student-contact-row:has(.student-contact-account-actions button) .student-contact-remove{grid-column:4;width:34px}
.student-contact-table:has([data-action="change-parent-phone"]) .student-contact-row:not(:has(.student-contact-account-actions button)) .student-contact-remove{grid-column:3 / -1;width:100%}
.student-contact-account-actions .button{white-space:nowrap;padding-inline:8px}
@media(max-width:600px){.student-contact-table:has([data-action="change-parent-phone"]) .student-contact-row>label{grid-column:1 / -1}.student-contact-table:has([data-action="change-parent-phone"]) .student-contact-account-actions{grid-column:1 / 4}}

/* Visual alignment fixes (2026-10-22). Small, local adjustments only. */
@media (min-width: 720px) {
  :root {
    /* The topbar holds labelled selects and renders 83px tall; keep the sidebar
       brand divider, the context banner and the page offset on the same line. */
    --topbar-height: 83px;
  }
}

/* Symbol glyphs sit lower and look lighter than the letter icons. */
.main-navigation button[data-view="dashboard"] .nav-icon,
.main-navigation button[data-view="attendance"] .nav-icon {
  font-size: 13px;
}

.main-navigation button[data-view="dashboard"] .nav-icon {
  padding-bottom: 1px;
}

.is-sidebar-collapsed .build-status {
  justify-content: center;
  padding-inline: 0;
}

/* A status badge beside a two-line heading centres on the heading block. */
.panel-header > .badge:last-child {
  align-self: center;
}

.school-card header {
  align-items: center;
}

.school-heading {
  padding-top: 0;
}

/* Visual polish, batch 2 (2026-10-22). Layout gaps and wrapping only. */
@media (min-width: 1181px) {
  /* Card rows fill the width instead of leaving an empty column. */
  .metric-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .dashboard-lower > :only-child {
    grid-column: 1 / -1;
  }

  .trip-command-card:not(:has(> :nth-child(3))) {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  }
}

/* Keep the student column in view while the wide table scrolls sideways. */
.student-master-table th:first-child,
.student-master-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
  box-shadow: 1px 0 0 var(--line);
}

.student-master-table thead th:first-child {
  z-index: 2;
  background: #f0f6ff;
}

.route-card-metrics {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 0.8fr) minmax(0, 1.4fr);
}

.route-card-metrics span {
  white-space: nowrap;
}

.route-card footer > span {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The route select would otherwise sit alone in half a row. */
.form-grid > label:has(> select[name="routeId"][data-change="override-route"]) {
  grid-column: 1 / -1;
}

.year-rollover {
  flex-direction: column;
  align-items: flex-start;
}

.year-rollover ol {
  max-width: none;
  justify-content: flex-start;
}

.assignment-flow {
  justify-content: flex-start;
}

.import-drop input[type="file"]::file-selector-button {
  margin-right: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.student-management-grid {
  align-items: stretch;
}

.subscription-route-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.detail-value-row > span:first-child {
  flex-shrink: 0;
  white-space: nowrap;
}

/* Student pickup labels remain part of the existing remark text. */
.student-remark-fields {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.student-remark-fields > .student-pickup-field { display: grid; gap: 7px; align-content: start; color: #26435f; font-size: 13px; font-weight: 700; }
.student-pickup-field > span { display: block; margin: 0; }
.student-remark-fields .student-pickup-options { min-height: 112px; border-color: #cddceb; border-radius: 11px; background: #fbfdff; box-shadow: none; }
.student-remark-fields textarea { min-height: 112px; }
.student-pickup-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px;
  border: 1px solid #cbdced;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(19, 74, 134, .06);
}
.student-pickup-options.is-vertical { flex-direction: column; }
.student-pickup-options .student-pickup-option { position: relative; display: block; flex: 1; margin: 0; cursor: pointer; }
.student-pickup-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.student-pickup-options .student-pickup-option > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 11px;
  color: #50677f;
  font-weight: 800;
  transition: background .15s, color .15s;
}
.student-pickup-option b { visibility: hidden; }
.student-pickup-option input:checked + span { background: linear-gradient(135deg, #1675df, #258cf2); color: #fff; box-shadow: 0 6px 14px rgba(24, 112, 209, .2); }
.student-pickup-option input:checked + span b { visibility: visible; }
.student-pickup-option input:focus-visible + span { outline: 3px solid rgba(31, 120, 218, .35); outline-offset: 2px; }
.student-pickup-option input:disabled + span { opacity: .6; cursor: wait; }
.student-remark-sections { display: grid; gap: 16px; }
.student-remark-sections > section + section { border-top: 1px solid #e0eaf6; padding-top: 14px; }
.student-remark-sections h4 { margin: 0 0 8px; color: #50677f; font-size: 13px; }
.student-pickup-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.student-pickup-value { font-weight: 800; color: #176bc0; }
.student-pickup-saved:empty { display: none; }
.student-pickup-saved { color: #168164; font-size: 12px; }
.student-pickup-dialog {
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  border: 1px solid #d5e4f5;
  border-radius: 22px;
  padding: 24px;
  color: #15304e;
  box-shadow: 0 24px 80px rgba(16, 41, 73, .25);
}
.student-pickup-dialog::backdrop { background: rgba(18, 38, 63, .4); }
.student-pickup-dialog header { display: flex; justify-content: space-between; align-items: start; gap: 20px; }
.student-pickup-dialog h2 { margin: 4px 0 16px; }
.student-pickup-dialog footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.student-pickup-dialog [data-error] { color: #b42318; }
.student-pickup-dialog [data-error]:empty { display: none; }
@media (max-width: 560px) {
  .student-remark-fields { grid-template-columns: 1fr; }
}

/* Academic-year settings and school-specific catalogue preparation. */
.year-catalog-panel { padding:24px; }
.year-catalog-scope { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin-bottom:20px; }
.year-school-reminder { margin:0 0 20px; }
.year-school-reminder strong { font-size:18px; line-height:1.5; }
.year-table-scroll { overflow-x:auto; }
.year-catalog-table { width:100%; border-collapse:collapse; min-width:760px; }
.year-catalog-table th { background:#f5f8fc; color:#536b89; font-size:13px; font-weight:600; }
.year-catalog-table th,.year-catalog-table td { text-align:left; padding:20px 16px; border-bottom:1px solid #e4edf6; }
.year-catalog-table tr:last-child td { border-bottom:0; }
.year-catalog-table td:first-child { white-space:nowrap; }
.year-state { display:inline-block; margin-left:10px; padding:4px 9px; border-radius:8px; background:#edf2f7; color:#66768b; font-size:12px; vertical-align:middle; }
.year-state.is-current { background:#e4f6f0; color:#07816a; }
.year-dialog-layer { position:fixed; inset:0; z-index:1100; display:grid; place-items:center; padding:24px; background:rgba(20,40,66,.42); }
.year-dialog { background:#fff; border:1px solid #d7e5f5; border-radius:22px; width:min(920px,100%); max-height:calc(100dvh - 48px); display:flex; flex-direction:column; box-shadow:0 24px 80px rgba(16,40,75,.22); }
.year-dialog header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:24px 28px; border-bottom:1px solid #e1eaf4; }
.year-dialog header h2 { margin:0 0 8px; font-size:24px; }
.year-dialog header p { margin:0; }
.year-dialog-body { padding:24px 28px; overflow:auto; background:#f7faff; }
.year-dialog footer { padding:18px 28px; display:flex; justify-content:flex-end; gap:12px; border-top:1px solid #e1eaf4; }
.year-dialog-secondary .year-dialog { width:min(620px,100%); }
.year-management-list { display:grid; gap:14px; }
.year-management-list article { border:1px solid #dce7f3; border-radius:14px; padding:20px; background:#fff; display:flex; align-items:center; gap:18px; justify-content:space-between; }
.year-management-list p { margin:10px 0 0; }
.year-management-actions { display:flex; flex-wrap:wrap; gap:8px; }
.year-dialog fieldset { border:0; padding:0; margin:0; display:grid; gap:18px; min-width:0; }
.year-dialog label:not(.checkbox-line) { display:grid; gap:8px; }
.year-dialog input:not([type=checkbox]),.year-dialog select { width:100%; padding:12px; border:1px solid #cbdcf0; border-radius:10px; background:white; color:#18314f; }
.year-dialog .checkbox-line { display:flex; align-items:flex-start; gap:10px; line-height:1.6; }
[data-form="year-copy-preview"] fieldset { gap:10px; }
.year-copy-description { margin:0; line-height:1.6; }
.year-copy-preview { margin-top:24px; padding:20px; background:white; border:1px solid #dce7f3; border-radius:14px; }
.year-copy-preview li { margin:8px 0; }
.year-copy-counts { display:flex; flex-wrap:wrap; gap:10px; }
.year-copy-counts span { padding:10px 14px; border-radius:9px; background:#edf5ff; }
@media(max-width:680px) {
 .year-dialog-layer { padding:10px; }
 .year-dialog { max-height:calc(100dvh - 20px); }
 .year-dialog header,.year-dialog-body { padding:18px; }
 .year-management-list article { align-items:flex-start; flex-direction:column; }
 .year-catalog-panel { padding:16px; }
}

[data-student-continuation] .year-dialog-body { display:grid; gap:12px; }
[data-student-continuation] textarea { width:100%; padding:12px; border:1px solid #cbdcf0; border-radius:10px; background:white; color:#18314f; font:inherit; }
[data-student-continuation] label.continuation-import-label { display:inline-flex; align-items:center; justify-content:center; }

[data-student-continuation] .continuation-import-options summary { cursor:pointer; font-weight:600; }
[data-student-continuation] .continuation-import-options[open] > label { margin:12px 0; }
