:root {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #19283a;
  background: #f0f4f8;
  color-scheme: light;
  --border: #d9e3ec;
  --muted: #53657a;
  --teal: #126963;
  --teal-dark: #0b514c;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
main { max-width: 1440px; margin: 0 auto; padding: clamp(16px, 4vw, 52px); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(26px, 4vw, 36px); letter-spacing: -.035em; }
h2 { font-size: 17px; }
p { line-height: 1.5; color: var(--muted); }
button, input { font: inherit; }
button {
  padding: 9px 14px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: inherit;
  font-weight: 600;
  cursor: pointer;
}
button:hover:not(:disabled) { background: #e8f1f7; }
button:disabled { opacity: .5; cursor: default; }
button.primary { color: white; background: var(--teal); border-color: var(--teal); }
button.primary:hover:not(:disabled) { background: var(--teal-dark); }
button:focus-visible, input:focus-visible, .grid:focus-visible { outline: 2px solid #147e78; outline-offset: 2px; }
.sign-in {
  max-width: 410px;
  margin: clamp(32px, 12vh, 112px) auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  background: white;
}
.sign-in form { display: grid; gap: 8px; margin-top: 24px; }
.sign-in label { font-weight: 600; }
.sign-in input { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; }
.sign-in button { margin-top: 10px; }
#login-error, .error { color: #a52219; }
.page-header, .calendar-toolbar, .account, .actions, nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.page-header, .calendar-toolbar { justify-content: space-between; }
.page-header { margin-bottom: 22px; }
.property-name { font-size: 13px; font-weight: 700; color: var(--teal-dark); }
.connection { font-size: 13px; font-weight: 650; color: #895500; }
.connection.online { color: var(--teal-dark); }
.calendar, .details { background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.calendar-toolbar, .details { padding: 16px 18px; }
.calendar-toolbar p, .details p { margin-top: 3px; font-size: 13px; }
.grid { overflow: auto; border-block: 1px solid var(--border); }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { padding: 10px 8px; border-right: 1px solid #e7edf3; border-bottom: 1px solid #e7edf3; vertical-align: top; }
tr:last-child th, tr:last-child td { border-bottom: 0; }
th { text-align: center; font-weight: 650; background: #f4f7fa; white-space: nowrap; }
th span { display: block; font-size: 11px; color: var(--muted); }
th:first-child { position: sticky; z-index: 1; left: 0; min-width: 168px; text-align: left; padding-inline: 13px; }
.date-today { color: var(--teal-dark); background: #e4f4f2; }
td { min-width: 70px; text-align: center; }
td.today { background: #f4fbfa; }
.stock {
  font-variant-numeric: tabular-nums;
  color: inherit;
  text-align: center;
  width: 49px;
  height: 38px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #f0f4f8;
  font-weight: 680;
  appearance: textfield;
}
.stock::-webkit-inner-spin-button { appearance: none; }
.stock:hover { border-color: #aec1d1; }
.stock.dirty { color: #074e49; background: #daf4ee; border-color: #65b7a8; }
.stock.invalid { border-color: #bb3127; }
.cell-state { display: block; margin-top: 5px; font-size: 10px; white-space: nowrap; color: var(--muted); }
.cell-state[data-tone="good"] { color: #12633d; }
.cell-state[data-tone="warn"] { color: #895500; }
.cell-state[data-tone="error"] { color: #a52219; }
.footer { align-items: center; min-height: 76px; }
#message:empty, #selection:empty { display: none; }
.details { margin-top: 16px; }
.details ul { margin: 10px 0 0; padding-left: 22px; font-size: 13px; }
.details li { padding: 3px; line-height: 1.5; }
.setup { margin: 0 0 18px; }
.setup h2:not(:first-child) { margin-top: 18px; }
.setup-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 10px 0; }
.setup-fields label { display: grid; gap: 5px; min-width: 140px; font-size: 13px; font-weight: 600; }
.setup-fields input, .setup-fields select {
  max-width: min(320px, 72vw); min-height: 40px; padding: 8px 10px;
  font: inherit; color: inherit; background: #fff; border: 1px solid var(--border); border-radius: 7px;
}
.setup-fields select:focus-visible { outline: 2px solid #147e78; outline-offset: 2px; }
.setup-fields input[type="number"] { width: 140px; }
.empty-rooms { padding: 14px 18px; background: #f4f7fa; }
@media (max-width: 640px) {
  .page-header, .calendar-toolbar { align-items: flex-start; flex-direction: column; }
  .calendar-toolbar, .details { padding: 12px; }
  .actions, .account { flex-wrap: wrap; }
  th:first-child { min-width: 116px; max-width: 140px; white-space: normal; }
}
