/* Sweet & Simple — shared design system (public site adds site.css)
   Brand: cream #FDF9F0 · olive #5E6B4A · sage #8B9A7A · honey #D4AF7C · taupe #B9A89A · ink #2F3528
   Type: Cormorant Garamond (display) · Lora (body on the site) · system sans (apps) */

:root {
  --cream: #fdf9f0;
  --cream-2: #f6f0e2;
  --paper: #fffdf8;
  --olive: #5e6b4a;
  --olive-dark: #3f4a33;
  --olive-ink: #2f3528;
  --sage: #8b9a7a;
  --sage-light: #dfe5d4;
  --honey: #d4af7c;
  --honey-dark: #b8935a;
  --honey-light: #f3e6cc;
  --taupe: #b9a89a;
  --line: #e4dccb;
  --muted: #7a7a6e;
  --danger: #a4452f;
  --danger-bg: #f8e9e4;
  --ok: #4f7a4a;
  --ok-bg: #e5efdf;
  --warn: #9a6f1f;
  --warn-bg: #fbf0d8;
  --display: 'Cormorant Garamond', 'Georgia', serif;
  --serif: 'Lora', 'Georgia', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(47, 53, 40, 0.06), 0 8px 24px rgba(47, 53, 40, 0.07);
  --tap: 48px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--olive-ink); font-family: var(--sans); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--olive-dark); }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.15; color: var(--olive-dark); margin: 0 0 0.4em; letter-spacing: -0.01em; }
h1 { font-size: 2rem; } h2 { font-size: 1.5rem; } h3 { font-size: 1.25rem; } h4 { font-size: 1.05rem; font-family: var(--sans); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; color: var(--muted); }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.tiny { font-size: 0.78rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--olive-dark); color: #fff; padding: 8px 12px; z-index: 100; } .skip:focus { left: 8px; }
.error { color: var(--danger); background: var(--danger-bg); padding: 10px 14px; border-radius: var(--radius-sm); }
.dev-note { background: var(--honey-light); border: 1px dashed var(--honey-dark); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.9rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 10px 20px; border-radius: 999px; border: 1.5px solid var(--olive-dark); background: var(--paper); color: var(--olive-dark); font: 600 1rem var(--sans); text-decoration: none; cursor: pointer; transition: background 0.15s, transform 0.05s; }
.btn:hover { background: var(--cream-2); } .btn:active { transform: translateY(1px); }
.btn-primary { background: var(--olive); border-color: var(--olive); color: #fff; } .btn-primary:hover { background: var(--olive-dark); }
.btn-honey { background: var(--honey); border-color: var(--honey); color: var(--olive-ink); } .btn-honey:hover { background: var(--honey-dark); }
.btn-danger { background: var(--paper); border-color: var(--danger); color: var(--danger); } .btn-danger:hover { background: var(--danger-bg); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: 6px 14px; font-size: 0.9rem; }
.btn-lg { min-height: 56px; font-size: 1.1rem; padding: 14px 26px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
button.link { background: none; border: 0; padding: 0; color: var(--olive-dark); text-decoration: underline; font: inherit; cursor: pointer; min-height: 32px; }

/* Forms */
.stack > * + * { margin-top: 14px; }
label { display: block; font-weight: 600; font-size: 0.92rem; }
label > input, label > select, label > textarea { margin-top: 6px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="date"], input[type="time"], input[type="search"], input[type="password"], select, textarea {
  width: 100%; min-height: var(--tap); padding: 10px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); font: 1rem var(--sans); color: var(--olive-ink);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid rgba(212, 175, 124, 0.6); outline-offset: 2px; border-color: var(--honey-dark); }
.help { color: var(--muted); font-size: 0.85rem; font-weight: 400; margin-top: 4px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; } .row > * { flex: 1 1 160px; }
.check, .radio { display: flex; align-items: center; gap: 10px; min-height: var(--tap); font-weight: 500; padding: 6px 0; }
.check input, .radio input { width: 22px; height: 22px; accent-color: var(--olive); margin: 0; }
.choice-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.choice { position: relative; display: block; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--paper); cursor: pointer; font-weight: 500; min-height: var(--tap); }
.choice input { position: absolute; opacity: 0; } .choice:has(input:checked) { border-color: var(--olive); background: var(--sage-light); box-shadow: inset 0 0 0 1px var(--olive); }
.choice small { display: block; font-weight: 400; color: var(--muted); }
.code-input { font-size: 1.6rem; letter-spacing: 0.4em; text-align: center; font-family: var(--sans); }
fieldset { border: 0; padding: 0; margin: 0 0 18px; } legend { font-family: var(--display); font-size: 1.3rem; font-weight: 600; color: var(--olive-dark); margin-bottom: 8px; }

