/* ==========================================================================
   Jerald & Charisse Wedding Dashboard — the one shared design file.
   Every page uses this file, so the colors, fonts, cards, buttons and
   tables look the same everywhere.
   ========================================================================== */

/* ---------- 1. Colors, fonts and sizes (change them here, they change everywhere) ---------- */
:root {
  --cream: #FBF7EE;        /* page background */
  --cream-2: #F6F0E3;      /* table headers, soft fills */
  --white: #FFFFFF;        /* cards */
  --beige: #E8DCC8;        /* borders */
  --beige-soft: #F2EADC;   /* light lines */
  --taupe: #7D6F62;        /* secondary text */
  --taupe-light: #B3A79B;
  --ink: #4A4038;          /* main text */
  --sage: #9CAF88;         /* progress, accents */
  --sage-dark: #5F7454;    /* buttons, active menu */
  --sage-soft: #E7EDDF;
  --yellow: #F2DE8C;       /* pastel yellow */
  --yellow-soft: #FBF4D3;
  --yellow-ink: #85691A;
  --rose: #B4675B;         /* errors, delete */
  --rose-soft: #F7E4DF;

  --radius: 18px;
  --radius-sm: 11px;
  --shadow: 0 1px 2px rgba(74, 64, 56, .04), 0 8px 24px rgba(74, 64, 56, .06);
  --shadow-lg: 0 20px 50px rgba(74, 64, 56, .18);

  --font-title: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body: 'Nunito Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --sidebar-w: 256px;
}

/* ---------- 2. Basics ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
}
h1, h2, h3, h4 { font-family: var(--font-title); font-weight: 600; line-height: 1.15; margin: 0; color: var(--ink); }
p { margin: 0; }
a { color: var(--sage-dark); }
.icon { width: 20px; height: 20px; flex: none; }
.muted { color: var(--taupe); }
.hidden { display: none !important; }

/* ---------- 3. Sidebar menu ---------- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--beige);
  display: flex;
  flex-direction: column;
  padding: 26px 16px 20px;
  z-index: 40;
  overflow-y: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 22px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--beige-soft);
  color: inherit;
  text-decoration: none;
}
.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--yellow-soft);
  border: 1px solid var(--yellow);
  display: grid;
  place-items: center;
  font-family: var(--font-title);
  font-size: 17px;
  font-weight: 600;
  color: var(--sage-dark);
  flex: none;
}
.brand-name { font-family: var(--font-title); font-size: 21px; font-weight: 600; line-height: 1.1; }
.brand-sub { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--taupe); margin-top: 3px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--taupe);
  text-decoration: none;
  font-weight: 600;
  font-size: 14.5px;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--cream); color: var(--ink); }
.nav a.active { background: var(--sage-soft); color: var(--sage-dark); }
.nav .icon { width: 19px; height: 19px; }

.sidebar-foot { margin-top: auto; padding: 18px 8px 0; }
.mode-pill {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--yellow-soft);
  font-size: 12px;
  line-height: 1.4;
  color: var(--yellow-ink);
}
.mode-pill.online { background: var(--sage-soft); color: var(--sage-dark); }
.mode-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-top: 4px; flex: none; }
.mode-pill b { display: block; font-size: 12.5px; }

.signout { width: 100%; margin-top: 8px; justify-content: flex-start; }

/* Online mode: hide the page until we know someone is signed in */
.auth-pending .main { visibility: hidden; }

/* Phone top bar and dark backdrop (only shown on small screens) */
.topbar { display: none; }
.backdrop { display: none; }

/* ---------- 4. Page area ---------- */
.main {
  margin-left: var(--sidebar-w);
  padding: 34px 40px 56px;
  max-width: calc(1280px + var(--sidebar-w));
}
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}
.page-header h1 { font-size: 36px; }
.page-sub { color: var(--taupe); margin-top: 6px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.section { margin-top: 26px; }
.section-title { font-size: 24px; margin-bottom: 14px; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--sage-dark); }

/* ---------- 5. Cards and grids ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--beige-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-title { font-size: 23px; }
.card-sub { color: var(--taupe); font-size: 13.5px; margin-top: 2px; }

.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

/* Summary (number) cards */
.stat { display: flex; gap: 14px; align-items: flex-start; padding: 20px; }
.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--sage-soft);
  color: var(--sage-dark);
  flex: none;
}
.stat-icon.yellow { background: var(--yellow-soft); color: var(--yellow-ink); }
.stat-icon.beige { background: var(--beige-soft); color: var(--taupe); }
.stat-icon.rose { background: var(--rose-soft); color: var(--rose); }
.stat-label { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--taupe); }
.stat-value { font-family: var(--font-title); font-size: 30px; font-weight: 600; line-height: 1.1; margin-top: 4px; overflow-wrap: anywhere; }
.stat-note { font-size: 12.5px; color: var(--taupe); margin-top: 4px; }

