/* ============ PAPER MUSE PLANNERS — Modern Minimal ============ */
:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --ink: #1c1b1a;
  --ink-soft: #6b6862;
  --ink-faint: #a3a09a;
  --line: #e8e5e0;
  --accent: #ebbec5;        /* blush */
  --accent-ink: #6e3a43;
  --accent-soft: #f6e3e6;
  --danger: #b3564d;
  --warn: #b08a4f;
  --ok: #5d7d5f;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(28,27,26,.06), 0 8px 24px rgba(28,27,26,.05);
  --font: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-script: "Rouge Script", cursive;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-weight: 300; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 400; letter-spacing: 0; margin: 0; }
a { color: var(--accent-ink); }
input, select, textarea, button { font-family: inherit; font-size: inherit; color: inherit; }

/* ---------- Auth ---------- */
.auth-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(160deg, #faf6f4 0%, #f6e3e6 100%); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 40px 36px; }
.auth-brand { text-align: center; margin-bottom: 28px; }
.auth-logo { font-family: var(--font-display); font-size: 28px; font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; }
.auth-tagline { color: var(--ink-soft); margin: 6px 0 0; font-size: 14px; }
.auth-form h2 { font-size: 21px; margin-bottom: 14px; text-align: center; }
.auth-form label { display: block; font-size: 13px; font-weight: 300; color: var(--ink-soft); margin-bottom: 12px; }
.auth-form input { display: block; width: 100%; margin-top: 5px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); outline: none; }
.auth-form input:focus { border-color: var(--accent); background: #fff; }
.auth-note { font-size: 13px; color: var(--ink-soft); margin: 0 0 14px; text-align: center; }
.auth-alt { text-align: center; font-size: 13px; color: var(--ink-soft); margin: 12px 0 0; }
.auth-message { margin-top: 16px; padding: 10px 14px; border-radius: 8px; font-size: 13px; text-align: center; }
.auth-message.error { background: #f9edec; color: var(--danger); }
.auth-message.ok { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 232px; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 40; overflow-y: auto; }
.sidebar-brand { padding: 20px 20px 8px; display: flex; align-items: center; justify-content: space-between; }
.sidebar-logo { font-family: var(--font-display); font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; font-size: 16px; }
.sidebar-close { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--ink-soft); }
.sidebar-couple { padding: 0 20px 12px; font-size: 12.5px; color: var(--ink-faint); }
.sidebar-nav { flex: 1; padding: 4px 12px 12px; }
.nav-group { margin-bottom: 14px; }
.nav-group-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); padding: 6px 10px 4px; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 8px; cursor: pointer; color: var(--ink-soft); font-size: 14px; font-weight: 300; text-decoration: none; }
.nav-item:hover { background: var(--bg); color: var(--ink); }
.nav-item.active { background: var(--accent); color: var(--accent-ink); font-weight: 500; }
.nav-item .ni { width: 18px; text-align: center; font-size: 14px; }
.sidebar-foot { padding: 12px 16px 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px; }

