:root {
  color-scheme: light;
  --brand-blue: #00a3e0;
  --brand-blue-dark: #0078b8;
  --brand-blue-soft: #e7f7fd;
  --brand-yellow: #ffd400;
  --brand-yellow-soft: #fff7c2;
  --ink: #302a2a;
  --muted: #657780;
  --line: #d4e6ee;
  --paper: #f4f9fd;
  --panel: #ffffff;
  --green: #16855f;
  --blue: var(--brand-blue);
  --red: #9a4b3f;
  --gold: #d8a600;
  --shadow: 0 18px 45px rgba(0, 112, 170, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont,
    sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: var(--brand-blue-dark);
  color: #fff;
  padding: 0 14px;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.06);
}

button.ghost {
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: transparent;
}

button.link {
  min-height: 0;
  background: transparent;
  color: var(--red);
  padding: 0;
}

button.secondary {
  border: 1px solid var(--line);
  background: var(--brand-blue-soft);
  color: var(--brand-blue-dark);
}

button.link.approve {
  color: var(--brand-blue-dark);
  font-weight: 750;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
}

textarea {
  resize: vertical;
}

fieldset {
  margin: 0;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

legend {
  padding: 0 6px;
  color: var(--ink);
  font-weight: 750;
}

label span,
.eyebrow,
.muted,
.empty,
td,
th,
.timeline span,
.menu-block span {
  color: var(--muted);
}

label {
  display: grid;
  gap: 6px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.1;
}

h2 {
  font-size: 19px;
  line-height: 1.2;
}

.message {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  background: var(--brand-blue-dark);
  color: #fff;
  font-weight: 650;
}

.message.error {
  background: #8f332c;
}

.workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: calc(100vh - 44px);
}

.login-shell {
  min-height: calc(100vh - 44px);
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top right, rgba(0, 163, 224, 0.16), transparent 34%),
    linear-gradient(180deg, #f7fbff 0%, #eef8fd 100%);
}

.login-card {
  position: relative;
  overflow: hidden;
  width: min(520px, 100%);
  display: grid;
  gap: 18px;
  border-top: 5px solid var(--brand-blue);
  border-radius: 8px;
  background: var(--panel);
  padding: 24px;
  box-shadow: var(--shadow);
}

.login-card::after {
  content: "";
  position: absolute;
  right: -74px;
  bottom: -92px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: var(--brand-yellow);
  opacity: 0.16;
  pointer-events: none;
}

.demo-account-list {
  display: grid;
  gap: 10px;
}

.demo-account {
  min-height: auto;
  display: grid;
  justify-items: start;
  gap: 4px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 12px;
  text-align: left;
}

.brand-lockup {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.brand-logo {
  display: block;
  object-fit: contain;
}

.brand-mark {
  position: absolute;
  object-fit: contain;
  opacity: 0.08;
  pointer-events: none;
}

.login-brand {
  min-height: 72px;
}

.login-brand .brand-logo {
  width: min(310px, 82%);
  max-height: 82px;
}

.login-brand .brand-mark {
  right: -44px;
  top: -64px;
  width: 190px;
  height: 190px;
}

.brand-mascot {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 74px;
  height: auto;
  opacity: 0.92;
  pointer-events: none;
}

.login-title {
  display: grid;
  gap: 4px;
  max-width: 360px;
}

.demo-account span,
.account-card span,
.account-card em,
.account-note span {
  color: var(--muted);
}

.rail {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 24px;
  background:
    linear-gradient(180deg, rgba(0, 163, 224, 0.98), rgba(0, 120, 184, 0.98)),
    var(--brand-blue);
  color: #fff;
  padding: 28px;
}

.rail .eyebrow,
.rail label span {
  color: rgba(255, 255, 255, 0.78);
}

.rail-brand {
  min-height: 62px;
}

.rail-brand .brand-logo {
  width: min(210px, 100%);
  max-height: 68px;
  filter: brightness(0) invert(1);
}

.rail-brand .brand-mark {
  right: -68px;
  top: 38px;
  width: 220px;
  height: 220px;
  filter: brightness(0) invert(1);
}

.system-title {
  display: grid;
  gap: 2px;
}

.account-card {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 12px;
}

.account-card strong,
.account-card em {
  font-style: normal;
}

.panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  padding: 22px;
}

.role-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.role-tabs button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 750;
}

