/* MicroStarts Sales Event Planner — one stylesheet, token-driven. */

:root {
  --forest: #1F3D2B;
  --forest-2: #2A5139;
  --forest-tint: #EAF0E7;
  --sage: #A9BFA3;
  --sage-100: #E4EBDF;
  --sage-200: #CFDCC9;
  --cream: #F7F5EF;
  --surface: #FFFFFF;
  --surface-2: #FBFAF7;
  --ink: #1C1F1D;
  --ink-2: #414A44;
  --muted: #69736B;
  --line: #E1E4DC;
  --line-2: #D2D7CE;

  /* event types (validated categorical set; always paired with a text label) */
  --local: #3B7A3E;  --local-tint: #E7F0E5;
  --market: #C2861C; --market-tint: #F8EEDB; --market-ink: #7A520C;
  --live: #4F6FD0;   --live-tint: #E6EBF9;

  /* status */
  --danger: #B3261E; --danger-tint: #FBE9E7;
  --warn: #8A5A00;   --warn-tint: #FDF1D8;
  --ok: #2E7D4F;     --ok-tint: #E3F1E8;
  --info: #3D5A80;   --info-tint: #E6EDF6;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(28, 31, 29, .06), 0 1px 1px rgba(28, 31, 29, .03);
  --shadow-lg: 0 10px 30px rgba(28, 31, 29, .18);
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --gutter: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.45;
  color: var(--ink); background: var(--cream);
}
a { color: var(--forest-2); }
a:hover { color: var(--forest); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 .6em; }
code { font-size: .9em; background: var(--sage-100); padding: 1px 5px; border-radius: 4px; }
small, .small { font-size: .82rem; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--forest-2); outline-offset: 2px; }

/* ------------------------------------------------------------ layout */
#demo-banner {
  background: var(--warn-tint); color: var(--warn); font-size: .85rem;
  padding: 6px var(--gutter); display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  border-bottom: 1px solid #F0DDB0;
}
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px;
  padding: 0 var(--gutter); height: 58px; background: var(--forest); color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; white-space: nowrap; }
