/* Meadows Host Desk – the owner's private app. Same palette as the booking page: forest green, cream, amber. Mobile first. */
:root {
  --green-900: #1b3524; --green-800: #24492f; --green-700: #2f5d3a; --green-100: #e3ecdf;
  --cream-50: #fdfaf4; --cream-100: #f7f0e1;
  --amber-500: #c8893b; --amber-100: #fbefd9; --amber-text: #6b4210;
  --bg: var(--cream-50); --surface: #ffffff; --surface-2: var(--cream-100);
  --text: #23271f; --muted: #555c51; --border: #e4dccb;
  --primary: var(--green-800); --primary-text: #ffffff; --primary-soft: var(--green-100);
  --accent-soft: var(--amber-100); --accent-text: var(--amber-text);
  --danger: #a1301f; --danger-soft: #f8e1dd; --wa: #128c4b; --wa-text: #ffffff;
  --ring: 0 0 0 3px rgba(47, 93, 58, .35);
  --shadow: 0 2px 4px rgba(35, 39, 31, .04), 0 8px 24px rgba(35, 39, 31, .08);
  --radius: 14px; --radius-lg: 20px;
  --font-serif: "Fraunces", Georgia, serif;
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121813; --surface: #1b241d; --surface-2: #222d24; --text: #efe9dc; --muted: #c1bcae; --border: #334036;
    --primary: #8ccf9b; --primary-text: #102016; --primary-soft: #23382a; --accent-soft: #3a2c17; --accent-text: #f3d2a1;
    --danger: #ff9a85; --danger-soft: #3d1a16; --wa: #2fbf6c; --wa-text: #08240f;
    --ring: 0 0 0 3px rgba(140, 207, 155, .45); --shadow: 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; font: 400 1rem/1.5 var(--font-sans); color: var(--text); background: var(--bg); padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; line-height: 1.2; margin: 0; }
