:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --panel-soft: #eef4f1;
  --line: #d8e1dd;
  --text: #1c2422;
  --muted: #61706b;
  --brand: #1f7a5a;
  --brand-dark: #15553f;
  --danger: #b42318;
  --warning: #a15c07;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.login-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 18px 40px rgba(31, 57, 49, 0.12);
}

.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
}

.app-shell.nav-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.app-shell.nav-collapsed .sidebar {
  overflow: hidden;
  padding-left: 0;
  padding-right: 0;
}

.nav-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  box-shadow: 0 8px 24px rgba(31, 57, 49, 0.14);
  cursor: pointer;
}

.sidebar {
  background: #16241f;
  color: #eff8f3;
  padding: 24px 16px;
}

.brand {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 26px;
}

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

.nav-link,
.nav-sub-link,
.logout-button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  background: transparent;
  color: #d9e9e2;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.nav-group {
  display: grid;
  gap: 6px;
}

.nav-group-title {
  padding: 8px 12px 0;
  color: #9fb8ae;
  font-size: 12px;
  font-weight: 700;
}

.nav-sub-link {
  min-height: 34px;
  padding-left: 24px;
  font-size: 14px;
}

.nav-link.active,
.nav-sub-link.active,
.nav-link:hover,
.nav-sub-link:hover,
.logout-button:hover {
  background: #234037;
  color: #ffffff;
}

.logout-form {
  margin-top: 28px;
}

.main {
  min-width: 0;
  padding: 28px;
}

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

.page-heading {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.page-title {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
}

.page-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.metric-label {
  color: var(--muted);
  font-size: 14px;
}

.metric-value {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 700;
}

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

.toolbar {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

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

.field {
  display: grid;
  gap: 6px;
}

label,
.field-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #c8d4cf;
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

input,
select {
  height: 38px;
  padding: 0 10px;
}

textarea {
  min-height: 160px;
  padding: 10px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 122, 90, 0.14);
  outline: none;
}

.button,
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--brand);
  border-radius: 6px;
  padding: 0 14px;
  background: var(--brand);
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.button.secondary {
  background: #ffffff;
  color: var(--brand);
}

.button.danger {
  border-color: #f3c7c2;
  background: #fff7f6;
  color: var(--danger);
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--panel-soft);
  color: #33423d;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

td {
  color: #2e3936;
}

.entry-table {
  min-width: 1280px;
}

.summary-table {
  min-width: 1720px;
}

.online-sales-table {
  min-width: 1320px;
}

.revenue-table {
  min-width: 1560px;
}

.online-preview-wrap {
  margin-top: 16px;
}

.online-preview-table {
  min-width: 520px;
}

.employee-meal-entry-table {
  width: auto;
  min-width: 360px;
}

.employee-meal-entry-table td:first-child {
  font-weight: 600;
}

.employee-meal-entry-table th,
.employee-meal-entry-table td {
  padding: 5px 8px;
}

.employee-meal-entry-table input {
  width: 86px;
  height: 30px;
  padding: 0 8px;
  text-align: right;
}

.employee-meal-edit-table {
  min-width: 420px;
}

.employee-meal-edit-table th,
.employee-meal-edit-table td {
  padding: 6px 8px;
}

.employee-meal-edit-table input {
  height: 32px;
  text-align: right;
}

.entry-mode-toolbar {
  margin-bottom: 0;
}

.entry-table th,
.entry-table td {
  padding: 7px;
}

.entry-table input,
.entry-table select {
  min-width: 98px;
}

.entry-table .wide {
  min-width: 160px;
}

.entry-table .number {
  min-width: 94px;
  text-align: right;
}

.entry-table .row-index {
  width: 42px;
  color: var(--muted);
  text-align: center;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid #c8d4cf;
  border-radius: 6px;
  background: #ffffff;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.icon-button.danger:hover {
  border-color: #f3c7c2;
  color: var(--danger);
}

.record-actions {
  display: inline-flex;
  gap: 8px;
  white-space: nowrap;
}

.modal {
  border: 1px solid var(--line);
  border-radius: 8px;
  width: min(920px, calc(100vw - 32px));
  padding: 0;
  box-shadow: 0 24px 70px rgba(31, 57, 49, 0.22);
}

.modal::backdrop {
  background: rgba(16, 28, 23, 0.34);
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.modal-title {
  margin: 0;
  font-size: 20px;
}

.modal-body {
  padding: 18px;
}

.edit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.bulk-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}

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

.message {
  margin-bottom: 14px;
  border-radius: 6px;
  padding: 10px 12px;
  font-weight: 600;
}

.message.success {
  background: #e9f7ef;
  color: #17633f;
}

.message.error {
  background: #fff0ee;
  color: var(--danger);
}

.message.warning {
  background: #fff7e8;
  color: var(--warning);
}

.settings-section {
  margin-bottom: 22px;
}

.settings-row {
  display: grid;
  grid-template-columns: 1fr 120px 92px 1.4fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.settings-row form {
  display: contents;
}

.settings-heading {
  display: grid;
  grid-template-columns: 1fr 120px 92px 1.4fr auto auto;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}

.empty {
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.text-right {
  text-align: right;
}

.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(16, 28, 23, 0.38);
}

.nav-overlay[hidden] {
  display: none;
}

body.nav-drawer-open {
  overflow: hidden;
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-shell.nav-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    width: min(280px, 86vw);
    overflow-y: auto;
    padding: 18px 16px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .app-shell.nav-open .sidebar {
    transform: translateX(0);
  }

  .nav-list {
    grid-template-columns: 1fr;
  }

  .brand,
  .logout-form {
    display: block;
  }

  .main {
    padding: 18px;
  }

  .page-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .page-heading {
    align-items: flex-start;
  }

  .metric-grid,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .settings-heading,
  .settings-row {
    grid-template-columns: 1fr 90px;
  }

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

  .settings-row form,
  .settings-heading {
    display: grid;
  }
}