/* ---------- 6. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn .icon { width: 17px; height: 17px; }
.btn-primary { background: var(--sage-dark); color: #fff; }
.btn-primary:hover { background: #526549; }
.btn-secondary { background: var(--white); border-color: var(--beige); color: var(--ink); }
.btn-secondary:hover { background: var(--cream); }
.btn-danger { background: var(--rose); color: #fff; }
.btn-danger:hover { background: #9f594e; }
.btn-ghost { background: transparent; color: var(--taupe); }
.btn-ghost:hover { background: var(--beige-soft); color: var(--ink); }
.btn-sm { min-height: 34px; padding: 0 14px; font-size: 13px; }
.icon-btn { width: 36px; min-height: 36px; padding: 0; border-radius: 50%; }
.icon-btn.danger:hover { background: var(--rose-soft); color: var(--rose); }

:focus-visible { outline: 3px solid rgba(95, 116, 84, .35); outline-offset: 2px; }

/* ---------- 7. Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > label { font-size: 13px; font-weight: 700; color: var(--ink); }
.field .req { color: var(--rose); }
.field .help { font-size: 12px; color: var(--taupe); }
.field .error { font-size: 12.5px; color: var(--rose); font-weight: 600; }
.input, .field input:not([type=checkbox]), .field select, .field textarea, .toolbar select {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--beige);
  border-radius: var(--radius-sm);
  background: var(--white);
  font: inherit;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 88px; padding: 11px 14px; resize: vertical; }
.field select, .toolbar select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%237D6F62' stroke-width='1.6'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.input:focus, .field input:focus, .field select:focus, .field textarea:focus, .toolbar select:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 3px var(--sage-soft);
}
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--rose); }
.input-prefix { position: relative; }
.input-prefix > span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--taupe); font-weight: 700; pointer-events: none; }
.field .input-prefix input { padding-left: 32px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--sage-dark); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ---------- 8. Search / filter bar ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar select { width: auto; min-width: 150px; }
.search { position: relative; flex: 1 1 240px; }
.search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--taupe); width: 18px; height: 18px; }
.search input { padding-left: 42px; }

/* ---------- 9. Tables ---------- */
.table-wrap {
  overflow-x: auto;
  background: var(--white);
  border: 1px solid var(--beige-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left;
  font-size: 11.5px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--taupe);
  font-weight: 700;
  background: var(--cream-2);
  padding: 13px 14px;
  white-space: nowrap;
}
.table td { padding: 13px 14px; border-top: 1px solid var(--beige-soft); vertical-align: middle; }
.table tbody tr:hover td { background: #FDFBF6; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; }
.table tfoot td { font-weight: 700; background: var(--cream-2); }

/* ---------- 10. Badges (status labels) ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--beige-soft);
  color: var(--taupe);
}
.badge.sage { background: var(--sage-soft); color: var(--sage-dark); }
.badge.yellow { background: var(--yellow-soft); color: var(--yellow-ink); }
.badge.rose { background: var(--rose-soft); color: var(--rose); }

/* ---------- 11. Progress bars ---------- */
.progress { height: 10px; background: var(--beige-soft); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--sage), var(--sage-dark)); transition: width .5s ease; }
.progress.yellow > span { background: linear-gradient(90deg, var(--yellow), #D9BE5C); }
.progress.rose > span { background: var(--rose); }

/* ---------- 12. Empty messages ---------- */
.empty { text-align: center; padding: 46px 20px; color: var(--taupe); }
.empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--yellow-soft);
  color: var(--yellow-ink);
}
.empty-icon .icon { width: 28px; height: 28px; }
.empty h3 { font-size: 24px; margin-bottom: 6px; }
.empty p { max-width: 440px; margin: 0 auto; }
.empty .btn { margin-top: 18px; }

/* ---------- 13. Pop-up windows (forms and confirmations) ---------- */
.modal {
  border: 0;
  padding: 0;
  border-radius: 22px;
  width: min(660px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  box-shadow: var(--shadow-lg);
  color: var(--ink);
  background: var(--white);
  overflow: hidden;
}
.modal.small { width: min(440px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(74, 64, 56, .38); backdrop-filter: blur(2px); }
.modal > form { display: flex; flex-direction: column; max-height: calc(100vh - 24px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--beige-soft); }
.modal-head h2 { font-size: 26px; }
.modal-body { padding: 22px 24px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--beige-soft); background: var(--cream); }
.confirm-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--rose-soft); color: var(--rose); margin-bottom: 14px; }
.confirm-icon.info { background: var(--yellow-soft); color: var(--yellow-ink); }

