/* Razivite Dashboard — design system shared with razivite.com (same palette, type, radius,
   shadow and motion tokens). Operational first: dense where data is, calm everywhere else. */
:root {
  --cream: #FBF7F2;
  --warm: #F6EFE7;
  --blush: #F7EDE8;
  --sand: #EFE4D7;
  --rose: #D4857A;
  --rose-dark: #B86B5E;
  --rose-deep: #8B3A2A;
  --gold: #C9A96E;
  --gold-dark: #A07840;
  --brown: #2C2016;
  --brown-mid: #6B4C3B;
  --brown-light: #8E6E5E;
  --sage: #4A7A45;
  --sage-bg: rgba(143, 169, 138, .16);
  --navy: #2A3A52;
  --m-ink: #1E1822;
  --m-champagne: #E9C9A0;
  --m-glow: #E59A8C;
  --line: rgba(44, 32, 22, .09);
  --line-strong: rgba(44, 32, 22, .16);
  --card: #fff;
  --danger: #A33A2E;
  --danger-bg: rgba(163, 58, 46, .09);
  --warn-bg: rgba(201, 169, 110, .18);
  --shadow-xs: 0 1px 2px rgba(44, 32, 22, .05);
  --shadow-sm: 0 1px 2px rgba(44, 32, 22, .04), 0 6px 18px rgba(44, 32, 22, .05);
  --shadow-md: 0 4px 12px rgba(44, 32, 22, .06), 0 18px 44px rgba(44, 32, 22, .1);
  --radius: 16px;
  --radius-sm: 11px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --t: .2s cubic-bezier(.4, 0, .2, 1);
  --sidebar-w: 264px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--cream);
  color: var(--brown);
  line-height: 1.55;
  font-size: 14.5px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: 'Playfair Display', Georgia, serif; line-height: 1.2; margin: 0; color: var(--brown); font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(1.5rem, 2.6vw, 1.95rem); }
h2 { font-size: 1.22rem; }
h3 { font-size: 1.04rem; }
p { margin: 0; }
a { color: var(--rose-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid rgba(201, 169, 110, .7); outline-offset: 2px; border-radius: 8px; }
.noscript { padding: 24px; text-align: center; }

/* ── Boot / login ─────────────────────────────────────────── */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--brown-light); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(800px 500px at 85% 10%, rgba(232, 213, 168, .4), transparent 60%), radial-gradient(700px 500px at 10% 90%, rgba(212, 133, 122, .18), transparent 60%), linear-gradient(160deg, #FDF9F5 0%, #FAF1E8 55%, #F6E9DD 100%); }
.login-card { width: 100%; max-width: 410px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .9); border-radius: 26px; box-shadow: var(--shadow-md); padding: 36px 30px 30px; }
.login-card .brand { display: flex; justify-content: center; margin-bottom: 12px; }
.login-card .brand img { border-radius: 24px; }
.login-card h1 { text-align: center; font-size: 1.55rem; margin-bottom: 6px; }
.login-card .sub { text-align: center; color: var(--brown-light); font-size: .9rem; margin-bottom: 24px; }
.login-card form { display: grid; gap: 14px; }
.login-foot { text-align: center; margin-top: 18px; font-size: .78rem; color: var(--brown-light); }

