/* Workspace tokens */
:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --panel: white;
  --ink: #242826;
  --muted: #626a70;
  --line: #e1e5e5;
  --active: #e8eee9;
  --accent: #907448;
}
html.dark {
  color-scheme: dark;
  --bg: #111315;
  --panel: #191c1f;
  --ink: #edeef0;
  --muted: #b1b7bb;
  --line: #383e43;
  --active: #293a32;
  --accent: #d1b685;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    15px/1.5 Inter,
    "IBM Plex Sans Thai",
    system-ui,
    sans-serif;
  font-variant-numeric: tabular-nums;
}
button,
select,
input,
a {
  font: inherit;
  color: inherit;
}
button,
select {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  background: var(--panel);
  cursor: pointer;
}
button:hover,
a:hover {
  background: var(--active);
}
:focus-visible {
  outline: 3px solid var(--accent);
}
aside,
header,
article {
  background: var(--panel);
}
aside {
  width: 232px;
  position: fixed;
  inset: 0 auto 0 0;
  border-right: 1px solid var(--line);
  padding: 24px 16px;
  overflow: auto;
  z-index: 2;
}
strong.brand {
  display: block;
  font-size: 19px;
  letter-spacing: 0.07em;
}
.brand i {
  color: var(--accent);
  font-style: normal;
}
small {
  color: var(--muted);
}
nav {
  margin-top: 24px;
}
nav a {
  display: block;
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 6px;
  margin: 3px 0;
}
nav a.on {
  background: var(--active);
  font-weight: 600;
}
nav small {
  display: block;
  margin: 18px 12px 5px;
  font-size: 11px;
  letter-spacing: 0.1em;
}
header,
main {
  margin-left: 232px;
}
header {
  height: 60px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
}
header b {
  margin-right: auto;
  font-weight: 500;
}
.demo {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 600;
}
main {
  padding: 30px;
  max-width: 1500px;
}
h1 {
  font-size: 28px;
  font-weight: 600;
  margin: 4px 0 20px;
}
h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 14px;
}
.stats,
.columns {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
}
.stats {
  grid-template-columns: repeat(4, 1fr);
}
.columns {
  grid-template-columns: 3fr 2fr;
}
article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  min-width: 0;
}
.value {
  font-size: 31px;
  display: block;
  font-weight: 550;
  margin-top: 8px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding: 14px 0;
}
.pill {
  font-size: 13px;
  background: var(--active);
  border-radius: 5px;
  padding: 4px 8px;
}
.primary {
  background: var(--ink);
  color: var(--panel);
}
.calendar {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 465px;
}
td,
th {
  padding: 12px;
  text-align: left;
  border-top: 1px solid var(--line);
}
th {
  color: var(--muted);
  font-weight: 500;
}
.menu {
  display: none;
}
dialog {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  width: min(430px, 94vw);
  padding: 24px;
}
dialog::backdrop {
  background: #10181577;
}
@media (max-width: 900px) {
  aside {
    display: none;
    top: 60px;
    box-shadow: 5px 8px 22px #0002;
  }
  aside.open,
  .menu {
    display: block;
  }
  header,
  main {
    margin-left: 0;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  main {
    padding: 18px 12px;
  }
  .columns {
    grid-template-columns: 1fr;
  }
  .stats {
    gap: 8px;
  }
  article {
    padding: 14px;
  }
  header {
    padding: 0 10px;
    gap: 6px;
  }
  header b {
    font-size: 13px;
  }
  button,
  select,
  nav a {
    min-height: 44px;
  }
  .row {
    flex-wrap: wrap;
  }
  .demo {
    font-size: 10px;
  }
}
dialog label {
  display: grid;
  gap: 5px;
  margin: 14px 0;
}
dialog input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
#gallery {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
}
#gallery img {
  width: 100%;
  max-height: 130px;
  object-fit: contain;
}
model-viewer {
  width: 100%;
  height: 210px;
  background: var(--bg);
}
dialog footer {
  text-align: right;
  position: sticky;
  bottom: 0;
  background: var(--panel);
  padding: 8px 0;
}
.monthHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.monthHead h2 {
  margin: 0;
}
.monthHead button {
  min-width: 44px;
  font-size: 20px;
}
.monthGrid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.monthGrid strong,
.monthGrid .empty {
  background: var(--bg);
}
.monthGrid strong {
  text-align: center;
  padding: 7px 0;
  font-size: 13px;
}
.monthGrid button {
  border: 0;
  border-radius: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 67px;
  padding: 7px;
}
.monthGrid small {
  color: var(--muted);
  white-space: nowrap;
}
.monthGrid button[aria-pressed="true"] {
  background: var(--active);
  box-shadow: inset 0 0 0 2px var(--accent);
}
.selectedDate {
  margin: 20px 0 8px;
}
@media (max-width: 600px) {
  .month {
    padding: 8px;
  }
  .monthGrid button {
    padding: 4px;
    min-height: 49px;
  }
  .monthGrid small {
    font-size: 10px;
  }
}
.switcher {
  display: inline-flex;
  margin-bottom: 16px;
  gap: 3px;
  background: var(--bg);
  padding: 3px;
  border-radius: 8px;
}
.switcher button {
  border: 0;
  background: transparent;
}
.switcher [aria-pressed="true"] {
  background: var(--ink);
  color: var(--panel);
}
.tape {
  min-width: 700px;
  border: 1px solid var(--line);
  margin-bottom: 10px;
}
.tapeRow {
  display: grid;
  grid-template-columns: 150px 1fr;
  border-bottom: 1px solid var(--line);
}
.tapeRow strong {
  position: sticky;
  left: 0;
  background: var(--panel);
  padding: 12px;
  z-index: 1;
  font-size: 14px;
}
.track {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: center;
  background: repeating-linear-gradient(
    to right,
    var(--line) 0 1px,
    transparent 1px calc(100% / 7)
  );
  min-height: 52px;
}
.track small {
  text-align: center;
}
.stay {
  grid-row: 1;
  background: #cfe7df;
  color: #173e33;
  padding: 5px 2px;
  margin: 2px;
  font-size: 12px;
  border: 0;
}
.stay[data-status="ทำความสะอาด"] {
  background: #f4deb6;
  color: #503b17;
}
.stay[data-status="กันบ้าน"] {
  background: #e1d7ee;
  color: #483458;
}
.occupancy {
  margin-bottom: 20px;
}
.plot {
  display: flex;
  align-items: end;
  height: 112px;
  gap: 3px;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(
    to top,
    var(--line) 0 1px,
    transparent 1px 33.33%
  );
}
.plotSlot {
  height: 100%;
  flex: 1;
  display: flex;
  align-items: end;
}
.plotSlot i {
  width: 100%;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
}
.axis {
  display: flex;
  justify-content: space-between;
}
.monthHead {
  gap: 8px;
  flex-wrap: wrap;
}
