/* ==========================================================================
   LUANA CAMPOS — Design System
   Paleta: nude quente + rosé profundo + champagne. Tipografia: Fraunces (display)
   + Manrope (interface). Tokens em :root; tema escuro via [data-theme="dark"].
   ========================================================================== */
:root {
  --bg: #f8f3ef; --bg-2: #f1e8e2; --surface: #ffffff; --surface-2: #fbf8f6; --surface-3: #f5eee9;
  --line: #ebe0d8; --line-2: #dccbc0;
  --ink: #2a1d22; --ink-2: #5b4850; --ink-3: #8a7780; --ink-4: #b7a8ae;
  --brand: #9a566a; --brand-2: #b97c8c; --brand-3: #e8c9d1; --brand-soft: #f6e8ec; --brand-ink: #6b3244;
  --gold: #b38b54; --gold-soft: #f5ecdf;
  --ok: #3f8a64; --ok-soft: #e2f1e8; --warn: #c8871f; --warn-soft: #fcf1da;
  --bad: #c2453f; --bad-soft: #fbe4e2; --info: #3f6fb5; --info-soft: #e3ecf8;
  --violet: #7a58b3; --violet-soft: #efe8f8; --orange: #d5701f; --orange-soft: #fdebdc;
  --teal: #23858a; --teal-soft: #dcf1f1; --yellow: #d9a514; --yellow-soft: #fbf3d2;
  --slate: #7c828c; --slate-soft: #eef0f3;
  --radius: 14px; --radius-sm: 10px; --radius-xs: 7px; --radius-lg: 20px; --radius-xl: 28px;
  --shadow-1: 0 1px 2px rgba(42, 29, 34, .06), 0 1px 1px rgba(42, 29, 34, .03);
  --shadow-2: 0 10px 30px -12px rgba(42, 29, 34, .22), 0 2px 6px rgba(42, 29, 34, .05);
  --shadow-3: 0 30px 70px -24px rgba(42, 29, 34, .45);
  --ring: 0 0 0 3px rgba(154, 86, 106, .22);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Fraunces', 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --mono: ui-monospace, 'Cascadia Code', Consolas, monospace;
  --sidebar-w: 252px; --topbar-h: 64px;
  color-scheme: light;
}
[data-theme='dark'] {
  --bg: #161113; --bg-2: #1d1619; --surface: #221a1e; --surface-2: #281f24; --surface-3: #2f252a;
  --line: #3a2e34; --line-2: #4a3b42;
  --ink: #f4ebee; --ink-2: #d3c3c9; --ink-3: #a3929a; --ink-4: #6f6067;
  --brand: #d18fa1; --brand-2: #b97c8c; --brand-3: #5e3544; --brand-soft: #3a2530; --brand-ink: #f0c6d2;
  --gold-soft: #3a2f22; --ok-soft: #1c3328; --warn-soft: #3a2e17; --bad-soft: #3d1f1e; --info-soft: #1d2a3f;
  --violet-soft: #2c2340; --orange-soft: #3b2616; --teal-soft: #173334; --yellow-soft: #3a3214; --slate-soft: #2a2c31;
  --shadow-2: 0 10px 30px -12px rgba(0, 0, 0, .6); --shadow-3: 0 30px 70px -24px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
::selection { background: var(--brand-3); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
.serif { font-family: var(--display); font-weight: 500; letter-spacing: -.02em; }
.h1 { font-size: 28px; } .h2 { font-size: 22px; } .h3 { font-size: 17px; } .h4 { font-size: 15px; }
.muted { color: var(--ink-3); } .muted-2 { color: var(--ink-2); } .small { font-size: 12.5px; } .tiny { font-size: 11px; letter-spacing: .02em; }
.upper { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; font-weight: 700; color: var(--ink-3); }
.strong { font-weight: 700; } .num { font-variant-numeric: tabular-nums; } .mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; } .ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-ok { color: var(--ok); } .t-bad { color: var(--bad); } .t-warn { color: var(--warn); } .t-brand { color: var(--brand); } .t-info { color: var(--info); }
.center { text-align: center; } .right { text-align: right; }

/* ---------- layout utilitário ---------- */
.row { display: flex; align-items: center; gap: 8px; }
.row.top { align-items: flex-start; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; } .row.end { justify-content: flex-end; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.gap-0 { gap: 0; } .gap-4 { gap: 4px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; } .gap-24 { gap: 24px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.p-16 { padding: 16px; } .p-20 { padding: 20px; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } .g-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1fr) 360px; } .g-side { grid-template-columns: 300px minmax(0, 1fr); }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-all { grid-column: 1 / -1; }
@media (max-width: 1280px) { .g-5, .g-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g-main { grid-template-columns: 1fr; } }
@media (max-width: 1024px) { .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-side { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .g-2, .g-3, .g-4, .g-5, .g-6 { grid-template-columns: 1fr; } .span-2, .span-3 { grid-column: auto; } .hide-sm { display: none !important; } }
@media (min-width: 641px) { .show-sm { display: none !important; } }

/* ---------- cartões ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.card-head h3 { font-size: 15px; }
.card-body { padding: 14px 20px 18px; }
.card.soft { background: var(--surface-2); box-shadow: none; }
.card.hover { transition: transform .15s, box-shadow .15s, border-color .15s; cursor: pointer; }
.card.hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--line-2); }
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 26px 0 12px; }
.section-title h2 { font-family: var(--display); font-weight: 500; font-size: 21px; }
.section-title .q { color: var(--brand); font-family: var(--display); font-style: italic; }

/* ---------- botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 650; font-size: 13.5px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .08s, box-shadow .15s; user-select: none; }
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 16px -8px var(--brand); }
.btn.primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
[data-theme='dark'] .btn.primary { color: #1b1215; }
[data-theme='dark'] .btn.primary:hover { background: var(--brand-2); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.soft { background: var(--brand-soft); border-color: transparent; color: var(--brand-ink); }
.btn.soft:hover { background: var(--brand-3); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.wa { background: #1faa59; border-color: #1faa59; color: #fff; }
.btn.sm { height: 31px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn.xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 8px; gap: 5px; }
.btn.xs svg { width: 13px; height: 13px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 14px; }
.btn.icon { width: 38px; padding: 0; } .btn.sm.icon { width: 31px; } .btn.xs.icon { width: 26px; }
.btn.block { width: 100%; }
.btn-group { display: inline-flex; border: 1px solid var(--line-2); border-radius: 11px; overflow: hidden; background: var(--surface); }
.btn-group .btn { border: 0; border-radius: 0; height: 36px; }
.btn-group .btn + .btn { border-left: 1px solid var(--line); }
.btn-group .btn.on { background: var(--brand-soft); color: var(--brand-ink); }

/* ---------- segmented / tabs ---------- */
.seg { display: inline-flex; padding: 3px; background: var(--surface-3); border-radius: 12px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 9px; font-weight: 650; font-size: 12.5px; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.seg button .count { font-size: 11px; background: var(--brand-soft); color: var(--brand-ink); padding: 0 6px; border-radius: 20px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: transparent; padding: 11px 14px; font-weight: 650; color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; font-size: 13.5px; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--brand-ink); border-bottom-color: var(--brand); }
[data-theme='dark'] .tabs button.on { color: var(--brand); }
.tabs button svg { width: 15px; height: 15px; }

/* ---------- formulários ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .label { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.field .hint { font-size: 11.5px; color: var(--ink-3); }
.field .err { font-size: 11.5px; color: var(--bad); }
.input, .select, .textarea { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; transition: border-color .15s, box-shadow .15s; }
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand-2); box-shadow: var(--ring); }
.input.sm, .select.sm { height: 33px; font-size: 13px; border-radius: 9px; }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-3); pointer-events: none; }
.input-icon .input { padding-left: 36px; }
.check { display: inline-flex; align-items: flex-start; gap: 9px; cursor: pointer; font-size: 13.5px; line-height: 1.4; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); margin: 1px 0 0; flex: none; }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line-2); border-radius: 22px; cursor: pointer; transition: .2s; }
.switch span::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::before { transform: translateX(16px); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- badges / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 30px; font-size: 11.5px; font-weight: 700; background: var(--slate-soft); color: var(--ink-2); white-space: nowrap; }
.badge svg { width: 12px; height: 12px; }
.badge.dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); } .badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand-ink); } .badge.violet { background: var(--violet-soft); color: var(--violet); }
.badge.gold { background: var(--gold-soft); color: var(--gold); } .badge.orange { background: var(--orange-soft); color: var(--orange); }
.badge.teal { background: var(--teal-soft); color: var(--teal); } .badge.dark { background: var(--ink); color: var(--bg); }
[data-theme='dark'] .badge.brand { color: var(--brand); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 30px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 650; font-size: 13px; cursor: pointer; transition: .15s; white-space: nowrap; }
.chip:hover { border-color: var(--brand-2); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
[data-theme='dark'] .chip.on { color: #1b1215; }
.chip svg { width: 14px; height: 14px; }

/* ---------- avatar ---------- */
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; flex: none; letter-spacing: .02em; background: var(--brand); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; } .avatar.xs { width: 22px; height: 22px; font-size: 9.5px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; } .avatar.xl { width: 84px; height: 84px; font-size: 28px; }
.avatar-stack { display: flex; } .avatar-stack .avatar { border: 2px solid var(--surface); margin-left: -8px; } .avatar-stack .avatar:first-child { margin-left: 0; }

/* ---------- tabela ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th { text-align: left; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .1s; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr:hover { background: var(--surface-2); }
.table .r { text-align: right; } .table .c { text-align: center; }
.table tfoot td { font-weight: 800; background: var(--surface-2); border-top: 1px solid var(--line-2); }

/* ---------- KPI ---------- */
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; position: relative; overflow: hidden; }
.kpi .k-label { font-size: 12px; font-weight: 700; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.kpi .k-label svg { width: 15px; height: 15px; }
.kpi .k-value { font-size: 25px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .k-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-3); }
.trend { display: inline-flex; align-items: center; gap: 3px; font-weight: 800; font-size: 12px; }
.trend.up { color: var(--ok); } .trend.down { color: var(--bad); } .trend.flat { color: var(--ink-3); }
.trend svg { width: 13px; height: 13px; }
.kpi .spark { position: absolute; right: 12px; top: 14px; opacity: .9; }