.role-tabs button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.panel {
  display: grid;
  align-content: start;
  gap: 18px;
  min-width: 0;
  border-top: 5px solid var(--brand-blue);
  border-radius: 8px;
  background: var(--panel);
  padding: 20px;
  box-shadow: var(--shadow);
}

.panel.wide {
  grid-column: 1 / -1;
}

.accent-blue {
  border-top-color: var(--brand-blue);
}

.accent-red {
  border-top-color: var(--red);
}

.accent-gold {
  border-top-color: var(--brand-yellow);
}

.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.account-note {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 14px;
}

.eyebrow {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
}

.price,
.status {
  white-space: nowrap;
  border-radius: 999px;
  background: var(--brand-yellow-soft);
  color: #6f5600;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 750;
}

.menu-block {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
}

.menu-photo,
.menu-preview,
.dish-card img,
.dish-slot img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: #f3f5f1;
}

.menu-preview {
  aspect-ratio: 5 / 2;
}

.menu-block p {
  line-height: 1.6;
}

.dish-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.dish-card {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 8px;
}

.dish-card img {
  width: 68px;
  height: 52px;
  aspect-ratio: auto;
}

.dish-card div {
  display: grid;
  gap: 2px;
}

.dish-card strong {
  line-height: 1.25;
}

.dish-editor {
  display: grid;
  gap: 12px;
}

.dish-slot {
  display: grid;
  gap: 10px;
}

.upload-field {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 10px;
}

.upload-field input {
  border: 0;
  background: transparent;
  padding: 6px 0 0;
}

.dish-slot img {
  aspect-ratio: 5 / 2;
}

.weekly-menu-form {
  gap: 12px;
}

.week-menu-day {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefb;
  overflow: hidden;
}

.week-menu-day summary {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(0, 1.2fr);
  gap: 10px;
  cursor: pointer;
  padding: 12px 14px;
  background: #f7f8f3;
}

.week-menu-day summary span {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-menu-fields {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(140px, 0.8fr) minmax(180px, 1fr);
  gap: 10px;
  padding: 14px 14px 0;
}

.weekly-dish-editor {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  padding: 14px;
}

.compact-dish-slot {
  gap: 8px;
  padding: 10px;
}

.compact-dish-slot img {
  max-height: 92px;
}

.switch-field {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 42px;
}

.switch-field input {
  width: 42px;
  height: 24px;
  accent-color: var(--brand-blue);
}

.is-disabled-block {
  opacity: 0.58;
}

.parent-section-nav,
.owner-section-nav,
.campus-section-nav,
.kitchen-section-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 8px;
  scrollbar-width: thin;
}

.parent-section-nav button,
.owner-section-nav button,
.campus-section-nav button,
.kitchen-section-nav button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: #fbfcfa;
  color: var(--ink);
  min-height: 38px;
}

.parent-section-nav button.active,
.owner-section-nav button.active,
.campus-section-nav button.active,
.kitchen-section-nav button.active {
  border-color: var(--brand-blue);
  background: var(--brand-blue-dark);
  color: #fff;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  align-items: end;
  gap: 10px;
}

.grid-form.compact {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

.campus-student-form {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfc;
  padding: 14px;
}

.student-roster-panel {
  display: grid;
  gap: 12px;
  border: 1px solid #c9d8df;
  border-radius: 8px;
  background: #f7fbfd;
  padding: 14px;
}

.student-roster-panel .inline-form {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.student-roster-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.student-roster-details summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 750;
  background: #f7fbfd;
}

.student-roster-details .table-wrap,
.student-roster-details .empty {
  margin: 12px;
}

.late-add-panel {
  display: grid;
  gap: 12px;
  border: 1px solid #edc7bd;
  border-radius: 8px;
  background: #fff7f4;
  padding: 14px;
}

.campus-payment-reminder {
  display: grid;
  gap: 12px;
  border: 2px solid #b9442f;
  border-radius: 8px;
  background: #fff0e6;
  box-shadow: 0 10px 24px rgba(185, 68, 47, 0.14);
  padding: 16px;
}

.payment-reminder-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.payment-reminder-head strong {
  display: block;
  color: #8f2418;
  font-size: 18px;
  line-height: 1.35;
}

.payment-reminder-head span {
  color: #51352d;
  font-weight: 700;
}

.urgent-pay-button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: #b9442f;
  color: #fff;
  font-size: 16px;
  font-weight: 850;
  padding: 0 20px;
}

.payment-reminder-list {
  display: grid;
  gap: 8px;
}