/* Cards & lists */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; } .card-head h2, .card-head h3 { margin: 0; }
.list { list-style: none; margin: 0; padding: 0; } .list > li { padding: 12px 0; border-top: 1px solid var(--line); } .list > li:first-child { border-top: 0; }
.list-link { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-decoration: none; color: inherit; min-height: var(--tap); } .list-link::after { content: '›'; color: var(--taupe); font-size: 1.4rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; } .kv dt { color: var(--muted); font-size: 0.88rem; } .kv dd { margin: 0; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; background: var(--sage-light); color: var(--olive-dark); white-space: nowrap; }
.pill-honey { background: var(--honey-light); color: var(--honey-dark); } .pill-danger { background: var(--danger-bg); color: var(--danger); } .pill-ok { background: var(--ok-bg); color: var(--ok); } .pill-warn { background: var(--warn-bg); color: var(--warn); } .pill-muted { background: var(--cream-2); color: var(--muted); }
.notice { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--honey-light); border-left: 4px solid var(--honey-dark); margin-bottom: 14px; }
.notice-alert { background: var(--danger-bg); border-left-color: var(--danger); } .notice-ok { background: var(--ok-bg); border-left-color: var(--ok); } .notice-info { background: var(--sage-light); border-left-color: var(--sage); }
.flash { padding: 12px 16px; text-align: center; font-weight: 600; } .flash-ok { background: var(--ok-bg); color: var(--ok); } .flash-error { background: var(--danger-bg); color: var(--danger); }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; } .stat b { display: block; font-family: var(--display); font-size: 1.7rem; color: var(--olive-dark); line-height: 1.1; } .stat span { color: var(--muted); font-size: 0.85rem; }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 16px; }
.money { font-variant-numeric: tabular-nums; }
.amount { font-family: var(--display); font-size: 2.2rem; font-weight: 600; color: var(--olive-dark); }
table.table { width: 100%; border-collapse: collapse; font-size: 0.93rem; } .table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; } .table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); } .table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
details.panel { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); padding: 0 14px; } details.panel summary { cursor: pointer; padding: 12px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; } details.panel summary::after { content: '+'; color: var(--taupe); } details.panel[open] summary::after { content: '–'; } details.panel > :not(summary) { padding-bottom: 12px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.right { text-align: right; } .center { text-align: center; }
.grid-2 { display: grid; gap: 14px; grid-template-columns: 1fr; } @media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.grid-3 { display: grid; gap: 14px; grid-template-columns: 1fr; } @media (min-width: 900px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.empty .ico { font-size: 2rem; display: block; margin-bottom: 6px; color: var(--taupe); }

/* Plain centered pages (sign-in) */
body.plain { display: grid; place-items: start center; padding: 24px 16px; min-height: 100vh; }
.plain-card { width: 100%; max-width: 440px; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 28px 24px 24px; box-shadow: var(--shadow); margin-top: 4vh; }
.plain-card .brand-center { display: block; margin: 0 auto 18px; width: 240px; }
.plain-card h1 { font-size: 1.7rem; text-align: center; } .plain-card > p.muted { text-align: center; }

/* App shell */
body.app { background: var(--cream); }
.app-frame { display: flex; min-height: 100vh; }
.app-side { display: none; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: rgba(253, 249, 240, 0.92); backdrop-filter: saturate(140%) blur(8px); border-bottom: 1px solid var(--line); padding-top: max(12px, env(safe-area-inset-top)); }
.app-header h1 { font-size: 1.45rem; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-header .back { font-size: 1.8rem; line-height: 1; text-decoration: none; padding: 0 8px; color: var(--olive); }
.header-actions { display: flex; gap: 8px; }
.app-content { flex: 1; padding: 16px 16px calc(84px + env(safe-area-inset-bottom)); max-width: 760px; width: 100%; margin: 0 auto; }
.app-wide .app-content { max-width: 1180px; }
.tab-bar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; background: var(--paper); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tab-bar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 6px; text-decoration: none; color: var(--muted); font-size: 0.7rem; font-weight: 600; position: relative; min-height: 56px; }
.tab-bar a .ico { font-size: 1.25rem; line-height: 1; } .tab-bar a[aria-current="page"] { color: var(--olive-dark); }
.badge { background: var(--danger); color: #fff; border-radius: 999px; font-size: 0.68rem; padding: 1px 6px; min-width: 18px; text-align: center; }
.tab-bar .badge { position: absolute; top: 4px; right: calc(50% - 22px); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--olive-dark); } .brand img { border-radius: 10px; } .brand strong { display: block; font-family: var(--display); font-size: 1.25rem; line-height: 1; } .brand small { display: block; font-size: 0.68rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--honey-dark); margin-top: 3px; }
@media (min-width: 900px) {
  .app-side { display: flex; flex-direction: column; width: 236px; padding: 22px 16px; border-right: 1px solid var(--line); background: var(--cream-2); position: sticky; top: 0; height: 100vh; }
  .side-nav { margin-top: 26px; display: flex; flex-direction: column; gap: 2px; }
  .side-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--olive-ink); font-weight: 500; } .side-nav a[aria-current="page"] { background: var(--paper); color: var(--olive-dark); box-shadow: var(--shadow); } .side-nav .ico { width: 20px; text-align: center; color: var(--honey-dark); } .side-nav .badge { margin-left: auto; }
  .side-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; }
  .tab-bar { display: none; }
  .app-content { padding-bottom: 40px; }
}