/* ---------- progress ---------- */
.progress { height: 8px; background: var(--surface-3); border-radius: 10px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-2), var(--brand)); border-radius: 10px; transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.progress.ok > span { background: var(--ok); } .progress.warn > span { background: var(--warn); } .progress.bad > span { background: var(--bad); }
.progress.thin { height: 5px; }

/* ---------- lista ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.list-item:last-child { border-bottom: 0; }
.list-item.click { cursor: pointer; border-radius: 10px; margin: 0 -10px; padding-left: 10px; padding-right: 10px; }
.list-item.click:hover { background: var(--surface-2); }
.icon-box { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand); }
.icon-box svg { width: 19px; height: 19px; }
.icon-box.ok { background: var(--ok-soft); color: var(--ok); } .icon-box.bad { background: var(--bad-soft); color: var(--bad); }
.icon-box.warn { background: var(--warn-soft); color: var(--warn); } .icon-box.info { background: var(--info-soft); color: var(--info); }
.icon-box.violet { background: var(--violet-soft); color: var(--violet); } .icon-box.gold { background: var(--gold-soft); color: var(--gold); }
.icon-box.teal { background: var(--teal-soft); color: var(--teal); } .icon-box.orange { background: var(--orange-soft); color: var(--orange); }

/* ---------- vazio / skeleton ---------- */
.empty { text-align: center; padding: 38px 20px; color: var(--ink-3); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty svg { width: 36px; height: 36px; color: var(--ink-4); }
.empty .t { font-weight: 700; color: var(--ink-2); }
.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- modal / drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(28, 18, 22, .42); backdrop-filter: blur(3px); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s ease; }
.modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-3); width: min(640px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: pop .2s cubic-bezier(.2, .9, .3, 1.2); border: 1px solid var(--line); }
.modal.lg { width: min(900px, 100%); } .modal.xl { width: min(1140px, 100%); } .modal.sm { width: min(440px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 12px; }
.modal-head h3 { font-size: 19px; font-family: var(--display); font-weight: 500; }
.modal-body { padding: 6px 22px 18px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.drawer-overlay { justify-content: flex-end; padding: 0; }
.drawer { background: var(--surface); height: 100%; width: min(560px, 100%); box-shadow: var(--shadow-3); display: flex; flex-direction: column; animation: slide .22s cubic-bezier(.2, .9, .3, 1); border-left: 1px solid var(--line); }
.drawer.lg { width: min(760px, 100%); }
.drawer .modal-foot { border-radius: 0; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@media (max-width: 640px) {
  .overlay { padding: 0; align-items: flex-end; }
  .modal { width: 100% !important; max-height: 94vh; border-radius: 22px 22px 0 0; animation: sheet .25s cubic-bezier(.2, .9, .3, 1); }
  .modal-foot { border-radius: 0; }
  @keyframes sheet { from { transform: translateY(40px); } }
}

/* ---------- toast ---------- */
.toasts { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: 11px; align-items: flex-start; background: var(--ink); color: var(--bg); padding: 13px 15px; border-radius: 14px; box-shadow: var(--shadow-3); animation: pop .22s ease; font-size: 13.5px; }
.toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast.ok svg { color: #7fd3a3; } .toast.bad svg { color: #ff9a92; } .toast.warn svg { color: #ffd07a; }
.toast .t-title { font-weight: 800; }
.toast .t-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.toast .t-actions button { background: rgba(255, 255, 255, .14); color: inherit; border: 0; border-radius: 8px; padding: 4px 10px; font-weight: 700; cursor: pointer; font-size: 12px; }
@media (max-width: 640px) { .toasts { left: 16px; right: 16px; bottom: 84px; } }

/* ---------- alertas inline ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 12px; background: var(--info-soft); color: var(--ink); font-size: 13px; border: 1px solid transparent; }
.alert svg { width: 17px; height: 17px; flex: none; margin-top: 1px; color: var(--info); }
.alert.warn { background: var(--warn-soft); } .alert.warn svg { color: var(--warn); }
.alert.bad { background: var(--bad-soft); } .alert.bad svg { color: var(--bad); }
.alert.ok { background: var(--ok-soft); } .alert.ok svg { color: var(--ok); }
.alert.brand { background: var(--brand-soft); } .alert.brand svg { color: var(--brand); }

/* ==========================================================================
   SHELL DO SISTEMA (sidebar + topbar)
   ========================================================================== */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); flex: none; background: var(--surface); border-right: 1px solid var(--line); height: 100vh; position: sticky; top: 0; display: flex; flex-direction: column; z-index: 40; }
.brand { display: flex; align-items: center; gap: 11px; padding: 18px 18px 14px; }
.brand-mark { width: 40px; height: 40px; border-radius: 13px; background: linear-gradient(145deg, var(--brand-2), var(--brand-ink)); display: grid; place-items: center; color: #fff; font-family: var(--display); font-size: 19px; font-weight: 500; letter-spacing: -.03em; box-shadow: 0 8px 18px -8px var(--brand); flex: none; }
.brand-name { font-family: var(--display); font-size: 19px; font-weight: 500; line-height: 1; letter-spacing: -.02em; }
.brand-sub { font-size: 10.5px; text-transform: uppercase; letter-spacing: .18em; color: var(--ink-3); margin-top: 4px; font-weight: 700; }
.nav { flex: 1; overflow-y: auto; padding: 6px 10px 12px; scrollbar-width: thin; }
.nav-group { margin-top: 12px; }
.nav-group-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-4); font-weight: 800; padding: 6px 10px; }
.nav a, .nav button.nav-link { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; color: var(--ink-2); font-weight: 650; font-size: 13.5px; text-decoration: none; cursor: pointer; border: 0; background: none; width: 100%; text-align: left; transition: background .12s, color .12s; }
.nav a:hover { background: var(--surface-3); color: var(--ink); }
.nav a.on { background: var(--brand-soft); color: var(--brand-ink); }
[data-theme='dark'] .nav a.on { color: var(--brand); }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a .n-badge { margin-left: auto; font-size: 11px; font-weight: 800; background: var(--bad); color: #fff; border-radius: 20px; padding: 0 6px; min-width: 18px; text-align: center; line-height: 18px; }
.nav a .n-badge.soft { background: var(--brand-soft); color: var(--brand-ink); }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--line); }
.user-card { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; cursor: pointer; }
.user-card:hover { background: var(--surface-3); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 26px; position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
.topbar.scrolled { border-bottom-color: var(--line); }
.search-trigger { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-3); cursor: text; font-size: 13.5px; }
.search-trigger svg { width: 16px; height: 16px; }
.search-trigger kbd { margin-left: auto; }
kbd { font-family: var(--font); font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink-3); }
.page { padding: 8px 26px 60px; max-width: 1600px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 10px 0 20px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--display); font-weight: 500; font-size: 30px; letter-spacing: -.025em; }
.page-head .sub { color: var(--ink-3); margin-top: 4px; }
.bell { position: relative; }
.bell .dot { position: absolute; top: 6px; right: 7px; min-width: 16px; height: 16px; border-radius: 10px; background: var(--bad); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--bg); }
.mobile-nav { display: none; }
.demo-ribbon { background: linear-gradient(90deg, var(--gold-soft), var(--brand-soft)); color: var(--ink-2); font-size: 12px; text-align: center; padding: 6px 12px; font-weight: 650; }
.demo-ribbon b { color: var(--brand-ink); }
@media (max-width: 960px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow-3); }
  .sidebar.open { transform: none; }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 39; }
  .topbar { padding: 0 14px; }
  .page { padding: 4px 14px 96px; }
  .page-head h1 { font-size: 25px; }
  .mobile-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .mobile-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 700; color: var(--ink-3); padding: 4px 8px; border-radius: 10px; text-decoration: none; }
  .mobile-nav a.on { color: var(--brand); }
  .mobile-nav a svg { width: 21px; height: 21px; }
}
@media (min-width: 961px) { .only-mobile { display: none !important; } }

