:root {
  color-scheme: light;
  --ink: #17332b;
  --muted: #4c675c;
  --line: #d4e3da;
  --canvas: #f2f6f2;
  --paper: #fff;
  --teal: #19704f;
  --teal-dark: #0b593e;
  --teal-wash: #e8f3ec;
  --nav: #163f34;
  --danger: #a33738;
  --warn: #895116;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--canvas);
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
[hidden] { display: none !important; }
a { color: var(--teal-dark); font-weight: 650; text-underline-offset: 3px; }
p, h1, h2, h3 { margin: 0; }
button, input, select { font: inherit; }
h1 { font-size: clamp(1.85rem, 4vw, 2.65rem); line-height: 1.12; letter-spacing: -.038em; }
h2 { font-size: 1.22rem; line-height: 1.25; letter-spacing: -.015em; }
h3 { font-size: 1rem; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: .42rem;
  min-height: 42px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--ink);
  padding: .55rem .9rem; font-weight: 650; text-decoration: none; cursor: pointer; white-space: normal;
}
button:hover, .button:hover { background: #f7fbfb; border-color: #96b5b8; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary, .button.primary { background: var(--teal-dark); color: white; border-color: var(--teal-dark); }
button.primary:hover, .button.primary:hover { background: #064b46; }
button.danger { color: var(--danger); }
:focus-visible { outline: 3px solid #259d91; outline-offset: 2px; }
input:not([type="checkbox"]), select {
  width: 100%; min-height: 43px; border: 1px solid #b8cccf; border-radius: 8px; padding: .52rem .68rem;
  background: var(--paper); color: var(--ink);
}
input[type="date"], input[type="time"] { min-width: 0; }
input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: var(--teal-dark); }
input:disabled, select:disabled { opacity: .65; background: #f1f5f5; }
label { display: grid; gap: .27rem; font-size: .92rem; font-weight: 630; min-width: 0; }
.check { display: flex; align-items: center; gap: .5rem; }
form, .stack { display: grid; gap: .9rem; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.fields.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.width-full { grid-column: 1 / -1; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.split { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.card {
  border: 1px solid var(--line); border-radius: 16px; background: var(--paper); padding: clamp(1rem, 2.65vw, 1.5rem);
  box-shadow: 0 2px 3px #173d4110; min-width: 0;
}
.card-title { margin-bottom: .25rem; }
.message { border: 1px solid #c4e6df; background: var(--teal-wash); color: #204f49; padding: .65rem .8rem; border-radius: 9px; }
.message.error { border-color: #ebc7c5; background: #fff1f0; color: var(--danger); }
.message.warning { border-color: #eedcba; background: #fcf5e7; color: #715026; }
.message:empty, .form-error:empty { display: none; }
.form-error { color: var(--danger); }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: inherit; text-decoration: none; font-size: 1rem; font-weight: 780; letter-spacing: .005em; }
.brand-icon { display: inline-grid; place-items: center; position: relative; width: 39px; height: 39px; flex-shrink: 0; border-radius: 11px; background: #dbf2e9; }
.brand-icon::before, .brand-icon::after { content: ""; position: absolute; background: #184c37; border-radius: 2px; inset: 9px 12px 9px 11px; }
.brand-icon::after { inset: 13px 17px 21px 16px; background: #dbf2e9; border-radius: 1px; }
.brand small { display: block; color: var(--muted); line-height: 1.15; font-size: .76rem; font-weight: 640; }
.masthead { border-bottom: 1px solid var(--line); background: var(--paper); padding: .8rem clamp(1rem, 4vw, 2rem); }
.masthead-inner { max-width: 1080px; margin: auto; }
.login-layout { display: grid; min-height: 100svh; grid-template-columns: 42fr 58fr; }
.login-brand { background: var(--nav); color: white; display: grid; align-content: center; gap: 2.25rem; padding: clamp(1.8rem, 7vw, 6rem); }
.login-brand small, .sidebar small { color: #b6dde0; }
.login-brand h1 { max-width: 13ch; font-size: clamp(2.25rem, 4.4vw, 3.6rem); }
.login-body { display: grid; align-content: center; justify-items: center; padding: clamp(1rem, 5vw, 3rem); }
.login-card { width: min(100%, 560px); padding: clamp(1.15rem, 3.5vw, 2rem); }
.login-card h2 { font-size: 1.6rem; margin-bottom: .2rem; }
.login-card input { background: #fbfefe; }
.login-card > button { min-height: 44px; }
.login-tools { display: grid; gap: .42rem; padding-top: .72rem; border-top: 1px solid var(--line); }
.login-tools p { font-size: .79rem; }
.login-shortcuts :is(button,.button) { min-height: 34px; padding: .35rem .62rem; font-size: .8rem; }
#add-home { background: var(--teal-wash); color: var(--teal-dark); }
#add-home:hover { background: #d9efe7; }
.login-footer { justify-content: flex-end; }
.login-footer .button { min-height: 40px; padding-inline: .8rem; font-size: .84rem; }
.staff-shell { display: grid; min-height: 100svh; grid-template-columns: 228px minmax(0, 1fr); }
.sidebar {
  position: sticky; inset: 0 auto auto 0; height: 100svh; min-height: 0; background: #163f34; color: #f7faf2;
  display: flex; flex-direction: column; gap: 1.2rem; padding: 1.7rem 1.05rem .9rem;
}
.sidebar .brand { margin-left: .65rem; gap: .7rem; }
.sidebar .brand-icon { background: #d6e9b7; }
.sidebar .brand-icon::after { background: #d6e9b7; }
.sidebar .brand small { color: #d7e8d8; font-size: .66rem; letter-spacing: .08em; }
.sidebar-panel { min-height: 0; flex: 1; display: flex; flex-direction: column; gap: .75rem; }
.sidebar-menu { display: grid; align-content: start; gap: .3rem; overflow-y: auto; scrollbar-width: thin; }
.sidebar-menu button, .sidebar-menu a, .sidebar .sign-out {
  justify-content: flex-start; gap: .65rem; border-color: transparent; color: #eef7ef; background: transparent;
  font-size: .88rem; font-weight: 500; text-align: left; padding: .58rem .7rem;
}
.sidebar-menu button:hover, .sidebar-menu a:hover, .sidebar .sign-out:hover { background: #24543f; }
.sidebar-menu [aria-current="page"], .sidebar-menu [aria-current="page"]:hover {
  border-color: #d6e9b7; background: #d6e9b7; color: #163f34; font-weight: 700;
}
.sidebar .nav-icon { width: 17px; height: 17px; flex: none; }
.sidebar-foot { margin-top: auto; padding: .75rem .25rem 0; border-top: 1px solid #46735f; }
.staff-identity { display: flex; align-items: center; gap: .55rem; }
.staff-avatar {
  display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: #426a56; color: #f3faf2; font-weight: 720;
}
.sidebar-foot strong, .sidebar-foot small { display: block; overflow-wrap: anywhere; }
.sidebar-foot strong { font-size: .88rem; }
.sidebar-foot small { color: #d7e8d8; }
.sidebar .sign-out { min-height: 32px; padding: .3rem .2rem; margin: .26rem 0 0 2.4rem; font-size: .78rem; }
.sidebar-toggle { display: none; }
.workspace { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .85rem clamp(1rem, 4vw, 2rem); border-bottom: 1px solid var(--line); background: var(--paper); }
.topbar strong { overflow-wrap: anywhere; }
.workspace-body { max-width: 1430px; margin: auto; padding: clamp(1rem, 4vw, 2rem); display: grid; gap: 1rem; }
.counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.counts .card { display: grid; gap: .24rem; }
.counts strong { font-size: 1.8rem; line-height: 1.1; }
.filters { display: grid; grid-template-columns: minmax(170px, 1.2fr) repeat(2, minmax(125px, 1fr)); align-items: end; gap: .7rem; }
.status { display: inline-block; width: fit-content; padding: .21rem .58rem; border-radius: 9px; background: var(--teal-wash); color: var(--teal-dark); font-size: .82rem; font-weight: 670; }
.status.arrived, .status.rescheduled { background: #e6f1fa; color: #245878; }
.status.absent { background: #f8efd9; color: #76500f; }
.status.cancelled { background: #fae9e8; color: #923432; }
.item-list { list-style: none; margin: 0; padding: 0; }
.item-list li { border-bottom: 1px solid var(--line); padding: .66rem 0; overflow-wrap: anywhere; }
.item-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.empty { padding-block: 1rem; color: var(--muted); }
dialog { border: 1px solid var(--line); color: var(--ink); background: var(--paper); border-radius: 16px; width: min(92vw, 650px); max-height: 90svh; padding: clamp(.95rem, 3vw, 1.5rem); }
dialog::backdrop { background: #112f37a5; }
.dialog-title { margin-bottom: .9rem; }
.dialog-title button { padding: .3rem .64rem; min-height: 36px; }
dialog .stack { gap: .75rem; }
.dialog-details { background: var(--canvas); border-radius: 10px; padding: .7rem .8rem; }
.check-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .35rem .6rem; }
fieldset { min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: 9px; padding: .6rem .74rem; }
legend { font-size: .9rem; font-weight: 690; }
.footer-version { color: var(--muted); font-size: .79rem; padding-bottom: .2rem; }
@media (max-width: 930px) {
  .staff-shell { grid-template-columns: 190px minmax(0, 1fr); }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 660px) {
  .login-layout, .staff-shell { grid-template-columns: minmax(0, 1fr); }
  .login-brand { padding: 1.2rem 1rem; gap: .85rem; }
  .login-brand h1 { font-size: 2rem; max-width: none; }
  .login-body { align-content: start; }
  .sidebar { position: static; height: auto; padding: .8rem; gap: .75rem; }
  .sidebar .brand { margin-left: 0; }
  .sidebar-toggle { display: inline-flex; position: absolute; top: .7rem; right: .75rem; color: #f7faf2;
    background: transparent; border-color: #59816d; min-height: 40px; }
  .sidebar-toggle:hover { background: #24543f; }
  .sidebar-toggle[aria-expanded="false"] + .sidebar-panel { display: none; }
  .sidebar-menu { max-height: 48svh; }
  .sidebar-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 0; }
  .sidebar .sign-out { margin: 0; }
  .counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fields.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 380px) {
  .fields, .fields.three { grid-template-columns: minmax(0, 1fr); }
}
textarea { resize: vertical; min-height: 108px; border: 1px solid #b8ccbf; border-radius: 8px; padding: .6rem .68rem; background: white; color: var(--ink); font: inherit; }
.sidebar-menu :is(button,.button) { line-height: 1.3; }
.sign-out { flex-shrink: 0; }
.staff-context { display: grid; gap: .12rem; }
.staff-context span { color: var(--muted); font-size: .83rem; }
.period-control { max-width: 160px; }
.period-control input { min-height: 38px; }
.content { min-width: 0; }
.section-head { margin-bottom: .15rem; }
.counts section:first-child { border-color: #b7d7c8; background: #f7fcf9; }
.counts .card { box-shadow: 0 3px 10px #1d58420c; }
.counts strong { font-size: clamp(1.2rem,2.2vw,1.78rem); overflow-wrap: anywhere; }
.metric-note { color: var(--muted); font-size: .8rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: .65rem; align-items: end; justify-content: space-between; }
.toolbar input { min-width: 190px; }
.table-wrap { overflow-x: auto; min-width: 0; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table :is(td,th) { padding: .7rem .55rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table thead { background: #f6f9f6; color: var(--muted); font-size: .8rem; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .number { white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table button { min-height: 33px; padding: .34rem .56rem; font-size: .84rem; margin: .08rem; }
.data-table td.wrap { min-width: 170px; overflow-wrap: anywhere; }
.card .item-list .actions button { min-height: 34px; }
.notice-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,300px),1fr)); gap: .8rem; }
.preserve-lines { white-space: pre-wrap; overflow-wrap: anywhere; }
.archive { opacity: .75; }
.status.danger { background: #fae9e8; color: #923432; }
.status.warn { background: #f8efd9; color: #76500f; }
.status.quiet { background: #edf2ef; color: #425a4d; }
.receipt-details { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .55rem; }
.receipt-top { border-bottom: 1px solid var(--line); padding-bottom: .65rem; }
.receipt-total { display: flex; justify-content: space-between; font-size: 1.18rem; font-weight: 750; padding-top: .7rem; }
#receipt-print { display: none; }
@media (max-width: 660px) {
  .section-head h1 { font-size: 1.95rem; }
  .section-head .actions { width: 100%; }
  .data-table :is(td,th) { padding: .6rem .42rem; }
  .sidebar-menu button { padding-inline: .44rem; font-size: .87rem; }
  .sidebar .sign-out { min-height: 36px; font-size: .84rem; }
}
@media print {
  @page { margin: 12mm; }
  body.printing > :not(#receipt-print) { display: none !important; }
  body.printing { background: white; color: #000; }
  body.printing #receipt-print { display: block !important; max-width: 190mm; margin: 0 auto; }
  #receipt-print .card, #receipt-print .data-table thead { background: white; box-shadow: none; }
  #receipt-print .data-table tr { break-inside: avoid; }
}
