/* ============================================================
   J. McAllister Events Backend — preview prototype
   DESKTOP-FIRST. JMC tokens + grid layout. No frameworks.
   Primary canvas 1280px; intentional at 1440px.
   Mobile is a graceful stacked fallback, not the design target.
   ============================================================ */

:root {
  --jmc-black: #000000;
  --jmc-gold: #C9A961;          /* champagne gold accent */
  --jmc-wine: #7A1F2B;          /* overdue / attention */
  --jmc-cream: #F7F4EE;         /* cards on black, body on dark */
  --jmc-charcoal: #1A1A1A;      /* text on light surfaces */
  --jmc-sage: #7BA38F;          /* on track */
  --jmc-muted: rgba(247, 244, 238, 0.65);
  --jmc-card-dark: #111111;
  --jmc-border: rgba(201, 169, 97, 0.35);
  --font-display: 'Tenor Sans', sans-serif;
  --font-script: 'Allura', cursive;
  --font-body: 'Inter', sans-serif;
  --radius: 10px;
  --radius-pill: 999px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--jmc-black);
  color: var(--jmc-cream);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===================== TOP BAR ===================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--jmc-border);
  padding-top: env(safe-area-inset-top);
}
.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 40px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}
.topbar-brand { display: flex; align-items: center; gap: 11px; justify-self: start; }
.monogram { flex: none; width: 34px; height: 34px; display: block; }
.topbar-title { font-family: var(--font-display); font-size: 15px; letter-spacing: 0.5px; color: var(--jmc-cream); white-space: nowrap; }

.topnav { display: flex; gap: 8px; justify-self: center; }
.topnav a {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--jmc-muted);
  text-decoration: none;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
  white-space: nowrap;
}
.topnav a:hover { color: var(--jmc-cream); border-color: var(--jmc-border); }
.topnav a.active { color: var(--jmc-black); background: var(--jmc-gold); }

.topbar-eyebrow {
  justify-self: end;
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(201, 169, 97, 0.75);
  font-weight: 600;
  white-space: nowrap;
}

/* ===================== PAGE ===================== */
.page {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 40px 48px;
  flex: 1;
}

/* ---------- type ---------- */
.eyebrow { font-size: 10.5px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--jmc-gold); font-weight: 600; }
.greeting { font-family: var(--font-display); font-size: 34px; line-height: 1.1; color: var(--jmc-cream); }
.subgreeting { color: var(--jmc-muted); font-size: 15px; margin-top: 6px; }
.section-label { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--jmc-muted); font-weight: 600; margin: 0 0 12px; }
.page-head { margin-bottom: 18px; }
.page-title { font-family: var(--font-display); font-size: 30px; color: var(--jmc-cream); line-height: 1.15; }
.page-sub { color: var(--jmc-muted); font-size: 14px; margin-top: 6px; }
.script { font-family: var(--font-script); color: var(--jmc-gold); font-size: 1.35em; line-height: 1; }

/* ---------- cards ---------- */
.card {
  background: var(--jmc-card-dark);
  border: 1px solid var(--jmc-border);
  border-radius: var(--radius);
  padding: 20px;
}
.card + .card { margin-top: 20px; }
.card-cream {
  background: var(--jmc-cream);
  color: var(--jmc-charcoal);
  border: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.18), 0 12px 30px rgba(122,31,43,.07);
}
.card-cream .section-label, .card-cream .muted { color: rgba(26,26,26,.55); }

.hero { background: var(--jmc-card-dark); border-left: 4px solid var(--jmc-gold); border-radius: var(--radius); padding: 24px; }
.hero h2 { font-family: var(--font-display); font-size: 22px; font-weight: 400; color: var(--jmc-cream); margin-bottom: 8px; }

/* ---------- dashboard grid ---------- */
.dash-grid { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; margin-top: 24px; }
.dash-main > * + * { margin-top: 24px; }
.dash-side > * + * { margin-top: 20px; }

