/* ==========================================================================
   Yugara — design tokens + app (dashboard, auth, landing)
   Colour psychology:
     Ivory / cream  → purity, calm, new beginnings
     Champagne gold → prosperity, auspiciousness (nakath, pirith, pahana)
     Lotus pink     → love, tenderness, harmony
     Deep rose      → passion, commitment (used sparingly for emphasis)
     Warm ink       → elegance, depth (opening screen / royal theme)
     Sage           → growth & reassurance (success states)
   ========================================================================== */
:root {
  --ivory: #FBF7F0;
  --cream: #F5ECDF;
  --sand: #EADCC6;
  --gold: #B8893B;
  --gold-deep: #8C6524;
  --gold-soft: #E9D7AE;
  --lotus: #EBBAC4;
  --lotus-soft: #F8E4E8;
  --rose: #B4566F;
  --ink: #221812;
  --ink-2: #352820;
  --text: #3A2E26;
  --muted: #8B7B6C;
  --sage: #6F8F76;
  --sage-soft: #E5EEE6;
  --danger: #B54A4A;
  --line: rgba(184, 137, 59, .22);
  --card: #FFFFFF;
  --shadow: 0 10px 30px -12px rgba(92, 64, 30, .25);
  --shadow-sm: 0 2px 10px -4px rgba(92, 64, 30, .18);
  --radius: 18px;
  --font-ui: "Inter", "Noto Sans Sinhala", system-ui, sans-serif;
  --font-display: "Cormorant Garamond", "Abhaya Libre", "Noto Serif Sinhala", serif;
  --font-script: "Great Vibes", "Abhaya Libre", cursive;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font-ui); color: var(--text);
  background: var(--ivory); line-height: 1.55; font-size: 15px;
}
:lang(si) body, body:lang(si) { line-height: 1.7; }
img { max-width: 100%; display: block; }
a { color: var(--gold-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; color: var(--ink-2); line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Icons ---------- */
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .7em 1.25em; border-radius: 999px; border: 1px solid transparent;
  font: 500 .95rem var(--font-ui); cursor: pointer; text-decoration: none !important;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-gold {
  background: linear-gradient(135deg, #C99A4A, var(--gold) 45%, var(--gold-deep));
  color: #fff; box-shadow: 0 6px 18px -8px rgba(140, 101, 36, .8);
}
.btn-gold:hover { box-shadow: 0 10px 24px -8px rgba(140, 101, 36, .9); }
.btn-ghost { background: #fff; color: var(--gold-deep); border-color: var(--line); }
.btn-ghost:hover { background: var(--cream); }
.btn-wa { background: #25D366; color: #fff; }
.btn-danger { background: #fff; color: var(--danger); border-color: rgba(181, 74, 74, .3); }
.btn-sm { padding: .4em .85em; font-size: .82rem; }
.btn-block { width: 100%; }
.btn-icon { padding: .5em; border-radius: 12px; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 500; font-size: .88rem; margin-bottom: .35em; color: var(--ink-2); }
.input, select, textarea {
  width: 100%; padding: .72em .9em; border-radius: 12px; border: 1px solid var(--sand);
  background: #fff; font: inherit; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184, 137, 59, .15); }
textarea { min-height: 110px; resize: vertical; }
.field { margin-bottom: 1rem; }
.hint { font-size: .78rem; color: var(--muted); margin-top: .3em; }
.error { font-size: .8rem; color: var(--danger); margin-top: .3em; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1rem; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.check { display: flex; gap: .6em; align-items: flex-start; font-weight: 400; }
.check input { margin-top: .3em; accent-color: var(--gold); }

/* Segmented choice (bride / groom, theme, etc.) */
.choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .6rem; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label {
  display: flex; flex-direction: column; align-items: center; gap: .35em; margin: 0;
  padding: .9em .6em; border-radius: 14px; border: 1.5px solid var(--sand); background: #fff;
  cursor: pointer; text-align: center; transition: all .15s;
}
.choice input:checked + label { border-color: var(--gold); background: var(--cream); box-shadow: var(--shadow-sm); }
.choice input:focus-visible + label { outline: 2px solid var(--gold); }
.swatch { width: 100%; height: 38px; border-radius: 10px; border: 1px solid var(--line); }
.swatch.lotus { background: linear-gradient(135deg, #FBF7F0, #F8E4E8 60%, #E9D7AE); }
.swatch.royal { background: linear-gradient(135deg, #221812, #3A2C22 60%, #B8893B); }
.swatch.blush { background: linear-gradient(135deg, #FCEFF1, #EBBAC4 60%, #B4566F); }

/* ---------- Alerts ---------- */
.alert { padding: .85em 1.1em; border-radius: 14px; margin-bottom: 1rem; font-size: .92rem; }
.alert-ok { background: var(--sage-soft); color: #3F6147; border: 1px solid #CADBCD; }
.alert-err { background: #FBEAEA; color: #8E3434; border: 1px solid #F0CDCD; }
.alert ul { margin: 0; padding-left: 1.1em; }

/* ---------- Cards ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--line); padding: 1.4rem; }
.card + .card { margin-top: 1.2rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.ornament { display: flex; align-items: center; gap: .8rem; color: var(--gold); margin: .3rem 0 1rem; }
.ornament::before, .ornament::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-soft), transparent); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .3em; padding: .2em .65em; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.badge-pending { background: #F4EEE4; color: #8B7B6C; }
.badge-attending { background: var(--sage-soft); color: #3F6147; }
.badge-declined { background: #F8E7E9; color: var(--rose); }
.badge-gold { background: var(--cream); color: var(--gold-deep); }

/* ==========================================================================
   App shell (dashboard)
   ========================================================================== */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 1.6rem 1.1rem;
  background: linear-gradient(180deg, var(--ink) 0%, #2C2019 100%); color: #EADCC6;
  display: flex; flex-direction: column; gap: 1.6rem;
}
.brand { display: flex; align-items: center; gap: .6rem; color: #fff !important; text-decoration: none !important; }
.brand-mark { width: 46px; height: 39px; flex: none; }
.brand-name { font-family: "Cormorant Garamond", serif; font-size: 1.45rem; font-weight: 600; letter-spacing: .22em; line-height: 1; padding-left: .7rem; border-left: 1px solid rgba(217, 178, 106, .35); }
.brand-name small { display: block; font: 600 .82rem "Abhaya Libre", serif; color: var(--gold-soft); letter-spacing: .04em; margin-top: 4px; }
.nav { display: flex; flex-direction: column; gap: .25rem; }
.nav a {
  display: flex; align-items: center; gap: .75rem; padding: .7rem .9rem; border-radius: 12px;
  color: #D9C9B2; text-decoration: none; font-size: .93rem; transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active { background: linear-gradient(135deg, rgba(201, 154, 74, .28), rgba(184, 137, 59, .12)); color: #fff; box-shadow: inset 0 0 0 1px rgba(233, 215, 174, .2); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: .6rem; }
.lang-switch { display: inline-flex; background: rgba(255, 255, 255, .08); border-radius: 999px; padding: 3px; }
.lang-switch a { padding: .3em .9em; border-radius: 999px; color: #D9C9B2; font-size: .82rem; text-decoration: none !important; }
.lang-switch a.on { background: var(--gold); color: #fff; }
.light .lang-switch { background: #fff; border: 1px solid var(--line); }
.light .lang-switch a { color: var(--muted); }
.light .lang-switch a.on { color: #fff; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: #BFAE97; cursor: pointer; display: flex; align-items: center; gap: .6rem; }
.linkish:hover { color: #fff; }

.main { padding: 2rem clamp(1rem, 3vw, 2.5rem) 3rem; max-width: 1180px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { margin: 0; }
.topbar { display: none; }

/* Mobile: top bar + bottom tab bar */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar {
    display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 30;
    padding: .7rem 1rem; background: rgba(34, 24, 18, .96); backdrop-filter: blur(8px);
  }
  .topbar .brand-name { font-size: 1.1rem; }
  .topbar .brand-mark { width: 36px; height: 30px; }
  .main { padding-bottom: 6.5rem; }
  .tabbar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr);
    background: #fff; border-top: 1px solid var(--line); padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 24px -12px rgba(92, 64, 30, .25);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .35rem 0; color: var(--muted); font-size: .66rem; text-decoration: none !important; text-align: center; line-height: 1.2; }
  .tabbar a .ic { width: 1.35em; height: 1.35em; }
  .tabbar a.active { color: var(--gold-deep); }
}
@media (min-width: 901px) { .tabbar { display: none; } }

/* ---------- Dashboard widgets ---------- */
.hero-panel {
  position: relative; overflow: hidden; border-radius: 24px; padding: clamp(1.4rem, 3vw, 2.2rem);
  background: radial-gradient(120% 140% at 100% 0%, #F8E4E8 0%, transparent 55%), linear-gradient(135deg, #FFFDF9, var(--cream));
  border: 1px solid var(--line); box-shadow: var(--shadow); margin-bottom: 1.4rem;
  display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: center;
}
.hero-panel .names { font-family: var(--font-script); font-size: clamp(2rem, 5vw, 3rem); color: var(--gold-deep); line-height: 1.1; }
:lang(si) .hero-panel .names { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.6rem, 4vw, 2.3rem); }
.hero-panel .lotus-bg { position: absolute; right: -30px; bottom: -40px; width: 260px; opacity: .25; pointer-events: none; }
.days-pill { text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 1rem 1.4rem; box-shadow: var(--shadow-sm); position: relative; }
.days-pill strong { display: block; font-family: var(--font-display); font-size: 2.6rem; color: var(--gold-deep); line-height: 1; }
@media (max-width: 640px) { .hero-panel { grid-template-columns: 1fr; } .days-pill { justify-self: start; } }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .9rem; margin-bottom: 1.4rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.1rem; box-shadow: var(--shadow-sm); }
.stat .num { font-family: var(--font-display); font-size: 2rem; font-weight: 600; color: var(--ink-2); line-height: 1.1; }
.stat .lbl { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: .4em; }
.stat .dot { width: 8px; height: 8px; border-radius: 50%; }
.progress { height: 8px; border-radius: 999px; background: var(--cream); overflow: hidden; display: flex; margin-top: .6rem; }
.progress span { display: block; height: 100%; }

.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.2rem; align-items: start; }
@media (max-width: 1000px) { .two-col { grid-template-columns: 1fr; } }

.copy-row { display: flex; gap: .5rem; }
.copy-row .input { font-size: .85rem; background: var(--ivory); }
@media (max-width: 480px) { .copy-row { flex-direction: column; } }
.code-box { font-family: ui-monospace, monospace; font-size: 1.6rem; letter-spacing: .3em; color: var(--gold-deep); background: var(--cream); border: 1px dashed var(--gold); padding: .4em .8em; border-radius: 12px; display: inline-block; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--lotus-soft); color: var(--rose); font-weight: 600; flex: none; }

.actions-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; }
.action-tile { display: flex; flex-direction: column; gap: .4rem; padding: 1rem; border-radius: 14px; background: var(--ivory); border: 1px solid var(--line); color: var(--ink-2); text-decoration: none !important; font-size: .9rem; transition: transform .15s, box-shadow .15s; }
.action-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.action-tile .ic { color: var(--gold); width: 1.5em; height: 1.5em; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; font-weight: 600; font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: .7rem .6rem; border-bottom: 1px solid var(--line); }
.tbl td { padding: .75rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: #FFFCF7; }
.row-actions { display: flex; gap: .35rem; justify-content: flex-end; flex-wrap: wrap; }

/* Mobile: table → cards */
@media (max-width: 760px) {
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: .8rem; padding: .6rem .9rem; }
  .tbl td { border: 0; padding: .3rem 0; display: flex; justify-content: space-between; gap: 1rem; }
  .tbl td::before { content: attr(data-label); color: var(--muted); font-size: .78rem; }
  .tbl td.cell-main::before { display: none; }
  .row-actions { justify-content: flex-start; }
}

.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar .input, .toolbar select { width: auto; flex: 1 1 160px; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { padding: .35em .9em; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: .82rem; color: var(--muted); text-decoration: none !important; }
.chip.on { background: var(--ink-2); color: #fff; border-color: var(--ink-2); }

/* ---------- Modal (native <dialog>) ---------- */
dialog.modal { border: 0; border-radius: 22px; padding: 0; width: min(560px, 94vw); box-shadow: 0 30px 60px -20px rgba(34, 24, 18, .5); }
dialog.modal::backdrop { background: rgba(34, 24, 18, .5); backdrop-filter: blur(3px); }
.modal-body { padding: 1.5rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: .6rem; margin-top: .5rem; }

/* ---------- Plan editor ---------- */
.plan-item { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; padding: 1rem; border: 1px solid var(--line); border-radius: 16px; background: #fff; margin-bottom: .7rem; }
.plan-icon { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--cream); color: var(--gold-deep); }
.plan-icon .ic { width: 22px; height: 22px; }
.time-badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: .15em .7em; border-radius: 999px; background: linear-gradient(135deg, #C99A4A, var(--gold-deep)); color: #fff; }
@media (max-width: 560px) { .plan-item { grid-template-columns: auto 1fr; } .plan-item .row-actions { grid-column: 1 / -1; } }
.icon-pick { grid-template-columns: repeat(5, 1fr); }
.icon-pick label { padding: .6em; }
.icon-pick .ic { width: 22px; height: 22px; color: var(--gold-deep); }

.photo-prev { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); margin-bottom: .6rem; background: var(--cream); }
.sticky-save { position: sticky; bottom: 0; z-index: 5; background: linear-gradient(180deg, transparent, var(--ivory) 30%); padding: 1rem 0 .5rem; display: flex; justify-content: flex-end; gap: .6rem; }
@media (max-width: 900px) { .sticky-save { bottom: 64px; } }

/* ==========================================================================
   Auth + landing (light, ornamental)
   ========================================================================== */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art {
  position: relative; overflow: hidden; color: #F5ECDF; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(80% 60% at 50% 110%, rgba(235, 186, 196, .35), transparent 70%), linear-gradient(160deg, var(--ink) 10%, #3A2A20 100%);
}
.auth-art h2 { color: #fff; font-size: clamp(1.8rem, 3vw, 2.6rem); max-width: 14em; }
.auth-art .lotus-big { width: min(380px, 80%); margin: 0 auto; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .35)); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 2rem 1.2rem; }
.auth-card { width: 100%; max-width: 440px; }
.auth-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-art { padding: 1.4rem; min-height: auto; }
  .auth-art h2, .auth-art .lotus-big, .auth-art p { display: none; }
}

/* Landing */
.landing-nav { display: flex; justify-content: space-between; align-items: center; padding: 1rem clamp(1rem, 4vw, 3rem); position: absolute; top: 0; left: 0; right: 0; z-index: 5; }
.landing-hero {
  position: relative; min-height: 92vh; display: grid; place-items: center; text-align: center; overflow: hidden; color: #F5ECDF;
  padding: 7rem 1.2rem 4rem;
  background: radial-gradient(60% 50% at 50% 100%, rgba(235, 186, 196, .28), transparent 70%), radial-gradient(40% 40% at 50% 30%, rgba(184, 137, 59, .18), transparent 70%), var(--ink);
}
.landing-hero h1 { color: #fff; font-size: clamp(2.1rem, 6vw, 4rem); max-width: 15em; margin: 1rem auto .6rem; }
.landing-hero p { max-width: 40em; margin: 0 auto 2rem; color: #D9C9B2; font-size: 1.05rem; }
.landing-hero .lotus-big { width: 170px; margin: 0 auto; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.2rem; max-width: 1100px; margin: -3rem auto 4rem; padding: 0 1.2rem; position: relative; z-index: 2; }
.feature { background: #fff; border-radius: 20px; padding: 1.5rem; border: 1px solid var(--line); box-shadow: var(--shadow); }
.feature .ic { width: 2rem; height: 2rem; color: var(--gold); margin-bottom: .6rem; }
.landing-foot { text-align: center; padding: 2rem 1rem 3rem; color: var(--muted); font-size: .85rem; }

/* Pagination (partials/pagination.blade.php) */
.pager { margin-top: 1rem; }
.pagination { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; padding: 0; margin: 0; }
.pagination li > * { display: inline-block; min-width: 2.2em; text-align: center; padding: .35em .7em; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: .85rem; }
.pagination li.active > * { background: var(--gold); color: #fff; border-color: var(--gold); }
.pagination li.disabled > * { opacity: .45; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); background: var(--ink-2); color: #fff; padding: .6em 1.2em; border-radius: 999px; font-size: .88rem; opacity: 0; transition: all .25s; z-index: 100; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 480px) {
  .landing-nav { padding: .8rem; }
  .landing-nav .brand-mark { width: 36px; height: 30px; }
  .landing-nav .brand-name { font-size: 1.1rem; }
  .landing-nav .btn-sm { padding: .4em .6em; font-size: .78rem; }
}

/* ==========================================================================
   v2 additions: shell, admin, marketplace, designer, billing
   ========================================================================== */
.side-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 0; background: rgba(255, 255, 255, .06); color: #EADCC6; cursor: pointer; position: relative; text-decoration: none !important; }
.icon-btn:hover { background: rgba(255, 255, 255, .12); }
.icon-btn .ic { width: 22px; height: 22px; }
.dot-count { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--rose); color: #fff; font-size: .65rem; font-weight: 700; display: grid; place-items: center; }
.role-chip { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-soft); background: rgba(255, 255, 255, .06); padding: .3rem .7rem; border-radius: 999px; align-self: flex-start; }
.nav-group { font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: #8D7B66; margin: .9rem .9rem .25rem; }
.sidebar { overflow-y: auto; }
.is-admin .sidebar { background: linear-gradient(180deg, #1A1411, #241B15); }
.nav-scrim { display: none; }
@media (max-width: 900px) {
  .topbar { gap: .5rem; }
  .sidebar { display: flex; position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); z-index: 60; transform: translateX(-105%); transition: transform .25s ease; }
  body.nav-open .sidebar { transform: none; box-shadow: 20px 0 40px rgba(0, 0, 0, .35); }
  body.nav-open .nav-scrim { display: block; position: fixed; inset: 0; background: rgba(20, 14, 10, .45); z-index: 55; }
  .tabbar { grid-template-columns: repeat(5, 1fr); }
  .desk-only { display: none; }
}
.small { font-size: .82rem; }
.mono { font-family: ui-monospace, monospace; font-size: .85em; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.flex { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 1rem; } .mb-0 { margin-bottom: 0; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width: 900px) { .grid-4 { grid-template-columns: 1fr 1fr; } }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.1rem; }
.kpi .num { font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; color: var(--ink-2); line-height: 1.1; }
.kpi .lbl { font-size: .78rem; color: var(--muted); }
.kpi .sub { font-size: .75rem; color: var(--sage); margin-top: .2rem; }
.kpi.warn .num { color: var(--rose); }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 70px; }
.spark span { flex: 1; background: linear-gradient(180deg, var(--gold), var(--gold-deep)); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.badge-paid, .badge-approved, .badge-active, .badge-completed, .badge-delivered, .badge-read, .badge-accepted { background: var(--sage-soft); color: #3F6147; }
.badge-failed, .badge-rejected, .badge-suspended, .badge-expired, .badge-cancelled, .badge-chargedback, .badge-declined_by_merchant, .badge-declined_by_couple { background: #F8E7E9; color: var(--rose); }
.badge-refunded, .badge-trial, .badge-quoted, .badge-sent, .badge-sending, .badge-new { background: #E6EEF8; color: #4A6FA5; }
.badge-past_due, .badge-queued, .badge-skipped, .badge-draft, .badge-pending { background: #F4EEE4; color: #8B7B6C; }
.lock-note { display: flex; gap: .8rem; align-items: center; padding: .9rem 1rem; border-radius: 14px; background: linear-gradient(135deg, #FFF9EF, #FDF2F4); border: 1px dashed var(--gold); margin-bottom: 1rem; }
.lock-note .ic { color: var(--gold-deep); width: 1.6em; height: 1.6em; flex: none; }
.tbl td .row-actions form { display: inline; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.filters .input, .filters select { width: auto; min-width: 140px; }
dl.kv { display: grid; grid-template-columns: 160px 1fr; gap: .45rem 1rem; margin: 0; font-size: .9rem; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }
@media (max-width: 600px) { dl.kv { grid-template-columns: 1fr; } dl.kv dt { margin-top: .4rem; } }
pre.json { background: var(--ink); color: #EADCC6; padding: .9rem; border-radius: 12px; font-size: .78rem; overflow: auto; max-height: 320px; }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.plan { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 1.4rem 1.2rem; display: flex; flex-direction: column; gap: .6rem; position: relative; }
.plan.featured { border: 2px solid var(--gold); box-shadow: var(--shadow); }
.plan.current { outline: 3px solid var(--sage-soft); }
.plan .ribbon { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); background: var(--gold); color: #fff; font-size: .7rem; font-weight: 700; padding: .2rem .8rem; border-radius: 999px; white-space: nowrap; }
.plan .price { font-family: var(--font-display); font-size: 2rem; font-weight: 600; color: var(--gold-deep); line-height: 1; }
.plan .price s { font-size: 1rem; color: var(--muted); margin-left: .3rem; }
.plan ul { list-style: none; padding: 0; margin: 0; font-size: .88rem; display: grid; gap: .35rem; flex: 1; }
.plan li { display: flex; gap: .45rem; align-items: flex-start; }
.plan li .ic { color: var(--sage); flex: none; margin-top: .15rem; }
.plan li.off { color: #B9AA9A; text-decoration: line-through; }
.plan li.off .ic { color: #D5C9BB; }

/* Marketplace */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .9rem; }
.cat-tile { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 1.1rem; text-decoration: none !important; color: var(--ink-2); display: flex; flex-direction: column; gap: .2rem; transition: transform .15s, box-shadow .15s; }
.cat-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.cat-tile .emo { font-size: 1.8rem; }
.cat-tile.teaser { opacity: .75; background: repeating-linear-gradient(135deg, #fff, #fff 10px, #FBF7F0 10px, #FBF7F0 20px); }
.vendor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.vendor { background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; text-decoration: none !important; color: var(--text); display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.vendor:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.vendor .cover { height: 130px; background: linear-gradient(135deg, var(--cream), var(--lotus-soft)) center/cover; position: relative; }
.vendor .logo { position: absolute; left: 1rem; bottom: -22px; width: 48px; height: 48px; border-radius: 12px; background: #fff center/cover; border: 2px solid #fff; box-shadow: var(--shadow-sm); display: grid; place-items: center; font-weight: 700; color: var(--gold-deep); }
.vendor .body { padding: 1.7rem 1rem 1rem; display: grid; gap: .25rem; }
.vendor h3 { margin: 0; font-size: 1.15rem; }
.stars { color: var(--gold); letter-spacing: .05em; }
.pill-recommended { position: absolute; right: .7rem; top: .7rem; background: rgba(34, 24, 18, .8); color: #F2DFB8; font-size: .68rem; padding: .2rem .6rem; border-radius: 999px; }
.mhero { border-radius: 22px; overflow: hidden; background: linear-gradient(135deg, var(--cream), var(--lotus-soft)) center/cover; min-height: 200px; position: relative; margin-bottom: 1.2rem; }
.mhero .over { position: absolute; inset: auto 0 0 0; padding: 1.2rem; background: linear-gradient(transparent, rgba(20, 14, 10, .75)); color: #fff; }
.mhero .over h1 { color: #fff; margin: 0; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .5rem; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }

/* Card designer */
.designer { display: grid; grid-template-columns: minmax(300px, 440px) 1fr; gap: 1.4rem; align-items: start; }
@media (max-width: 1000px) { .designer { grid-template-columns: 1fr; } }
.designer-preview { position: sticky; top: 1rem; background: #E9E2D8; border-radius: 20px; padding: 1rem; display: grid; place-items: center; overflow: hidden; }
@media (max-width: 1000px) { .designer-preview { position: static; } }
.designer-preview .pcard { margin: 0; box-shadow: 0 16px 40px -18px rgba(0, 0, 0, .4); }
.tabs { display: flex; gap: .3rem; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin-bottom: 1rem; overflow-x: auto; }
.tabs button { flex: 1; border: 0; background: none; padding: .55rem .9rem; border-radius: 999px; font: 500 .88rem var(--font-ui); color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button.on { background: var(--ink-2); color: #fff; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.tpl-opt { position: relative; border: 2px solid transparent; border-radius: 14px; background: #fff; padding: .5rem; cursor: pointer; text-align: center; font: 500 .82rem var(--font-ui); color: var(--ink-2); }
.tpl-opt.on { border-color: var(--gold); box-shadow: var(--shadow-sm); }
.tpl-opt .thumb { height: 190px; overflow: hidden; border-radius: 8px; display: grid; place-items: start center; margin-bottom: .4rem; background: #EFE8DE; }
.tpl-opt .thumb .pcard { zoom: .3; margin: 0; box-shadow: none; }
.tpl-opt .lock { position: absolute; top: .6rem; right: .6rem; background: rgba(34, 24, 18, .8); color: #F2DFB8; border-radius: 999px; padding: .15rem .5rem; font-size: .68rem; display: flex; gap: .2rem; align-items: center; }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
.swatches label { font-size: .75rem; }
.swatches input[type=color] { width: 100%; height: 42px; border: 1px solid var(--sand); border-radius: 10px; padding: 3px; background: #fff; }
.art-stage { position: relative; width: 100%; max-width: 420px; aspect-ratio: 148 / 210; margin: 0 auto; background: #fff center/cover no-repeat; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); touch-action: none; }
.art-stage .drag { position: absolute; transform: translate(-50%, -50%); cursor: grab; border: 1.5px dashed var(--gold); background: rgba(255, 255, 255, .55); border-radius: 8px; padding: .2rem .5rem; user-select: none; white-space: nowrap; font-family: var(--font-display); font-style: italic; font-weight: 600; }
.art-stage .drag.qr { aspect-ratio: 1; display: grid; place-items: center; font: 600 .7rem var(--font-ui); font-style: normal; padding: 0; }
.art-stage .drag:active { cursor: grabbing; }
.art-empty { display: grid; place-items: center; height: 100%; color: var(--muted); text-align: center; padding: 1rem; font-size: .9rem; }

/* One-by-one sender */
.sendbox { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; background: linear-gradient(135deg, #fff, #F2FBF4); border: 1px solid #CDE7D3; border-radius: 20px; padding: 1.2rem; }
.sendbox .who { font-family: var(--font-display); font-size: 1.6rem; color: var(--ink-2); }
@media (max-width: 600px) { .sendbox { grid-template-columns: 1fr; } }
.progress-lg { height: 12px; }
.wa-bubble { background: #E7FFDB; border-radius: 4px 14px 14px 14px; padding: .8rem 1rem; max-width: 420px; font-size: .9rem; white-space: pre-line; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); }
.wa-bubble img { border-radius: 8px; margin-bottom: .5rem; max-height: 180px; object-fit: cover; width: 100%; }
.wa-bubble .btnlink { display: block; text-align: center; color: #1F7AE0; border-top: 1px solid #CDE7C0; margin: .7rem -1rem -.8rem; padding: .6rem; font-weight: 600; }
.notif { display: flex; gap: .8rem; padding: .85rem 0; border-bottom: 1px solid var(--line); text-decoration: none !important; color: var(--text); }
.notif.unread { font-weight: 500; }
.notif.unread .avatar { background: var(--gold); color: #fff; }
.spinner { width: 46px; height: 46px; margin: 0 auto 1rem; border-radius: 50%; border: 4px solid var(--cream); border-top-color: var(--gold); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.logo-md { width: 110px; height: auto; display: block; margin: 0 auto; }

/* ── AI video page ───────────────────────────────────────────────── */
.vid-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: 1rem; flex-wrap: wrap; }
.vid-grid { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 1.6rem; align-items: start; }
@media (max-width: 760px) { .vid-grid { grid-template-columns: 1fr; } }
.vid-stage { position: relative; aspect-ratio: 9 / 16; border-radius: 18px; overflow: hidden; background: #120c09; box-shadow: 0 18px 40px -18px rgba(34, 24, 18, .5); container-type: inline-size; }
.vid-stage.landscape { aspect-ratio: 16 / 9; }
.vid-stage video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vid-text { position: absolute; left: 0; right: 0; padding: 0 1rem; text-align: center; color: var(--vt-color, #fff); font-family: var(--vt-font, "Great Vibes", cursive);
  text-shadow: 0 2px 14px rgba(0, 0, 0, .55); pointer-events: none; }
.vid-text .vt-title { font-size: clamp(1.4rem, 11cqi, 2.6rem); line-height: 1.1; }
.vid-text .vt-sub { font-family: "Cormorant Garamond", Georgia, serif; font-size: clamp(.75rem, 4.6cqi, 1.05rem); letter-spacing: .16em; text-transform: uppercase; margin-top: .3rem; }
.vid-text.pos-top { top: 9%; } .vid-text.pos-center { top: 50%; translate: 0 -50%; } .vid-text.pos-bottom { bottom: 12%; }
.vid-ai-tag { position: absolute; left: 10px; top: 10px; font: 600 .6rem/1 Inter, system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .85); background: rgba(0, 0, 0, .35); padding: .3rem .5rem; border-radius: 999px; }
.vid-working { display: flex; gap: 1.1rem; align-items: center; background: linear-gradient(135deg, #FFF9EF, #FDF2F4); }
.vid-spinner { width: 46px; height: 46px; flex: none; border-radius: 50%; border: 3px solid var(--gold-soft); border-top-color: var(--gold); animation: vidspin 1s linear infinite; }
@keyframes vidspin { to { transform: rotate(360deg); } }
.vid-step { display: flex; align-items: center; gap: .55rem; margin: 1.4rem 0 .8rem; font-size: 1.05rem; }
.vid-step span { width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; background: var(--ink-2); color: #fff; font-size: .85rem; }
.vid-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: .9rem; }
.vid-tpl { display: grid; gap: .3rem; cursor: pointer; position: relative; }
.vid-tpl input { position: absolute; opacity: 0; }
.vid-tpl-media { display: block; aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; background: #1b1410; border: 2px solid var(--line); transition: border-color .2s, box-shadow .2s; }
.vid-tpl-media.landscape { aspect-ratio: 16 / 9; }
.vid-tpl-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vid-tpl input:checked + .vid-tpl-media { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(184, 137, 59, .18); }
.vid-tpl input:focus-visible + .vid-tpl-media { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
.vid-tpl-name { font-weight: 600; font-size: .9rem; }
.face-drop { display: grid; place-items: center; aspect-ratio: 1; max-width: 260px; border-radius: 18px; border: 2px dashed var(--sand); background: #FFFCF7; cursor: pointer; overflow: hidden; text-align: center; }
.face-drop:hover { border-color: var(--gold); }
.face-drop img { width: 100%; height: 100%; object-fit: cover; }
.face-empty { display: grid; gap: .35rem; justify-items: center; padding: 1rem; color: var(--muted); }
.face-empty .ic { width: 2rem; height: 2rem; color: var(--gold); }
.face-empty strong { color: var(--text); }
.vid-tips { margin: .2rem 0 0; padding-left: 1.1rem; }
.chip-radio { position: relative; }
.chip-radio input { position: absolute; opacity: 0; }
.chip-radio span { display: inline-block; padding: .4em .95em; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: .85rem; cursor: pointer; }
.chip-radio input:checked + span { background: var(--ink-2); color: #fff; border-color: var(--ink-2); }
.chip-radio input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.adm-vid { width: 110px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 10px; background: #111; display: block; }
.adm-vid.landscape { width: 180px; aspect-ratio: 16 / 9; }
.adm-face { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); }
.adm-face.lg { width: 110px; height: 110px; display: block; margin-bottom: .5rem; }