/* Visit / job cards used by all apps */
.visit-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); position: relative; }
.visit-card + .visit-card { margin-top: 12px; }
.visit-card .eyebrow { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--honey-dark); font-weight: 700; margin-bottom: 4px; }
.visit-card .when { font-family: var(--display); font-size: 1.5rem; font-weight: 600; color: var(--olive-dark); line-height: 1.15; }
.visit-card .window { font-size: 1.05rem; color: var(--olive-ink); margin: 2px 0 8px; }
.visit-card .meta { color: var(--muted); font-size: 0.9rem; }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--sage); margin-right: 6px; } .status-dot.live { background: var(--honey); box-shadow: 0 0 0 4px var(--honey-light); } .status-dot.done { background: var(--ok); } .status-dot.off { background: var(--taupe); }

/* Big one-tap buttons (cleaner app) */
.tap-btn { width: 100%; min-height: 72px; border-radius: 18px; font-size: 1.25rem; font-weight: 700; border: 0; background: var(--olive); color: #fff; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; }
.tap-btn.honey { background: var(--honey); color: var(--olive-ink); } .tap-btn.done { background: var(--ok); } .tap-btn.secondary { background: var(--paper); color: var(--olive-dark); border: 1.5px solid var(--line); }
.tap-btn[disabled] { opacity: 0.5; }
.timer { font-variant-numeric: tabular-nums; font-family: var(--display); font-size: 2.4rem; font-weight: 600; color: var(--olive-dark); line-height: 1; }

/* Modal / sheet */
dialog.sheet { border: 0; border-radius: 20px 20px 0 0; padding: 0; width: 100%; max-width: 100%; margin: auto 0 0; background: var(--paper); box-shadow: 0 -8px 30px rgba(0,0,0,0.15); }
dialog.sheet::backdrop { background: rgba(47, 53, 40, 0.45); }
dialog.sheet .sheet-body { padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 85vh; overflow: auto; }
dialog.sheet h2 { font-size: 1.4rem; }
@media (min-width: 640px) { dialog.sheet { border-radius: 20px; max-width: 520px; margin: auto; } }

/* Utilities */
.hide { display: none !important; }
.toast { position: fixed; left: 50%; bottom: calc(72px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--olive-dark); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 600; z-index: 50; box-shadow: var(--shadow); max-width: 92vw; }
.offline-bar { position: fixed; top: 0; left: 0; right: 0; background: var(--warn-bg); color: var(--warn); text-align: center; font-size: 0.85rem; padding: 6px; z-index: 60; }
.inline-form { display: inline; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; } .chips a, .chips button { border: 1.5px solid var(--line); background: var(--paper); border-radius: 999px; padding: 6px 14px; font: 600 0.88rem var(--sans); color: var(--olive-ink); text-decoration: none; min-height: 36px; cursor: pointer; } .chips [aria-current="true"], .chips .on { background: var(--olive); border-color: var(--olive); color: #fff; }
.price-health { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; } .price-health::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); } .price-health.thin::before { background: var(--warn); } .price-health.below_floor::before, .price-health.loss::before { background: var(--danger); }
@media print { .tab-bar, .app-side, .app-header .header-actions, .site-header, .site-footer { display: none !important; } body { background: #fff; } }
