/* ==========================================================================
   valdez15 — shared stylesheet
   ========================================================================== */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --border: #e2e5ea;
  --border-strong: #cfd4dc;
  --text: #16181d;
  --muted: #666d78;
  --accent: #2f6feb;
  --accent-hover: #2a62d0;
  --accent-ink: #ffffff;
  --danger: #c62a30;
  --danger-hover: #a81f25;
  --danger-soft: rgba(229, 72, 77, .12);
  --warn-bg: #fdf3e2;
  --warn-ink: #8a5a10;
  --danger-bg: #fdeceb;
  --danger-ink: #93231c;
  --notice-bg: #eaf2fd;
  --notice-ink: #1b4a91;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 20, 28, .06), 0 8px 24px rgba(16, 20, 28, .06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115;
    --surface: #171a20;
    --surface-2: #1e222a;
    --border: #262b34;
    --border-strong: #39404c;
    --text: #e8eaee;
    --muted: #99a1ad;
    --accent: #5b8dff;
    --accent-hover: #7aa2ff;
    --accent-ink: #0b1020;
    --danger: #ff9a9d;
    --danger-hover: #ffb4b6;
    --danger-soft: rgba(229, 72, 77, .16);
    --warn-bg: #3a2e16;
    --warn-ink: #f0c987;
    --danger-bg: #3a1c1a;
    --danger-ink: #ffb4ad;
    --notice-bg: #16243d;
    --notice-ink: #a8c8ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.ta-r { text-align: right; }

/* ==========================================================================
   Button system — every action is a box
   ========================================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px;
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2;
  border: 1px solid transparent; border-radius: 8px;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn--primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn--ghost {
  background: var(--surface); color: var(--text); border-color: var(--border-strong);
}
.btn--ghost:hover { background: var(--surface-2); border-color: var(--muted); }

.btn--danger {
  background: transparent; color: var(--danger); border-color: var(--border-strong);
}
.btn--danger:hover {
  background: var(--danger-soft); border-color: var(--danger); color: var(--danger-hover);
}

.btn--sm { padding: 6px 12px; font-size: 13px; border-radius: 7px; }
.btn--block { width: 100%; }

/* Forms that exist only to carry a single button + CSRF token. */
.inline-form { display: inline-block; margin: 0; }

/* Bare text button, used only for "Sign out" in the header. */
button.link {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--muted); font: inherit; font-size: 14px;
}
button.link:hover { color: var(--text); }

/* ==========================================================================
   Auth screens
   ========================================================================== */

.is-auth { display: grid; place-items: center; min-height: 100dvh; padding: 24px; }
.auth { width: 100%; max-width: 380px; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px;
}

.hero { text-align: center; margin-bottom: 20px; }
.hero__mark { font-size: 34px; display: block; line-height: 1; }
.hero h1 { font-size: 20px; margin: 10px 0 4px; letter-spacing: -.01em; }
.hero p { margin: 0; font-size: 13px; }
.code { font-size: 34px; margin: 0 0 4px; }
.foot { margin: 18px 0 0; text-align: center; font-size: 13px; }

.auth button[type="submit"] {
  width: 100%; margin-top: 20px; padding: 11px 14px;
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent);
  border-radius: 8px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}
.auth button[type="submit"]:hover { background: var(--accent-hover); }

/* ==========================================================================
   Form controls
   ========================================================================== */

label { display: block; font-size: 13px; font-weight: 600; margin: 0 0 6px; }
.auth label { margin: 14px 0 6px; }

input[type="text"], input[type="search"], input[type="number"],
input[type="email"], input[type="password"], input[type="tel"], select {
  width: 100%; padding: 9px 11px;
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 14.5px;
}
.auth input { background: var(--bg); padding: 10px 12px; font-size: 15px; }
input:focus, select:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent;
}
input::placeholder { color: var(--muted); opacity: .75; }

.form-grid {
  display: grid; gap: 16px; padding: 18px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.f { display: flex; flex-direction: column; min-width: 0; }
.f--wide { grid-column: 1 / -1; }
.f__hint { margin-top: 5px; font-size: 12.5px; color: var(--muted); }

.form-actions {
  flex-direction: row; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-top: 4px;
}

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 26px; }
.filters input[type="search"] { flex: 1 1 240px; width: auto; }
.filters select { width: auto; flex: 0 1 170px; }

/* ==========================================================================
   Alerts
   ========================================================================== */

