/* Swan Valley Retreat — Catering
   Palette taken from swanvalleyretreat.com.au (soft white, warm greys, dusty taupe)
   with the layout of the Formation timesheet tracker (dark header, card, bottom tabs). */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Noto+Serif+Display:wght@400;500&display=swap');

:root {
  --bg: #F4F2EF;
  --card: #FFFFFF;
  --ink: #3A3A3A;
  --muted: #8A8A8A;
  --line: #E3DFDA;
  --accent: #B39A8C;        /* dusty taupe from the website */
  --accent-dark: #8F7566;
  --accent-light: #EFE7E1;
  --header: #6E6A66;        /* warm grey header */
  --header-ink: #FAFAFA;
  --gold: #C9A15B;
  --late: #2F6FB5;          /* blue = late change */
  --late-bg: #E4EEF9;
  --red: #B23A3A;           /* red = past-date correction */
  --red-bg: #F8E4E4;
  --green: #4F7F5A;
  --green-bg: #E4F0E6;
  --amber: #B7801C;
  --amber-bg: #FBF0D9;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 14px rgba(0,0,0,.05);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 15px/1.5 Lato, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-family: "Noto Serif Display", Georgia, serif; font-weight: 400; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.error { color: var(--red); }
a { color: var(--accent-dark); }

.screen { min-height: 100vh; min-height: 100dvh; }
.center {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 24px 16px; text-align: center;
}
.center .app-name { font-family: "Noto Serif Display", serif; font-size: 1.7rem; letter-spacing: .02em; }
.center .brand-sub { letter-spacing: .25em; text-transform: uppercase; font-size: .7rem; color: var(--muted); }

/* Sign-in (email + password) */
.signin-box { width: 100%; max-width: 360px; text-align: left; margin-top: 8px; }
.signin-box h2 { text-align: center; margin-bottom: 10px; }
.signin-links { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.linkbtn {
  appearance: none; background: none; border: 0; padding: 6px 0; min-height: 34px;
  font: inherit; font-size: .85rem; color: var(--accent-dark); text-decoration: underline; cursor: pointer;
}
.info-msg { background: var(--green-bg); color: var(--green); border-radius: 9px; padding: 8px 10px; }
.divider { width: 100%; max-width: 360px; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .8rem; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
#btn-signin { width: 100%; max-width: 360px; }

/* Buttons */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 9px; padding: 11px 16px; font: inherit; font-weight: 700; cursor: pointer; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent-dark); color: #fff; border-color: var(--accent-dark); }
.btn.gold { background: var(--gold); color: #3a2e14; border-color: var(--gold); }
.btn.danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 12px; min-height: 34px; font-size: .85rem; }
.btn.block { width: 100%; }
.btn.icon { padding: 6px 10px; min-height: 34px; min-width: 34px; }

/* Header */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--header); color: var(--header-ink);
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.topbar .app-name { font-family: "Noto Serif Display", serif; font-size: 1.1rem; letter-spacing: .04em; }
.topbar .sub { font-size: .75rem; opacity: .8; letter-spacing: .1em; text-transform: uppercase; }
.topbar .btn { background: transparent; color: var(--header-ink); border-color: rgba(255,255,255,.35); }
.balance-strip {
  background: var(--accent-light); border-bottom: 1px solid var(--line);
  padding: 8px 16px; display: flex; gap: 18px; flex-wrap: wrap; font-size: .85rem;
}
.balance-strip b { font-size: 1rem; }

.content { padding: 16px; padding-bottom: 96px; max-width: 760px; margin: 0 auto; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 14px;
}
.card h2 { margin-bottom: 8px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.stack > * + * { margin-top: 10px; }

/* Forms */
label.field { display: block; margin-bottom: 10px; }
label.field > span {
  display: block; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 4px; font-weight: 700;
}
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #FBFAF8;
  border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; min-height: 44px;
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper input { text-align: center; width: 70px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: -4px; margin-bottom: 10px; }

/* Week strip */
.week {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 12px;
}
.week button {
  border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 6px 2px;
  font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 58px;
}
.week button .dow { font-size: .65rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.week button .dom { font-weight: 700; font-size: 1.05rem; }
.week button .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.week button .dot.has { background: var(--accent); }
.week button .dot.locked { background: var(--green); }
.week button.today { border-color: var(--gold); }
.week button.selected { background: var(--accent-dark); color: #fff; border-color: var(--accent-dark); }
.week button.selected .dow { color: rgba(255,255,255,.75); }
.week-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }

/* Day status banner */
.banner { border-radius: 10px; padding: 10px 12px; font-size: .9rem; margin-bottom: 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.banner.open { background: var(--accent-light); color: var(--accent-dark); }
.banner.soon { background: var(--amber-bg); color: var(--amber); }
.banner.locked { background: var(--green-bg); color: var(--green); }
.banner.past { background: var(--red-bg); color: var(--red); }
.banner.late { background: var(--late-bg); color: var(--late); }

/* Order lines */
.slot-title { font-size: .7rem; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; font-weight: 700; }
.line {
  background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--line);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; display: flex; gap: 10px; align-items: flex-start; cursor: pointer;
}
.line.late { border-left-color: var(--late); background: var(--late-bg); }
.line.pastCorrection { border-left-color: var(--red); background: var(--red-bg); }
.line.deleted { opacity: .6; text-decoration: line-through; border-left-color: #bbb; background: #f2f2f2; }
.line .qty { font-family: "Noto Serif Display", serif; font-size: 1.4rem; min-width: 36px; text-align: center; line-height: 1.2; }
.line .name { font-weight: 700; }
.line .meta { font-size: .8rem; color: var(--muted); }
.line .price { margin-left: auto; text-align: right; white-space: nowrap; }
.chip {
  display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .05em; padding: 1px 7px;
  border-radius: 20px; background: var(--accent-light); color: var(--accent-dark); margin-left: 4px; vertical-align: middle;
}
.chip.late { background: var(--late); color: #fff; }
.chip.red { background: var(--red); color: #fff; }
.chip.green { background: var(--green); color: #fff; }
.chip.amber { background: var(--amber); color: #fff; }
.chip.grey { background: #ddd; color: #555; }
/* Orders schedule: one card per day with a clear gap between days (like the spreadsheet) */
.sched-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.earlier-links { gap: 12px; margin-bottom: 12px; }
.day-block { margin-bottom: 28px; }
.day-block.today { border-left: 5px solid var(--gold); }
.day-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.day-head h2 { margin: 0 6px 0 0; }
.day-head .chip { margin-left: 0; }
.day-actions { margin-top: 10px; gap: 8px; }
.chip.gold { background: var(--gold); color: #3a2e14; }
.line .time { font-weight: 700; min-width: 48px; font-variant-numeric: tabular-nums; line-height: 1.5; }

/* Add/edit order: variant + compact qty on one row; per-item variant $ adjust in the menu sheet */
.vq { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.stepper.compact { gap: 4px; }
.stepper.compact .btn.icon { min-height: 44px; min-width: 36px; padding: 6px 8px; }
.stepper.compact input { width: 46px; padding: 10px 2px; }
.var-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.var-row input.adj { width: 90px; min-height: 34px; padding: 6px 8px; text-align: right; }

.total-row { display: flex; justify-content: space-between; font-weight: 700; padding: 10px 4px; border-top: 1px solid var(--line); margin-top: 10px; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
td.num, th.num { text-align: right; white-space: nowrap; }
.table-wrap { overflow-x: auto; }

/* Log */
.log { border-bottom: 1px solid var(--line); padding: 10px 0; }
.log .who { font-weight: 700; }
.log .when { font-size: .8rem; color: var(--muted); }
.log .diff { font-size: .9rem; margin-top: 2px; }
.log .reason { font-size: .85rem; color: var(--red); margin-top: 2px; }

/* Bottom tabs */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--header); border-top: 2px solid var(--gold);
  display: flex; justify-content: space-around; padding: 6px 0; padding-bottom: max(6px, env(safe-area-inset-bottom));
}
.tabs button {
  background: none; border: 0; color: rgba(255,255,255,.65); font: inherit; font-size: .7rem;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 8px; cursor: pointer; min-width: 56px;
}
.tabs button .ic { font-size: 1.2rem; line-height: 1; }
.tabs button.active { color: var(--gold); }

/* Sheet / modal */
.sheet-bg { position: fixed; inset: 0; background: rgba(40,35,30,.45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  background: var(--card); width: 100%; max-width: 640px; max-height: 92vh; overflow: auto;
  border-radius: 16px 16px 0 0; padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom));
}
@media (min-width: 700px) { .sheet-bg { align-items: center; } .sheet { border-radius: 16px; } }
.sheet h2 { margin-bottom: 10px; }
.sheet .actions { display: flex; gap: 10px; margin-top: 12px; }
.sheet .actions .btn { flex: 1; }

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 30;
  background: #333; color: #fff; padding: 10px 16px; border-radius: 20px; font-size: .9rem; box-shadow: var(--shadow);
}
.copybox { background: #FBFAF8; border: 1px dashed var(--line); border-radius: 9px; padding: 10px; font-size: .85rem; white-space: pre-wrap; font-family: ui-monospace, Menlo, monospace; }

.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.quick .btn { padding: 6px 10px; min-height: 32px; font-size: .8rem; font-weight: 400; }

/* Print (statement PDF) */
@media print {
  body { background: #fff; font-size: 12px; }
  .topbar, .tabs, .balance-strip, .no-print { display: none !important; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
.statement-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--accent); padding-bottom: 10px; margin-bottom: 12px; }
.statement-head h1 { font-size: 1.4rem; }
.statement-totals td { font-weight: 700; }
