:root {
  color-scheme: light;
  --bg: #f5f2ed;
  --ink: #1f2421;
  --muted: #686e68;
  --line: #ded8cf;
  --panel: #ffffff;
  --accent: #2d6f73;
  --accent-dark: #204f52;
  --accent-soft: #e7f2f1;
  --warn: #8a5b00;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input {
  font: inherit;
}

.app {
  width: min(1220px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 38px;
  line-height: 1;
}

.saved-state {
  margin-bottom: 6px;
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
}

.saved-state[data-mode="warn"] {
  color: var(--warn);
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.tab,
.button {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 16px;
  background: white;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.tab.active,
.button {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.tab:hover,
.button:hover {
  border-color: var(--accent-dark);
}

.calendar {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.calendar-head h2 {
  margin-bottom: 0;
  font-size: 24px;
}

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

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

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

th:last-child,
td:last-child {
  border-right: 0;
}

thead th {
  background: #f0eee9;
  color: #343a36;
  font-size: 13px;
  text-align: left;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.date-col {
  width: 150px;
}

.number-col {
  width: 145px;
}

.price-col {
  width: 130px;
}

.date-cell {
  background: #fbfaf7;
  font-weight: 700;
}

.date-cell span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.weekend .date-cell {
  background: var(--accent-soft);
}

.field {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 10px;
  background: transparent;
  color: var(--ink);
}

.field:hover,
.field:focus {
  border-color: var(--accent);
  background: white;
  outline: none;
}

.field.number,
.field.price {
  text-align: right;
}

@media (max-width: 760px) {
  .app {
    width: min(100% - 18px, 1220px);
    padding-top: 18px;
  }

  .topbar,
  .calendar-head {
    display: block;
  }

  h1 {
    margin-bottom: 12px;
    font-size: 31px;
  }

  .tabs,
  .button {
    width: 100%;
  }

  .tab {
    flex: 1;
  }

  .button {
    margin-top: 12px;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 9mm;
  }

  body {
    background: white;
  }

  .app {
    width: 100%;
    padding: 0;
  }

  .tabs,
  .saved-state,
  .no-print {
    display: none !important;
  }

  .calendar {
    border: 0;
  }

  .calendar-head {
    padding: 0 0 10px;
  }

  .table-wrap {
    overflow: visible;
  }

  table {
    min-width: 0;
    font-size: 10px;
  }

  th,
  td {
    padding: 5px;
  }

  .field {
    height: auto;
    padding: 0;
    border: 0;
    background: transparent;
  }
}
