/* Wedibox admin — modern SaaS dashboard (Squarespace/Typeform-grade).
   Inter UI + Fraunces display, sidebar app shell, wedding-rose brand.
   Built in the fleet roadmaps idiom; class names match the PHP views. */
:root {
  --bg: #f8f6f4; --surface: #ffffff; --raised: #ffffff;
  --ink: #1c1a1d; --ink-2: #5a555c; --muted: #938e96;
  --line: #ece8ea; --line-2: #f4f1f3; --hover: #f6f3f5;
  --brand: #b9456b; --brand-ink: #1c1a1d;
  --green: #157f48; --green-bg: #e3f4ea; --amber: #976a16; --amber-bg: #f6eed8;
  --red: #c2362a; --red-bg: #fbe7e4;
  --radius: 12px; --radius-sm: 8px; --radius-xs: 6px; --radius-lg: 16px;
  --shadow-xs: 0 1px 2px rgba(28,26,29,.05);
  --shadow: 0 1px 2px rgba(28,26,29,.04), 0 2px 6px -2px rgba(28,26,29,.06);
  --shadow-md: 0 6px 16px -4px rgba(28,26,29,.12), 0 2px 6px -2px rgba(28,26,29,.06);
  --shadow-lg: 0 20px 48px -16px rgba(28,26,29,.22);
  --sidebar-w: 248px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Fraunces', Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14px;
  line-height: 1.55; letter-spacing: -.006em; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
h1,h2,h3,h4 { letter-spacing: -.02em; line-height: 1.2; font-weight: 650; color: var(--ink); margin: 0; }
h1 { font-family: var(--display); font-weight: 560; letter-spacing: -.01em; font-size: 26px; }
h3 { font-size: 15px; margin-bottom: 12px; }
h4 { font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.ta-r { text-align: right; }
.grow { flex: 1; }
hr { border: none; border-top: 1px solid var(--line); margin: 18px 0; }
code { font-family: ui-monospace,'SF Mono',Menlo,monospace; font-size: .84em; background: var(--line-2); padding: .14em .44em; border-radius: 5px; }
.ico { display: inline-block; vertical-align: -0.18em; flex: none; }
.stack { display: flex; flex-direction: column; gap: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; margin-bottom: 18px; }
@media (max-width: 720px) { .grid2, .cols2 { grid-template-columns: 1fr; } }

/* App shell */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line); padding: 12px; gap: 6px; }
.side-top { padding: 2px; }
.ws-switch { position: relative; display: flex; align-items: center; gap: 9px; padding: 8px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.ws-switch:hover { background: var(--hover); }
.ws-name { font-weight: 650; font-size: 13.5px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-chevron { color: var(--muted); display: flex; }
.ws-switch form { position: absolute; inset: 0; margin: 0; }
.ws-switch select { width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; }
.side-nav { display: flex; flex-direction: column; gap: 1px; margin-top: 6px; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px;
  color: var(--ink-2); font-weight: 500; font-size: 13.5px; transition: background .1s, color .1s; }
.side-nav a .ico { color: var(--muted); }
.side-nav a:hover { background: var(--hover); color: var(--ink); }
.side-nav a.active { background: color-mix(in srgb, var(--brand) 11%, transparent); color: var(--brand); font-weight: 600; }
.side-nav a.active .ico { color: var(--brand); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding-top: 8px; border-top: 1px solid var(--line-2); }
.side-link { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 500; font-size: 13px; }
.side-link .ico { color: var(--muted); }
.side-link:hover { background: var(--hover); color: var(--ink); }
.side-user { display: flex; align-items: center; gap: 8px; padding: 6px 8px; }
.side-email { flex: 1; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user form, .side-foot form { margin: 0; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.brand { font-family: var(--display); font-weight: 560; font-size: 17px; color: var(--ink); }
.canvas { min-width: 0; background: var(--bg); }
.inner { padding: 22px 40px 64px; max-width: 1040px; }

/* Page header */
.ph { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 4px 0 22px; }
.ph h1 { font-size: 25px; }
.ph-sub { color: var(--muted); font-size: 13.5px; margin: 4px 0 0; }
.ph-actions { display: flex; gap: 8px; align-items: center; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-family: var(--font);
  font-size: 13.5px; font-weight: 550; padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
  transition: background .12s, border-color .12s, box-shadow .12s, transform .04s; box-shadow: var(--shadow-xs); white-space: nowrap; }
.btn .ico { color: currentColor; opacity: .85; }
.btn:hover { border-color: #dcd6d9; background: #fdfcfc; }
.btn:active { transform: translateY(.5px); }
.btn.brand { background: var(--brand); color: #fff; border-color: transparent; box-shadow: 0 1px 2px color-mix(in srgb,var(--brand) 40%,transparent); }
.btn.brand:hover { filter: brightness(1.06); background: var(--brand); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--hover); }
.btn.danger, .danger { color: var(--red); }
.btn.danger:hover { background: var(--red-bg); border-color: var(--red); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; gap: 5px; }
.btn.lg { padding: 11px 18px; font-size: 14.5px; border-radius: var(--radius); }
.btn:disabled { opacity: .5; cursor: default; }
.ic { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: none; background: transparent; color: var(--muted); border-radius: 7px; cursor: pointer; }
.ic:hover { background: var(--hover); color: var(--ink); }
.ic.danger:hover { background: var(--red-bg); color: var(--red); }
form { margin: 0; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.card.flat { box-shadow: none; }

/* Forms */
label.field { display: block; margin-bottom: 0; }
.field > span { display: block; font-weight: 550; font-size: 12.5px; margin-bottom: 6px; color: var(--ink-2); }
input[type=text], input[type=email], input[type=url], input[type=search], input[type=password],
input[type=number], input[type=date], input[type=datetime-local], input[type=color], select, textarea {
  width: 100%; font-family: var(--font); font-size: 13.5px; color: var(--ink); padding: 9px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); outline: none;
  transition: border-color .12s, box-shadow .12s; box-shadow: var(--shadow-xs); }
input[type=color] { padding: 4px; height: 38px; }
input::placeholder, textarea::placeholder { color: #b3aeb4; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb,var(--brand) 16%,transparent); }
textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
.check { display: flex; align-items: center; gap: 9px; font-weight: 500; color: var(--ink); font-size: 13.5px; }
.check input { width: auto; }
.hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.row-form { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.row-form input, .row-form select { flex: 1; }
.ghost-input { border: none !important; box-shadow: none !important; background: transparent !important; padding: 2px 4px !important; font-weight: 600; }
.mini { margin-top: 6px; font-size: 12.5px; padding: 6px 9px !important; }
.num { max-width: 70px; }

/* Flash / status / avatar */
.flash { padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 13.5px; font-weight: 500; }
.flash.ok { background: var(--green-bg); color: var(--green); }
.flash.err { background: var(--red-bg); color: var(--red); }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 7px;
  color: var(--sc, var(--muted)); background: color-mix(in srgb, var(--sc, #888) 12%, transparent); }
.status .dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--sc, var(--muted)); }
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 650; font-size: 12px; flex: none; }

/* Share / QR card */
.share { display: flex; gap: 24px; align-items: center; }
.share-qr #qr { width: 132px; height: 132px; display: flex; align-items: center; justify-content: center; }
.share-qr #qr img, .share-qr #qr canvas { width: 132px !important; height: 132px !important; border-radius: 8px; }
.share-info { flex: 1; min-width: 0; }
.copy-row { display: flex; gap: 8px; margin: 10px 0; }
.copy-row input { font-family: ui-monospace, monospace; font-size: 12px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: 14px; margin-bottom: 18px; }
.stat { display: flex; flex-direction: column; gap: 3px; text-decoration: none; color: var(--ink); }
.stat-n { font-size: 26px; font-weight: 700; letter-spacing: -.03em; font-family: var(--display); }
.stat-l { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.meter { height: 6px; border-radius: 4px; background: var(--line-2); overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.checklist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.checklist li { display: flex; align-items: center; gap: 10px; color: var(--ink-2); }
.checklist .ico { color: var(--green); }

/* Sections table */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); font-weight: 600; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.sec-name { display: flex; align-items: center; gap: 8px; }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: .15s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: var(--shadow-xs); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::before { transform: translateX(16px); }

/* Lite rows / lists */
.lite-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.lite-row:last-child { border-bottom: none; }
.lite-row .muted.small { display: block; }
.house { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 12px; }
.house-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 6px; }
.house-head .ph-actions { margin-left: auto; }
.inline-att select { padding: 4px 8px; font-size: 12.5px; }

/* Photo wall */
.album-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.seg-item { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 550; color: var(--ink-2); }
.seg-item.active { background: var(--brand); color: #fff; border-color: transparent; }
.seg-item .cnt { opacity: .6; margin-left: 4px; }
.album-add { display: flex; gap: 6px; margin-left: auto; }
.album-add input { width: 140px; }
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 8px; }
.tile { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--line-2); }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile.hidden { opacity: .45; }
.tile .badge { position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,.6); color: #fff; border-radius: 6px; padding: 2px 4px; display: flex; }
.tile .flagdot { position: absolute; top: 6px; right: 6px; background: var(--amber); color: #fff; border-radius: 50%; padding: 3px; display: flex; }
.audiotile { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--brand); }
.tile-meta { position: absolute; bottom: 0; left: 0; right: 0; padding: 14px 8px 5px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.tile-actions { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 4px; background: rgba(20,16,20,.55); opacity: 0; transition: .12s; }
.tile:hover .tile-actions { opacity: 1; }
.tile-actions .ic { background: rgba(255,255,255,.92); color: #1c1a1d; width: 32px; height: 32px; }
.tile-actions .ic.danger:hover { background: var(--red); color: #fff; }

/* Guestbook admin */
.gb-row { display: flex; gap: 14px; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.gb-row:last-child { border-bottom: none; }
.gb-body p { margin: 6px 0; }
.gb-body audio { margin: 8px 0; width: 100%; max-width: 320px; }
.gb-actions { display: flex; gap: 6px; align-items: flex-start; }

/* Seating */
.tables-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 14px; }
.table-card { margin-bottom: 0; }
.seat-list { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 4px; }
.seat-list li { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 3px 0; border-bottom: 1px solid var(--line-2); }

/* Funds */
.fund-stat { margin: 8px 0 6px; font-size: 13.5px; color: var(--ink-2); }
.danger-card { border-color: var(--red-bg); }

/* Onboarding / login */
.onboard { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.onboard-card { max-width: 440px; width: 100%; padding: 34px; }
.onboard-card h1 { font-size: 26px; margin-bottom: 6px; }
.onboard-mark { width: 56px; height: 56px; border-radius: 16px; background: color-mix(in srgb,var(--brand) 14%,transparent); color: var(--brand); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.onboard-card .field, .onboard-card .stack { margin-top: 14px; text-align: left; }
.slug-row { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.slug-pre { padding: 9px 4px 9px 11px; color: var(--muted); font-size: 12.5px; white-space: nowrap; background: var(--line-2); }
.slug-row input { border: none !important; box-shadow: none !important; }

/* Plans / billing */
.plan { display: flex; flex-direction: column; gap: 8px; }
.plan-cur { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb,var(--brand) 22%,transparent); }
.plan .stat-n .per { font-size: 13px; color: var(--muted); font-weight: 500; }
.plan-feat { list-style: none; padding: 0; margin: 4px 0 10px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
.plan-feat li::before { content: "✓ "; color: var(--green); }

/* Legal pages */
.legal { max-width: 720px; margin: 0 auto; padding: 40px 22px 70px; }
.legal h1 { font-size: 28px; margin: 14px 0 6px; }
.legal h3 { margin-top: 22px; }
.legal p { color: var(--ink-2); }

/* Cookie notice */
#cookie-note { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 560px; margin: 0 auto;
  background: var(--ink); color: #fff; border-radius: 12px; padding: 12px 16px; display: flex; align-items: center;
  gap: 12px; font-size: 13px; box-shadow: var(--shadow-lg); z-index: 200; }
#cookie-note a { color: #fff; text-decoration: underline; }
#cookie-note button { margin-left: auto; background: #fff; color: var(--ink); border: none; border-radius: 7px; padding: 6px 12px; font-weight: 600; cursor: pointer; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--line); }
  .side-nav { flex-direction: row; flex-wrap: wrap; margin-top: 0; }
  .side-nav a span { display: none; }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; border: none; padding-top: 0; }
  .side-link span { display: none; }
  .inner { padding: 18px 18px 48px; }
  .share { flex-direction: column; align-items: flex-start; }
}