/* ---------- command palette ---------- */
.cmdk { width: min(640px, 100%); background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-3); overflow: hidden; border: 1px solid var(--line); align-self: flex-start; margin-top: 10vh; animation: pop .18s ease; }
.cmdk-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cmdk-input input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; color: var(--ink); }
.cmdk-input svg { width: 19px; height: 19px; color: var(--ink-3); }
.cmdk-list { max-height: 56vh; overflow-y: auto; padding: 8px; }
.cmdk-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; color: var(--ink-4); padding: 10px 10px 4px; }
.cmdk-item { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.cmdk-item.on { background: var(--brand-soft); }
.cmdk-item .icon-box { width: 32px; height: 32px; border-radius: 9px; }
.cmdk-item .icon-box svg { width: 16px; height: 16px; }
@media (max-width: 640px) { .cmdk { margin-top: 0; border-radius: 0; height: 100%; } }

/* ---------- notificações ---------- */
.popover { position: absolute; right: 0; top: calc(100% + 8px); width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-3); z-index: 60; overflow: hidden; animation: pop .15s ease; }
@media (max-width: 640px) { .popover { position: fixed; left: 12px; right: 12px; top: 70px; width: auto; } }

/* ==========================================================================
   DASHBOARD / OPORTUNIDADES
   ========================================================================== */
