:root {
  --ink: #17212b;
  --muted: #657184;
  --line: #d9e2ea;
  --paper: #ffffff;
  --bg: #f3f6f8;
  --navy: #17324d;
  --teal: #2f6f73;
  --olive: #6b5b2e;
  --blue: #169dcc;
  --orange: #ee7130;
  --green: #17722f;
  --danger: #ad2e24;
  --shadow: 0 12px 28px rgba(23, 50, 77, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

body {
  margin: 0;
  min-height: 100%;
}

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

.app-shell {
  width: min(1120px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  color: #fff;
  background: var(--navy);
  border-radius: 8px 8px 0 0;
}

.topbar h1,
.section-title h2,
.panel-header h3 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 22px;
}

.topbar p {
  margin: 4px 0 0;
  color: #dbe8ef;
  font-size: 13px;
}

.icon-button,
.primary-button,
.secondary-button,
.tab {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.icon-button {
  min-width: 54px;
  padding: 0 12px;
  color: var(--navy);
  background: #fff;
  font-weight: 700;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: #c9d6df;
}

.tab {
  color: var(--navy);
  background: #eaf2f8;
  font-weight: 700;
}

.tab.is-active {
  color: #fff;
  background: var(--teal);
}

main {
  padding: 16px 0 72px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.section-title,
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title h2 {
  font-size: 18px;
}

.filter-bar,
.entry-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.entry-form.compact {
  grid-template-columns: 1.3fr 1fr auto;
  align-items: end;
}

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

label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

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

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(47, 111, 115, 0.25);
  border-color: var(--teal);
}

textarea {
  resize: vertical;
  min-height: 104px;
}

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

.primary-button {
  padding: 0 16px;
  color: #fff;
  background: var(--teal);
  font-weight: 700;
}

.secondary-button {
  padding: 0 14px;
  color: var(--navy);
  background: #dcebf2;
  font-weight: 700;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.kpi {
  min-height: 108px;
  padding: 16px;
  color: #fff;
  background: var(--teal);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.kpi:nth-child(3) {
  background: var(--olive);
}

.kpi:nth-child(4) {
  background: #355a7d;
}

.kpi-fee-lunch {
  background: #16735f;
}

.kpi-fee-dinner {
  background: #8a4f24;
}

.kpi-primary {
  background: var(--navy);
}

.kpi span {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
}

.kpi strong {
  display: block;
  font-size: 26px;
  line-height: 1.1;
}

.panel {
  margin-bottom: 14px;
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.chart-panel {
  min-height: 214px;
}

.bars {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: 72px 1fr 92px;
  align-items: center;
  gap: 10px;
}

.bar-track {
  height: 26px;
  overflow: hidden;
  background: #e8eef2;
  border-radius: 6px;
}

.bar-fill {
  height: 100%;
  min-width: 4px;
  background: var(--blue);
}

.bar-fill.alt {
  background: var(--orange);
}

.bar-value {
  text-align: right;
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  padding: 10px 9px;
  border-bottom: 1px solid #e4eaef;
  text-align: left;
  white-space: nowrap;
}

th {
  color: #fff;
  background: var(--olive);
  font-size: 13px;
}

td:not(:first-child),
th:not(:first-child) {
  text-align: right;
}

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

.record {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.record strong {
  display: block;
  margin-bottom: 4px;
}

.record small {
  color: var(--muted);
}

.record-actions {
  display: flex;
  gap: 6px;
}

.tiny-button {
  min-height: 34px;
  padding: 0 9px;
  color: var(--navy);
  background: #eaf2f8;
  border: 0;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
}

.tiny-button.danger {
  color: #fff;
  background: var(--danger);
}

.empty-state {
  padding: 18px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed #c8d4dc;
  border-radius: 8px;
}

.batch-note {
  padding: 10px 12px;
  color: var(--muted);
  background: #f4f8fa;
  border: 1px dashed #c8d4dc;
  border-radius: 6px;
  font-size: 13px;
}

@media (max-width: 760px) {
  .app-shell {
    padding: 0;
  }

  .topbar {
    border-radius: 0;
  }

  main {
    padding: 12px 10px 84px;
  }

  .tabs {
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .filter-bar,
  .entry-form,
  .entry-form.compact,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

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

  .kpi {
    min-height: 96px;
  }

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

  .bar-row {
    grid-template-columns: 64px 1fr;
  }

  .bar-value {
    grid-column: 2;
    text-align: left;
  }

}

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