/* ---------- attention rows (hero) ---------- */
.att-row {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  border-top: 1px solid rgba(201,169,97,.14);
  padding: 16px 14px 14px;
  border-radius: var(--radius);
  transition: border-color .15s ease, background .15s ease;
}
.att-row:first-of-type { border-top-color: transparent; }
a.att-row:hover { border-color: var(--jmc-border); background: rgba(201,169,97,.05); }
.att-row.dim { opacity: 0.82; }
.att-row .name { font-family: var(--font-display); font-size: 17px; color: var(--jmc-cream); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.att-row .name .arrow { color: var(--jmc-gold); font-size: 18px; }
.att-meta { font-size: 13px; color: var(--jmc-muted); margin-top: 6px; }

/* ---------- chips ---------- */
.chip { display: inline-block; font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 600; padding: 4px 10px; border-radius: var(--radius-pill); margin-top: 8px; }
.chip-wine { background: var(--jmc-wine); color: var(--jmc-cream); }
.chip-gold { background: transparent; color: var(--jmc-gold); border: 1px solid var(--jmc-border); }
.chip-sage { background: rgba(123,163,143,.16); color: var(--jmc-sage); border: 1px solid rgba(123,163,143,.4); }

/* ---------- team status ---------- */
.team-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 8px; border-top: 1px solid rgba(0,0,0,.08);
  text-decoration: none; color: inherit; border-radius: 8px;
  transition: background .15s ease;
}
.team-row:first-of-type { border-top: none; }
a.team-row:hover { background: rgba(122,31,43,.06); }
.dot { flex: none; width: 9px; height: 9px; border-radius: 50%; }
.dot-green { background: var(--jmc-sage); }
.dot-wine { background: var(--jmc-wine); }
.team-row .who { font-weight: 600; font-size: 14.5px; }
.team-row .what { font-size: 13px; color: rgba(26,26,26,.6); }
.team-row .arrow { margin-left: auto; color: var(--jmc-wine); font-size: 16px; }

/* ---------- this week (vertical list) ---------- */
.week-list .week-item {
  display: flex; align-items: baseline; gap: 14px;
  padding: 13px 0; border-top: 1px solid rgba(201,169,97,.14);
}
.week-list .week-item:first-child { border-top: none; }
.week-item .when { flex: none; width: 72px; font-size: 11px; letter-spacing: 1.3px; text-transform: uppercase; color: var(--jmc-gold); }
.week-item .title { font-family: var(--font-display); font-size: 15px; }
.week-item .detail { font-size: 12.5px; color: var(--jmc-muted); margin-left: auto; }

/* ---------- collapsible ---------- */
.collapse { }
.collapse-trigger {
  width: 100%; text-align: left;
  background: var(--jmc-card-dark); border: 1px solid var(--jmc-border);
  border-radius: var(--radius); color: var(--jmc-cream);
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  padding: 16px 18px; display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; transition: border-color .15s ease;
}
.collapse-trigger:hover { border-color: var(--jmc-gold); }
.collapse-trigger .ind { color: var(--jmc-gold); transition: transform .25s ease; font-size: 13px; }
.collapse-trigger[aria-expanded="true"] .ind { transform: rotate(45deg); }
.collapse-body { display: none; border: 1px solid var(--jmc-border); border-top: none; border-radius: 0 0 var(--radius) var(--radius); padding: 4px 18px 16px; margin-top: -6px; }
.collapse-body.open { display: block; }
.collapse-body ul { list-style: none; }
.collapse-body li { font-size: 13.5px; color: var(--jmc-muted); padding: 8px 0; border-top: 1px solid rgba(201,169,97,.12); }
.collapse-body li:first-child { border-top: none; }
.collapse-body .kv { display: flex; justify-content: space-between; gap: 10px; }
.collapse-body .kv b { color: var(--jmc-cream); font-weight: 600; }

/* ---------- secondary text links ---------- */
.text-links { display: flex; gap: 24px; flex-wrap: wrap; padding-top: 4px; }
.text-links a { color: var(--jmc-gold); font-size: 13.5px; font-weight: 600; text-decoration: none; border-bottom: 1px solid transparent; padding-bottom: 2px; }
.text-links a:hover { border-bottom-color: var(--jmc-gold); }

/* ---------- OG callout + buttons ---------- */
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: transparent; border: 1px solid var(--jmc-border); border-radius: var(--radius-pill);
  color: var(--jmc-gold); font-family: var(--font-body); font-size: 13px; font-weight: 600;
  padding: 12px 20px; margin-top: 14px; cursor: pointer; transition: background .15s ease, border-color .15s ease;
}
.btn-ghost:hover { background: rgba(201,169,97,.1); border-color: var(--jmc-gold); }
.card-cream .btn-ghost { color: var(--jmc-wine); border-color: rgba(122,31,43,.35); }
.card-cream .btn-ghost:hover { background: rgba(122,31,43,.07); }

/* ===================== EVENT PAGE ===================== */
.event-grid { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; margin-top: 20px; }
.event-grid.solo { grid-template-columns: 1fr; }
.event-main > * + * { margin-top: 24px; }
.event-side { position: sticky; top: 92px; }
.event-side > * + * { margin-top: 20px; }