.hero-dash { position: relative; overflow: hidden; border-radius: var(--radius-xl); padding: 24px 26px; background: radial-gradient(1200px 300px at 100% 0%, color-mix(in srgb, var(--brand-2) 35%, transparent), transparent 60%), linear-gradient(135deg, var(--brand-ink), #3b1c28); color: #fff; box-shadow: var(--shadow-2); }
.hero-dash h1 { font-family: var(--display); font-weight: 400; font-size: 30px; letter-spacing: -.02em; }
.hero-dash .muted { color: rgba(255, 255, 255, .72); }
.hero-dash .hero-stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 18px; }
.hero-dash .hero-stats .v { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hero-dash .hero-stats .l { font-size: 12px; color: rgba(255, 255, 255, .7); font-weight: 600; }
.hero-dash .btn { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .22); color: #fff; }
.hero-dash .btn:hover { background: rgba(255, 255, 255, .2); }
.hero-dash .btn.primary { background: #fff; color: var(--brand-ink); border-color: #fff; }
.opp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.opp { padding: 16px; display: flex; flex-direction: column; gap: 10px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); position: relative; overflow: hidden; }
.opp::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--opp, var(--brand)); }
.opp .o-num { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.opp .o-title { font-weight: 750; }
.opp .o-desc { font-size: 12.5px; color: var(--ink-3); }
.opp .o-value { font-size: 13px; font-weight: 800; color: var(--ok); }
.opp .o-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.ring-wrap { position: relative; display: inline-grid; place-items: center; }
.ring-wrap .ring-label { position: absolute; text-align: center; }
.ring-wrap .ring-label .v { font-size: 22px; font-weight: 800; }

/* ---------- gráficos SVG ---------- */
.chart { width: 100%; display: block; overflow: visible; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .grid-line { stroke: var(--line); stroke-dasharray: 3 4; }
.chart text { fill: var(--ink-3); font-size: 10.5px; font-family: var(--font); }
.chart .tip-hit { fill: transparent; cursor: crosshair; }
.chart-tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); padding: 7px 10px; border-radius: 9px; font-size: 12px; box-shadow: var(--shadow-2); white-space: nowrap; transform: translate(-50%, -110%); z-index: 5; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.heat { display: grid; gap: 3px; }
.heat .cell { border-radius: 5px; height: 26px; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; }

/* ==========================================================================
   AGENDA
   ========================================================================== */
.st-PRE_AGENDADO { --st: #9aa0a9; --st-soft: #f3f4f6; }
.st-AGENDADO { --st: #7c828c; --st-soft: #eef0f3; }
.st-CONFIRMADO { --st: #3f6fb5; --st-soft: #e3ecf8; }
.st-CHECKIN { --st: #23858a; --st-soft: #dcf1f1; }
.st-EM_ATENDIMENTO { --st: #d9a514; --st-soft: #fbf3d2; }
.st-FINALIZADO { --st: #3f8a64; --st-soft: #e2f1e8; }
.st-FALTOU { --st: #c2453f; --st-soft: #fbe4e2; }
.st-CANCELADO { --st: #b7a8ae; --st-soft: #f5f1f2; }
.st-REAGENDADO { --st: #d5701f; --st-soft: #fdebdc; }
.st-ENCAIXE { --st: #7a58b3; --st-soft: #efe8f8; }
.st-BLOQUEIO { --st: #26211f; --st-soft: #3a3431; }
[data-theme='dark'] [class*='st-'] { --st-soft: color-mix(in srgb, var(--st) 22%, var(--surface)); }
.st-badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 20px; font-size: 11.5px; font-weight: 750; background: var(--st-soft); color: var(--st); white-space: nowrap; }
.st-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--st); }
.st-BLOQUEIO.st-badge { color: #fff; }
.st-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--st); display: inline-block; flex: none; }

.agenda-shell { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
@media (max-width: 1200px) { .agenda-shell { grid-template-columns: 1fr; } }
.agenda-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.agenda-toolbar .date-title { font-family: var(--display); font-size: 21px; font-weight: 500; min-width: 0; }
.ag-time.first { transform: none; }
.main { overflow-x: clip; }
.search-trigger { min-width: 0; }
/* iPhone: campos de data/hora têm largura mínima própria e vazam do cartão */
input.input[type="date"], input.input[type="time"], input.input[type="datetime-local"] { -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%; text-align: left; line-height: 38px; }
input.input[type="date"]::-webkit-date-and-time-value, input.input[type="time"]::-webkit-date-and-time-value { text-align: left; }
.search-trigger kbd { white-space: nowrap; }
@media (max-width: 640px) { .search-trigger kbd { display: none; } }
@media (max-width: 1280px) { .unit-badge { display: none !important; } }
.ag-board { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; max-height: calc(100vh - 190px); position: relative; box-shadow: var(--shadow-1); }
.ag-grid { display: flex; min-width: min-content; position: relative; }
.ag-times { position: sticky; left: 0; z-index: 4; background: var(--surface); border-right: 1px solid var(--line); width: 58px; flex: none; }
.ag-times .ag-head { position: sticky; top: 0; z-index: 5; }
.ag-time { position: absolute; right: 8px; font-size: 11px; color: var(--ink-3); font-weight: 700; transform: translateY(-7px); font-variant-numeric: tabular-nums; }
.ag-col { position: relative; flex: 1 0 180px; border-right: 1px solid var(--line); }
.ag-col:last-child { border-right: 0; }
.ag-head { position: sticky; top: 0; z-index: 3; height: 62px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 9px; padding: 0 12px; }
.ag-head .h-name { font-weight: 750; font-size: 13px; line-height: 1.15; }
.ag-head .h-sub { font-size: 11px; color: var(--ink-3); }
.ag-body { position: relative; }
.ag-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); pointer-events: none; }
.ag-line.half { border-top-style: dashed; opacity: .6; }
.ag-off { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(-45deg, transparent 0 6px, color-mix(in srgb, var(--ink-4) 14%, transparent) 6px 7px); pointer-events: none; }
.ag-hover { position: absolute; left: 3px; right: 3px; border-radius: 9px; border: 1.5px dashed var(--brand-2); background: var(--brand-soft); color: var(--brand-ink); font-size: 11.5px; font-weight: 750; padding: 3px 8px; pointer-events: none; opacity: .9; }
.ag-card { position: absolute; left: 4px; right: 4px; border-radius: 10px; padding: 5px 8px 5px 10px; font-size: 12px; background: var(--st-soft); color: var(--ink); border-left: 4px solid var(--st); cursor: pointer; overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); transition: box-shadow .12s, transform .12s; z-index: 2; }
.ag-card:hover { box-shadow: var(--shadow-2); z-index: 3; }
.ag-card.dragging { opacity: .45; }
.ag-card .c-top { display: flex; justify-content: space-between; gap: 6px; font-weight: 800; font-size: 11px; color: var(--st); }
.ag-card .c-name { font-weight: 750; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-card .c-proc { color: var(--ink-2); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-card .c-icons { display: flex; gap: 4px; margin-top: 2px; flex-wrap: wrap; }
.ag-card .c-icons span { font-size: 10px; font-weight: 800; padding: 0 5px; border-radius: 6px; background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--ink-2); }
.ag-card.st-CANCELADO { text-decoration: line-through; opacity: .6; }
.ag-card.st-BLOQUEIO { color: #f2ece9; cursor: default; background: repeating-linear-gradient(-45deg, #2c2624 0 8px, #37302d 8px 16px); }
.ag-card.st-BLOQUEIO .c-top { color: #f2ece9; }
.ag-card.prep::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: var(--prep, 0); background: repeating-linear-gradient(90deg, transparent 0 4px, rgba(0, 0, 0, .04) 4px 8px); }
.ag-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 3; pointer-events: none; }
.ag-now::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); }
.ag-col.drop-ok { background: color-mix(in srgb, var(--brand-soft) 50%, transparent); }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(140px, 1fr)); gap: 0; min-width: 980px; }
.week-day { border-right: 1px solid var(--line); min-height: 420px; }
.week-day:last-child { border-right: 0; }
.week-day .wd-head { position: sticky; top: 0; background: var(--surface); padding: 10px 12px; border-bottom: 1px solid var(--line); z-index: 2; }
.week-day.today .wd-head { background: var(--brand-soft); }
.week-item { margin: 6px 8px; padding: 6px 8px; border-radius: 9px; background: var(--st-soft); border-left: 3px solid var(--st); font-size: 12px; cursor: pointer; }
.week-item:hover { box-shadow: var(--shadow-1); }
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.month-grid .mg-h { padding: 8px 10px; font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--line); letter-spacing: .06em; }
.month-cell { min-height: 108px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px; cursor: pointer; transition: background .12s; }
.month-cell:nth-child(7n) { border-right: 0; }
.month-cell:hover { background: var(--surface-2); }
.month-cell.out { opacity: .4; }
.month-cell.today .d { background: var(--brand); color: #fff; }
.month-cell .d { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-weight: 800; font-size: 12.5px; }
.month-cell .occ { height: 5px; border-radius: 5px; background: var(--surface-3); margin-top: 8px; overflow: hidden; }
.month-cell .occ span { display: block; height: 100%; background: var(--brand-2); }

/* mini calendário */
.mini-cal { user-select: none; }
.mini-cal .mc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-weight: 800; text-transform: capitalize; }
.mini-cal .mc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.mini-cal .mc-w { font-size: 10.5px; color: var(--ink-4); font-weight: 800; padding: 4px 0; }
.mini-cal button.mc-d { border: 0; background: transparent; height: 34px; border-radius: 10px; cursor: pointer; font-weight: 650; font-size: 13px; color: var(--ink); position: relative; }
.mini-cal button.mc-d:hover:not(:disabled) { background: var(--surface-3); }
.mini-cal button.mc-d.out { color: var(--ink-4); }
.mini-cal button.mc-d.today { color: var(--brand); font-weight: 900; }
.mini-cal button.mc-d.sel { background: var(--brand); color: #fff; }
.mini-cal button.mc-d:disabled { color: var(--ink-4); cursor: not-allowed; text-decoration: line-through; opacity: .5; }
.mini-cal button.mc-d.has::after { content: ''; position: absolute; bottom: 4px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--ok); }
.mini-cal button.mc-d.sel.has::after { background: #fff; }

/* grade de horários */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.slot { height: 40px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 750; cursor: pointer; font-variant-numeric: tabular-nums; transition: .12s; font-size: 14px; }
.slot:hover { border-color: var(--brand); color: var(--brand); }
.slot.on { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 14px -6px var(--brand); }
.slot-period { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 12px 0 8px; }

/* conflito */
.conflict-box { border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); background: var(--bad-soft); border-radius: 12px; padding: 12px 14px; }
.conflict-box ul { margin: 6px 0 0; padding-left: 18px; }
.resource-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.resource-pills .rp { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 9px; background: var(--surface-3); color: var(--ink-2); }
.resource-pills .rp svg { width: 13px; height: 13px; }
.resource-pills .rp.ok { background: var(--ok-soft); color: var(--ok); }

/* timeline */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item::before { content: ''; position: absolute; left: -20px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2.5px solid var(--tl, var(--brand)); }
.tl-item .tl-date { font-size: 11.5px; color: var(--ink-3); font-weight: 700; }

/* checklist */
.checklist { display: flex; flex-direction: column; gap: 6px; }
.checklist .ck { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 650; font-size: 13px; }
.checklist .ck svg { width: 17px; height: 17px; color: var(--ink-4); }
.checklist .ck.done { background: var(--ok-soft); border-color: transparent; }
.checklist .ck.done svg { color: var(--ok); }

/* ==========================================================================
   CLIENTE 360 / PRONTUÁRIO
   ========================================================================== */
.profile-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.stat-strip > div { padding: 14px 18px; border-right: 1px solid var(--line); }
.stat-strip > div:last-child { border-right: 0; }
.stat-strip .v { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-strip .l { font-size: 11.5px; color: var(--ink-3); font-weight: 700; }
.ba { position: relative; aspect-ratio: 4 / 5; border-radius: 16px; overflow: hidden; user-select: none; background: var(--surface-3); cursor: ew-resize; }
.ba img, .ba .ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba .after { clip-path: inset(0 0 0 var(--pos, 50%)); }
.ba .handle { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 3px; background: #fff; transform: translateX(-50%); box-shadow: 0 0 0 1px rgba(0, 0, 0, .1); }
.ba .handle::after { content: '⇆'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 38px; height: 38px; border-radius: 50%; background: #fff; color: var(--ink); display: grid; place-items: center; font-weight: 900; box-shadow: var(--shadow-2); }
.ba .tag { position: absolute; top: 12px; padding: 3px 10px; border-radius: 20px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.photo-thumb { aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; position: relative; background: var(--surface-3); cursor: pointer; border: 2px solid transparent; }
.photo-thumb.sel { border-color: var(--brand); }
.photo-thumb img, .photo-thumb .ph { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; background: linear-gradient(transparent, rgba(0, 0, 0, .6)); color: #fff; font-size: 11px; font-weight: 700; }
.ph { display: grid; place-items: center; color: rgba(255, 255, 255, .85); font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.form-q { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.form-q.drag { border-style: dashed; }
.signature { border: 1.5px dashed var(--line-2); border-radius: 12px; background: var(--surface-2); height: 150px; width: 100%; touch-action: none; cursor: crosshair; }

/* ==========================================================================
   KANBAN (CRM)
   ========================================================================== */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.k-col { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; max-height: calc(100vh - 250px); }
.k-col.over { border-color: var(--brand); background: var(--brand-soft); }
.k-col-head { padding: 12px 14px 8px; display: flex; align-items: center; gap: 8px; }
.k-col-head .k-dot { width: 9px; height: 9px; border-radius: 50%; }
.k-col-body { padding: 4px 10px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.k-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; cursor: grab; box-shadow: var(--shadow-1); transition: box-shadow .12s, transform .12s; }
.k-card:hover { box-shadow: var(--shadow-2); }
.k-card:active { cursor: grabbing; }

/* ==========================================================================
   WHATSAPP
   ========================================================================== */
.wa-shell { display: grid; grid-template-columns: 330px minmax(0, 1fr) 310px; height: calc(100vh - 150px); min-height: 520px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1); }
@media (max-width: 1280px) { .wa-shell { grid-template-columns: 300px minmax(0, 1fr); } .wa-side { display: none; } }
@media (max-width: 760px) { .wa-shell { grid-template-columns: 1fr; height: calc(100vh - 170px); } .wa-shell.open .wa-list { display: none; } .wa-shell:not(.open) .wa-chat { display: none; } }
.wa-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.wa-list-items { overflow-y: auto; flex: 1; }
.wa-conv { display: flex; gap: 11px; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--line); align-items: center; }
.wa-conv:hover { background: var(--surface-2); }
.wa-conv.on { background: var(--brand-soft); }
.wa-conv .unread { min-width: 20px; height: 20px; border-radius: 20px; background: #1faa59; color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; padding: 0 6px; }
.wa-chat { display: flex; flex-direction: column; min-height: 0; background: var(--surface-2); }
.wa-chat-head { display: flex; align-items: center; gap: 10px; padding: 11px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.wa-msgs { flex: 1; overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 6px; background-image: radial-gradient(color-mix(in srgb, var(--ink-4) 18%, transparent) 1px, transparent 1px); background-size: 18px 18px; }
.bubble { max-width: min(78%, 520px); padding: 8px 12px 6px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; box-shadow: var(--shadow-1); white-space: pre-wrap; word-wrap: break-word; position: relative; }
.bubble.in { align-self: flex-start; background: var(--surface); border-top-left-radius: 4px; }
.bubble.out { align-self: flex-end; background: #dcf5e3; color: #17301f; border-top-right-radius: 4px; }
.bubble.bot { align-self: flex-end; background: var(--brand-soft); color: var(--ink); border-top-right-radius: 4px; }
[data-theme='dark'] .bubble.out { background: #1f4a31; color: #e6f7ec; }
.bubble .meta { font-size: 10.5px; color: var(--ink-3); text-align: right; margin-top: 3px; display: flex; gap: 5px; justify-content: flex-end; align-items: center; }
.bubble .who { font-size: 10.5px; font-weight: 800; color: var(--brand); margin-bottom: 2px; text-transform: uppercase; letter-spacing: .05em; }
.bubble .b-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bubble .b-actions button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 9px; padding: 5px 10px; font-weight: 750; font-size: 12px; color: var(--info); cursor: pointer; }
.day-sep { align-self: center; font-size: 11px; font-weight: 800; color: var(--ink-3); background: var(--surface); padding: 3px 10px; border-radius: 20px; margin: 8px 0; box-shadow: var(--shadow-1); }
.wa-compose { display: flex; gap: 8px; padding: 10px 12px; background: var(--surface); border-top: 1px solid var(--line); align-items: flex-end; }
.wa-compose textarea { flex: 1; resize: none; min-height: 42px; max-height: 140px; border-radius: 14px; }
.wa-side { border-left: 1px solid var(--line); overflow-y: auto; padding: 16px; }
.quick-replies { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px 0; background: var(--surface); scrollbar-width: none; }

/* ==========================================================================
   ASSISTENTE IA
   ========================================================================== */
.ai-fab { position: fixed; right: 24px; bottom: 24px; z-index: 70; height: 52px; padding: 0 18px 0 14px; border-radius: 30px; border: 0; background: linear-gradient(135deg, var(--brand), var(--brand-ink)); color: #fff; font-weight: 800; display: flex; align-items: center; gap: 9px; box-shadow: 0 16px 34px -12px var(--brand); cursor: pointer; transition: transform .15s; }
.ai-fab:hover { transform: translateY(-2px); }
.ai-fab svg { width: 22px; height: 22px; }
@media (max-width: 960px) { .ai-fab { bottom: 84px; right: 14px; height: 48px; } .ai-fab .lbl { display: none; } .ai-fab { padding: 0 13px; } }
.ai-panel { position: fixed; right: 24px; bottom: 24px; width: min(440px, calc(100vw - 32px)); height: min(680px, calc(100vh - 48px)); z-index: 90; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-3); border: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; animation: pop .2s ease; }
@media (max-width: 640px) { .ai-panel { inset: 0; width: 100%; height: 100%; border-radius: 0; } }
.ai-head { padding: 14px 16px; display: flex; align-items: center; gap: 10px; background: linear-gradient(135deg, var(--brand-ink), #3b1c28); color: #fff; }
.ai-head .avatar { background: rgba(255, 255, 255, .16); }
.ai-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.ai-msg { max-width: 88%; padding: 10px 13px; border-radius: 16px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; }
.ai-msg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 5px; }
.ai-msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.ai-msg table { border-collapse: collapse; margin-top: 6px; font-size: 12.5px; width: 100%; }
.ai-msg td, .ai-msg th { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.ai-msg .ai-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ai-suggest { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 14px 0; background: var(--surface); }
.ai-suggest button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 20px; padding: 5px 11px; font-size: 12px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.ai-suggest button:hover { border-color: var(--brand); color: var(--brand); }
.ai-compose { display: flex; gap: 8px; padding: 12px 14px 14px; background: var(--surface); }
.typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* ==========================================================================
   LOGIN
   ========================================================================== */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: radial-gradient(800px 500px at 20% 10%, rgba(233, 196, 206, .55), transparent 60%), radial-gradient(700px 600px at 90% 90%, rgba(179, 139, 84, .35), transparent 60%), linear-gradient(160deg, #6b3244, #2d141d); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art h1 { font-family: var(--display); font-weight: 300; font-size: clamp(38px, 4.4vw, 62px); line-height: 1.02; letter-spacing: -.03em; }
.login-art h1 em { font-style: italic; color: #f3cdd7; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-card { width: min(400px, 100%); }
.demo-users { display: grid; gap: 8px; }
.demo-user { display: flex; gap: 12px; align-items: center; padding: 11px 13px; border: 1px solid var(--line); border-radius: 13px; cursor: pointer; background: var(--surface); transition: .12s; text-align: left; width: 100%; }
.demo-user:hover { border-color: var(--brand-2); box-shadow: var(--shadow-1); }
@media (max-width: 900px) { .login { grid-template-columns: 1fr; } .login-art { min-height: 260px; padding: 28px; } }

/* ---------- utilitários adicionais ---------- */
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: rot .7s linear infinite; display: inline-block; flex: none; }
@keyframes rot { to { transform: rotate(360deg); } }
.ico { flex: none; }
.ac-wrap { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-3); z-index: 20; max-height: 320px; overflow-y: auto; padding: 5px; }
.ac-item { display: flex; gap: 10px; align-items: center; padding: 8px 9px; border-radius: 9px; cursor: pointer; }
.ac-item.on, .ac-item:hover { background: var(--brand-soft); }
.sel-chip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface-2); min-height: 48px; }
.pay-row { display: grid; grid-template-columns: 1.3fr 1fr .9fr 1fr auto; gap: 8px; align-items: end; }
@media (max-width: 640px) { .pay-row { grid-template-columns: 1fr 1fr; } }
.summary-line { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13.5px; }
.summary-line.total { font-size: 18px; font-weight: 800; border-top: 1px dashed var(--line-2); margin-top: 6px; padding-top: 10px; }
.plan-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 11px; border: 1px solid var(--line); }
.plan-row.ok { background: var(--ok-soft); border-color: transparent; }
.plan-row.bad { background: var(--warn-soft); border-color: transparent; }
.plan-row .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--surface); font-size: 12px; }
.info-grid { display: grid; grid-template-columns: 128px 1fr; gap: 9px 12px; font-size: 13.5px; margin: 0; }
.info-grid dt { color: var(--ink-3); font-weight: 650; }
.info-grid dd { margin: 0; font-weight: 600; min-width: 0; }
.hr-label { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin: 16px 0 10px; }
.hr-label::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.link { color: var(--brand); cursor: pointer; font-weight: 700; }
.link:hover { text-decoration: underline; }
.mini-stat { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.mini-stat .v { font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.mini-stat .l { font-size: 11.5px; color: var(--ink-3); font-weight: 700; }
.day-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.day-chips button { width: 42px; height: 34px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 750; cursor: pointer; font-size: 12.5px; }
.day-chips button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.receipt { font-size: 13px; }
.receipt .r-head { text-align: center; border-bottom: 1px dashed var(--line-2); padding-bottom: 12px; margin-bottom: 12px; }
.w-100 { width: 100%; }
.sep { width: 1px; align-self: stretch; background: var(--line); }

/* impressão (relatório de evolução, orçamento, recibo) */
@media print {
  .sidebar, .topbar, .mobile-nav, .ai-fab, .no-print, .toasts, .demo-ribbon { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; }
  .card { box-shadow: none; border-color: #ddd; }
  .overlay { position: static; background: none; backdrop-filter: none; padding: 0; }
  .modal { box-shadow: none; max-height: none; width: 100% !important; border: 0; }
  .modal-foot { display: none; }
}
