/* Disha & Ronak — Wedding HQ dashboard
   Brand: ivory paper · antique gold engraving · deep green velvet */

:root {
  --paper: #F7F3EA;
  --paper-raised: #FDFBF5;
  --ink: #22302A;
  --ink-2: #5C665F;
  --ink-3: #8B948C;
  --gold: #A8853B;
  --gold-soft: #C4A468;
  --gold-line: rgba(168, 133, 59, 0.32);
  --gold-line-soft: rgba(168, 133, 59, 0.16);
  --green: #1E3D2F;
  --track: rgba(168, 133, 59, 0.18);
  --shadow: 0 1px 2px rgba(30, 61, 47, 0.06), 0 6px 24px rgba(30, 61, 47, 0.07);

  /* status — validated: light surface #F7F3EA */
  --st-done: #0E7A50;
  --st-decision: #B8860B;
  --st-progress: #2D5FA8;
  --st-blocked: #B03A48;
  --st-idle: #8A8578;
  --st-done-bg: rgba(14, 122, 80, 0.10);
  --st-decision-bg: rgba(184, 134, 11, 0.12);
  --st-progress-bg: rgba(45, 95, 168, 0.10);
  --st-blocked-bg: rgba(176, 58, 72, 0.10);
  --st-idle-bg: rgba(138, 133, 120, 0.10);
}

[data-theme="dark"] {
  --paper: #15211B;
  --paper-raised: #1C2B23;
  --ink: #EAE4D6;
  --ink-2: #A9B2A9;
  --ink-3: #7E877E;
  --gold: #C4A468;
  --gold-soft: #A8853B;
  --gold-line: rgba(196, 164, 104, 0.36);
  --gold-line-soft: rgba(196, 164, 104, 0.16);
  --green: #DCE7DF;
  --track: rgba(196, 164, 104, 0.2);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 28px rgba(0, 0, 0, 0.35);

  /* status — validated: dark surface #15211B */
  --st-done: #2C9163;
  --st-decision: #B8891E;
  --st-progress: #547FD2;
  --st-blocked: #C25562;
  --st-idle: #9A937F;
  --st-done-bg: rgba(44, 145, 99, 0.16);
  --st-decision-bg: rgba(184, 137, 30, 0.16);
  --st-progress-bg: rgba(84, 127, 210, 0.16);
  --st-blocked-bg: rgba(194, 85, 98, 0.16);
  --st-idle-bg: rgba(154, 147, 127, 0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
[hidden] { display: none !important; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Jost", "Avenir Next", system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.55;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

h1, h2, h3, .serif { font-family: "Cormorant Garamond", "Georgia", serif; }
.amp { font-style: italic; color: var(--gold); }
.hashtag { color: var(--gold); letter-spacing: 0.04em; }

/* ---------- passcode gate ---------- */
.gate {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper);
  padding: 24px;
}
.gate-card {
  text-align: center; max-width: 380px; width: 100%;
  padding: 48px 32px;
  border: 1px solid var(--gold-line);
  border-radius: 4px;
  background: var(--paper-raised);
  box-shadow: var(--shadow);
  position: relative;
}
.gate-card::before, .gate-card::after {
  content: ""; position: absolute; inset: 6px;
  border: 1px solid var(--gold-line-soft); border-radius: 2px; pointer-events: none;
}
.gate-logo { width: 88px; margin: 0 auto 18px; display: block; }
.gate-title { font-size: 2rem; font-weight: 600; color: var(--green); }
.gate-sub { color: var(--ink-2); font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; margin: 6px 0 26px; }
#gate-form { display: flex; gap: 8px; }
#gate-input {
  flex: 1; padding: 10px 14px; font: inherit;
  border: 1px solid var(--gold-line); border-radius: 3px;
  background: var(--paper); color: var(--ink); outline: none;
}
#gate-input:focus { border-color: var(--gold); }
#gate-form button {
  padding: 10px 20px; font: inherit; font-weight: 500; letter-spacing: 0.06em;
  background: var(--green); color: #F7F3EA; border: none; border-radius: 3px; cursor: pointer;
}
[data-theme="dark"] #gate-form button { background: var(--gold); color: #15211B; }
.gate-err { color: var(--st-blocked); font-size: 0.85rem; margin-top: 12px; }