.payment-reminder-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.8fr);
  gap: 10px;
  border-top: 1px solid rgba(185, 68, 47, 0.2);
  padding-top: 8px;
}

.payment-reminder-item span {
  font-weight: 750;
}

.payment-reminder-item em {
  color: #7b5a4c;
  font-style: normal;
}

.remark-board {
  display: grid;
  gap: 12px;
  border: 1px solid #e4d6c5;
  border-radius: 8px;
  background: #fffaf2;
  padding: 14px;
}

.kitchen-total-board {
  display: grid;
  gap: 12px;
  border: 1px solid #d7ded8;
  border-radius: 8px;
  background: #f6faf7;
  padding: 14px;
}

.late-alert-board {
  display: grid;
  gap: 12px;
  border: 1px solid #d99a8c;
  border-radius: 8px;
  background: #fff4f1;
  padding: 14px;
}

.cancellation-board {
  display: grid;
  gap: 12px;
  border: 1px solid #d7b6a9;
  border-radius: 8px;
  background: #fff8f4;
  padding: 14px;
}

.kitchen-school-picker {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 14px;
}

.kitchen-school-buttons {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.kitchen-school-buttons button {
  display: grid;
  gap: 4px;
  min-width: 138px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
}

.kitchen-school-buttons button.active {
  border-color: var(--brand-blue);
  background: var(--brand-blue-dark);
  color: #fff;
}

.kitchen-school-buttons span {
  color: inherit;
  font-size: 13px;
  opacity: 0.82;
}

.cancellation-totals {
  grid-template-columns: repeat(3, minmax(130px, 1fr));
}

.cancellation-totals strong,
.cancelled-row strong {
  color: #ad3d2b;
}

.owner-report-board,
.owner-issue-board,
.owner-section-card,
.order-details {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
  padding: 14px;
}

.owner-issue-board {
  border-color: #e7c2b7;
  background: #fff8f5;
}

.owner-overview {
  grid-template-columns: repeat(6, 1fr);
}

.owner-summary-table {
  min-width: 760px;
}

.owner-issue-table {
  min-width: 860px;
}

.order-details summary {
  cursor: pointer;
  font-weight: 750;
}

.compact-timeline {
  max-height: 360px;
  overflow: auto;
}

.kitchen-totals strong {
  color: var(--brand-blue-dark);
  font-size: 28px;
}

.late-totals {
  grid-template-columns: repeat(4, 1fr);
}

.late-totals strong {
  color: #9a4b3f;
}

.school-remark-board {
  background: #fffdf8;
}

.subhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.subhead span {
  color: var(--muted);
}

.stack-form {
  display: grid;
  gap: 10px;
}

.split {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
}

.list {
  display: grid;
  gap: 10px;
}

.row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.2fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.remark-field {
  min-width: 0;
}

.row div,
.timeline article {
  display: grid;
  gap: 4px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.metrics div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.metrics strong {
  font-size: 22px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
}

.remark-table {
  min-width: 720px;
}

.student-roster-table {
  min-width: 920px;
}

.pending-row {
  background: #fff0eb;
}

.inactive-row {
  background: #f3f4f2;
}

.inactive-row input {
  color: var(--muted);
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  white-space: nowrap;
}

th {
  font-size: 12px;
  font-weight: 750;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline article {
  border-left: 4px solid var(--line);
  padding: 4px 0 4px 12px;
}

.timeline em {
  color: var(--brand-blue-dark);
  font-style: normal;
}

.timeline em.cancelled {
  color: var(--red);
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .rail {
    grid-template-columns: 1fr;
  }

  .panels {
    grid-template-columns: 1fr;
  }

  .split,
  .grid-form,
  .grid-form.compact {
    grid-template-columns: 1fr;
  }

  .owner-overview,
  .late-totals,
  .cancellation-totals {
    grid-template-columns: repeat(2, 1fr);
  }

  .dish-gallery {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .week-menu-fields {
    grid-template-columns: 1fr;
  }

  .payment-reminder-head,
  .payment-reminder-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .message {
    padding: 0 14px;
    font-size: 14px;
  }

  .rail,
  .panels,
  .panel {
    padding: 16px;
  }

  .inline-form,
  .row,
  .panel-head,
  .subhead {
    display: grid;
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 25px;
  }

  .dish-gallery {
    grid-template-columns: 1fr;
  }

  .week-menu-day summary {
    grid-template-columns: 1fr;
  }

  .owner-overview,
  .late-totals,
  .cancellation-totals {
    grid-template-columns: 1fr;
  }
}