.toggle { display: inline-flex; background: var(--jmc-card-dark); border: 1px solid var(--jmc-border); border-radius: var(--radius-pill); padding: 4px; margin-top: 16px; }
.toggle button { background: transparent; border: none; color: var(--jmc-muted); font-family: var(--font-body); font-size: 13.5px; font-weight: 600; padding: 10px 22px; border-radius: var(--radius-pill); cursor: pointer; }
.toggle button.active { background: var(--jmc-gold); color: var(--jmc-black); }

.exceptions { border-left: 4px solid var(--jmc-wine); }
.swatches { display: flex; gap: 12px; margin: 12px 0; flex-wrap: wrap; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.swatch i { display: block; width: 44px; height: 44px; border-radius: 8px; border: 1px solid rgba(247,244,238,.18); }
.swatch span { font-size: 10px; color: var(--jmc-muted); letter-spacing: .5px; }
.exc-line { font-size: 13px; color: var(--jmc-muted); padding: 9px 0; border-top: 1px solid rgba(201,169,97,.14); }
.exc-line b { color: var(--jmc-cream); font-weight: 600; }
.exc-line a { color: var(--jmc-gold); }

.pay-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; padding: 8px 0; border-top: 1px solid rgba(201,169,97,.12); }
.pay-row:first-of-type { border-top: none; }
.pay-row b { color: var(--jmc-cream); font-weight: 600; }
.vendor-list { list-style: none; }
.vendor-list li { font-size: 13.5px; color: var(--jmc-muted); padding: 7px 0; border-top: 1px solid rgba(201,169,97,.12); }
.vendor-list li:first-child { border-top: none; }

.stages { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 0; }
.stage { font-size: 12px; white-space: nowrap; padding: 8px 13px; border-radius: var(--radius-pill); border: 1px solid rgba(201,169,97,.2); color: var(--jmc-muted); }
.stage.done { color: var(--jmc-cream); }
.stage.done::before { content: "✓ "; color: var(--jmc-sage); }
.stage.current { background: rgba(201,169,97,.16); border-color: var(--jmc-gold); color: var(--jmc-gold); font-weight: 600; }
.stage.current::before { content: "◐ "; }

.task-group-name { font-family: var(--font-display); font-size: 16px; margin: 16px 0 4px; color: var(--jmc-cream); }
.task-group-name:first-child { margin-top: 0; }
.task { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 13px 0; border-top: 1px solid rgba(201,169,97,.14); }
.task:first-of-type { border-top: none; }
.task .tx { font-size: 14px; flex: 1; }
.task .tx.done { color: var(--jmc-muted); text-decoration: line-through; }

.auditor { background: rgba(122,31,43,.22); border: 1px solid rgba(122,31,43,.55); border-radius: var(--radius); padding: 16px 20px; margin-top: 24px; font-size: 13.5px; color: var(--jmc-cream); line-height: 1.5; }
.auditor b { color: var(--jmc-gold); }

/* raven view */
.raven-view .lede { font-family: var(--font-display); font-size: 24px; margin-top: 4px; }
.numbered { counter-reset: t; }
.numbered .task { counter-increment: t; }
.numbered .task .tx::before { content: counter(t) ".  "; color: var(--jmc-gold); font-weight: 600; }
.note-italic { font-style: italic; color: var(--jmc-muted); font-size: 13px; margin-top: 18px; line-height: 1.55; }
.simple-stage { font-size: 14px; color: var(--jmc-gold); margin-top: 10px; }

/* ===================== CLIENT PAGE ===================== */
.client-grid { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 36px; align-items: start; }
.thread { display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 86%; }
.msg .stamp { font-size: 10.5px; color: var(--jmc-muted); margin-bottom: 4px; letter-spacing: .3px; }
.bubble { padding: 14px 16px; border-radius: 16px; font-size: 14px; line-height: 1.5; }
.msg.client { align-self: flex-start; }
.msg.client .bubble { background: var(--jmc-card-dark); border: 1px solid var(--jmc-border); border-bottom-left-radius: 5px; color: var(--jmc-cream); }
.msg.assistant { align-self: flex-end; }
.msg.assistant .stamp { text-align: right; }
.msg.assistant .bubble { background: rgba(201,169,97,.10); border: 1px solid var(--jmc-border); border-left: 3px solid var(--jmc-gold); border-bottom-right-radius: 5px; color: var(--jmc-cream); }
.thread-caption, .section-caption { font-size: 13px; color: var(--jmc-muted); text-align: center; margin-top: 22px; line-height: 1.55; }