/* ---------- header ---------- */
.site-header { padding: 28px clamp(16px, 4vw, 48px) 0; }
.header-inner { display: flex; align-items: center; gap: 20px; max-width: 1240px; margin: 0 auto; }
.header-logo { width: 64px; height: auto; }
.header-names h1 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); font-weight: 600; color: var(--green); line-height: 1.1; }
.header-sub { color: var(--ink-2); font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase; margin-top: 4px; }
.header-side { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.countdown { text-align: right; }
.countdown .big { font-family: "Cormorant Garamond", serif; font-size: 2rem; font-weight: 700; color: var(--gold); line-height: 1; }
.countdown small { display: block; color: var(--ink-2); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; }
.cd-units { display: flex; align-items: baseline; gap: 8px; justify-content: flex-end; }
.cd-unit { text-align: center; min-width: 34px; }
.cd-num {
  font-family: "Cormorant Garamond", serif; font-size: 1.7rem; font-weight: 700;
  color: var(--gold); line-height: 1; font-variant-numeric: tabular-nums;
}
.cd-unit small { font-size: 0.6rem; letter-spacing: 0.1em; }
.cd-sep { color: var(--gold-line); align-self: center; }
.cd-caption { margin-top: 4px; }
@media (max-width: 560px) {
  .cd-units { justify-content: flex-start; }
  .countdown { text-align: left; }
}
.theme-toggle {
  background: none; border: 1px solid var(--gold-line); color: var(--gold);
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 1rem;
}
.gold-rule {
  max-width: 1240px; margin: 22px auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-line) 18%, var(--gold-line) 82%, transparent);
  position: relative;
}
.gold-rule::after {
  content: "❦"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  color: var(--gold); background: var(--paper); padding: 0 14px; font-size: 0.9rem;
}