.alert {
  padding: 11px 14px; border-radius: 9px; font-size: 13.5px; margin-bottom: 12px;
}
.alert--error { background: var(--danger-bg); color: var(--danger-ink); }
.alert--notice { background: var(--notice-bg); color: var(--notice-ink); }
.alert--warn { background: var(--warn-bg); color: var(--warn-ink); }

/* ==========================================================================
   Site chrome
   ========================================================================== */

.topbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar__in {
  max-width: 1040px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 22px;
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand__mark { font-size: 18px; }
.topbar nav { display: flex; align-items: center; flex: 1; font-size: 14px; min-width: 0; }
.topbar form { margin: 0; }

.crumb { color: var(--muted); }
.crumb--here { color: var(--text); font-weight: 600; }
.crumb__sep { color: var(--border-strong); margin: 0 8px; }

.wrap { max-width: 880px; margin: 0 auto; padding: 36px 20px 72px; }
.wrap--wide { max-width: 1040px; }
.wrap h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -.015em; }
.wrap > .muted { margin: 0 0 26px; font-size: 14px; }

.head-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 22px;
}
.head-row h1 { margin: 0 0 4px; }
.head-row p { margin: 0; font-size: 14px; }

.section-h { font-size: 15px; margin: 30px 0 14px; }
.hint { margin-top: 26px; font-size: 13px; }

/* ==========================================================================
   Launcher / section tiles
   ========================================================================== */

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