.booked { background: var(--jmc-black); border: 1px solid var(--jmc-border); border-radius: var(--radius); padding: 32px 26px; text-align: center; position: sticky; top: 92px; }
.booked .monogram-lg { width: 48px; height: 48px; margin: 0 auto 18px; display: block; }
.booked .script { font-size: 36px; display: block; margin-bottom: 14px; }
.booked p { font-size: 13.5px; color: var(--jmc-muted); line-height: 1.55; }
.booked .milestones { display: flex; justify-content: center; gap: 16px; margin-top: 20px; flex-wrap: wrap; }
.booked .milestones span { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--jmc-gold); position: relative; }
.booked .milestones span + span::before { content: "·"; position: absolute; left: -10px; color: var(--jmc-muted); }

/* ===================== CLOSE PAGE ===================== */
.close-head { text-align: center; }
.loop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 24px; }
.tl-card { background: var(--jmc-cream); color: var(--jmc-charcoal); border-radius: var(--radius); padding: 22px; box-shadow: 0 1px 2px rgba(0,0,0,.18), 0 10px 26px rgba(122,31,43,.07); transition: transform .15s ease; }
.tl-card:hover { transform: translateY(-3px); }
.tl-card .when { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--jmc-wine); font-weight: 700; }
.tl-card .label { font-family: var(--font-display); font-size: 18px; margin: 6px 0 10px; }
.tl-card .snippet { font-size: 13.5px; color: rgba(26,26,26,.7); font-style: italic; line-height: 1.5; }

/* ===================== MODAL + TOAST ===================== */
.modal-backdrop { display: none; position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.6); backdrop-filter: blur(3px); align-items: center; justify-content: center; padding: 24px; }
.modal-backdrop.open { display: flex; }
.modal { width: 100%; max-width: 460px; background: var(--jmc-card-dark); border: 1px solid var(--jmc-border); border-radius: 16px; padding: 26px 24px; }
.modal .eyebrow { display: block; }
.modal h3 { font-family: var(--font-display); font-size: 22px; margin: 8px 0 4px; font-weight: 400; }
.modal .modal-cap { font-size: 13px; color: var(--jmc-muted); margin-bottom: 8px; line-height: 1.5; }
.field { margin-top: 14px; }
.field label { display: block; font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--jmc-muted); font-weight: 600; }
.field .input { margin-top: 6px; border: 1px solid var(--jmc-border); border-radius: 9px; padding: 13px; font-size: 14px; color: var(--jmc-cream); background: rgba(247,244,238,.04); }
.modal-actions { display: flex; gap: 10px; margin-top: 22px; }
.btn-fill { flex: 1; background: var(--jmc-gold); color: var(--jmc-black); border: none; border-radius: var(--radius-pill); font-family: var(--font-body); font-weight: 700; font-size: 13.5px; padding: 14px; cursor: pointer; }
.btn-text { background: transparent; border: none; color: var(--jmc-muted); font-family: var(--font-body); font-size: 13.5px; padding: 14px; cursor: pointer; }

.toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(20px); background: var(--jmc-cream); color: var(--jmc-charcoal); font-size: 13px; font-weight: 600; padding: 12px 20px; border-radius: var(--radius-pill); box-shadow: 0 8px 30px rgba(0,0,0,.4); opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease; z-index: 70; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===================== FOOTER ===================== */
.site-footer { width: 100%; text-align: center; padding: 28px 24px; border-top: 1px solid rgba(201,169,97,.14); }
.footer-brand { font-size: 11px; font-style: italic; color: rgba(201,169,97,.6); }

.hidden { display: none !important; }

/* ===================== RESPONSIVE ===================== */
/* Tablet — stack grids to single column */
@media (max-width: 900px) {
  .topbar-inner { grid-template-columns: 1fr; justify-items: start; gap: 12px; padding: 12px 24px; }
  .topnav { justify-self: stretch; flex-wrap: wrap; }
  .topbar-eyebrow { justify-self: start; }
  .page { padding: 28px 28px 40px; }
  .dash-grid, .event-grid { grid-template-columns: 1fr; }
  .event-side { position: static; }
  .client-grid { grid-template-columns: 1fr; max-width: 720px; }
  .booked { position: static; max-width: 360px; margin: 0 auto; }
  .loop-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Phone — acceptable fallback, not primary. 44px touch targets. */
@media (max-width: 600px) {
  .page { padding: 22px 20px 36px; }
  .greeting { font-size: 28px; }
  .topnav a { padding: 11px 14px; }
  .loop-grid { grid-template-columns: 1fr; }
  .stages { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .stages::-webkit-scrollbar { height: 0; }
  .att-row, .team-row, .collapse-trigger, .btn-ghost, .toggle button, .topnav a { min-height: 44px; }
}