/* ---------- layout ---------- */
main { max-width: 1240px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 48px) 40px; display: grid; gap: 40px; }
.section-title { font-size: 1.5rem; font-weight: 600; color: var(--green); margin-bottom: 14px; }
.title-count { color: var(--gold); font-size: 1.1rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ---------- KPIs ---------- */
.kpis {
  display: grid; grid-template-columns: auto repeat(4, 1fr); gap: 14px; align-items: stretch;
}
.kpi {
  background: var(--paper-raised); border: 1px solid var(--gold-line-soft); border-radius: 6px;
  padding: 18px 20px; display: flex; flex-direction: column; justify-content: center; box-shadow: var(--shadow);
}
.kpi-num { font-family: "Cormorant Garamond", serif; font-size: 2.2rem; font-weight: 700; color: var(--ink); line-height: 1.1; }
.kpi-label { color: var(--ink-2); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; margin-top: 2px; }
.kpi-foot { color: var(--ink-3); font-size: 0.78rem; margin-top: 8px; }
.kpi-ring { position: relative; align-items: center; padding: 14px; }
.ring { width: 108px; height: 108px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; stroke-linecap: round; }
.ring-track { stroke: var(--track); }
.ring-fill { stroke: var(--gold); stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset 0.8s ease; }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-center span { font-family: "Cormorant Garamond", serif; font-size: 1.6rem; font-weight: 700; color: var(--ink); }
.ring-center small { color: var(--ink-2); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; }

/* ---------- schedule ---------- */
.schedule { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.venue-card { grid-column: 1 / -1; border-left-width: 5px; background: var(--st-done-bg); }
.day-card {
  border: 1px solid var(--gold-line-soft); border-left: 3px solid var(--gold); border-radius: 6px;
  background: var(--paper-raised); padding: 14px 18px; box-shadow: var(--shadow);
}
.day-card h3 { font-size: 1.15rem; font-weight: 700; color: var(--gold); }
.day-card p { color: var(--ink-2); font-size: 0.88rem; margin-top: 4px; }

/* ---------- decisions & blockers ---------- */
.decision-list { list-style: none; display: grid; gap: 8px; }
.decision-list li {
  background: var(--st-decision-bg); border: 1px solid var(--gold-line-soft); border-radius: 6px;
  padding: 10px 14px; font-size: 0.92rem; display: flex; gap: 10px; align-items: baseline;
}
.blocker-list li { background: var(--st-blocked-bg); }
.decision-list .decision-more { background: none; border: none; color: var(--ink-3); font-style: italic; }
.decision-area { white-space: nowrap; color: var(--ink-2); font-size: 0.8rem; letter-spacing: 0.04em; cursor: pointer; }
.decision-area:hover { color: var(--gold); }

/* ---------- filters ---------- */
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chip {
  font: inherit; font-size: 0.78rem; letter-spacing: 0.03em; cursor: pointer;
  padding: 4px 12px; border-radius: 999px; border: 1px solid var(--gold-line-soft);
  background: var(--paper-raised); color: var(--ink-2);
}
.filter-chip[aria-pressed="true"] { border-color: var(--gold); color: var(--ink); background: var(--gold-line-soft); }

/* ---------- area cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 14px; }
.card {
  background: var(--paper-raised); border: 1px solid var(--gold-line-soft); border-radius: 8px;
  padding: 16px 18px 14px; box-shadow: var(--shadow); cursor: pointer; text-align: left;
  font: inherit; color: inherit; display: flex; flex-direction: column; gap: 10px;
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: var(--gold); transform: translateY(-2px); }
.card-top { display: flex; align-items: center; gap: 10px; }
.card-emoji { font-size: 1.4rem; }
.card-title { font-size: 1.18rem; font-weight: 700; color: var(--ink); line-height: 1.15; flex: 1; }
.card-milestone { color: var(--ink-2); font-size: 0.86rem; min-height: 2.6em; }
.bar { height: 5px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--gold); transition: width 0.6s ease; }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.78rem; color: var(--ink-3); }
.card-pct { font-weight: 600; color: var(--ink-2); }

/* status chips — always dot + text, never color alone */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.72rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.chip .dot { font-size: 0.8em; line-height: 1; }
.chip-done { background: var(--st-done-bg); color: var(--st-done); }
.chip-in-progress { background: var(--st-progress-bg); color: var(--st-progress); }
.chip-needs-decision { background: var(--st-decision-bg); color: var(--st-decision); }
.chip-blocked { background: var(--st-blocked-bg); color: var(--st-blocked); }
.chip-not-started { background: var(--st-idle-bg); color: var(--st-idle); border: 1px dashed var(--st-idle); }

/* ---------- chat / HQ inbox ---------- */
.chat-hint { color: var(--ink-2); font-size: 0.88rem; margin: -6px 0 12px; }
.answer-btn {
  margin-left: auto; flex-shrink: 0; font: inherit; font-size: 0.74rem; letter-spacing: 0.05em;
  padding: 3px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--gold-line); background: var(--paper-raised); color: var(--gold);
}
.answer-btn:hover { background: var(--gold-line-soft); }
.chat-thread {
  max-height: 380px; overflow-y: auto; display: grid; gap: 10px;
  border: 1px solid var(--gold-line-soft); border-radius: 8px;
  background: var(--paper-raised); padding: 16px; box-shadow: var(--shadow);
}
.chat-empty { color: var(--ink-3); font-size: 0.9rem; font-style: italic; }
.msg { max-width: 72%; padding: 10px 14px; border-radius: 10px; font-size: 0.92rem; }
.msg-family { justify-self: end; background: var(--st-done-bg); border: 1px solid var(--gold-line-soft); border-bottom-right-radius: 3px; }
.msg-hq { justify-self: start; background: var(--gold-line-soft); border: 1px solid var(--gold-line-soft); border-bottom-left-radius: 3px; }
.msg-meta { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 4px; }
.msg-area { color: var(--gold); text-transform: none; letter-spacing: 0; }
.msg-ts { color: var(--ink-3); text-transform: none; letter-spacing: 0; }
.msg-ref { font-size: 0.8rem; color: var(--ink-2); font-style: italic; border-left: 2px solid var(--gold-line); padding-left: 8px; margin-bottom: 6px; }
.msg-text { white-space: pre-wrap; }
#chat-form { margin-top: 12px; }
.chat-context {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  font-size: 0.82rem; color: var(--ink-2);
  background: var(--st-decision-bg); border: 1px solid var(--gold-line-soft);
  border-radius: 6px; padding: 6px 10px;
}
.chat-context button { margin-left: auto; background: none; border: none; color: var(--ink-2); font-size: 1rem; cursor: pointer; }
.chat-row { display: flex; gap: 8px; align-items: stretch; }
#chat-name {
  width: 130px; flex-shrink: 0; padding: 10px 12px; font: inherit; font-size: 0.9rem;
  border: 1px solid var(--gold-line); border-radius: 6px; background: var(--paper-raised); color: var(--ink);
}
#chat-text {
  flex: 1; padding: 10px 12px; font: inherit; font-size: 0.92rem; resize: vertical; min-height: 44px;
  border: 1px solid var(--gold-line); border-radius: 6px; background: var(--paper-raised); color: var(--ink);
}
#chat-name:focus, #chat-text:focus { outline: none; border-color: var(--gold); }
#chat-send {
  padding: 10px 22px; font: inherit; font-weight: 500; letter-spacing: 0.06em; cursor: pointer;
  background: var(--green); color: #F7F3EA; border: none; border-radius: 6px;
}
[data-theme="dark"] #chat-send { background: var(--gold); color: #15211B; }
#chat-send:disabled { opacity: 0.6; }
.chat-status { margin-top: 8px; font-size: 0.82rem; color: var(--ink-2); }
.drawer .decision-list li { flex-wrap: wrap; }
@media (max-width: 560px) {
  .chat-row { flex-wrap: wrap; }
  #chat-name { width: 100%; }
  .msg { max-width: 90%; }
}

