/* Signature Kitchens CRM. Design tokens first; swap brand values here. */
@font-face { font-family: "Jakarta"; src: url("/fonts/jakarta.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("/fonts/cormorant-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("/fonts/cormorant-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("/fonts/cormorant-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("/fonts/cormorant-500-italic.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }

:root {
  --wine: #7a1f2b;
  --wine-deep: #5c1621;
  --plum: #3b1820;
  --plum-2: #4d1f29;
  --cream: #f5efe7;
  --cream-2: #efe6db;
  --surface: #fffdfa;
  --ink: #2a2220;
  --ink-2: #5b504b;
  --muted: #8a7d76;
  --line: #e8ddd1;
  --line-2: #dccfc1;
  --ok: #2f6b4f;
  --ok-bg: #e6f2ea;
  --warn: #9a5b12;
  --warn-bg: #fbefdc;
  --danger: #a32a2a;
  --danger-bg: #fbe9e7;
  --focus: rgba(122, 31, 43, 0.28);
  --shadow-sm: 0 1px 2px rgba(59, 24, 32, 0.06);
  --shadow: 0 1px 2px rgba(59, 24, 32, 0.05), 0 8px 24px -12px rgba(59, 24, 32, 0.18);
  --shadow-lg: 0 24px 60px -24px rgba(59, 24, 32, 0.35);
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --sans: "Jakarta", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Cormorant", "Cormorant Garamond", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --cream: #1a1315;
    --cream-2: #221a1c;
    --surface: #241b1d;
    --ink: #f3ebe4;
    --ink-2: #cbbdb4;
    --muted: #9c8d85;
    --line: #3a2d30;
    --line-2: #4a393c;
    --wine: #c9566a;
    --wine-deep: #a8424f;
    --ok: #8fd1ad;
    --ok-bg: #1f3329;
    --warn: #e6b36a;
    --warn-bg: #3a2c19;
    --danger: #f19a92;
    --danger-bg: #3d2220;
    --focus: rgba(201, 86, 106, 0.35);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--sans); font-size: 15px; line-height: 1.55; color: var(--ink);
  background: var(--cream);
  background-image:
    radial-gradient(1200px 600px at 110% -10%, rgba(122, 31, 43, 0.06), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(176, 140, 100, 0.08), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--wine); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
svg.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- type ---------- */
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.display { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 4.2vw, 46px); line-height: 1.05; letter-spacing: -.01em; color: var(--ink); }
.display em, .title em { font-style: italic; color: var(--wine); }
.title { font-family: var(--serif); font-weight: 500; font-size: 28px; line-height: 1.15; }
.card-title { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- auth layout ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 900px) { .auth { grid-template-columns: minmax(380px, 46%) 1fr; } }
.brand-panel {
  position: relative; overflow: hidden; color: #f6ece4; padding: 28px 24px 32px;
  background:
    radial-gradient(700px 420px at 85% 10%, rgba(201, 86, 106, 0.35), transparent 60%),
    radial-gradient(600px 500px at 0% 100%, rgba(20, 6, 10, 0.55), transparent 60%),
    linear-gradient(155deg, var(--wine) 0%, var(--plum-2) 55%, var(--plum) 100%);
  display: flex; flex-direction: column; gap: 28px;
}
.brand-panel::after { /* soft marble veining */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .22;
  background:
    radial-gradient(120% 60% at 30% 40%, transparent 48%, rgba(255,255,255,.18) 49%, transparent 51%),
    radial-gradient(90% 50% at 80% 75%, transparent 47%, rgba(255,255,255,.14) 48%, transparent 50%),
    radial-gradient(70% 40% at 10% 85%, transparent 46%, rgba(255,255,255,.12) 47%, transparent 49%);
}
.brand-panel > * { position: relative; z-index: 1; }
@media (min-width: 900px) { .brand-panel { padding: 44px 52px; justify-content: space-between; min-height: 100vh; } }
.brand-panel .eyebrow { color: rgba(246, 236, 228, .7); }
.brand-panel .display { color: #fff8f2; font-size: clamp(36px, 4.6vw, 58px); }
.brand-panel .display em { color: #f2c7cf; }
.brand-copy { display: grid; gap: 16px; max-width: 460px; }
.brand-copy p { color: rgba(246, 236, 228, .82); font-size: 15px; }
.brand-points { display: none; gap: 12px; color: rgba(246, 236, 228, .85); font-size: 14px; }
@media (min-width: 900px) { .brand-points { display: grid; } }
.brand-points div { display: flex; gap: 10px; align-items: center; }
.brand-points svg.icon { color: #f2c7cf; }

.wordmark { display: inline-flex; align-items: baseline; gap: 10px; color: inherit; }
.wordmark .script { font-family: var(--serif); font-style: italic; font-size: 30px; line-height: 1; font-weight: 500; letter-spacing: -.01em; }
.wordmark .sub { font-size: 10px; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; opacity: .75; }
.wordmark .pill { font-size: 10px; font-weight: 700; letter-spacing: .14em; padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px 16px 48px; }
.auth-card { width: 100%; max-width: 420px; display: grid; gap: 22px; }
.auth-card .head { display: grid; gap: 8px; }
.auth-card .display { font-size: clamp(32px, 3.6vw, 40px); }

/* ---------- app layout ---------- */
.app { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 900px) { .app { grid-template-columns: 264px 1fr; } }
.sidebar {
  display: none; position: sticky; top: 0; height: 100vh; padding: 26px 18px 18px; color: #f6ece4; flex-direction: column; gap: 28px;
  background:
    radial-gradient(500px 300px at 120% 0%, rgba(201, 86, 106, 0.28), transparent 60%),
    linear-gradient(180deg, var(--plum-2), var(--plum));
}
@media (min-width: 900px) { .sidebar { display: flex; } }
.sidebar .wordmark { padding: 0 10px; display: grid; gap: 6px; justify-items: start; }
.sidebar .wordmark .script { font-size: 34px; }
.wordmark .line { display: inline-flex; align-items: center; gap: 8px; }
.side-nav { display: grid; gap: 4px; }
.side-nav .label { padding: 0 12px 6px; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: rgba(246,236,228,.5); font-weight: 600; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: rgba(246, 236, 228, .82); font-weight: 500; font-size: 14.5px; transition: background .15s, color .15s; }
.side-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.side-nav a.active { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.side-nav a.active svg.icon { color: #f2c7cf; }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); }
.side-foot .who { min-width: 0; flex: 1; }
.side-foot .who b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who span { font-size: 12px; color: rgba(246,236,228,.6); }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,.1); }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; color: #f6ece4; background: linear-gradient(135deg, var(--wine), var(--plum)); position: sticky; top: 0; z-index: 5; }
.topbar .wordmark .script { font-size: 24px; }
@media (min-width: 900px) { .topbar { display: none; } }

.main { padding: 22px 16px 104px; max-width: 1120px; width: 100%; margin: 0 auto; display: grid; gap: 20px; align-content: start; }
@media (min-width: 900px) { .main { padding: 44px 48px 64px; gap: 24px; } }
.page-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
.page-head .text { display: grid; gap: 8px; }

.tabbar { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 10; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 6px; border-radius: 18px; background: rgba(255, 253, 250, .86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
@media (prefers-color-scheme: dark) { .tabbar { background: rgba(36, 27, 29, .86); } }
@media (min-width: 900px) { .tabbar { display: none; } }
.tabbar a { display: grid; justify-items: center; gap: 2px; padding: 7px 4px; border-radius: 12px; font-size: 11px; font-weight: 600; color: var(--muted); }
.tabbar a:hover { text-decoration: none; }
.tabbar a.active { color: var(--wine); background: rgba(122, 31, 43, .08); }
.tabbar svg.icon { width: 20px; height: 20px; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow); }
@media (min-width: 900px) { .card { padding: 26px 28px; } }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-head .text { display: grid; gap: 4px; }
.grid-2 { display: grid; gap: 20px; }
@media (min-width: 1000px) { .grid-2 { grid-template-columns: 1.4fr 1fr; align-items: start; } }

.stats { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 1000px) { .stats { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
.stat { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 16px 18px; box-shadow: var(--shadow-sm); display: grid; gap: 10px; overflow: hidden; }
.stat .ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: rgba(122, 31, 43, .08); color: var(--wine); }
.stat b { font-family: var(--sans); font-weight: 650; font-size: 30px; line-height: 1; letter-spacing: -.03em; font-variant-numeric: lining-nums tabular-nums; }
.stat b.word { font-size: 16px; letter-spacing: 0; padding-top: 8px; }
.stat span { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat.feature { background: linear-gradient(150deg, var(--wine), var(--plum)); border-color: transparent; color: #fff; }
.stat.feature .ico { background: rgba(255,255,255,.14); color: #fff; }
.stat.feature span { color: rgba(255,255,255,.75); }

.steps { display: grid; gap: 4px; }
.step { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 14px; }
a.step { color: inherit; }
a.step:hover { background: var(--cream); text-decoration: none; }
a.step:hover .body b { color: var(--wine); }
.step .dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 1.5px dashed var(--line-2); color: var(--muted); }
.step.done .dot { border: 0; background: var(--ok-bg); color: var(--ok); }
.step .body { flex: 1; min-width: 0; display: grid; gap: 1px; }
.step .body b { font-weight: 600; font-size: 14.5px; }
.step .body span { font-size: 13px; color: var(--muted); }
.step .body .badge { justify-self: start; margin-top: 6px; }
.step .arrow { color: var(--muted); }
.step.done .body b { color: var(--ink-2); }

/* ---------- forms ---------- */
form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
input, select {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: var(--muted); }
input:hover, select:hover { border-color: var(--muted); }
input:focus, select:focus { outline: none; border-color: var(--wine); box-shadow: 0 0 0 4px var(--focus); }
select { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a7d76' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; cursor: pointer; }
select.compact { padding: 8px 34px 8px 12px; font-size: 13.5px; border-radius: 10px; width: auto; min-width: 150px; }
.code-input { font-size: 28px; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; padding: 14px 10px 14px calc(10px + .5em); font-weight: 600; }
.hint { font-size: 12.5px; color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; font-size: 14.5px; padding: 12px 18px; border-radius: 12px; border: 1px solid transparent; cursor: pointer; transition: transform .06s, box-shadow .15s, background .15s, border-color .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--focus); }
.btn-primary { background: linear-gradient(180deg, #8a2533, var(--wine-deep)); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 8px 18px -8px rgba(122, 31, 43, .7); }
.btn-primary:hover { background: linear-gradient(180deg, #932838, #651826); }
.btn-block { width: 100%; padding: 14px 18px; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn[disabled] { opacity: .6; cursor: progress; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--wine); cursor: pointer; justify-self: start; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; }
.alert svg.icon { margin-top: 1px; }
.alert.error { background: var(--danger-bg); color: var(--danger); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }

/* ---------- MFA ---------- */
.qr-wrap { display: grid; place-items: center; padding: 18px; border-radius: var(--r); background: linear-gradient(180deg, var(--cream), var(--cream-2)); border: 1px solid var(--line); }
.qr { width: 196px; height: 196px; background: #fff; border-radius: 12px; padding: 8px; box-shadow: var(--shadow); }
.secret { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 14px; letter-spacing: .06em; text-align: center; padding: 10px 12px; border-radius: 10px; background: var(--cream); border: 1px dashed var(--line-2); word-break: break-all; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.codes span { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 14px; letter-spacing: .04em; text-align: center; padding: 10px 8px; border-radius: 10px; background: var(--cream); border: 1px solid var(--line); }
.steps-inline { display: grid; gap: 10px; counter-reset: s; }
.steps-inline div { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.steps-inline div::before { counter-increment: s; content: counter(s); flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: rgba(122,31,43,.1); color: var(--wine); }

/* ---------- people ---------- */
.avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 13px; font-weight: 700; letter-spacing: .02em; color: #fff; background: linear-gradient(140deg, #a4495a, var(--plum)); }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.avatar.light { background: rgba(255,255,255,.16); }
.people { display: grid; }
.person { display: grid; grid-template-columns: auto 1fr; gap: 12px 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.person:first-child { border-top: 0; padding-top: 4px; }
@media (min-width: 760px) { .person { grid-template-columns: auto minmax(0, 1.6fr) minmax(150px, auto) minmax(120px, .9fr) auto; } }
.person .who { min-width: 0; display: grid; }
.person .who b { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .who span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .meta { display: grid; gap: 4px; justify-items: start; }
.person .meta span { font-size: 12px; color: var(--muted); }
.person .acts { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 759px) { .person > :nth-child(n+3) { grid-column: 2; } }
.you { font-size: 11px; font-weight: 700; color: var(--wine); margin-left: 6px; letter-spacing: .04em; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--cream); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.off { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.badge.soon { background: rgba(122,31,43,.08); color: var(--wine); border-color: transparent; }

.invite-row { display: grid; gap: 14px; }
@media (min-width: 760px) { .invite-row { grid-template-columns: 1fr 200px auto; align-items: end; } }
.copy-box { display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 14px; border-radius: 12px; background: var(--cream); border: 1px solid var(--line); }
.copy-box input { border: 0; background: transparent; padding: 6px 0; font-size: 13px; box-shadow: none; }
.copy-box input:focus { box-shadow: none; }

/* ---------- activity ---------- */
.timeline { display: grid; }
.event { display: grid; grid-template-columns: 36px 1fr; gap: 14px; position: relative; padding-bottom: 18px; }
.event::before { content: ""; position: absolute; left: 17px; top: 36px; bottom: 0; width: 1.5px; background: var(--line); }
.event:last-child::before { display: none; }
.event .ico { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--cream); border: 1px solid var(--line); color: var(--ink-2); }
.event.warn .ico { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.event.good .ico { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.event .ico svg.icon { width: 16px; height: 16px; }
.event .body { display: grid; gap: 2px; padding-top: 6px; }
.event .body b { font-weight: 600; font-size: 14px; }
.event .body span { font-size: 13px; color: var(--muted); }

/* ---------- account ---------- */
.profile { display: flex; gap: 16px; align-items: center; }
.profile .who { display: grid; gap: 2px; }
.profile .who b { font-size: 17px; font-weight: 650; }
.kv { display: grid; gap: 12px; margin-top: 18px; }
.kv div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.kv span { color: var(--muted); }

/* ---------- empty, toast, dialog ---------- */
.empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 28px 12px; color: var(--muted); }
.empty .ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--cream); color: var(--wine); margin-bottom: 4px; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 40; display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 14px; background: var(--plum); color: #fff; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); transition: opacity .2s, transform .2s; pointer-events: none; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }
@media (min-width: 900px) { .toast { bottom: 28px; } }
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(28, 12, 16, .45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal .card { width: 100%; max-width: 420px; display: grid; gap: 14px; box-shadow: var(--shadow-lg); }
.modal .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.loading { display: grid; place-items: center; min-height: 60vh; color: var(--muted); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid var(--line-2); border-top-color: var(--wine); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.fade-in { animation: fade .28s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 6px; }
.chip { font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--cream); border: 1px solid var(--line); color: var(--ink-2); }
.chip.won { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.chip.lost { color: var(--muted); }
.empty b { color: var(--ink); font-weight: 650; }
@media (min-width: 760px) { .person { grid-template-columns: auto minmax(0, 1fr) 180px 170px minmax(84px, auto); } .person .acts { justify-content: flex-end; } }

/* ---------- leads (slice 1) ---------- */
.stat-link { display: block; color: inherit; text-decoration: none; border-radius: var(--r); }
.stat-link:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--focus); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
.seg a { font-size: 13.5px; font-weight: 600; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); text-decoration: none; }
.seg a.active { background: var(--wine); border-color: var(--wine); color: #fff; }
.lead-row { display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; align-items: center; padding: 14px 4px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.lead-row:first-child { border-top: 0; }
.lead-row:hover { background: var(--cream); }
.lead-row .who { min-width: 0; display: grid; gap: 2px; }
.lead-row .who b { font-weight: 600; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.lead-row .who span { font-size: 13px; color: var(--muted); }
.lead-row .meta { grid-column: 2; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lead-row .meta span:not(.badge) { font-size: 12.5px; color: var(--muted); }
@media (min-width: 760px) { .lead-row { grid-template-columns: auto 1fr auto; } .lead-row .meta { grid-column: auto; justify-content: flex-end; } }
.message { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.message p { margin: 0; white-space: pre-wrap; line-height: 1.55; }
.raw { margin-top: 16px; }
.raw summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.raw pre { white-space: pre-wrap; word-break: break-word; font-size: 12px; background: var(--cream); padding: 12px; border-radius: 10px; max-height: 360px; overflow: auto; }
.kv a { color: var(--wine); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }

/* ---------- working a lead (slice 2) ---------- */
.work-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .work-grid { grid-template-columns: repeat(3, 1fr); } .work-grid .span-2 { grid-column: span 2; } }
.work-grid .span-all { grid-column: 1 / -1; display: grid; gap: 10px; justify-items: start; }
.work-grid select, .work-grid input { width: 100%; }
textarea { width: 100%; font: inherit; font-size: 15px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); resize: vertical; box-sizing: border-box; }
textarea:focus { outline: none; border-color: var(--wine); box-shadow: 0 0 0 4px var(--focus); }
.composer { display: grid; gap: 10px; margin-bottom: 20px; }
.composer .row { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.note-text { margin: 2px 0; white-space: pre-wrap; line-height: 1.5; font-size: 14px; color: var(--ink); }
.event .body b { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.event .body .badge { text-decoration: none; }
.lead-row .due { font-size: 12.5px; color: var(--ink-2); }
.lead-row .due.overdue { color: var(--danger); font-weight: 600; }
.page-head select.compact { min-width: 190px; }

/* ---------- people, companies, search (slice 2b) ---------- */
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: 20px; align-content: start; }
.modal .card.wide { max-width: 640px; max-height: calc(100vh - 32px); overflow-y: auto; }
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.form-grid .span-all { grid-column: 1 / -1; }
.form-grid.nested { margin-top: 8px; padding: 14px; border: 1px dashed var(--line-2); border-radius: 12px; background: var(--cream); }
.form-grid textarea { min-height: 96px; }
.search-box { position: relative; display: flex; align-items: center; }
.search-box svg.icon { position: absolute; left: 13px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search-box .search-input { padding-left: 40px; }
.side-search { margin: 18px 0 4px; }
.side-search .search-input { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); color: #fff; font-size: 14px; padding-top: 10px; padding-bottom: 10px; }
.side-search .search-input::placeholder { color: rgba(255, 255, 255, .6); }
.side-search svg.icon { color: rgba(255, 255, 255, .7); }
.filter-row { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .filter-row { grid-template-columns: 1fr 220px; } }
.search-results { display: grid; gap: 20px; }
.search-results .card-title { margin-bottom: 8px; }
.picker { position: relative; display: grid; gap: 6px; }
.picker-results { display: grid; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); overflow: hidden; box-shadow: var(--shadow-lg); }
.picker-results button { display: grid; gap: 2px; text-align: left; padding: 10px 14px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); font: inherit; cursor: pointer; }
.picker-results button:first-child { border-top: 0; }
.picker-results button:hover, .picker-results button:focus-visible { background: var(--cream); outline: none; }
.picker-results button span { font-size: 12.5px; color: var(--muted); }
.picker-results .none { padding: 10px 14px; }
.picked { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 11px 14px; border: 1px solid var(--wine); border-radius: 12px; background: rgba(122, 31, 43, .05); font-weight: 600; }
.company-line { display: flex; gap: 10px; align-items: center; padding: 0 4px 12px; font-size: 14.5px; }
.company-line svg.icon { width: 18px; height: 18px; color: var(--muted); }
.company-line a { color: var(--wine); font-weight: 600; }
.lead-row .who b a { color: inherit; }
.admin-links { margin-top: 18px; }
.topbar .row { gap: 4px; flex-wrap: nowrap; }
.page-head .row .btn svg.icon, .card-head .btn svg.icon { width: 16px; height: 16px; }

/* ---------- delete, trash, deletion log (slice 2c) ---------- */
.choices { display: grid; gap: 10px; }
.choice { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; }
.choice.single { grid-template-columns: 1fr; cursor: default; }
.choice:has(input:checked) { border-color: var(--danger); background: var(--danger-bg); }
.choice input { margin-top: 3px; accent-color: var(--danger); }
.choice > div { display: grid; gap: 4px; min-width: 0; }
.choice b { font-weight: 650; font-size: 14.5px; }
.choice span { font-size: 13px; color: var(--muted); }
.linked-list { margin: 4px 0 6px; padding-left: 18px; font-size: 13px; color: var(--ink-2); display: grid; gap: 2px; max-height: 220px; overflow: auto; }
.lead-row.as-button { width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; font: inherit; text-align: left; cursor: pointer; }
.lead-row.as-button:hover { background: var(--cream); }
.person .who b .badge { margin-left: 6px; vertical-align: middle; }
/* Light avatars inside cards (Trash, Deletion Log, Spam, lead lists): the sidebar style was white on white here. */
.card .avatar.light { background: var(--cream); color: var(--wine); }
