/* I Do Wedding Florals: shared styles for the dashboard, couple-facing pages and auth.
   site.css adds the marketing pages on top. */

:root {
  --bg: #f6f3ee;
  --surface: #ffffff;
  --ink: #2d2a26;
  --ink-2: #5d5750;
  --muted: #8a837a;
  --line: #e6e0d6;
  --line-2: #efeae2;
  --brand: #5f7a5a;
  --brand-ink: #ffffff;
  --brand-soft: #eef2ec;
  --accent: #7a8f6a;
  --ok: #3f7d4e;
  --ok-soft: #e7f2e9;
  --warn: #9a6a14;
  --warn-soft: #fbf1dc;
  --bad: #b0413e;
  --bad-soft: #f8e6e5;
  --info-soft: #eaf0f6;
  --heading-font: 'Cormorant Garamond', Georgia, serif;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(45, 42, 38, .05), 0 4px 16px rgba(45, 42, 38, .05);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}
img { max-width: 100%; }
a { color: var(--brand); text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-family: var(--heading-font); font-weight: 600; font-size: 2rem; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; font-weight: 600; }
h3 { font-size: .95rem; font-weight: 600; }
p { margin: 0 0 1em; }
small, .small { font-size: .85em; }
.muted { color: var(--muted); }
.center { text-align: center; }
.right { text-align: right; }
.ok { color: var(--ok); }
.fine { font-size: .82rem; color: var(--muted); margin-top: .6em; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.icon { width: 18px; height: 18px; flex: none; }
[hidden] { display: none !important; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 500; font-size: .9rem; color: var(--ink-2); margin-bottom: 14px; }
label small { display: block; font-weight: 400; color: var(--muted); margin-top: 4px; }
input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 5px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 11px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 44px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(95, 122, 90, .15); }
input.invalid, textarea.invalid { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(176, 65, 62, .12); }
input[type=checkbox], input[type=radio] { display: inline-block; width: auto; margin: 0 8px 0 0; vertical-align: -2px; accent-color: var(--brand); }
input[type=color] { width: 48px; height: 40px; padding: 3px; }
input[type=file] { padding: 7px; background: var(--bg); }
input[readonly] { background: var(--bg); }
label.check, label.radio { display: flex; align-items: flex-start; font-weight: 400; color: var(--ink); gap: 0; }
label.check input, label.radio input { margin-top: 3px; }
label.radio small { display: inline; margin: 0 0 0 6px; }
.stack > * + * { margin-top: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid-form.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-form .span2 { grid-column: span 2; }
.grid-form > .btn { justify-self: start; }
.narrow { max-width: 260px; }
.w-xs { width: 60px !important; display: inline-block; margin: 0 4px; padding: 4px 8px; }
.w-sm { width: 90px !important; }
.w-md { width: 140px !important; }
.w-amount { width: 110px !important; flex: none; }
.row-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-inline input { margin-top: 0; flex: 1; min-width: 120px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 8px 0 24px; }
.inline-label { display: flex; align-items: center; gap: 8px; margin: 0; }
.inline-label input { margin: 0; }
.prefix-input { display: flex; align-items: stretch; margin-top: 5px; }
.prefix-input span { background: var(--bg); border: 1px solid var(--line); border-right: 0; border-radius: 7px 0 0 7px; padding: 9px 10px; color: var(--muted); font-weight: 400; white-space: nowrap; }
.prefix-input input { margin: 0; border-radius: 0 7px 7px 0; }
.money-in { position: relative; margin: 0; }
.money-in span { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 400; pointer-events: none; }
.money-in input, .cat-row .money-in input, .edit-table .money-in input { padding-left: 22px; margin: 0; }
.color-field { display: flex; align-items: center; gap: 10px; margin-top: 5px; font-weight: 400; }
.color-field input { margin: 0; }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; margin-bottom: 14px; }
.check-grid label { margin-bottom: 8px; }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 38px; height: 22px; margin: 0; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #d8d2c8; border-radius: 22px; cursor: pointer; transition: background .15s; }
.switch span::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::before { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px rgba(95, 122, 90, .25); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-weight: 600;
  font-size: .92rem;
  line-height: 1.2;
  padding: 10px 16px;
  border-radius: 7px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: var(--brand-ink);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .icon { width: 16px; height: 16px; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg); filter: none; }