.brand:hover { color: inherit; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 50%; background: var(--sage-100); flex: none; position: relative;
}
.brand-mark::after {
  content: ''; position: absolute; left: 9px; top: 6px; width: 10px; height: 14px;
  border-radius: 10px 0 10px 0; background: var(--forest-2); transform: rotate(10deg);
}
.brand-text strong { font-weight: 700; }
.brand-text span { opacity: .75; font-weight: 400; }
.brand-lg { color: var(--forest); font-size: 1.2rem; margin-bottom: 18px; }
.mainnav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a {
  color: rgba(255,255,255,.78); text-decoration: none; padding: 8px 12px; border-radius: 8px;
  font-weight: 500; white-space: nowrap;
}
.mainnav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.mainnav a.active { color: #fff; background: rgba(255,255,255,.14); }
.user-menu { display: flex; gap: 10px; align-items: center; }
.user-menu .muted { color: rgba(255,255,255,.7); }
.user-menu .btn-ghost { color: #fff; border-color: rgba(255,255,255,.3); }
.user-menu .btn-ghost:hover { background: rgba(255,255,255,.1); }

.view { outline: none; }
.page { max-width: 1280px; margin: 0 auto; padding: 22px var(--gutter) 60px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.section { margin-top: 26px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.spacer { flex: 1; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; font-size: .9rem; line-height: 1;
  padding: 10px 14px; border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap; min-height: 38px;
  transition: background .12s, border-color .12s;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--forest); color: #fff; }
.btn-primary:hover { background: var(--forest-2); color: #fff; }
.btn-secondary { background: var(--sage-100); color: var(--forest); border-color: var(--sage-200); }
.btn-secondary:hover { background: var(--sage-200); color: var(--forest); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: #EBC3BF; }
.btn-danger-ghost:hover { background: var(--danger-tint); }
.btn-sm { padding: 6px 10px; min-height: 30px; font-size: .82rem; }
.btn-lg { padding: 14px 20px; font-size: 1rem; min-height: 48px; }
.btn-block { width: 100%; }
.icon-btn {
  background: none; border: 0; cursor: pointer; font-size: 1rem; color: var(--muted);
  padding: 6px; border-radius: 6px; line-height: 1; min-width: 30px; min-height: 30px;
}
.icon-btn:hover { background: var(--sage-100); color: var(--ink); }
.icon-btn.danger:hover { background: var(--danger-tint); color: var(--danger); }
.link-btn { background: none; border: 0; padding: 0; color: var(--forest-2); font: inherit; cursor: pointer; text-decoration: underline; }

/* ------------------------------------------------------------ cards */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush > .card-head { padding: 14px 16px 0; }

.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi-label { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.kpi-value { font-size: 1.75rem; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi-sub { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.kpi.kpi-alert .kpi-value { color: var(--danger); }

/* ------------------------------------------------------------ badges */
.type-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 600;
  padding: 3px 9px 3px 8px; border-radius: 999px; white-space: nowrap;
}
.type-badge::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.type-local { background: var(--local-tint); color: var(--local); }
.type-market { background: var(--market-tint); color: var(--market-ink); }
.type-market::before { background: var(--market); }
.type-live { background: var(--live-tint); color: #334FA8; }
.type-live::before { background: var(--live); }

.status {
  display: inline-block; font-size: .75rem; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: var(--sage-100); color: var(--ink-2); white-space: nowrap;
}
.status-planning { background: #EEEDE8; color: #555; }
.status-preparing { background: var(--info-tint); color: var(--info); }
.status-promoting { background: #F3E8F7; color: #6B3A80; }
.status-ready { background: var(--ok-tint); color: var(--ok); }
.status-live { background: var(--danger); color: #fff; }
.status-completed { background: var(--forest); color: #fff; }
.status-cancelled { background: #EEE; color: #888; text-decoration: line-through; }

.pill { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--sage-100); color: var(--ink-2); }
.pill-danger { background: var(--danger-tint); color: var(--danger); }
.pill-warn { background: var(--warn-tint); color: var(--warn); }
.pill-ok { background: var(--ok-tint); color: var(--ok); }
.pill-info { background: var(--info-tint); color: var(--info); }
.pill-internal { background: #3A1F1F; color: #FFD9D4; letter-spacing: .05em; }

.lot-status { font-size: .75rem; font-weight: 600; padding: 3px 8px; border-radius: 6px; border: 0; }
.ls-needs_pulling { background: var(--danger-tint); color: var(--danger); }
.ls-pulled, .ls-photographed { background: var(--warn-tint); color: var(--warn); }
.ls-staged { background: var(--info-tint); color: var(--info); }
.ls-ready { background: var(--ok-tint); color: var(--ok); }
.ls-sold { background: var(--forest); color: #fff; }
.ls-passed, .ls-unsold { background: #ECECEC; color: #555; }

/* ------------------------------------------------------------ progress */
.progress-wrap { display: flex; align-items: center; gap: 8px; }
.progress { flex: 1; height: 8px; background: var(--sage-100); border-radius: 999px; overflow: hidden; min-width: 60px; }
.progress-sm { height: 6px; }
.progress-bar { height: 100%; background: var(--forest-2); border-radius: 999px; }
.progress-label { font-size: .8rem; font-weight: 600; color: var(--ink-2); min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ forms */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label { font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.field .req { color: var(--danger); }
.hint { color: var(--muted); }
input, select, textarea {
  font: inherit; font-size: .92rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 8px 10px; min-height: 38px; width: 100%;
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--forest-2); box-shadow: 0 0 0 3px rgba(42, 81, 57, .15); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; accent-color: var(--forest-2); margin: 0; flex: none; }
.check { display: flex; align-items: center; gap: 8px; font-size: .9rem; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 14px; margin: 0; }
legend { font-size: .8rem; font-weight: 700; color: var(--ink-2); padding: 0 6px; text-transform: uppercase; letter-spacing: .04em; }
.saving { border-color: var(--sage) !important; }
.saved { border-color: var(--ok) !important; box-shadow: 0 0 0 3px rgba(46, 125, 79, .15) !important; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters select, .filters input { width: auto; min-width: 130px; min-height: 34px; padding: 6px 10px; font-size: .86rem; }
.filters .search { min-width: 200px; flex: 1; max-width: 320px; }

.segmented { display: inline-flex; background: var(--sage-100); border-radius: 8px; padding: 3px; gap: 2px; }
.segmented button, .segmented a {
  border: 0; background: transparent; font: inherit; font-size: .85rem; font-weight: 600; color: var(--ink-2);
  padding: 6px 12px; border-radius: 6px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.segmented .active { background: var(--surface); color: var(--forest); box-shadow: var(--shadow); }

/* ------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th {
  text-align: left; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2);
}
.table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: var(--surface-2); }
.table tfoot td { font-weight: 700; background: var(--surface-2); border-bottom: 0; }
.table .num, .table th.num { text-align: right; }
.table input, .table select { min-height: 32px; padding: 5px 7px; font-size: .86rem; }
.table input[type=number] { width: 84px; text-align: right; }
.table input.w-sm { width: 70px; }
.table input.w-md { width: 130px; }
.table input.w-lg { min-width: 200px; }
.table td.tight { width: 1%; white-space: nowrap; }
.table tr.done td { color: var(--muted); }
.table tr.done .task-text { text-decoration: line-through; }
.table tr.overdue td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }

/* ------------------------------------------------------------ tabs */
.tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 18px 0 18px;
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  padding: 10px 14px; font-weight: 600; font-size: .9rem; color: var(--muted); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--forest); border-bottom-color: var(--forest); }
.tabs .count { font-size: .72rem; background: var(--sage-100); padding: 1px 6px; border-radius: 999px; margin-left: 4px; color: var(--ink-2); }

/* ------------------------------------------------------------ event cards */
.event-card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; border-left: 4px solid var(--line-2); transition: box-shadow .12s, border-color .12s; }
.event-card:hover { box-shadow: 0 4px 14px rgba(28, 31, 29, .1); color: inherit; }
.event-card.t-local { border-left-color: var(--local); }
.event-card.t-market { border-left-color: var(--market); }
.event-card.t-live { border-left-color: var(--live); }
.event-card h3 { font-size: 1.05rem; }
.event-card .meta { font-size: .85rem; color: var(--ink-2); display: flex; flex-direction: column; gap: 2px; }
.event-card .card-kpi { display: flex; align-items: baseline; gap: 8px; }
.event-card .card-kpi strong { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.event-card .card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .82rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; margin-top: auto; }
.date-chip { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 48px; padding: 4px 6px; border-radius: 8px; background: var(--forest-tint); color: var(--forest); line-height: 1.05; }
.date-chip .m { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.date-chip .d { font-size: 1.3rem; font-weight: 700; }

/* ------------------------------------------------------------ event header */
.event-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.event-head-inner { max-width: 1280px; margin: 0 auto; padding: 18px var(--gutter) 0; }
.event-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.event-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; color: var(--ink-2); font-size: .9rem; }
.event-meta span { white-space: nowrap; }
.event-meta strong { color: var(--ink); }
.event-head .tabs { margin-bottom: 0; border-bottom: 0; }
.event-head-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 14px; }
.head-stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.head-stat .l { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.head-stat .v { font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.status-select { width: auto; min-height: 30px; padding: 3px 8px; font-size: .82rem; font-weight: 600; border-radius: 999px; }

/* ------------------------------------------------------------ next actions */
.next-actions { border: 2px solid var(--forest); }
.next-actions h2 { display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: .05em; font-size: .95rem; color: var(--forest); }
.na-list { list-style: none; margin: 0; padding: 0; }
.na-list li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.na-list li:first-child { border-top: 0; }
.na-list .na-text { flex: 1; min-width: 0; }
.na-list .na-when { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.na-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.na-overdue .na-dot { background: var(--danger); }
.na-today .na-dot { background: var(--warn); }
.na-soon .na-dot { background: var(--info); }
.na-warn .na-dot { background: var(--market); }
.na-info .na-dot { background: var(--sage); }
.na-clear { color: var(--ok); font-weight: 600; padding: 6px 0; }

/* ------------------------------------------------------------ offers */
.offers { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.offer { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; position: relative; }
.offer.featured { border: 2px solid var(--forest); background: var(--forest-tint); }
.offer .price { font-weight: 700; font-size: 1.15rem; color: var(--forest); }
.offer .star { font-size: .7rem; font-weight: 700; letter-spacing: .06em; color: var(--forest); text-transform: uppercase; }
.offer .offer-actions { position: absolute; top: 6px; right: 6px; display: flex; gap: 0; }

/* ------------------------------------------------------------ checklist */
.checklist-group + .checklist-group { margin-top: 14px; }
.checklist-group .card-head { margin-bottom: 6px; }
.check-items { list-style: none; padding: 0; margin: 0; }
.check-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.check-item:first-child { border-top: 0; }
.check-item input[type=checkbox] { width: 22px; height: 22px; }
.check-item.done .ci-text { text-decoration: line-through; color: var(--muted); }
.ci-text { font-weight: 500; }
.ci-meta { font-size: .78rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 1px; }
.ci-meta .overdue { color: var(--danger); font-weight: 600; }
.ci-right { display: flex; gap: 6px; align-items: center; }
.ci-right select { width: auto; min-height: 30px; padding: 3px 6px; font-size: .8rem; }

/* ------------------------------------------------------------ bars */
.bars { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.bars li { display: grid; grid-template-columns: minmax(90px, 160px) 1fr auto; gap: 10px; align-items: center; font-size: .88rem; }
.bars-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.bars-track { height: 12px; display: block; }
.bars-fill { display: block; height: 100%; background: var(--forest-2); border-radius: 0 4px 4px 0; min-width: 2px; }
.bars-value { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 40px; text-align: right; }
.bars-value small { font-weight: 400; color: var(--muted); }

/* ------------------------------------------------------------ calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.cal-dow { font-size: .72rem; font-weight: 700; text-transform: uppercase; color: var(--muted); padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cal-day { min-height: 104px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.cal-day.other { background: var(--surface-2); color: var(--muted); }
.cal-day.today .cal-num { background: var(--forest); color: #fff; }
.cal-num { font-size: .8rem; font-weight: 600; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.cal-ev { display: block; font-size: .76rem; font-weight: 600; padding: 3px 6px; border-radius: 5px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 3px solid; }
.cal-ev.t-local { background: var(--local-tint); color: var(--local); border-color: var(--local); }
.cal-ev.t-market { background: var(--market-tint); color: var(--market-ink); border-color: var(--market); }
.cal-ev.t-live { background: var(--live-tint); color: #334FA8; border-color: var(--live); }
.cal-ev.cancelled { opacity: .5; text-decoration: line-through; }

.agenda { list-style: none; padding: 0; margin: 0; }
.agenda-month { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; }
.agenda-item { display: flex; gap: 14px; align-items: center; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; text-decoration: none; color: inherit; border-left: 4px solid var(--line-2); }
.agenda-item:hover { color: inherit; box-shadow: 0 3px 10px rgba(0,0,0,.06); }
.agenda-item.t-local { border-left-color: var(--local); }
.agenda-item.t-market { border-left-color: var(--market); }
.agenda-item.t-live { border-left-color: var(--live); }
.agenda-item .ai-main { flex: 1; min-width: 0; }
.agenda-item .ai-main strong { display: block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; }

/* ------------------------------------------------------------ modal / toast */
dialog.modal { border: 0; padding: 0; border-radius: 14px; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: var(--shadow-lg); color: var(--ink); background: var(--surface); }
dialog.modal-wide { width: min(860px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(20, 30, 24, .45); }
.modal-form { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 10px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--surface-2); }

#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: calc(100% - 32px); }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: .9rem; box-shadow: var(--shadow-lg); max-width: 480px; }
.toast-error { background: var(--danger); }

/* ------------------------------------------------------------ misc */
.empty { text-align: center; padding: 30px 16px; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.empty p { margin-bottom: 10px; }
.loading { padding: 60px 16px; text-align: center; color: var(--muted); }
.detail-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: .9rem; }
.detail-list dt { color: var(--muted); font-weight: 500; }
.detail-list dd { margin: 0; white-space: pre-wrap; }
.callout { background: var(--forest-tint); border-radius: var(--radius); padding: 12px 14px; font-size: .9rem; }
.callout-warn { background: var(--warn-tint); color: var(--warn); }
.internal-box { border: 2px dashed var(--danger); border-radius: var(--radius); padding: 10px 12px; background: var(--danger-tint); }
.link-box { display: flex; gap: 6px; align-items: center; }
.link-box input { font-size: .8rem; color: var(--ink-2); background: var(--surface-2); }
.qr { background: #fff; padding: 12px; display: inline-block; border-radius: 8px; border: 1px solid var(--line); }
.qr img, .qr canvas { display: block; }
.drag-handle { cursor: grab; color: var(--muted); user-select: none; padding: 0 4px; font-size: 1.1rem; }
tr.dragging { opacity: .4; }
tr.drag-over td { box-shadow: inset 0 2px 0 var(--forest-2); }

/* ------------------------------------------------------------ stepper */
.stepper { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; color: var(--muted); padding: 6px 12px 6px 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.step .n { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--sage-100); font-size: .78rem; }
.step.active { color: var(--forest); border-color: var(--forest); }
.step.active .n, .step.done .n { background: var(--forest); color: #fff; }
.type-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.type-choice { text-align: left; font: inherit; cursor: pointer; padding: 18px; border-radius: var(--radius); border: 2px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.type-choice:hover { border-color: var(--sage); }
.type-choice.selected { border-color: var(--forest); background: var(--forest-tint); }
.type-choice p { margin: 0; color: var(--muted); font-size: .88rem; }
.tpl-choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.tpl-choice + .tpl-choice { margin-top: 8px; }
.tpl-choice input { margin-top: 3px; }

/* ------------------------------------------------------------ check-in */
.checkin-row { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line); }
.checkin-row:first-child { border-top: 0; }
.checkin-row .who { flex: 1; min-width: 0; }
.checkin-row .who strong { display: block; }
.checkin-row.is-in { background: var(--ok-tint); }
.walkin-counter { display: flex; align-items: center; gap: 12px; }
.walkin-counter .count { font-size: 2rem; font-weight: 700; min-width: 56px; text-align: center; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ host view */
body.bare .topbar { display: none !important; }
.host { min-height: 100vh; background: #13201A; color: #F2F4EF; padding: 14px var(--gutter) 40px; }
.host a { color: var(--sage); }
.host-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.host-top h1 { font-size: 1.1rem; font-weight: 600; color: var(--sage-100); }
.host-progress { font-size: .95rem; color: var(--sage); font-variant-numeric: tabular-nums; }
.host-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.host-card { background: #1C2D24; border: 1px solid #2D4436; border-radius: 14px; padding: 18px 20px; }
.host-label { font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--sage); margin-bottom: 8px; }
.host-current .host-name { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 700; line-height: 1.1; color: #fff; }
.host-flags { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.host-flag { font-size: .85rem; font-weight: 700; padding: 4px 10px; border-radius: 6px; background: #2D4436; color: #DDE7D8; }
.host-flag.feat { background: #E9C46A; color: #3A2A00; }
.host-flag.give { background: #8FB6FF; color: #0F2554; }
.host-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 14px 0; }
.host-num { background: #13201A; border-radius: 10px; padding: 10px 14px; }
.host-num .l { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--sage); font-weight: 700; }
.host-num .v { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 700; font-variant-numeric: tabular-nums; color: #fff; }
.host-internal { border: 2px dashed #E5736A; background: #2A1A18; border-radius: 10px; padding: 10px 14px; }
.host-internal .l { color: #FFB4AB; }
.host-talk { font-size: clamp(1.05rem, 1.8vw, 1.35rem); line-height: 1.5; color: #E6ECE3; background: #13201A; border-radius: 10px; padding: 12px 14px; white-space: pre-wrap; }
.host-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.host-actions .btn { min-height: 56px; font-size: 1.05rem; padding: 14px 22px; }
.host .btn-ghost { color: #E6ECE3; border-color: #3D5A49; }
.host .btn-ghost:hover { background: #2D4436; color: #fff; }
.btn-sold { background: #4CAF73; color: #06240F; }
.btn-sold:hover { background: #5FC286; }
.host-next .host-name { font-size: 1.5rem; font-weight: 700; color: #fff; }
.host-upcoming { list-style: none; padding: 0; margin: 0; }
.host-upcoming li { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid #2D4436; font-size: 1rem; align-items: baseline; }
.host-upcoming li:first-child { border-top: 0; }
.host-upcoming .ord { color: var(--sage); font-variant-numeric: tabular-nums; min-width: 26px; }
.host-upcoming .nm { flex: 1; }
.host-upcoming .pr { color: var(--sage); font-variant-numeric: tabular-nums; }
.host-done { opacity: .55; }
.host input, .host select { background: #13201A; color: #fff; border-color: #3D5A49; font-size: 1.1rem; min-height: 48px; }

/* ------------------------------------------------------------ login & public */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px var(--gutter); }
.login-card { width: 100%; max-width: 380px; padding: 28px; }
.login-card .brand-lg { margin-bottom: 14px; }
.login-title { font-size: 1.25rem; margin-bottom: 16px; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 960px) {
  .host-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  body { font-size: 14.5px; }
  .topbar { flex-wrap: wrap; height: auto; padding-top: 10px; gap: 6px 12px; }
  .brand-text span { display: none; }
  .mainnav { order: 3; flex-basis: 100%; padding-bottom: 6px; }
  .user-menu #user-email { display: none; }
  .user-menu { margin-left: auto; }
  .grid-2, .grid-3, .form-grid, .form-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .page { padding-top: 16px; }
  h1 { font-size: 1.35rem; }
  .cal-day { min-height: 64px; padding: 3px; }
  .cal-ev { font-size: .68rem; padding: 2px 4px; }
  .bars li { grid-template-columns: minmax(70px, 110px) 1fr auto; }
  .kpi-value { font-size: 1.45rem; }
  .filters select, .filters input { min-width: 0; flex: 1 1 140px; }
  .filters .search { max-width: none; flex-basis: 100%; }
  .detail-list { grid-template-columns: 1fr; gap: 0 0; }
  .detail-list dd { margin-bottom: 8px; }
  .hide-sm { display: none !important; }
  .host-actions .btn { flex: 1 1 40%; }
}

/* ------------------------------------------------------------ fixes / utilities */
.filters input[type=checkbox] { min-width: 0; width: 18px; flex: none; }
.table select { width: auto; max-width: none; }
.table select.lot-status { padding-right: 22px; }
.table input.w-sm { width: 72px; }
.table input.w-sku { width: 104px; }
tr.clickable, .clickable { cursor: pointer; }
@media (max-width: 760px) {
  #demo-banner { font-size: .76rem; padding: 4px 12px; gap: 6px; }
  #demo-banner .why { display: none; }
}

/* ------------------------------------------------------------ select controls
   Native selects look like text inputs; give them a tinted fill and a chevron so
   they read as dropdowns. Placed last so it wins over earlier padding/background
   shorthands (status pills, lot-status chips, filters, tables). */
:root {
  --control-bg: #F2F4EE;
  --control-bg-hover: #E8EDE3;
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%234A544D' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --chev-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23FFFFFF' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
select {
  -webkit-appearance: none; appearance: none;
  background-color: var(--control-bg);
  font-weight: 500; cursor: pointer; text-overflow: ellipsis;
}
select:not(.status-select):not(.lot-status):hover:not(:disabled) { background-color: var(--control-bg-hover); border-color: var(--sage); }
select:disabled { cursor: not-allowed; opacity: .6; }
select, select.status-select, select.lot-status {
  background-image: var(--chev);
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 12px 12px;
}
select, .filters select, .table select, .ci-right select, select.status-select, select.lot-status { padding-right: 30px; }
select.status-select, select.lot-status { background-position: right 8px center; padding-right: 26px; border: 1px solid transparent; }
select.status-select:hover, select.lot-status:hover { border-color: rgba(0, 0, 0, .15); filter: brightness(.97); }
select.ls-sold, select.status-live, select.status-completed { --chev: var(--chev-light); }
select option { font-weight: 400; color: var(--ink); background: var(--surface); }

/* ------------------------------------------------------------ print documents */
.print-toolbar {
  position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center;
  padding: 10px var(--gutter); background: var(--surface); border-bottom: 1px solid var(--line);
}
.print-stage { background: #E6E9E2; padding: 28px var(--gutter) 60px; min-height: calc(100vh - 56px); }
.print-page {
  --pr-ink: #1C1F1D; --pr-muted: #5E6861; --pr-rule: #D5D9D1; --pr-accent: var(--forest);
  max-width: 8.5in; margin: 0 auto; background: #fff; color: var(--pr-ink);
  padding: .6in .65in; box-shadow: 0 2px 14px rgba(0,0,0,.12); border-radius: 4px;
  font-size: 13.5px; line-height: 1.4;
}
.pr-head { border-bottom: 2.5px solid var(--pr-accent); padding-bottom: 10px; margin-bottom: 14px; }
.pr-brand { display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--pr-muted); }
.pr-brand .brand-mark { width: 18px; height: 18px; background: var(--forest); }
.pr-brand .brand-mark::after { left: 6px; top: 4px; width: 6px; height: 9px; background: var(--sage-100); }
.pr-brand strong { color: var(--pr-accent); }
.pr-head h1 { font-size: 24px; margin: 6px 0 6px; }
.pr-meta { display: flex; flex-wrap: wrap; gap: 2px 0; font-size: 12.5px; color: var(--pr-muted); }
.pr-meta span:not(:last-child)::after { content: '·'; margin: 0 8px; color: var(--pr-rule); }
.pr-meta b { color: var(--pr-ink); }

.pr-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-bottom: 14px; }
.pr-stat { border: 1px solid var(--pr-rule); border-radius: 6px; padding: 6px 10px; }
.pr-stat .l { font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--pr-muted); }
.pr-stat .v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pr-stat .s { font-size: 11px; color: var(--pr-muted); }

.pr-summary { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 12.5px; padding: 8px 10px; background: #F4F6F1; border-radius: 6px; margin-bottom: 12px; }
.pr-legend { margin-left: auto; color: var(--pr-muted); }

.pr-section { margin-top: 16px; break-inside: avoid; page-break-inside: avoid; }
.pr-section.pr-break-ok, .pr-section.pr-group { break-inside: auto; page-break-inside: auto; }
.pr-section h2 {
  font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pr-accent);
  border-bottom: 1px solid var(--pr-rule); padding-bottom: 4px; margin-bottom: 6px;
  break-after: avoid; page-break-after: avoid; display: flex; align-items: baseline; gap: 8px;
}
.pr-count { font-weight: 600; color: var(--pr-muted); letter-spacing: 0; }
.pr-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.pr-cols .pr-section:first-child { margin-top: 0; }
.pr-cols .pr-section { margin-top: 0; }

.pr-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pr-table thead { display: table-header-group; }
.pr-table th { text-align: left; font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--pr-muted); padding: 4px 6px; border-bottom: 1.5px solid var(--pr-ink); }
.pr-table td { padding: 6px; border-bottom: 1px solid var(--pr-rule); vertical-align: top; }
.pr-table tr { break-inside: avoid; page-break-inside: avoid; }
.pr-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pr-check td:first-child { padding-right: 0; }
.pr-check tr.is-done .pr-task { text-decoration: line-through; color: var(--pr-muted); }
.pr-check tr.is-done td { color: var(--pr-muted); }
.pr-write { min-width: 60px; }
.pr-box {
  display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px;
  border: 1.5px solid var(--pr-ink); border-radius: 3px; font-size: 11px; font-weight: 700; line-height: 1; vertical-align: -2px; flex: none;
}
.pr-box.checked { background: var(--pr-ink); color: #fff; }
.pr-crit { color: var(--danger); }
.pr-overdue { color: var(--danger); font-weight: 700; }
.pr-sub { display: block; font-size: 11px; color: var(--pr-muted); margin-top: 1px; }
.pr-sub-inline { font-size: 11px; color: var(--pr-muted); }
.pr-internal { font-size: 8.5px; font-weight: 700; letter-spacing: .05em; color: #fff; background: #3A1F1F; padding: 1px 4px; border-radius: 3px; }
.pr-dl { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; margin: 0; font-size: 12.5px; }
.pr-dl dt { color: var(--pr-muted); }
.pr-dl dd { margin: 0; white-space: pre-wrap; }
.pr-actions { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.pr-actions li { display: flex; gap: 8px; padding: 3px 0; }
.pr-offers { columns: 2; column-gap: 24px; list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.pr-offers li { break-inside: avoid; padding: 3px 0; }
.pr-offers li.feat b { color: var(--pr-accent); }
.pr-chips { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; }
.pr-pre { white-space: pre-wrap; margin: 0; font-size: 12.5px; }
.pr-hint, .pr-empty { font-size: 11px; color: var(--pr-muted); margin: 4px 0 0; }
.pr-line { height: 26px; border-bottom: 1px solid var(--pr-rule); }
.pr-footer { margin-top: 22px; padding-top: 6px; border-top: 1px solid var(--pr-rule); font-size: 10px; color: var(--pr-muted); }

@media (max-width: 760px) {
  .print-page { padding: 22px 18px; }
  .pr-cols { grid-template-columns: 1fr; gap: 14px; }
  .pr-offers { columns: 1; }
  .print-stage { padding: 12px 8px 40px; }
  .print-page .pr-table { display: block; overflow-x: auto; }
}

@page { size: letter; margin: 0.5in 0.55in; }
@media print {
  .topbar, #demo-banner, .no-print, #toasts { display: none !important; }
  body, .print-stage { background: #fff !important; }
  .print-stage { padding: 0; min-height: 0; }
  .print-page { max-width: none; padding: 0; box-shadow: none; border-radius: 0; font-size: 10.5pt; }
  .print-page, .print-page * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pr-table, .pr-dl, .pr-actions, .pr-offers, .pr-chips, .pr-pre, .pr-summary, .pr-meta { font-size: 9.5pt; }
  .pr-sub, .pr-sub-inline { font-size: 8.5pt; }
  .pr-head h1 { font-size: 18pt; }
  a { color: inherit; text-decoration: none; }
  /* printing any other page: drop the app chrome */
  .tabs, .filters, .btn, .icon-btn { display: none !important; }
}