.tile {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 18px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  transition: border-color .12s ease, transform .12s ease, box-shadow .12s ease;
}
.tile:hover {
  text-decoration: none; border-color: var(--accent);
  transform: translateY(-1px); box-shadow: var(--shadow);
}
.tile__icon {
  flex: none; display: grid; place-items: center;
  width: 46px; height: 46px; font-size: 23px; border-radius: 11px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.tile__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tile__name { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 7px; }
.tile__tagline {
  font-size: 13px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tile--soon { opacity: .62; }
.tile--soon:hover { border-color: var(--border); transform: none; box-shadow: none; }
.tile__flag {
  position: absolute; top: 10px; right: 12px;
  font-size: 11px; font-weight: 600; letter-spacing: .03em;
  color: var(--muted); text-transform: uppercase;
}

.pill {
  display: inline-block; min-width: 20px; padding: 1px 7px;
  background: var(--accent); color: var(--accent-ink);
  border-radius: 999px; font-size: 11.5px; font-weight: 700; text-align: center;
}

/* ==========================================================================
   Sub-navigation
   ========================================================================== */

.subnav {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin-bottom: 26px; border-bottom: 1px solid var(--border);
}
.subnav__item {
  padding: 9px 15px; font-size: 14px; border-radius: 8px 8px 0 0;
  color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.subnav__item:hover { color: var(--text); text-decoration: none; background: var(--surface-2); }
.subnav__item.active { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.subnav__item.is-soon { opacity: .45; cursor: default; }

/* ==========================================================================
   Wedding hero + countdown
   ========================================================================== */

.wed-hero {
  text-align: center; padding: 34px 20px 30px; margin-bottom: 26px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.wed-hero__mark { font-size: 34px; display: block; line-height: 1; }
.wed-hero h1 { margin: 12px 0 0; font-size: 27px; font-weight: 600; letter-spacing: -.02em; }

.countdown__date { margin: 6px 0 18px; font-size: 14px; color: var(--muted); }
.countdown__units { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.cd {
  min-width: 74px; padding: 12px 8px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  display: flex; flex-direction: column; gap: 2px;
}
.cd b { font-size: 25px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cd i {
  font-style: normal; font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
}
.countdown__note { margin: 14px 0 0; font-size: 13px; }

/* ==========================================================================
   Stat strip
   ========================================================================== */

.strip {
  display: grid; gap: 10px; margin-bottom: 26px;
  grid-template-columns: repeat(auto-fit, minmax(115px, 1fr));
}
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 13px 15px;
  display: flex; flex-direction: column; gap: 2px;
}
.stat__v { font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
.stat__l { font-size: 12px; color: var(--muted); }

/* ==========================================================================
   Priority tiers
   ========================================================================== */

.tier { margin-bottom: 34px; }
.tier__h { display: flex; align-items: center; gap: 12px; font-size: 14px; margin: 0 0 4px; }
.tier__h .muted { font-weight: 400; font-size: 12.5px; }
.tier__hint { margin: 0 0 14px; font-size: 12.5px; }

.prio {
  display: inline-block; padding: 3px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.prio--1 { background: color-mix(in srgb, #e5484d 18%, transparent); color: #c62a30; }
.prio--2 { background: color-mix(in srgb, #2f6feb 16%, transparent); color: #2258c6; }
.prio--3 { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .prio--1 { color: #ff9a9d; }
  :root:not([data-theme="light"]) .prio--2 { color: #9dbcff; }
}

/* ==========================================================================
   Household cards
   ========================================================================== */

.hh-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.hh {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
}
.hh__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
}
.hh__title { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; min-width: 0; }
.hh__title h3 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.hh__meta { display: flex; gap: 6px; flex-wrap: wrap; }

.code-chip {
  display: inline-block; padding: 2px 8px;
  background: var(--surface-2); border: 1px dashed var(--border-strong);
  border-radius: 6px; font-size: 12px; letter-spacing: .08em; color: var(--muted);
}

.chip {
  display: inline-block; padding: 2px 9px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; font-size: 12px; color: var(--muted); white-space: nowrap;
}
.chip--seats { color: var(--text); font-weight: 600; }

.mems { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.mem { display: flex; align-items: baseline; gap: 8px; font-size: 14px; flex-wrap: wrap; }
.mem__name { font-weight: 500; }
.mem__rel { font-size: 12.5px; color: var(--muted); }
.mem--ghost { color: var(--muted); font-style: italic; font-size: 13px; }

.tag {
  display: inline-block; padding: 0 7px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; font-size: 11.5px; color: var(--muted); font-style: normal;
}

.hh__warn {
  margin: 0 0 12px; padding: 9px 12px;
  background: var(--warn-bg); color: var(--warn-ink);
  border-radius: 8px; font-size: 13px;
}
.hh__notes { margin: 0 0 12px; font-size: 13px; }

.hh__actions {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto;
  padding-top: 12px; border-top: 1px solid var(--border);
}

/* ==========================================================================
   Panels + tables
   ========================================================================== */

.panel-add, .panel-plain {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 20px;
}
.panel-add > summary {
  padding: 14px 18px; cursor: pointer; font-weight: 600; font-size: 14.5px;
  list-style: none; user-select: none;
}
.panel-add > summary::-webkit-details-marker { display: none; }
.panel-add > summary:hover { color: var(--accent); }
.panel-add[open] > summary { border-bottom: 1px solid var(--border); }

.tbl {
  width: 100%; border-collapse: collapse; margin-bottom: 20px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
}
.tbl th, .tbl td { text-align: left; padding: 11px 14px; font-size: 14px; vertical-align: middle; }
.tbl th {
  font-size: 11.5px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .04em; font-weight: 600; background: var(--surface-2);
}
.tbl tbody tr + tr td { border-top: 1px solid var(--border); }
.g-name { font-weight: 500; }
.row--ghost td { color: var(--muted); background: var(--surface-2); }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions > * + * { margin-left: 6px; }

.empty {
  text-align: center; padding: 48px 24px;
  background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius);
}
.empty p { margin: 0 0 10px; }
.empty p:last-child { margin: 18px 0 0; }

.danger-zone {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-top: 40px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-left: 3px solid var(--danger); border-radius: 10px;
}
.danger-zone p { margin: 4px 0 0; font-size: 13px; }

/* ==========================================================================
   Placeholder pages
   ========================================================================== */

.placeholder {
  text-align: center; padding: 56px 24px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.placeholder__icon { font-size: 42px; display: block; }
.placeholder h1 { margin: 14px 0 8px; }
.placeholder p { max-width: 42ch; margin: 0 auto 22px; font-size: 14px; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 640px) {
  .topbar__in { gap: 14px; }
  .wrap { padding: 26px 16px 56px; }
  .grid, .hh-grid { grid-template-columns: 1fr; }
  .cd { min-width: 66px; padding: 10px 6px; }
  .cd b { font-size: 21px; }
  .head-row { flex-direction: column; align-items: stretch; }
  .head-row .btn { align-self: flex-start; }
  .tbl th:nth-child(3), .tbl td:nth-child(3),
  .tbl th:nth-child(4), .tbl td:nth-child(4) { display: none; }
  .danger-zone { flex-direction: column; align-items: stretch; }
}