.btn-sm { padding: 7px 12px; font-size: .85rem; }
.btn-lg { padding: 13px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-accent { background: var(--accent); border-color: var(--accent); }
.link, .link-danger { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-danger { color: var(--bad); text-decoration: none; font-size: .88rem; }
.link-danger:hover { text-decoration: underline; }
form.inline { display: inline; }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
summary.link { display: inline; }

/* ---------- Cards, flashes, pills ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card > h2:first-child { margin-bottom: 14px; }
.narrow-card { max-width: 620px; }
.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; font-size: .92rem; background: var(--ok-soft); color: #24502f; border: 1px solid #cfe5d4; }
.flash-error { background: var(--bad-soft); color: #7d2a27; border-color: #efcdcb; }
.flash-warn { background: var(--warn-soft); color: #6b4a0e; border-color: #f0dfb8; }
p.flash { display: block; }
.pill { display: inline-block; font-size: .74rem; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--line-2); color: var(--ink-2); vertical-align: 3px; white-space: nowrap; font-family: Inter, sans-serif; letter-spacing: 0; }
h1 .pill { font-size: .8rem; vertical-align: 6px; }
.pill-new, .pill-sent, .pill-trial { background: var(--info-soft); color: #2f5577; }
.pill-viewed, .pill-contacted, .pill-proposal, .pill-due_soon, .pill-partial { background: var(--warn-soft); color: var(--warn); }
.pill-signed, .pill-booked, .pill-active, .pill-paid, .pill-completed, .pill-comped { background: var(--ok-soft); color: var(--ok); }
.pill-declined, .pill-canceled, .pill-overdue, .pill-past_due { background: var(--bad-soft); color: var(--bad); }
.pill-waitlist { background: #efe8f6; color: #6a4b8a; }
.badge { display: inline-block; min-width: 20px; padding: 1px 7px; border-radius: 99px; background: var(--bad); color: #fff; font-size: .72rem; font-weight: 700; text-align: center; margin-left: auto; }
.empty { color: var(--muted); margin: 0; }
.empty-state { text-align: center; padding: 48px 20px; }
.empty-state p { color: var(--muted); max-width: 440px; margin: 0 auto 18px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fbfaf7; white-space: nowrap; }
.table th a { color: inherit; text-decoration: none; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { border-top: 1px solid var(--line); padding: 12px 14px; }
.table .num { text-align: right; white-space: nowrap; }
.table-click tbody tr { cursor: pointer; }
.table-click tbody tr:hover td { background: #fbfaf7; }
.table td a { text-decoration: none; }
.card:not(.flush) .table th, .card:not(.flush) .table td { padding-left: 6px; padding-right: 6px; }
.card:not(.flush) .table th { background: none; }
.group-row td { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding-top: 16px !important; background: none !important; }
.edit-table td { padding: 6px 8px; vertical-align: middle; }
.edit-table input, .edit-table select { margin: 0; padding: 7px 9px; }
.edit-table .new-row td { background: #fbfaf7; }

/* ---------- Totals ---------- */
.totals { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; max-width: 420px; margin-left: auto; }
.totals > div { display: flex; justify-content: space-between; gap: 16px; padding: 3px 0; font-size: .92rem; }
.totals > div span:last-child { white-space: nowrap; }
.totals .grand { font-weight: 700; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; font-size: 1rem; }
.totals.compact { margin: 0; max-width: none; border: 0; padding: 0; }
.total-line { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }

/* =================================================================
   Dashboard shell
   ================================================================= */
body.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px;
  flex: none;
  background: #fbfaf7;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 30;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; text-decoration: none; color: var(--ink); font-weight: 600; line-height: 1.25; }
.sidebar .brand img { width: 34px; height: 34px; object-fit: contain; border-radius: 6px; flex: none; }
.sidebar nav { padding: 4px 10px; flex: 1; }
.sidebar nav a, .sidebar .logout button {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 7px;
  color: var(--ink-2); text-decoration: none; font-size: .92rem; font-weight: 500;
}
.sidebar nav a:hover, .sidebar .logout button:hover { background: var(--line-2); color: var(--ink); }
.sidebar nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-sep { height: 1px; background: var(--line); margin: 10px 8px; }
.sidebar .logout { padding: 10px; border-top: 1px solid var(--line); }
.sidebar .logout button { width: 100%; background: none; border: 0; font: inherit; cursor: pointer; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 28px; border-bottom: 1px solid var(--line); background: rgba(246, 243, 238, .92); backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 20; min-height: 58px; }
.topbar-title { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.menu-btn { display: none; background: none; border: 0; padding: 6px; margin-left: -6px; cursor: pointer; color: var(--ink); }
.menu-btn .icon { width: 22px; height: 22px; }
.banner { background: var(--info-soft); color: #2f5577; padding: 9px 28px; font-size: .88rem; border-bottom: 1px solid #d5e1ec; }
.banner-warn { background: var(--warn-soft); color: #6b4a0e; border-color: #f0dfb8; }
.content { padding: 26px 28px 60px; max-width: 1180px; width: 100%; }
.scrim { display: none; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin-bottom: 2px; }
.page-head p { margin: 0; max-width: 640px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back { display: inline-block; font-size: .85rem; color: var(--muted); text-decoration: none; margin-bottom: 4px; }
.back:hover { color: var(--ink); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 0 18px; align-items: start; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stats-3 { grid-template-columns: repeat(3, 1fr); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: border-color .15s; }
a.stat:hover { border-color: #d3cbbf; }
.stat-label { font-size: .8rem; color: var(--muted); font-weight: 500; }
.stat-value { font-size: 1.7rem; font-weight: 600; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: .8rem; color: var(--muted); }

.setup-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; background: linear-gradient(120deg, #f1f5ef, #fbf7f0); flex-wrap: wrap; }
.setup-card h2 { margin-bottom: 4px; }
.setup-card p { margin: 0; }

/* Lists */
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 4px 0; }
.todo, .upcoming, .activity, .ledger { list-style: none; padding: 0; margin: 0; }
.todo li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: .92rem; }
.todo li:last-child, .upcoming li:last-child, .activity li:last-child, .ledger li:last-child { border-bottom: 0; }
.todo li a { flex: 1; color: var(--ink); text-decoration: none; }
.todo li a:hover { color: var(--brand); }
.todo small, .activity small { color: var(--muted); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-new { background: #4f7fae; }
.dot-msg { background: #8a6f9e; }
.dot-due { background: #d39a2c; }
.dot-bad { background: var(--bad); }
.dot-follow { background: #b9b0a3; }
.upcoming li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.upcoming a { color: var(--ink); text-decoration: none; }
.grow { flex: 1; min-width: 0; }
.date-chip { width: 46px; text-align: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: none; }
.date-chip span { display: block; background: var(--brand); color: #fff; font-size: .66rem; text-transform: uppercase; font-weight: 600; letter-spacing: .06em; padding: 1px 0; }
.date-chip b { display: block; font-size: 1.05rem; padding: 2px 0; }
.activity li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: .88rem; }
.activity a { color: var(--ink); text-decoration: none; }
.ledger li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: .92rem; }
.ledger li > span:last-child { display: flex; align-items: center; gap: 10px; white-space: nowrap; }

.pipeline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pipe { display: block; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; text-decoration: none; color: var(--ink-2); }
.pipe:hover { border-color: #d3cbbf; }
.pipe b { display: block; font-size: 1.3rem; color: var(--ink); }
.pipe span { font-size: .8rem; }

/* Filters + tabs */
.filters { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 6px 12px; border-radius: 99px; text-decoration: none; color: var(--ink-2); font-size: .88rem; font-weight: 500; border: 1px solid transparent; }
.tabs a:hover { background: #fff; border-color: var(--line); }
.tabs a.active { background: var(--ink); color: #fff; }
.tabs a b { font-weight: 600; opacity: .7; margin-left: 2px; }
.settings-tabs { margin-bottom: 18px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.search input { margin: 0; min-width: 260px; padding: 8px 12px; }
.filters-card { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.filters-card label { margin: 0; }

/* Key/values */
.kvs { margin: 0; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line-2); }
.kv:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); font-size: .86rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 14px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
.danger-zone { text-align: center; padding: 6px 0 20px; }

/* Proposal page */
.send-panel { border-color: #cdd9c9; background: #fbfdfa; }
.copy-field { display: flex; gap: 8px; align-items: stretch; flex: 1; min-width: 240px; }
.copy-field input, .copy-field textarea { margin: 0; font-size: .88rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.copy-field.big input { font-size: 1rem; font-family: inherit; padding: 12px; }
.copy-field .btn { flex: none; }
.status-list li { color: var(--ink-2); font-size: .9rem; }
.status-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.record-payment { margin-top: 12px; }
.record-payment[open] summary { margin-bottom: 12px; }
.record-payment .grid-form { background: #fbfaf7; border: 1px solid var(--line-2); border-radius: 8px; padding: 14px; }
.thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.msg { max-width: 85%; padding: 10px 13px; border-radius: 12px; background: var(--bg); align-self: flex-start; }
.msg-florist { align-self: flex-end; background: var(--brand-soft); }
.msg-meta { font-size: .76rem; color: var(--muted); margin-bottom: 2px; }

/* Proposal editor */
.li-head, .li-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 70px 100px 90px 84px; gap: 8px; align-items: start; }
.li-head { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 0 0 6px; border-bottom: 1px solid var(--line); }
.li-head span:nth-child(3), .li-head span:nth-child(4), .li-head span:nth-child(5) { text-align: right; }
.li-row { padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.li-row input, .li-row textarea { margin: 0; padding: 7px 9px; }
.li-main { display: flex; flex-direction: column; gap: 5px; }
.li-main input { font-weight: 600; }
.li-main textarea { font-size: .86rem; color: var(--ink-2); resize: none; overflow: hidden; min-height: 32px; }
.li-qty, .li-price { text-align: right; }
.li-price-wrap { display: flex; flex-direction: column; }
.li-hint { font-size: .74rem; color: var(--muted); text-align: right; margin-top: 3px; min-height: 1em; }
.li-total { text-align: right; padding-top: 8px; font-weight: 600; font-variant-numeric: tabular-nums; }
.li-tools { display: flex; gap: 2px; justify-content: flex-end; padding-top: 4px; }
.li-tools button, .tools button { background: none; border: 1px solid transparent; border-radius: 5px; color: var(--muted); cursor: pointer; font-size: .95rem; width: 26px; height: 26px; padding: 0; }
.li-tools button:hover, .tools button:hover:not(:disabled) { border-color: var(--line); color: var(--ink); background: #fff; }
.tools button.danger:hover { color: var(--bad); }
.tools button:disabled { opacity: .3; cursor: default; }
.add-line { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.add-line select { max-width: 420px; margin: 0; }
.sticky-totals {
  position: sticky; bottom: 12px; z-index: 10;
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  background: var(--ink); color: #fff; border-radius: 12px; padding: 12px 18px; box-shadow: 0 8px 30px rgba(0,0,0,.18);
}
.sticky-totals small { display: block; color: #bfb8ad; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.sticky-totals b { font-variant-numeric: tabular-nums; }
.sticky-totals .btn { margin-left: auto; background: #fff; color: var(--ink); border-color: #fff; }

/* Price list editor */
.group-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.group-title { font-weight: 600; font-size: 1.05rem; margin: 0; border-color: transparent; background: transparent; padding-left: 4px; }
.group-title:hover { border-color: var(--line); }
.tools { display: flex; gap: 2px; align-items: center; flex: none; }
.tools button.danger { width: auto; padding: 0 8px; font-size: .82rem; }
.tool-link { font-size: .8rem; color: var(--muted); text-decoration: none; padding: 0 6px; white-space: nowrap; }
.tool-link:hover { color: var(--brand); }
.cat-head, .cat-row { display: grid; grid-template-columns: minmax(150px, 1.4fr) 110px 100px 100px minmax(120px, 1fr) 54px 150px; gap: 8px; align-items: center; }
.cat-head { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.cat-row { padding: 7px 0; border-bottom: 1px solid var(--line-2); }
.cat-row input, .cat-row select { margin: 0; padding: 7px 9px; }
.cat-row[data-type=fixed] .cat-high-wrap, .cat-row[data-type=quote] .cat-high-wrap, .cat-row[data-type=quote] .money-in:not(.cat-high-wrap) { visibility: hidden; }
.cat-row.simple { grid-template-columns: minmax(150px, 1fr) 110px 110px 110px 54px; }
.add-item { margin-top: 10px; }
.mini-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.mini-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mini-row > input:first-child, .mini-row > select:first-child { flex: 2; min-width: 160px; }
.mini-row input, .mini-row select { margin: 0; flex: 1; min-width: 100px; }
.mini-row .money-in { flex: 1; min-width: 110px; }
.mini-row label.check { margin: 0; white-space: nowrap; }
.cq-row input[type=hidden] { display: none; }
.recipe-cost { margin-top: 14px; padding: 12px 14px; background: #fbfaf7; border: 1px solid var(--line-2); border-radius: 8px; }
.recipe-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.recipe-chip { display: block; border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px; text-decoration: none; color: var(--ink); }
.recipe-chip.has { border-style: solid; background: #fbfdfa; }
.recipe-chip small { display: block; color: var(--muted); }
.recipe-chip:hover { border-color: var(--brand); }
.logo-field { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo-preview { max-height: 64px; max-width: 200px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #fff; }

/* Calendar */
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); padding: 0; overflow: hidden; gap: 0; }
.cal-dow { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); background: #fbfaf7; }
.cal-cell { min-height: 108px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-empty { background: #fcfbf9; }
.cal-day { font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.cal-day small { font-weight: 500; color: var(--bad); text-transform: uppercase; font-size: .66rem; letter-spacing: .04em; }
.cal-today .cal-day { color: #fff; background: var(--brand); border-radius: 99px; padding: 0 7px; align-self: flex-start; }
.cal-blackout { background: repeating-linear-gradient(45deg, #fbfaf7, #fbfaf7 6px, #f4f1ec 6px, #f4f1ec 12px); }
.cal-full { background: #fcf6f5; }
.ev { display: block; font-size: .76rem; padding: 2px 6px; border-radius: 5px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.legend .ev { display: inline-block; }
.ev-booked { background: var(--ok-soft); color: var(--ok); }
.ev-pending { background: var(--warn-soft); color: var(--warn); }
.ev-inquiry { background: var(--info-soft); color: #2f5577; }

/* Billing */
.plan-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.plan-price b { font-size: 2rem; letter-spacing: -.02em; }
.plan-price span { color: var(--muted); }
ul.checks { list-style: none; padding: 0; margin: 14px 0 20px; }
ul.checks li { padding: 4px 0 4px 26px; position: relative; }
ul.checks li::before { content: ''; position: absolute; left: 2px; top: 10px; width: 12px; height: 7px; border-left: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(-45deg); }

/* Share */
.qr-card { text-align: center; }
.qr { width: 170px; height: 170px; margin: 6px auto 12px; }
.qr svg { width: 100%; height: 100%; }
.preview-box { padding: 22px; background: var(--bg); border-radius: 8px; text-align: center; margin-bottom: 12px; }
.guides { margin-top: 18px; border-top: 1px solid var(--line); }
.guides details { border-bottom: 1px solid var(--line-2); padding: 10px 0; }
.guides summary { font-weight: 600; }
.guides summary::after { content: '+'; float: right; color: var(--muted); }
.guides details[open] summary::after { content: '–'; }
.guides ol { margin: 8px 0 0; padding-left: 20px; color: var(--ink-2); }

/* Setup wizard */
.setup { max-width: 820px; margin: 0 auto; }
.stepper { list-style: none; padding: 0; margin: 0 0 18px; display: flex; gap: 6px; flex-wrap: wrap; }
.stepper li { flex: 1; min-width: 140px; }
.stepper a { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: .9rem; background: #fff; border: 1px solid var(--line); }
.stepper span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); font-size: .8rem; font-weight: 700; flex: none; }
.stepper .current a { color: var(--ink); border-color: var(--brand); }
.stepper .current span { background: var(--brand); color: #fff; }
.stepper .done span { background: var(--ok-soft); color: var(--ok); }
.setup-step { padding: 28px; }
.setup-step h3 { margin-top: 18px; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.setup-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.setup-nav > div { display: flex; align-items: center; gap: 18px; }

/* =================================================================
   Auth pages (inside the marketing layout)
   ================================================================= */
.auth { padding: 48px 16px 80px; display: flex; justify-content: center; }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 32px 30px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.9rem; margin-bottom: 6px; }
.auth-alt { text-align: center; font-size: .9rem; margin: 18px 0 0; color: var(--muted); }
.center-msg { text-align: center; padding: 80px 16px; }

/* =================================================================
   Couple-facing pages (intake form, price list, proposal)
   ================================================================= */
body.public { background: #f8f6f2; --brand: var(--accent); --brand-soft: color-mix(in srgb, var(--accent) 12%, white); }
body.public h1 { font-weight: 500; }
.shop-header { text-align: center; padding: 26px 16px 8px; }
.shop-brand { text-decoration: none; color: var(--ink); display: inline-block; }
.shop-brand img { max-height: 84px; max-width: 260px; display: block; margin: 0 auto; }
.shop-brand span { font-family: var(--heading-font); font-size: 1.8rem; font-weight: 600; }
.public-main { padding: 10px 16px 30px; }
body.embed { background: transparent; }
body.embed .public-main { padding: 4px 4px 10px; }
.powered { text-align: center; font-size: .8rem; color: var(--muted); padding: 10px 16px 30px; }
.powered div { margin-bottom: 6px; }
.powered a { color: var(--muted); }
.narrow-page { max-width: 720px; margin: 0 auto; }
.btn-accent { background: var(--accent); border-color: var(--accent); }

.intake { max-width: 1040px; margin: 0 auto; }
.intake-hero { text-align: center; max-width: 640px; margin: 10px auto 26px; }
.intake-hero h1 { font-size: 2.4rem; margin-bottom: 8px; }
.intake-hero p { color: var(--ink-2); }
.intake-links { font-size: .9rem; }
.intake-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.intake .card { padding: 22px 24px 10px; }
.intake .card h2 { display: flex; align-items: center; gap: 10px; font-family: var(--heading-font); font-size: 1.45rem; font-weight: 600; margin-bottom: 16px; }
.step { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font: 700 .8rem Inter, sans-serif; flex: none; }
.req { color: var(--bad); }
.date-status { font-weight: 500; }
.date-status.ok { color: var(--ok); }
.date-status.warn { color: var(--warn); }
.date-status.bad { color: var(--bad); }
.choice { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.choice label { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin: 0; cursor: pointer; }
.choice label:has(input:checked) { border-color: var(--accent); background: var(--brand-soft); }
.photo-previews { display: flex; gap: 8px; flex-wrap: wrap; margin: -6px 0 14px; }
.photo-previews img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }

.item-group { margin-bottom: 14px; }
.item-group h3 { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 18px 0 4px; }
.item-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.item-group .item-row:last-child { border-bottom: 0; }
.item-label { font-weight: 600; }
.item-price { font-size: .86rem; color: var(--muted); }
.item-more { grid-column: 1 / -1; display: none; padding-top: 4px; }
.item-row.has-qty .item-more { display: block; }
.item-row.has-qty .item-label { color: var(--accent); }
.item-more label.check { margin-bottom: 6px; font-size: .9rem; }
.item-note { margin: 0 0 4px; font-size: .9rem; padding: 7px 10px; }
.qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; background: #fff; }
.qty input { width: 46px; margin: 0; border: 0; text-align: center; padding: 6px 0; font-weight: 600; -moz-appearance: textfield; border-radius: 0; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty input:focus { box-shadow: none; }
.qty-btn { width: 36px; height: 36px; border: 0; background: none; font-size: 1.2rem; color: var(--ink-2); cursor: pointer; }
.qty-btn:hover { background: var(--brand-soft); color: var(--accent); }

.estimate { position: sticky; top: 16px; }
.estimate-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); border-top: 4px solid var(--accent); }
.estimate-head { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.estimate-total { font-family: var(--heading-font); font-size: 2.1rem; font-weight: 600; line-height: 1.2; margin: 4px 0 10px; font-variant-numeric: tabular-nums; }
.estimate-lines div { display: flex; justify-content: space-between; gap: 10px; font-size: .88rem; padding: 3px 0; color: var(--ink-2); }
.estimate-lines div span:last-child { white-space: nowrap; }
.estimate-note { font-size: .8rem; color: var(--muted); margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line-2); }

.thanks { padding: 36px 24px; }
.thanks-mark { font-size: 2.2rem; color: var(--accent); line-height: 1; margin-bottom: 8px; }
.thanks h1 { font-size: 2.3rem; }
.price-group h2 { font-family: var(--heading-font); font-size: 1.5rem; font-weight: 600; }
.price-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px dotted var(--line); }
.price-row:last-child { border-bottom: 0; }
.price-row .price { font-weight: 600; white-space: nowrap; }

/* The proposal "sheet" */
.proposal-page { max-width: 820px; margin: 0 auto; }
.sheet { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 44px 52px; box-shadow: var(--shadow); margin-bottom: 20px; position: relative; }
.sheet-head { text-align: center; padding-bottom: 22px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.eyebrow { font-size: .74rem; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.sheet-head h1 { font-size: 2.5rem; margin-bottom: 6px; }
.sheet-meta { color: var(--ink-2); margin: 0; }
.stamp { position: absolute; top: 26px; right: 26px; border: 2px solid var(--ok); color: var(--ok); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; padding: 4px 10px; border-radius: 6px; transform: rotate(6deg); }
.sheet-message { font-family: var(--heading-font); font-size: 1.2rem; line-height: 1.5; color: var(--ink-2); text-align: center; max-width: 600px; margin: 0 auto 26px; font-style: italic; }
.sheet-section { margin-bottom: 26px; }
.sheet-section > h2 { font-family: var(--heading-font); font-size: 1.45rem; font-weight: 600; border-bottom: 1px solid var(--line-2); padding-bottom: 6px; margin-bottom: 4px; }
.sheet-line { display: flex; justify-content: space-between; gap: 18px; padding: 10px 0; border-bottom: 1px dotted var(--line); }
.sheet-line:last-child { border-bottom: 0; }
.sheet-item { font-weight: 600; }
.sheet-item .qty { display: inline; border: 0; color: var(--muted); font-weight: 500; }
.sheet-desc { font-size: .88rem; color: var(--ink-2); margin-top: 2px; }
.sheet-amt { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sheet-amt small { display: block; color: var(--muted); }
.sheet-totals { max-width: 380px; margin: 0 0 30px auto; }
.sheet-totals > div { display: flex; justify-content: space-between; padding: 4px 0; }
.sheet-totals .grand { font-weight: 700; font-size: 1.1rem; border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 8px; }
.sheet-totals .paid { color: var(--ok); font-size: .92rem; }
.schedule { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-top: 10px; }
.schedule-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.schedule-row:last-child { border-bottom: 0; }
.schedule-row small { display: block; color: var(--muted); font-size: .82rem; }
.schedule-row.status-paid { background: #f7fbf8; }
.schedule-row.status-paid small:last-child { color: var(--ok); font-weight: 600; }
.schedule-row.status-overdue small:last-child { color: var(--bad); font-weight: 600; }
.pay-box { margin-top: 16px; padding: 16px 18px; background: #fbfaf7; border-radius: 10px; border: 1px solid var(--line-2); }
.pay-links { display: flex; gap: 8px; flex-wrap: wrap; }
.agreement-text { font-size: .9rem; color: var(--ink-2); line-height: 1.65; background: #fbfaf7; border: 1px solid var(--line-2); border-radius: 10px; padding: 18px 20px; max-height: 420px; overflow-y: auto; }
.sign-form { margin-top: 18px; }
.sig-input { font-family: 'Great Vibes', 'Brush Script MT', 'Segoe Script', cursive; font-size: 1.5rem; padding: 10px 14px; }
.signed-box { margin-top: 18px; border-top: 1px solid var(--ink); padding-top: 8px; max-width: 320px; }
.signed-box .sig { font-family: 'Great Vibes', 'Brush Script MT', 'Segoe Script', cursive; font-size: 1.8rem; line-height: 1.2; }
.sheet-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid var(--line); padding-top: 18px; font-size: .9rem; color: var(--ink-2); flex-wrap: wrap; }

/* =================================================================
   Responsive
   ================================================================= */
@media (max-width: 1100px) {
  .cat-head { display: none; }
  .cat-row { grid-template-columns: 1fr 110px 100px 100px; }
  .cat-row .cat-note { grid-column: 1 / 3; }
  .cat-row .switch { justify-self: start; }
  .cat-row .tools { justify-content: flex-end; }
  .cat-row.simple { grid-template-columns: 1fr 110px 100px 100px 44px; }
}
@media (max-width: 960px) {
  .grid-main { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .intake-grid { grid-template-columns: 1fr; }
  .estimate { position: sticky; bottom: 0; top: auto; order: 2; margin: 0 -16px; z-index: 5; }
  .estimate-card { border-radius: 14px 14px 0 0; padding: 12px 18px; display: grid; grid-template-columns: 1fr auto; align-items: center; cursor: pointer; box-shadow: 0 -6px 24px rgba(0,0,0,.08); }
  .estimate-head { grid-column: 1; }
  .estimate-total { grid-column: 2; grid-row: 1; font-size: 1.5rem; margin: 0; }
  .estimate-lines, .estimate-note { grid-column: 1 / -1; display: none; }
  .estimate.open .estimate-lines, .estimate.open .estimate-note { display: block; }
  .estimate-head::after { content: ' · tap for details'; text-transform: none; letter-spacing: 0; font-weight: 400; }
  .intake-fields { order: 1; }
}
@media (max-width: 860px) {
  body.app { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.15); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 25; }
  .menu-btn { display: block; }
  .topbar { padding: 10px 16px; }
  .banner { padding: 9px 16px; }
  .content { padding: 18px 16px 60px; }
  .grid-2 { grid-template-columns: 1fr; }
  .li-head { display: none; }
  .li-row { grid-template-columns: 1fr 1fr 1fr; }
  .li-main { grid-column: 1 / -1; }
  .li-section { grid-column: 1 / -1; }
  .li-total { text-align: left; padding-top: 8px; }
  .li-tools { grid-column: 3; grid-row: 4; }
  .li-qty, .li-price, .li-hint { text-align: left; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  h1 { font-size: 1.6rem; }
  .row2, .grid-form, .grid-form.cols-3, .check-grid { grid-template-columns: 1fr; }
  .grid-form .span2 { grid-column: auto; }
  .stats, .stats-3 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat-value { font-size: 1.3rem; }
  .hide-sm { display: none !important; }
  .card { padding: 16px; }
  .kv { grid-template-columns: 1fr; gap: 0; }
  .search input { min-width: 0; width: 100%; }
  .search { width: 100%; }
  .pipeline { grid-template-columns: repeat(2, 1fr); }
  .calendar { font-size: .8rem; }
  .cal-cell { min-height: 70px; padding: 3px; }
  .cal-dow { padding: 6px 3px; text-align: center; }
  .ev { font-size: .66rem; padding: 1px 3px; }
  .cat-row { grid-template-columns: 1.2fr 1fr 1fr; }
  .cat-row .cat-label, .cat-row .cat-note { grid-column: 1 / -1; }
  .cat-row .tools { grid-column: 2 / -1; }
  .cat-row.simple { grid-template-columns: 1fr 1fr 44px; }
  .cat-row.simple .cat-label { grid-column: 1 / 3; }
  .sheet { padding: 28px 20px; border-radius: 10px; }
  .sheet-head h1 { font-size: 1.9rem; }
  .stamp { position: static; display: inline-block; margin-top: 12px; transform: none; }
  .intake-hero h1 { font-size: 1.9rem; }
  .intake .card { padding: 18px 16px 6px; }
  .sticky-totals { gap: 14px; bottom: 6px; }
  .setup-step { padding: 20px 16px; }
  .setup-nav { flex-wrap: wrap; }
  .auth-card { padding: 26px 20px; }
  .copy-field { min-width: 0; flex-wrap: wrap; }
  .copy-field .btn { width: 100%; }
}

@media print {
  .no-print, .powered, .shop-header + .flash, .flash { display: none !important; }
  body.public { background: #fff; }
  .sheet { border: 0; box-shadow: none; padding: 0; }
  .agreement-text { max-height: none; overflow: visible; }
  body.app .sidebar, body.app .topbar, body.app .banner, .page-head .actions { display: none !important; }
  .content { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
}