/* ---------- feed ---------- */
.feed { list-style: none; display: grid; gap: 0; border-left: 1px solid var(--gold-line); margin-left: 6px; }
.feed li { position: relative; padding: 0 0 18px 22px; }
.feed li::before {
  content: ""; position: absolute; left: -4.5px; top: 7px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--gold); border: 2px solid var(--paper);
}
.feed-date { color: var(--ink-3); font-size: 0.75rem; letter-spacing: 0.08em; }
.feed-area { color: var(--gold); font-size: 0.85rem; font-weight: 500; margin: 0 6px 0 8px; cursor: pointer; }
.feed-note { color: var(--ink); font-size: 0.92rem; display: block; }

/* ---------- drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(20, 30, 25, 0.45); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); z-index: 50;
  background: var(--paper-raised); border-left: 1px solid var(--gold-line);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.18);
  overflow-y: auto; padding: 26px 26px 40px;
}
.drawer-close {
  position: sticky; top: 0; float: right; margin-left: 12px;
  background: var(--paper); border: 1px solid var(--gold-line-soft); color: var(--ink-2);
  width: 32px; height: 32px; border-radius: 50%; font-size: 1.1rem; cursor: pointer;
}
.drawer h2 { font-size: 1.6rem; font-weight: 700; color: var(--green); margin: 4px 0 2px; }
.drawer .chip { margin: 8px 0 14px; }
.drawer-section { margin-top: 22px; }
.drawer-section h3 {
  font-family: "Jost", sans-serif; font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-2); border-bottom: 1px solid var(--gold-line-soft); padding-bottom: 6px; margin-bottom: 10px;
}
.task { display: flex; gap: 10px; padding: 5px 0; font-size: 0.92rem; align-items: baseline; }
.task-due { margin-left: auto; color: var(--ink-3); font-size: 0.76rem; white-space: nowrap; }
.task-due.overdue { color: var(--st-blocked); font-weight: 600; }
.task.done { color: var(--ink-3); text-decoration: line-through; }
.task .tick { color: var(--st-done); }
.task .box { color: var(--ink-3); }
.drawer-update { padding: 6px 0; font-size: 0.9rem; }
.drawer-update .feed-date { display: block; }
.drawer a { color: var(--gold); }
.drawer-milestone { font-size: 0.95rem; color: var(--ink-2); font-style: italic; }

/* ---------- footer ---------- */
.site-footer { padding: 0 clamp(16px, 4vw, 48px) 34px; text-align: center; color: var(--ink-3); font-size: 0.82rem; }
.site-footer p { margin-top: 18px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi-ring { grid-column: 1 / -1; flex-direction: row; gap: 18px; justify-content: center; }
  .schedule { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .header-inner { flex-wrap: wrap; }
  .header-side { margin-left: 0; width: 100%; justify-content: space-between; }
  .kpis { grid-template-columns: 1fr 1fr; }
}