/* ---------- 14. Notifications (toasts) ---------- */
.toasts { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 260px;
  max-width: 380px;
  padding: 13px 16px;
  background: var(--white);
  border: 1px solid var(--beige);
  border-left: 5px solid var(--sage-dark);
  border-radius: 13px;
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  font-size: 14px;
  animation: toast-in .25s ease;
}
.toast .icon { color: var(--sage-dark); }
.toast.error { border-left-color: var(--rose); }
.toast.error .icon { color: var(--rose); }
.toast.info { border-left-color: #D9BE5C; }
.toast.info .icon { color: var(--yellow-ink); }
.toast.out { opacity: 0; transform: translateY(8px); transition: .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- 15. Dashboard welcome banner and countdown ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 34px;
  background:
    radial-gradient(circle at 0% 0%, var(--yellow-soft), transparent 55%),
    radial-gradient(circle at 100% 100%, var(--sage-soft), transparent 60%),
    var(--white);
}
.hero-names { font-size: 50px; margin: 6px 0 16px; }
.hero-names .amp { font-style: italic; color: var(--sage-dark); font-weight: 500; }
.hero-meta { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; color: var(--taupe); }
.hero-meta li { display: flex; gap: 10px; align-items: center; }
.hero-meta .icon { width: 18px; height: 18px; color: var(--sage-dark); }
.countdown { text-align: center; }
.countdown-label { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--taupe); font-weight: 700; margin-bottom: 12px; }
.countdown-boxes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.countdown-box { background: rgba(255, 255, 255, .8); border: 1px solid var(--beige); border-radius: 14px; padding: 14px 6px 10px; }
.countdown-box b { display: block; font-family: var(--font-title); font-size: 38px; line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums; }
.countdown-box span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--taupe); }
.countdown-msg { font-family: var(--font-title); font-size: 30px; }

/* ---------- 16. Sign-in page ---------- */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(circle at 10% 10%, var(--yellow-soft), transparent 45%),
    radial-gradient(circle at 90% 90%, var(--sage-soft), transparent 50%),
    var(--cream);
}
.login-card { width: min(420px, 100%); padding: 36px 32px; text-align: center; }
.login-card .brand-mark { width: 64px; height: 64px; font-size: 22px; margin: 0 auto 16px; }
.login-card h1 { font-size: 34px; }
.login-card .page-sub { margin-bottom: 24px; }
.login-card form { display: grid; gap: 16px; text-align: left; }
.login-card .btn { width: 100%; }
.login-error { background: var(--rose-soft); color: var(--rose); border-radius: var(--radius-sm); padding: 10px 14px; font-weight: 600; font-size: 13.5px; }
.login-note { margin-top: 18px; font-size: 12.5px; color: var(--taupe); }

/* ---------- 17. Tablets and phones ---------- */
@media (max-width: 1000px) {
  .sidebar { transform: translateX(-100%); visibility: hidden; transition: transform .25s ease, visibility .25s; }
  body.nav-open .sidebar { transform: none; visibility: visible; box-shadow: var(--shadow-lg); }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(74, 64, 56, .35); z-index: 30; }
  .topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 10px 16px;
    background: rgba(251, 247, 238, .94);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--beige-soft);
  }
  .topbar-title { font-family: var(--font-title); font-size: 21px; font-weight: 600; }
  .main { margin-left: 0; padding: 22px 16px 48px; }
  .hero { grid-template-columns: 1fr; padding: 26px 20px; }
}
@media (max-width: 640px) {
  .page-header h1 { font-size: 30px; }
  .hero-names { font-size: 40px; }
  .form-grid { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .countdown-box b { font-size: 30px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; }
  .toasts { left: 16px; right: 16px; bottom: 16px; }
  .toast { max-width: none; }
  .modal-foot .btn { flex: 1; }
}

/* ---------- 18. Printing ---------- */
@media print {
  .sidebar, .topbar, .backdrop, .toasts, .no-print, .page-actions, .toolbar, .actions { display: none !important; }
  body { background: #fff; font-size: 12px; }
  .main { margin: 0; padding: 0; max-width: none; }
  .card, .table-wrap { box-shadow: none; border-color: #ddd; break-inside: avoid; }
  .hero { background: #fff; }
}