p { margin: 0; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 10px; }
.wrap { width: 100%; max-width: 560px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; background: var(--primary); color: var(--primary-text); }
@media (prefers-color-scheme: dark) { .top { background: #17231a; color: var(--text); border-bottom: 1px solid var(--border); } }
.top-inner { max-width: 560px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.top img { width: 40px; height: 40px; border-radius: 50%; background: #fff; flex: none; }
.top .t { flex: 1; min-width: 0; }
.top .t b { display: block; font-family: var(--font-serif); font-size: 1.1rem; font-weight: 600; }
.top .t small { opacity: .8; font-size: .8rem; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 0; background: rgba(255, 255, 255, .12); color: inherit; display: grid; place-items: center; cursor: pointer; flex: none; }
.demo-pill { font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-text); }

/* layout */
.view { padding: 16px 0 24px; display: grid; gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 16px; display: grid; gap: 12px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.card-head h2 { font-size: 1.15rem; }
.lbl { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

/* fields */
.fld { display: grid; gap: 4px; min-width: 0; }
.fld label, .fld .fl { font-size: .85rem; font-weight: 600; display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.fld input, .fld select, .fld textarea { width: 100%; min-width: 0; min-height: 48px; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); font-size: 1rem; }
.fld textarea { min-height: 72px; resize: vertical; }
.fld input:focus, .fld select:focus, .fld textarea:focus { border-color: var(--primary); box-shadow: var(--ring); outline: none; }
.fld input.auto { background: var(--surface-2); }
.fld input.edited { border-color: var(--amber-500); }
.fld .err { color: var(--danger); font-size: .8rem; }
.fld.bad input { border-color: var(--danger); }
.tag { font-size: .7rem; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--primary-soft); color: var(--primary); border: 0; cursor: default; white-space: nowrap; }
button.tag { cursor: pointer; background: var(--accent-soft); color: var(--accent-text); }
.hint { font-size: .8rem; color: var(--muted); }

.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { flex: 1 1 auto; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); font-weight: 600; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.stepper { display: flex; align-items: center; border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden; min-height: 48px; }
.stepper button { width: 48px; align-self: stretch; border: 0; background: var(--surface-2); font-size: 1.3rem; cursor: pointer; }
.stepper span { flex: 1; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; min-height: 44px; }
.switch input { width: 22px; height: 22px; accent-color: var(--primary); flex: none; }

/* notes */
.note { font-size: .9rem; border-radius: 12px; padding: 10px 12px; background: var(--primary-soft); color: var(--primary); }
.note.warn { background: var(--accent-soft); color: var(--accent-text); }
.note.bad { background: var(--danger-soft); color: var(--danger); }
.paid { display: flex; align-items: center; gap: 8px; background: var(--primary); color: var(--primary-text); border-radius: 12px; padding: 10px 12px; font-weight: 700; }
.balance { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; padding: 2px 0; }
.balance b { font-size: 1.2rem; font-variant-numeric: tabular-nums; }

/* calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; }
.cal-head button { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 1.2rem; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { text-align: center; font-size: .72rem; font-weight: 700; color: var(--muted); padding: 2px 0; }
.cal button { aspect-ratio: 1 / 1; min-height: 40px; border-radius: 10px; border: 1px solid transparent; background: var(--surface-2); cursor: pointer; font-weight: 600; font-variant-numeric: tabular-nums; position: relative; }
.cal button.on { background: var(--primary); color: var(--primary-text); }
.cal button.co { border-color: var(--primary); background: var(--surface); }
.cal button.co::after { content: "out"; position: absolute; bottom: 2px; left: 0; right: 0; font-size: .55rem; font-weight: 700; color: var(--primary); }
.cal button.today { text-decoration: underline; text-underline-offset: 3px; }

/* buttons */
.btn { min-height: 50px; padding: 0 18px; border-radius: 14px; border: 1px solid transparent; font-weight: 700; font-size: 1rem; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.98); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; pointer-events: none; }
.btn-primary { background: var(--primary); color: var(--primary-text); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-wa { background: var(--wa); color: var(--wa-text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; color: var(--primary); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; padding: 0 4px; cursor: pointer; }
.btn-link.danger { color: var(--danger); }
.actions { display: grid; gap: 10px; }
.actions-2 { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

/* tomorrow strip and lists */
.list { display: grid; gap: 6px; }
.item { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); text-align: left; cursor: pointer; width: 100%; }
.item[disabled] { cursor: default; opacity: .75; }
.item .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.item .dot.red { background: var(--danger); }
.item .dot.none { background: var(--border); }
.item .main { min-width: 0; }
.item .main b { font-weight: 700; }
.item .sub { display: block; font-size: .8rem; color: var(--muted); }
.item .side { font-size: .9rem; font-weight: 700; text-align: right; white-space: nowrap; }
.item .side small { display: block; font-size: .72rem; font-weight: 600; color: var(--muted); }

/* bottom nav */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.nav-inner { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); }
.nav button { min-height: 60px; border: 0; background: none; display: grid; justify-items: center; align-content: center; gap: 2px; font-size: .74rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.nav button[aria-current="page"] { color: var(--primary); }
.nav svg { width: 22px; height: 22px; }

/* bottom sheet */
.sheet-bg { position: fixed; inset: 0; z-index: 40; background: rgba(15, 20, 16, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; background: var(--surface); border-radius: 22px 22px 0 0; padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); display: grid; gap: 12px; }
.sheet .grab { width: 44px; height: 5px; border-radius: 99px; background: var(--border); justify-self: center; }
.sheet h3 { font-size: 1.2rem; }
.opt { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface); text-align: left; width: 100%; cursor: pointer; }
.opt[aria-checked="true"] { border-color: var(--primary); box-shadow: var(--ring); }
.opt .r { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); flex: none; }
.opt[aria-checked="true"] .r { border: 6px solid var(--primary); }
.opt .grow { flex: 1; min-width: 0; }
.chat { background: #e7dfd4; border-radius: 14px; padding: 10px; }
@media (prefers-color-scheme: dark) { .chat { background: #0d1410; } }
.bubble { background: #d9fdd3; color: #111b21; border-radius: 12px 2px 12px 12px; padding: 10px 12px; font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere; margin-left: 24px; }
@media (prefers-color-scheme: dark) { .bubble { background: #005c4b; color: #e9edef; } }

/* login */
.login { min-height: 80vh; display: grid; align-content: center; gap: 18px; padding: 24px 0; }
.login .logo { width: 96px; height: 96px; border-radius: 50%; justify-self: center; box-shadow: var(--shadow); background: #fff; }
.login h1 { text-align: center; font-size: 1.6rem; }
.login .sub { text-align: center; color: var(--muted); }

/* toast */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 60; max-width: min(520px, calc(100% - 32px)); background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 14px; font-size: .92rem; box-shadow: var(--shadow); }
.skeleton { height: 52px; border-radius: 12px; background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite linear; }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* finance */
.chk { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.chk label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; }
.chk input { width: 20px; height: 20px; accent-color: var(--primary); }
.ftable { overflow: auto; max-height: 60vh; border: 1px solid var(--border); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.ftable table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .9rem; font-variant-numeric: tabular-nums; }
.ftable th, .ftable td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.ftable thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ftable tbody th { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; font-weight: 600; }
.ftable thead th:first-child { left: 0; z-index: 3; text-align: left; }
.ftable td.empty { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.ftable td.miss { color: var(--accent-text); background: var(--accent-soft); font-weight: 700; }
.ftable td.all { font-weight: 700; }
.ftable tr.tot th, .ftable tr.tot td { position: sticky; bottom: 0; background: var(--primary-soft); color: var(--primary); font-weight: 800; border-bottom: 0; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpi { background: var(--surface-2); border-radius: 14px; padding: 12px; display: grid; gap: 2px; }
.kpi span { font-size: .8rem; color: var(--muted); }
.kpi b { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.kpi.wide { grid-column: 1 / -1; }
.kpi.main { background: var(--primary); color: var(--primary-text); }
.kpi.main span { color: inherit; opacity: .85; }
.occ { height: 8px; border-radius: 99px; background: var(--border); overflow: hidden; margin-top: 6px; }
.occ i { display: block; height: 100%; background: var(--primary); }