/* ── Shell ────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, #2A1E15 0%, #231912 100%); color: rgba(253, 249, 245, .78); padding: 20px 14px 16px; display: flex; flex-direction: column; gap: 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }
.sidebar .logo { display: flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; padding: 4px 8px 10px; }
.sidebar .logo img { width: 38px; height: 38px; border-radius: 11px; background: #fff; }
.sidebar .logo span { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.32rem; letter-spacing: -.01em; }
.sidebar .logo em { color: var(--rose); font-style: normal; }
.sidebar .logo small { display: block; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 500; font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(253, 249, 245, .45); margin-top: 2px; }
.nav { display: grid; gap: 14px; }
.nav-group { display: grid; gap: 2px; }
.nav-label { font-size: .64rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: rgba(253, 249, 245, .38); padding: 0 12px 6px; }
.nav a { position: relative; display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 9px 12px; border-radius: 10px; text-decoration: none; color: inherit; font-weight: 500; font-size: .88rem;
  transition: background-color var(--t), color var(--t); }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active { background: linear-gradient(90deg, rgba(212, 133, 122, .26), rgba(212, 133, 122, .1)); color: #fff; }
.nav a.active::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--rose); }
.nav .ico { width: 22px; height: 22px; display: grid; place-items: center; font-size: .92rem; flex-shrink: 0; opacity: .9; }
.nav .ext { margin-left: auto; font-size: .72rem; opacity: .5; }
.nav .count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--rose); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; }
.nav a.moments { color: var(--m-champagne); }
.nav a.moments .ico { border-radius: 6px; background: linear-gradient(135deg, var(--m-glow), var(--m-champagne)); color: var(--m-ink); font-weight: 800; font-size: .7rem; }
.sidebar .me { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .08); padding: 14px 8px 4px; font-size: .8rem; display: grid; gap: 8px; }
.sidebar .me .email { color: #fff; word-break: break-all; font-weight: 600; }
.sidebar .me .btn { justify-self: start; color: var(--cream); border-color: rgba(255, 255, 255, .18); }
.sidebar .me .btn:hover { background: rgba(255, 255, 255, .08); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px clamp(16px, 3vw, 36px); background: rgba(251, 247, 242, .85);
  backdrop-filter: saturate(1.3) blur(14px); border-bottom: 1px solid var(--line); min-height: 60px; }
.topbar .logo { display: none; }
.topbar .menu-btn { display: none; }
.topbar .tb-title { font-size: .82rem; color: var(--brown-light); font-weight: 500; }
.topbar .tb-title b { color: var(--brown); font-weight: 700; }
.topbar .grow { flex: 1; }
.topbar .tb-moments { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; font-size: .8rem; font-weight: 600; text-decoration: none;
  color: var(--m-ink); background: linear-gradient(135deg, #F6E5CF, var(--m-champagne)); transition: transform var(--t), box-shadow var(--t); }
.topbar .tb-moments:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -10px rgba(160, 120, 64, .6); }
.content { padding: 26px clamp(16px, 3vw, 36px) 64px; max-width: 1320px; width: 100%; animation: viewIn .45s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .meta { color: var(--brown-light); font-size: .86rem; margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.page-head .eyebrow { font-size: .7rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-dark); margin-bottom: 6px; }
.crumb { font-size: .8rem; color: var(--brown-light); margin-bottom: 6px; }
.crumb a { color: inherit; }

@media (max-width: 920px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .shell.menu-open .sidebar { display: flex; position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 60; height: 100%; box-shadow: var(--shadow-md); animation: slideIn .3s var(--ease); }
  .shell.menu-open::after { content: ''; position: fixed; inset: 0; background: rgba(36, 26, 18, .45); z-index: 50; }
  .topbar { background: var(--brown); color: var(--cream); border-bottom: 0; }
  .topbar .logo { display: flex; align-items: center; gap: 8px; font-family: 'Playfair Display', serif; font-weight: 700; color: var(--cream); text-decoration: none; }
  .topbar .logo img { width: 30px; height: 30px; border-radius: 8px; background: #fff; }
  .topbar .tb-title { display: none; }
  .topbar .menu-btn { display: inline-flex; background: rgba(255, 255, 255, .1); border: 0; color: #fff; border-radius: 10px; padding: 9px 14px; cursor: pointer; min-height: 40px; align-items: center; }
  .topbar .tb-moments { padding: 6px 10px; font-size: .74rem; }
  .content { padding-top: 20px; }
}
@keyframes slideIn { from { transform: translateX(-20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Building blocks ─────────────────────────────────────── */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--line); padding: 20px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head p { color: var(--brown-light); font-size: .85rem; }
.card-head .link { font-size: .82rem; font-weight: 600; text-decoration: none; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 12px; }
.stat { background: var(--card); border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow-xs); padding: 14px 16px; position: relative; overflow: hidden; }
.stat::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--line-strong); }
.stat .n { font-family: 'Playfair Display', serif; font-size: 1.7rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .l { font-size: .76rem; color: var(--brown-light); margin-top: 4px; }
.stat.rose::before { background: var(--rose); }
.stat.sage::before { background: #8FA98A; }
.stat.gold::before { background: var(--gold); }
.stat.navy::before { background: var(--navy); }
.stat.muted::before { background: #cbbfb5; }
.stat.big { grid-column: span 2; background: linear-gradient(135deg, #D99286, var(--rose) 40%, var(--rose-dark)); color: #fff; border: 0; }
.stat.big::before { display: none; }
.stat.big .l { color: rgba(255, 255, 255, .88); }
@media (max-width: 480px) { .stat.big { grid-column: span 1; } }

/* KPI cards (overview) */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.kpi { position: relative; display: grid; gap: 10px; padding: 16px 18px; border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-xs); text-decoration: none; color: inherit;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t); animation: kpiIn .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
a.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: rgba(212, 133, 122, .35); }
@keyframes kpiIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.kpi .k-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi .k-ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-size: 1rem; background: var(--blush); }
.kpi .k-ico.gold { background: var(--warn-bg); }
.kpi .k-ico.sage { background: var(--sage-bg); }
.kpi .k-ico.navy { background: rgba(42, 58, 82, .09); }
.kpi .k-ico.ink { background: linear-gradient(135deg, rgba(229, 154, 140, .28), rgba(233, 201, 160, .3)); }
.kpi .k-n { font-family: 'Playfair Display', serif; font-size: 1.9rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .k-l { font-size: .78rem; color: var(--brown-light); }
.kpi .k-sub { font-size: .72rem; color: var(--brown-light); }
.kpi.hero { grid-column: span 2; background: radial-gradient(400px 200px at 90% 0%, rgba(255, 255, 255, .22), transparent 60%), linear-gradient(135deg, #2C2016, #4A3324); color: var(--cream); border: 0; }
.kpi.hero .k-l, .kpi.hero .k-sub { color: rgba(253, 249, 245, .72); }
.kpi.hero .k-ico { background: rgba(255, 255, 255, .1); }
@media (max-width: 520px) { .kpis { grid-template-columns: 1fr 1fr; gap: 10px; } .kpi { padding: 13px 14px; gap: 8px; } .kpi .k-n { font-size: 1.5rem; } .kpi .k-ico { width: 30px; height: 30px; } .kpi .k-sub { display: none; } .kpi.hero .k-sub { display: block; } }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.quick a, .quick button { display: grid; gap: 6px; align-content: start; text-align: left; padding: 14px; border-radius: 14px; background: var(--warm); border: 1px solid transparent; text-decoration: none; color: var(--brown);
  cursor: pointer; transition: background-color var(--t), border-color var(--t), transform var(--t); min-height: 84px; }
.quick a:hover, .quick button:hover { background: #fff; border-color: rgba(212, 133, 122, .4); transform: translateY(-1px); }
.quick .q-ico { font-size: 1.15rem; }
.quick b { font-size: .86rem; }
.quick small { font-size: .72rem; color: var(--brown-light); }
.list { display: grid; }
.list-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; border-radius: 8px; transition: background-color var(--t); }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover { background: var(--warm); }
.list-row .t { font-weight: 700; font-size: .9rem; }
.list-row .s { font-size: .76rem; color: var(--brown-light); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.list-row .side { text-align: right; font-size: .78rem; color: var(--brown-light); }
.date-chip { display: grid; place-items: center; width: 46px; height: 50px; border-radius: 12px; background: var(--blush); color: var(--rose-dark); line-height: 1.05; flex-shrink: 0; }
.date-chip b { font-family: 'Playfair Display', serif; font-size: 1.15rem; }
.date-chip small { font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.list-row.with-date { grid-template-columns: auto minmax(0, 1fr) auto; }
.activity { display: grid; gap: 2px; }
.act { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; padding: 9px 2px; font-size: .82rem; }
.act .a-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--warm); font-size: .82rem; }
.act .a-when { font-size: .72rem; color: var(--brown-light); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1.5px solid transparent; border-radius: 999px; padding: 9px 18px; min-height: 38px; font-weight: 600; font-size: .85rem; cursor: pointer;
  transition: background-color var(--t), border-color var(--t), box-shadow var(--t), transform var(--t), filter var(--t); text-decoration: none; white-space: nowrap; background: var(--warm); color: var(--brown); }
.btn:hover { background: var(--blush); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, #D99286, var(--rose) 45%, var(--rose-dark)); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .3) inset, 0 8px 18px -8px rgba(184, 107, 94, .6); }
.btn.primary:hover { filter: brightness(1.04); box-shadow: 0 1px 0 rgba(255, 255, 255, .3) inset, 0 12px 24px -10px rgba(184, 107, 94, .7); }
.btn.outline { background: #fff; border-color: var(--line-strong); }
.btn.outline:hover { border-color: var(--rose); background: var(--blush); }
.btn.danger { background: var(--danger-bg); color: var(--danger); }
.btn.danger:hover { background: rgba(163, 58, 46, .16); }
.btn.dark { background: var(--brown); color: var(--cream); }
.btn.dark:hover { background: #3d2c1f; }
.btn.sm { padding: 6px 12px; font-size: .78rem; min-height: 32px; }
.btn.xs { padding: 4px 10px; font-size: .74rem; min-height: 28px; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--warm); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

label.field { display: grid; gap: 6px; font-size: .83rem; font-weight: 600; color: var(--brown-mid); }
label.field small, .hint { font-weight: 400; color: var(--brown-light); font-size: .77rem; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=search], input[type=datetime-local], input[type=date], input[type=time], select, textarea {
  width: 100%; min-height: 40px; padding: 9px 12px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; outline: none; transition: border-color var(--t), box-shadow var(--t); font-size: .88rem;
}
input:hover, select:hover, textarea:hover { border-color: rgba(44, 32, 22, .26); }
input:focus, select:focus, textarea:focus { border-color: var(--rose); box-shadow: 0 0 0 4px rgba(212, 133, 122, .14); }
input:disabled, select:disabled, textarea:disabled { background: var(--warm); color: var(--brown-light); }
textarea { resize: vertical; min-height: 90px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: start; }
.form-grid .full { grid-column: 1 / -1; }
fieldset { border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px 16px; margin: 0; }
legend { padding: 0 6px; font-weight: 700; font-size: .85rem; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; cursor: pointer; transition: var(--t); }
.choice:hover { background: var(--warm); }
.choice input { margin-top: 4px; accent-color: var(--rose); }
.choice b { display: block; font-size: .87rem; }
.choice span { display: block; font-size: .77rem; color: var(--brown-light); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.switch:last-child { border-bottom: 0; }
.switch b { font-size: .87rem; display: block; }
.switch span { font-size: .77rem; color: var(--brown-light); }
.switch input[type=checkbox] { appearance: none; width: 44px; height: 24px; border-radius: 999px; background: #ddd2c8; position: relative; cursor: pointer; transition: var(--t); flex-shrink: 0; }
.switch input[type=checkbox]::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: var(--t); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch input[type=checkbox]:checked { background: var(--rose); }
.switch input[type=checkbox]:checked::after { left: 23px; }
.switch input[type=checkbox]:disabled { opacity: .5; cursor: not-allowed; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .71rem; font-weight: 700; letter-spacing: .02em; background: var(--warm); color: var(--brown-mid); white-space: nowrap; }
.badge.active, .badge.approved, .badge.attending, .badge.opened, .badge.checked { background: var(--sage-bg); color: var(--sage); }
.badge.draft, .badge.pending, .badge.maybe, .badge.sent, .badge.scheduled, .badge.paused { background: var(--warn-bg); color: var(--gold-dark); }
.badge.inactive, .badge.rejected, .badge.not_attending, .badge.archived, .badge.expired { background: var(--danger-bg); color: var(--danger); }
.badge.hidden, .badge.no_response, .badge.not_sent { background: #efe9e3; color: var(--brown-light); }
.badge.super_admin { background: rgba(42, 58, 82, .12); color: var(--navy); }
.badge.rose { background: rgba(212, 133, 122, .16); color: var(--rose-dark); }
.badge.ink { background: var(--m-ink); color: var(--m-champagne); }
.badge.via-admin { background: rgba(42, 58, 82, .09); color: var(--navy); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; position: sticky; top: 60px; z-index: 20; background: var(--cream); }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 11px 14px; text-decoration: none; color: var(--brown-light); font-weight: 600; font-size: .86rem; border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color var(--t); }
.tabs a:hover { color: var(--brown); }
.tabs a.active { color: var(--rose-dark); border-bottom-color: var(--rose); }
.tabs a .count { margin-left: 6px; }
@media (max-width: 920px) { .tabs { top: 60px; } }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 13px; min-height: 32px; font-size: .77rem; font-weight: 600; cursor: pointer; transition: var(--t); color: var(--brown-mid); }
.pill:hover { border-color: var(--brown-light); }
.pill.active { background: var(--brown); color: var(--cream); border-color: var(--brown); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .grow { flex: 1; min-width: 180px; }
.toolbar select { width: auto; min-width: 140px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px; border-radius: 14px; background: #fff; border: 1px solid var(--line); margin-bottom: 12px; }
.filters .grow { flex: 1; min-width: 200px; }
.filters select { width: auto; min-width: 130px; min-height: 36px; padding: 6px 10px; font-size: .82rem; }
.filters input[type=search] { min-height: 36px; }

.table-wrap { overflow: auto; border-radius: 14px; border: 1px solid var(--line); background: #fff; max-height: 70vh; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { position: sticky; top: 0; z-index: 1; font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--brown-light); background: #FBF6F0; font-weight: 700; white-space: nowrap; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--brown); }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color var(--t); }
tbody tr:hover { background: #FFFAF6; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .sub { display: block; font-size: .75rem; color: var(--brown-light); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
td .row-actions { flex-wrap: nowrap; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: .8rem; color: var(--brown-light); }
.empty { text-align: center; padding: 40px 16px; color: var(--brown-light); }
.empty b { display: block; color: var(--brown); font-family: 'Playfair Display', serif; font-size: 1.08rem; margin-bottom: 4px; }
.empty .e-ico { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 16px; display: grid; place-items: center; font-size: 1.4rem; background: var(--warm); }

/* operational guest monitor */
.monitor { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.mon { padding: 12px 14px; border-radius: 13px; background: #fff; border: 1px solid var(--line); }
.mon .n { font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.mon .l { font-size: .72rem; color: var(--brown-light); margin-top: 3px; display: flex; gap: 4px; align-items: center; }
.mon .l abbr { text-decoration: none; cursor: help; border-bottom: 1px dotted currentColor; }
.mon.hl { background: linear-gradient(135deg, #2C2016, #4A3324); color: var(--cream); border: 0; }
.mon.hl .l { color: rgba(253, 249, 245, .7); }
.progress { height: 8px; border-radius: 999px; background: var(--warm); overflow: hidden; display: flex; margin-top: 8px; }
.progress i { display: block; height: 100%; }

.event-list { display: grid; gap: 12px; }
.event-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow-xs); padding: 16px 18px; text-decoration: none; color: inherit;
  transition: border-color var(--t), transform var(--t), box-shadow var(--t); }
.event-row:hover { border-color: rgba(212, 133, 122, .45); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.event-row .title { font-weight: 700; font-size: .98rem; }
.event-row .meta { font-size: .79rem; color: var(--brown-light); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 5px; align-items: center; }
.event-row .nums { display: flex; gap: 18px; text-align: center; }
.event-row .nums div b { display: block; font-family: 'Playfair Display', serif; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.event-row .nums div span { font-size: .68rem; color: var(--brown-light); }
@media (max-width: 640px) { .event-row { grid-template-columns: 1fr; } .event-row .nums { justify-content: flex-start; } }

.wish { padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; }
.wish:last-child { border-bottom: 0; }
.wish .who { font-weight: 700; }
.wish .when { font-size: .75rem; color: var(--brown-light); }
.wish .msg { margin-top: 6px; white-space: pre-wrap; word-break: break-word; }
.wish .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
@media (max-width: 640px) { .wish { grid-template-columns: auto 1fr; } .wish .row-actions { grid-column: 1 / -1; justify-content: flex-start; } }

.copy-line { display: flex; gap: 8px; align-items: center; background: var(--warm); border-radius: var(--radius-sm); padding: 8px 8px 8px 12px; }
.copy-line code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.notice { border-radius: var(--radius-sm); padding: 12px 14px; font-size: .84rem; background: var(--warn-bg); color: #5e4520; }
.notice.info { background: rgba(42, 58, 82, .07); color: var(--navy); }
.notice.ok { background: var(--sage-bg); color: #2f5a2b; }
.notice.danger { background: var(--danger-bg); color: var(--danger); }
.notice pre { white-space: pre-wrap; margin: 8px 0 0; font-size: .78rem; }
.muted { color: var(--brown-light); }
.small { font-size: .8rem; }
.mt { margin-top: 14px; }
.mt-lg { margin-top: 24px; }
.hide { display: none !important; }
.danger-zone { border: 1.5px solid rgba(163, 58, 46, .25); }

.toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 100; max-width: min(92vw, 400px); }
.toast { background: var(--brown); color: #fff; padding: 12px 16px 12px 14px; border-radius: 13px; box-shadow: var(--shadow-md); font-size: .85rem; animation: tin .3s var(--ease); display: flex; gap: 10px; align-items: flex-start; }
.toast::before { content: 'ℹ'; font-weight: 700; opacity: .8; }
.toast.error { background: var(--danger); }
.toast.error::before { content: '!'; }
.toast.ok { background: #3f6b3a; }
.toast.ok::before { content: '✓'; }
@keyframes tin { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

.modal { border: 0; border-radius: 20px; padding: 0; width: min(580px, 94vw); box-shadow: var(--shadow-md); color: var(--brown); }
.modal.wide { width: min(880px, 96vw); }
.modal[open] { animation: modalIn .3s var(--ease); }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.modal::backdrop { background: rgba(36, 26, 18, .45); backdrop-filter: blur(2px); }
.modal .m-head { padding: 18px 20px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal .m-body { padding: 16px 20px; display: grid; gap: 14px; max-height: 70vh; overflow: auto; }
.modal .m-foot { padding: 12px 20px 18px; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.modal .x { background: transparent; border: 0; font-size: 1.4rem; cursor: pointer; color: var(--brown-light); line-height: 1; width: 36px; height: 36px; border-radius: 50%; }
.modal .x:hover { background: var(--warm); }
.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(212, 133, 122, .25); border-top-color: var(--rose); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; gap: 10px; color: var(--brown-light); padding: 24px 0; }
.skeleton { border-radius: 12px; background: linear-gradient(90deg, #F3EBE2 25%, #FAF4EE 50%, #F3EBE2 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Dynamic content: status / editor / media ─────────────── */
.badge.preview { background: rgba(42, 58, 82, .1); color: var(--navy); }
.badge.admin { background: rgba(212, 133, 122, .16); color: var(--rose-dark); }
.badge.customer { background: #efe9e3; color: var(--brown-light); }
.publish-panel { margin-bottom: 16px; }
.publish-panel h3 { display: flex; align-items: center; gap: 8px; }
.publish-panel .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.notice.warn { background: var(--warn-bg); color: #5e4520; }
.sticky-save { position: sticky; top: 108px; z-index: 15; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: rgba(251, 247, 242, .94); backdrop-filter: blur(6px); padding: 10px 0; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.sticky-save .grow { flex: 1; }
.dirty-indicator { font-size: .82rem; font-weight: 600; }
.dirty-indicator.on { color: var(--gold-dark); }
.dirty-indicator.off { color: var(--sage); }
.content-form { display: grid; gap: 16px; }
.content-form textarea { resize: vertical; min-height: 42px; }
.text-group summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 6px; }
.text-group summary::before { content: '▸'; color: var(--brown-light); }
.text-group[open] summary::before { content: '▾'; }
.check-list { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: .85rem; }
.check-list.err li { color: var(--danger); }
.check-list.info li { color: var(--brown-light); }
label.btn input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
label.btn { position: relative; }
label.btn.disabled { opacity: .5; pointer-events: none; }
.upload-progress { color: var(--brown-mid); }
.media-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.media-card { background: var(--warm); border-radius: var(--radius-sm); overflow: hidden; display: grid; grid-template-rows: 120px auto auto; border: 1px solid var(--line); }
.media-card img, .media-card .audio-thumb { width: 100%; height: 120px; object-fit: cover; }
.media-card .audio-thumb { display: grid; place-items: center; font-size: 2rem; color: var(--brown-light); }
.media-card .media-meta { padding: 8px 10px 4px; min-width: 0; }
.media-card .btn { margin: 4px 10px 10px; justify-self: start; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-list { display: grid; gap: 8px; }
.slot-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) minmax(170px, 240px); gap: 12px; align-items: center; padding: 8px; border-radius: var(--radius-sm); background: var(--warm); }
.slot-row .badge { margin-left: 6px; }
.slot-thumb { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; background: #fff; display: grid; place-items: center; }
.slot-thumb img { width: 100%; height: 100%; object-fit: cover; }
.slot-row select { width: 100%; }
.sidebar .badge { background: rgba(255, 255, 255, .12); color: #fff; }

/* ---- Hardening upgrade: save state, slot editor v1, storage ---- */
.dirty-indicator.saving { color: var(--brown-mid); }
.linkish { background: none; border: 0; padding: 0; color: var(--brown-mid); text-decoration: underline; cursor: pointer; font: inherit; }
.slot-editor { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.slot-editor > .preview-card { position: sticky; top: 120px; }
.slot-controls { display: grid; gap: 6px; }
.slot-label { font-weight: 600; font-size: .86rem; }
.preview-device { margin: 0 auto; background: #222; border-radius: 18px; padding: 8px; transition: width .2s; max-width: 100%; }
.preview-device.mobile { width: 360px; }
.preview-device.tablet { width: 100%; }
.preview-device.desktop { width: 100%; }
.preview-frame { display: block; width: 100%; height: 640px; border: 0; border-radius: 12px; background: #fff; }
.preview-device.tablet .preview-frame { height: 560px; }
.preview-device.desktop .preview-frame { height: 480px; }
.usage-bar { height: 10px; border-radius: 999px; background: var(--warm); overflow: hidden; }
.usage-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-dark)); }
.media-card.unused { outline: 2px dashed var(--line-strong); }
.media-card .use { font-size: .72rem; color: var(--brown-light); }
.publish-target { font-weight: 600; background: var(--warm); padding: 8px 10px; border-radius: var(--radius-sm); }
@media (max-width: 1180px) {
  .slot-editor { grid-template-columns: 1fr; }
  .slot-editor > .preview-card { position: static; }
  .preview-device.mobile { width: 340px; }
}
@media (max-width: 640px) {
  .slot-row { grid-template-columns: 48px minmax(0, 1fr); }
  .slot-row .slot-controls { grid-column: 1 / -1; }
  .preview-device.mobile { width: 100%; }
}

/* ── Marketing: campaigns + website settings ──────────────── */
.camp-list { display: grid; gap: 12px; }
.camp { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-xs);
  text-decoration: none; color: inherit; transition: border-color var(--t), box-shadow var(--t); }
.camp:hover { border-color: rgba(212, 133, 122, .45); box-shadow: var(--shadow-sm); }
.camp .c-thumb { width: 96px; height: 64px; border-radius: 10px; background: linear-gradient(135deg, var(--blush), var(--sand)); overflow: hidden; display: grid; place-items: center; font-size: 1.3rem; }
.camp .c-thumb img { width: 100%; height: 100%; object-fit: cover; }
.camp .c-title { font-weight: 700; }
.camp .c-meta { font-size: .76rem; color: var(--brown-light); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; align-items: center; }
.camp .c-stats { display: flex; gap: 16px; text-align: center; font-size: .7rem; color: var(--brown-light); }
.camp .c-stats b { display: block; font-family: 'Playfair Display', serif; font-size: 1.08rem; color: var(--brown); }
@media (max-width: 720px) { .camp { grid-template-columns: 64px minmax(0, 1fr); } .camp .c-thumb { width: 64px; height: 48px; } .camp .c-stats { grid-column: 1 / -1; justify-content: flex-start; } }
.camp-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); gap: 16px; align-items: start; }
.camp-editor .preview-card { position: sticky; top: 76px; }
@media (max-width: 1100px) { .camp-editor { grid-template-columns: 1fr; } .camp-editor .preview-card { position: static; } }
.promo-surface { position: relative; border-radius: 16px; padding: 38px 18px 18px; min-height: 300px; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(400px 260px at 80% 0%, rgba(232, 213, 168, .45), transparent 60%), linear-gradient(160deg, #FDF9F5, #F4E8DB); border: 1px solid var(--line); }
.promo-surface.dock { place-items: end stretch; }
.promo-surface .ps-note { position: absolute; left: 14px; top: 12px; font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--brown-light); }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--warm); gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 999px; font-size: .78rem; font-weight: 600; cursor: pointer; color: var(--brown-mid); min-height: 30px; }
.seg button.active { background: #fff; color: var(--brown); box-shadow: var(--shadow-xs); }
.banner-drop { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; align-items: center; }
.banner-drop .bd-thumb { width: 120px; height: 63px; border-radius: 10px; background: var(--warm); overflow: hidden; display: grid; place-items: center; color: var(--brown-light); font-size: .74rem; }
.banner-drop .bd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.feature-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.feature-checks label { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--warm); font-size: .84rem; cursor: pointer; }
.feature-checks input { accent-color: var(--rose); width: 16px; height: 16px; }
.eco-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 18px; border-radius: var(--radius); text-decoration: none; color: var(--brown); border: 1px solid var(--line); background: #fff; }
.eco-card.moments { background: linear-gradient(135deg, var(--m-ink), #3A2E40); color: #F6EEE6; border: 0; }
.eco-card .eco-mark { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-family: 'Playfair Display', serif; font-size: 1.2rem; background: var(--blush); color: var(--rose-dark); }
.eco-card.moments .eco-mark { background: linear-gradient(135deg, var(--m-glow), var(--m-champagne)); color: var(--m-ink); }
.eco-card small { display: block; font-size: .78rem; opacity: .72; margin-top: 2px; }
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.tpl { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 8px; }
.tpl .tpl-name { font-weight: 700; }
.tpl .tpl-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.kbd-hint { font-size: .72rem; color: var(--brown-light); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