.main { flex: 1; margin-left: 232px; display: flex; flex-direction: column; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: rgba(250,249,247,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.menu-btn { display: none; background: none; border: none; font-size: 20px; cursor: pointer; }
.topbar-title { font-family: var(--font-display); font-size: 20px; font-weight: 400; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.save-status { font-size: 12px; color: var(--ink-faint); }
.save-status.saving { color: var(--warn); }
.save-status.error { color: var(--danger); font-weight: 600; }
.countdown-chip { font-size: 12.5px; background: var(--accent-soft); color: var(--accent-ink); padding: 4px 12px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.content { padding: 28px; max-width: 1160px; width: 100%; margin: 0 auto; }

/* ---------- Cards & sections ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; }
.card-title { font-family: var(--font-display); font-size: 18px; font-weight: 400; margin-bottom: 4px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-sub { font-size: 13px; color: var(--ink-soft); margin: 0 0 14px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

/* ---------- Stats ---------- */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); }
.stat .stat-value { font-size: 24px; font-weight: 600; margin-top: 2px; letter-spacing: -0.02em; }
.stat .stat-hint { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 16px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 12.5px; font-weight: 300; color: var(--ink-soft); }
.field input, .field select, .field textarea, .cell input, .cell select {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); outline: none; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus, .cell input:focus, .cell select:focus { border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 64px; }

/* ---------- Buttons ---------- */
.btn { font-family: var(--font); border: none; border-radius: 8px; padding: 9px 16px; cursor: pointer; font-weight: 500; font-size: 13.5px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.btn:hover { border-color: var(--ink-faint); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--bg); border-color: transparent; color: var(--ink); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-full { width: 100%; }
.btn-add { margin-top: 10px; }
.row-del { background: none; border: none; color: var(--ink-faint); cursor: pointer; font-size: 15px; padding: 4px 6px; border-radius: 6px; }
.row-del:hover { color: var(--danger); background: #f9edec; }

/* ---------- Tables ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); font-weight: 400; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 5px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl td.cell { min-width: 90px; }
.tbl tr.done td { opacity: .55; }
.tbl tr.done input[type="text"], .tbl tr.done input[type="date"] { text-decoration: line-through; }
.tbl input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }
.tbl .num { text-align: right; }
.tfoot { font-weight: 600; font-size: 13.5px; padding: 8px; }

/* ---------- Progress ---------- */
.progress { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s; }
.progress.over > div { background: var(--danger); }

/* ---------- Chips / badges ---------- */
.chip { font-family: var(--font); display: inline-block; font-size: 11.5px; font-weight: 500; padding: 2px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--ink-soft); }
.chip.ok { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.chip.warn { background: #f7efe1; color: var(--warn); border-color: transparent; }
.chip.bad { background: #f9edec; color: var(--danger); border-color: transparent; }

/* ---------- Calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-month { font-family: var(--font-display); font-size: 19px; font-weight: 400; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { font-size: 11px; text-transform: uppercase; color: var(--ink-faint); text-align: center; padding: 4px 0; }
.cal-day { min-height: 84px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 5px 7px; font-size: 12px; }
.cal-day.other { opacity: .38; }
.cal-day.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cal-day .d { font-weight: 600; font-size: 12px; margin-bottom: 3px; }
.cal-ev { display: block; padding: 1px 6px; margin-bottom: 2px; border-radius: 5px; background: var(--accent-soft); color: var(--accent-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.cal-ev.pay { background: #f7efe1; color: var(--warn); }
.cal-ev.wed { background: var(--ink); color: #fff; }

/* ---------- Seating ---------- */
.seat-table-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 16px; }
.seat-table-head { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.seat-table-head input { font-weight: 600; }
.seat-list { display: flex; flex-direction: column; gap: 6px; }
.seat-row { display: flex; gap: 6px; align-items: center; }
.seat-row select { flex: 1; }

/* ---------- Dashboard hero ---------- */
.hero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: grid; grid-template-columns: minmax(220px, 380px) 1fr; margin-bottom: 18px; }
.hero-photo { position: relative; min-height: 240px; background: var(--accent-soft); }
.hero-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-photo .photo-btns { position: absolute; bottom: 10px; left: 10px; display: flex; gap: 6px; }
.hero-photo .photo-btns .btn { background: rgba(255,255,255,.92); }
.hero-photo-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--ink-faint); font-size: 13px; cursor: pointer; }
.hero-right { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 36px 24px; gap: 6px; }
.hero-names { font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: clamp(34px, 5.5vw, 62px); line-height: 1.1; letter-spacing: -0.01em; }
.hero-countdown { font-family: var(--font-script); font-size: clamp(28px, 3.6vw, 42px); line-height: 1.2; color: var(--ink); }
.hero-sub { font-size: 13px; color: var(--ink-soft); }
@media (max-width: 700px) { .hero { grid-template-columns: 1fr; } .hero-photo { min-height: 200px; } }

/* ---------- Photo grids (Theme aesthetic / dashboard) ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.photo-item { position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 4/3; background: var(--bg); }
.photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-item .row-del { position: absolute; top: 4px; right: 4px; background: rgba(255,255,255,.92); border-radius: 6px; }
.photo-add { border: 1.5px dashed var(--line); border-radius: 8px; aspect-ratio: 4/3; background: none; color: var(--ink-faint); cursor: pointer; font-family: var(--font); font-size: 13px; }
.photo-add:hover { border-color: var(--accent); color: var(--accent-ink); }

/* ---------- Dashboard color dots ---------- */
.color-dots { display: flex; gap: 14px; flex-wrap: wrap; }
.color-dot { width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--line); }

/* ---------- Guest list blocks ---------- */
.guest-block { border-bottom: 1px solid var(--line); padding: 14px 0; }
.guest-block:last-of-type { border-bottom: none; }
.guest-line1 { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.guest-line1 .guest-name { flex: 6 1 420px; min-width: 300px; }
.guest-line1 .guest-name input { font-size: 16px; font-weight: 600; padding: 10px 12px; }
.guest-line1 > .field { flex: 0 0 auto; }
.guest-line1 > .field:not(.guest-name) { width: 130px; }
.guest-line1 > .guest-check { width: auto; }
.guest-line1 .row-del { align-self: center; }
.guest-line2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px 12px; margin-top: 10px; }
.guest-check { align-items: flex-start; }
.guest-check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); margin-top: 8px; cursor: pointer; }

/* ---------- Color swatches ---------- */
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-soft); }
.swatch input[type="color"] { width: 52px; height: 52px; border: 1px solid var(--line); border-radius: 10px; padding: 2px; background: var(--surface); cursor: pointer; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 20px; border-radius: 999px; font-size: 13.5px; z-index: 100; box-shadow: var(--shadow); max-width: 90vw; text-align: center; }
.toast.error { background: var(--danger); }

/* ---------- Empty state ---------- */
.empty { text-align: center; color: var(--ink-faint); font-size: 13.5px; padding: 18px 8px; }

/* ---------- Demo banner ---------- */
.demo-banner { background: #f7efe1; color: var(--warn); font-size: 12.5px; text-align: center; padding: 7px 12px; border-radius: 8px; margin-bottom: 16px; }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; width: 260px; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow); }
  .sidebar-close { display: block; }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.28); z-index: 35; }
  .sidebar.open ~ .sidebar-overlay, .sidebar-overlay.show { display: block; }
  .main { margin-left: 0; }
  .menu-btn { display: block; }
  .content { padding: 18px 14px; }
  .topbar { padding: 12px 14px; }
  .countdown-chip { display: none; }
  .cal-day { min-height: 56px; }
}

/* ---------- Export modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(28,27,26,.4); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 24px 26px; width: 100%; max-width: 440px; max-height: 86vh; overflow-y: auto; }
.modal-links { font-size: 13px; margin-bottom: 10px; }
.modal-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.modal-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 3px 0; cursor: pointer; }
.modal-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* ---------- PDF export (print) ---------- */
#print-root { display: none; }
@media print {
  @page { margin: 16mm 14mm; }
  body { background: #fff; }
  body.printing .app, body.printing .toast, body.printing .modal-overlay, body.printing .sidebar-overlay { display: none !important; }
  body.printing #print-root { display: block; }

  .p-cover { text-align: center; padding: 30mm 0 12mm; }
  .p-brand { font-family: var(--font); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: #8a8781; margin-bottom: 14px; }
  .p-names { font-family: var(--font-display); font-style: italic; font-size: 40px; }
  .p-amp { color: #b98f96; }
  .p-date { font-size: 13px; color: #6b6862; margin-top: 8px; }

  .p-section { page-break-before: always; padding-top: 4mm; }
  .p-section.first { page-break-before: avoid; }
  .p-h2 { font-family: var(--font-display); font-weight: 400; font-size: 22px; border-bottom: 1.5px solid #1c1b1a; padding-bottom: 5px; margin: 0 0 12px; }
  .p-h3 { font-family: var(--font-display); font-weight: 400; font-size: 16px; margin: 14px 0 6px; }
  .p-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #8a8781; margin: 14px 0 5px; font-weight: 500; }
  .p-empty { color: #8a8781; font-size: 12px; }

  .p-tbl { width: 100%; border-collapse: collapse; font-size: 10.5px; page-break-inside: auto; }
  .p-tbl th { text-align: left; font-weight: 600; font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em; color: #6b6862; border-bottom: 1px solid #1c1b1a; padding: 3px 6px 3px 0; }
  .p-tbl td { border-bottom: .5pt solid #d8d5d0; padding: 4px 6px 4px 0; vertical-align: top; }
  .p-tbl tr { page-break-inside: avoid; }

  .p-kv { border-collapse: collapse; font-size: 12px; margin-bottom: 4px; }
  .p-kv td { padding: 3px 14px 3px 0; vertical-align: top; }
  .p-kv td.k { color: #6b6862; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; padding-top: 5px; }

  .p-colors { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
  .p-dot { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: .5pt solid #ccc; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .p-hex { font-size: 9.5px; color: #8a8781; margin-right: 10px; }

  .p-seat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6mm; }
  .p-seat { page-break-inside: avoid; }
  .p-seat ol { margin: 2px 0 0 18px; padding: 0; font-size: 11px; }

  .p-foot { margin-top: 10mm; text-align: center; font-size: 9.5px; color: #a3a09a; }
}
