/* ==========================================================================
   Seul.ink — Design System v2
   Linguagem: off-white quente, superfícies brancas sem borda e sombra difusa,
   navegação em pílulas, botão principal preto, números grandes em peso fino
   (decimais em cinza), selos amarelo/coral, degradê âmbar -> pêssego -> lavanda.
   Tema claro/escuro via [data-theme] no <html> (ver seul.js).
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, monospace;

  --bg: #F6F4EF;
  --bg-rgb: 246,244,239;
  --surface: #FFFFFF;
  --surface-2: #FAF9F6;
  --surface-3: #F1EFE9;
  --line: #ECE9E2;
  --line-strong: #DEDAD1;

  --text: #161514;
  --text-rgb: 22,21,20;
  --text-2: #8C8880;     /* segundo tom de títulos / decimais */
  --text-3: #B7B3AA;     /* rótulos discretos */

  --ink: #161514;        /* botão principal */
  --on-ink: #FFFFFF;

  --amber: #F5B43C;
  --amber-rgb: 245,180,60;
  --orange: #FF8A3D;
  --yellow: #FFE07A;
  --yellow-ink: #6B4E00;
  --coral: #F2564B;
  --coral-rgb: 242,86,75;
  --green: #22A06B;
  --green-rgb: 34,160,107;
  --lavender: #D9DBF5;
  --blue: #5B7CFA;

  --accent: var(--amber);
  --focus: rgba(245,180,60,.35);

  --grad-warm: linear-gradient(135deg, #F6A93B 0%, #F9C66C 32%, #F6DDB5 62%, #DADCF5 100%);
  --grad-line: linear-gradient(90deg, #F2564B 0%, #FF8A3D 45%, #F5C04A 100%);
  --grad-glow: radial-gradient(60% 50% at 85% 0%, rgba(249,198,108,.28) 0%, rgba(249,198,108,0) 60%),
               radial-gradient(40% 40% at 100% 30%, rgba(218,220,245,.45) 0%, rgba(218,220,245,0) 70%);

  --r-xs: 8px;
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 24px;
  --r-pill: 999px;

  --sh-1: 0 1px 2px rgba(40,30,10,.04);
  --sh-2: 0 1px 2px rgba(40,30,10,.03), 0 10px 30px -18px rgba(60,40,10,.18);
  --sh-3: 0 2px 6px rgba(40,30,10,.04), 0 24px 60px -24px rgba(60,40,10,.28);
  --sh-pop: 0 30px 80px -20px rgba(40,25,5,.35);

  --topbar-h: 68px;
  --page-w: 1320px;
}

:root[data-theme="dark"] {
  --bg: #111110;
  --bg-rgb: 17,17,16;
  --surface: #1A1A18;
  --surface-2: #1F1F1C;
  --surface-3: #262622;
  --line: #2A2926;
  --line-strong: #383631;
  --text: #F3F1EC;
  --text-rgb: 243,241,236;
  --text-2: #8F8B82;
  --text-3: #5E5B55;
  --ink: #F3F1EC;
  --on-ink: #161514;
  --yellow: #E9C04F;
  --yellow-ink: #2A1F00;
  --lavender: #3A3C5C;
  --focus: rgba(245,180,60,.30);
  --grad-warm: linear-gradient(135deg, #C9822A 0%, #B58A45 35%, #6D5B45 65%, #3A3C5C 100%);
  --grad-glow: radial-gradient(60% 50% at 85% 0%, rgba(201,130,42,.16) 0%, rgba(201,130,42,0) 60%),
               radial-gradient(40% 40% at 100% 30%, rgba(90,95,160,.16) 0%, rgba(90,95,160,0) 70%);
  --sh-1: 0 1px 2px rgba(0,0,0,.4);
  --sh-2: 0 1px 2px rgba(0,0,0,.35), 0 10px 30px -18px rgba(0,0,0,.7);
  --sh-3: 0 2px 6px rgba(0,0,0,.4), 0 24px 60px -24px rgba(0,0,0,.8);
  --sh-pop: 0 30px 80px -20px rgba(0,0,0,.85);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
body.app::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: var(--grad-glow);
}
body > * { position: relative; z-index: 1; }
img, svg, canvas { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
h1, h2, h3, h4 { font-weight: 400; letter-spacing: -0.025em; line-height: 1.15; }
strong, b { font-weight: 600; }
code, pre, kbd { font-family: var(--mono); font-size: .88em; }
::selection { background: rgba(var(--amber-rgb), .35); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 6px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
[hidden] { display: none !important; }
.only-mobile { display: none !important; }
html, body { overflow-x: clip; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Tipografia utilitária ---------- */
.soft { color: var(--text-2); }
.faint { color: var(--text-3); }
.muted { color: var(--text-2); }
.eyebrow { font-size: .72rem; letter-spacing: .02em; color: var(--text-2); }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
.big-num { font-weight: 300; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.big-num .dec { color: var(--text-3); }
.big-num sup, .big-num .unit { font-size: .32em; vertical-align: top; color: var(--text-2); letter-spacing: 0; margin-right: 4px; font-weight: 400; position: relative; top: .3em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-right { text-align: right; }
.t-center { text-align: center; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(var(--bg-rgb), .78);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
}
.topbar-inner {
  max-width: var(--page-w); margin: 0 auto; height: var(--topbar-h);
  display: flex; align-items: center; gap: 20px; padding: 0 28px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; font-size: 1.05rem; letter-spacing: -0.02em; flex-shrink: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: var(--ink); color: var(--on-ink); font-size: 1.2rem;
}
.brand-mark i { transform: rotate(-18deg); }
.brand sup { font-size: .6rem; color: var(--text-2); margin-left: -6px; }

.nav-pills {
  display: flex; align-items: center; gap: 2px; padding: 4px; margin: 0 auto;
  background: var(--surface-3); border-radius: var(--r-pill);
  overflow-x: auto; scrollbar-width: none;
}
.nav-pills::-webkit-scrollbar { display: none; }
.nav-pill {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 8px 16px; border-radius: var(--r-pill); font-size: .88rem; color: var(--text-2);
  transition: color .15s, background .15s, box-shadow .15s;
}
.nav-pill i { font-size: 1.05rem; }
.nav-pill:hover { color: var(--text); }
.nav-pill.is-active { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }
.nav-pill .new-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--coral); }

.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center;
  color: var(--text-2); background: transparent; font-size: 1.15rem; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.bordered { background: var(--surface); box-shadow: var(--sh-1); }

.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--grad-warm); color: #3a2400; font-weight: 600; font-size: .9rem; text-transform: uppercase;
  box-shadow: inset 0 0 0 2px var(--surface);
}
.user-menu { position: relative; }
.user-menu > button { display: flex; align-items: center; gap: 8px; border-radius: var(--r-pill); padding: 2px; }
.menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 240px; z-index: 60;
  background: var(--surface); border-radius: var(--r); box-shadow: var(--sh-pop); padding: 6px;
  opacity: 0; transform: translateY(-4px) scale(.98); pointer-events: none; transform-origin: top right;
  transition: opacity .14s, transform .14s;
}
.menu.is-open { opacity: 1; transform: none; pointer-events: auto; }
.menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-head .email { font-size: .88rem; font-weight: 500; }
.menu a, .menu button.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 10px;
  font-size: .9rem; color: var(--text); text-align: left;
}
.menu a i, .menu button.menu-item i { font-size: 1.1rem; color: var(--text-2); }
.menu a:hover, .menu button.menu-item:hover { background: var(--surface-2); }
.menu .menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu .menu-label { font-size: .72rem; color: var(--text-3); padding: 8px 12px 4px; }
.menu .danger, .menu .danger i { color: var(--coral); }

/* Dock flutuante (mobile) */
.dock { display: none; }

/* ---------- Página ---------- */
.page { max-width: var(--page-w); margin: 0 auto; padding: 22px 28px 96px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 10px 0 26px; flex-wrap: wrap; }
.page-head-main { display: flex; align-items: center; gap: 16px; min-width: 0; }
.back-btn {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: var(--surface); box-shadow: var(--sh-1); color: var(--text); font-size: 1.1rem;
}
.back-btn:hover { box-shadow: var(--sh-2); }
.page-title { font-size: 2.15rem; font-weight: 400; letter-spacing: -0.035em; }
.page-title .soft { font-weight: 300; }
.page-sub { color: var(--text-2); margin-top: 6px; font-size: .95rem; max-width: 640px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Grid / layout ---------- */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid-aside { grid-template-columns: minmax(0,1fr) 360px; align-items: start; }
.grid-aside-l { grid-template-columns: 340px minmax(0,1fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 36px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }

/* ---------- Card ---------- */
.card {
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-2);
  position: relative; min-width: 0;
}
.card-pad { padding: 22px 24px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 20px 24px 0; }
.card-head + .card-body { padding-top: 14px; }
.card-body { padding: 20px 24px 22px; }
.card-title { font-size: 1rem; font-weight: 500; letter-spacing: -0.01em; }
.card-sub { font-size: .8rem; color: var(--text-2); margin-top: 2px; }
.card-tools { display: flex; gap: 6px; align-items: center; }
.card.flat { box-shadow: none; background: var(--surface-2); }
.card.inset { box-shadow: inset 0 0 0 1px var(--line); background: transparent; }
.card-divider { height: 1px; background: var(--line); margin: 0 24px; }
.card.is-hover { transition: transform .18s, box-shadow .18s; }
.card.is-hover:hover { transform: translateY(-2px); box-shadow: var(--sh-3); }

/* Card degradê (destaque) */
.card-gradient {
  --on-grad: #2B1A00; --on-grad-2: rgba(43,26,0,.58);
  background: var(--grad-warm); color: var(--on-grad); overflow: hidden;
}
:root[data-theme="dark"] .card-gradient { --on-grad: #FFF6E8; --on-grad-2: rgba(255,246,232,.65); }
.card-gradient .card-sub, .card-gradient .soft, .card-gradient .kpi-hint, .card-gradient .dec { color: var(--on-grad-2) !important; }
.card-gradient h3, .card-gradient .gradient-title, .card-gradient .kpi-value, .card-gradient .kpi-label { color: var(--on-grad); }
.card-gradient h3, .card-gradient .gradient-title { font-size: 1.7rem; font-weight: 300; line-height: 1.12; letter-spacing: -0.03em; }
.card-gradient .gradient-title b { font-weight: 500; }
.on-gradient.icon-btn { background: rgba(255,255,255,.35); color: var(--on-grad); }
.on-gradient.icon-btn:hover { background: rgba(255,255,255,.55); }
.meter.on-gradient { background: rgba(255,255,255,.4); }
.meter.on-gradient > span { background: var(--on-grad); }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 18px; }
.kpi { padding: 20px 22px 18px; display: flex; flex-direction: column; gap: 14px; min-height: 142px; }
.kpi-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.kpi-label { font-size: .9rem; font-weight: 500; }
.kpi-hint { font-size: .75rem; color: var(--text-2); }
.kpi-value { font-size: 2.9rem; }
.kpi-foot { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--text-2); margin-top: auto; }
.kpi-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); font-size: 1.05rem; }
.trend-up { color: var(--green); }
.trend-down { color: var(--coral); }

/* Linha de métricas grandes (estilo "6.91 / 3.64 / 1.75") */
.metric-strip { display: flex; gap: 48px; flex-wrap: wrap; align-items: flex-end; }
.metric-strip .metric { display: flex; flex-direction: column; gap: 6px; }
.metric-strip .big-num { font-size: 3.6rem; }
.metric-strip .metric-label { font-size: .8rem; color: var(--text-2); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px; border-radius: var(--r-pill);
  font-size: .9rem; font-weight: 500; white-space: nowrap; line-height: 1;
  border: 0; transition: background .15s, color .15s, box-shadow .15s, transform .12s, opacity .15s;
  -webkit-tap-highlight-color: transparent; cursor: pointer; text-decoration: none;
}
.btn i { font-size: 1.1em; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn-dark, .btn-primary { background: var(--ink); color: var(--on-ink); }
.btn-dark:hover, .btn-primary:hover { opacity: .9; }
.btn-light, .btn-secondary { background: var(--surface); color: var(--text); box-shadow: var(--sh-1), inset 0 0 0 1px var(--line); }
.btn-light:hover, .btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-accent { background: var(--amber); color: #2b1a00; }
.btn-accent:hover { filter: brightness(1.05); }
.btn-gradient { background: var(--grad-warm); color: #2b1a00; }
.btn-danger { background: rgba(var(--coral-rgb), .12); color: var(--coral); }
.btn-danger:hover { background: var(--coral); color: #fff; }
.btn-danger.solid { background: var(--coral); color: #fff; }
.btn-sm { height: 34px; padding: 0 14px; font-size: .82rem; }
.btn-lg { height: 52px; padding: 0 26px; font-size: 1rem; }
.btn-icon { width: 42px; padding: 0; }
.btn-icon.btn-sm { width: 34px; }
.btn-block { width: 100%; }
.btn:disabled, .btn.is-disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn .kbd { font-size: .7rem; padding: 2px 6px; border-radius: 6px; background: rgba(255,255,255,.14); }
.btn-light .kbd { background: var(--surface-3); color: var(--text-2); }

/* ---------- Pills / status ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-pill);
  font-size: .74rem; font-weight: 500; white-space: nowrap; background: var(--surface-3); color: var(--text-2);
}
.pill i { font-size: .95em; }
.pill-yellow { background: var(--yellow); color: var(--yellow-ink); }
.pill-coral { background: var(--coral); color: #fff; }
.pill-coral-soft { background: rgba(var(--coral-rgb), .12); color: var(--coral); }
.pill-green { background: rgba(var(--green-rgb), .13); color: var(--green); }
.pill-dark { background: var(--ink); color: var(--on-ink); }
.pill-outline { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text-2); }
.pill-lg { height: 30px; padding: 0 14px; font-size: .8rem; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--text-3); flex-shrink: 0; }
.dot-yellow { background: var(--amber); } .dot-coral { background: var(--coral); } .dot-green { background: var(--green); } .dot-blue { background: var(--blue); }

/* ---------- Segmented / tabs ---------- */
.segmented { display: inline-flex; gap: 2px; padding: 4px; border-radius: var(--r-pill); background: var(--surface-3); }
.segmented > * {
  padding: 7px 14px; border-radius: var(--r-pill); font-size: .84rem; color: var(--text-2); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; border: 0; background: transparent;
}
.segmented > *:hover { color: var(--text); }
.segmented > .is-active, .segmented > [aria-selected="true"], .segmented input:checked + label { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }
.segmented .count { font-size: .72rem; color: var(--text-3); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--r-pill);
  font-size: .84rem; color: var(--text-2); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  transition: all .15s; white-space: nowrap;
}
.chip:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.chip.is-active { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.chip .count { font-size: .72rem; opacity: .6; }

/* ---------- Formulários ---------- */
.field, .form-group { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; min-width: 0; }
.field:last-child, .form-group:last-child { margin-bottom: 0; }
.field > label, .form-group > label, .label { font-size: .82rem; font-weight: 500; color: var(--text); display: flex; align-items: center; gap: 6px; }
.field > label .opt, .field > label > a:last-child, .form-group > label .opt, .form-group > label > a:last-child, .label .opt { margin-left: auto; }
.field > label .opt, .label .opt { font-weight: 400; color: var(--text-3); }
.hint { font-size: .78rem; color: var(--text-2); }
.input, .select, .textarea,
.field input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]):not([type=file]),
.field select, .field textarea,
.form-group input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]):not([type=file]),
.form-group select, .form-group textarea {
  width: 100%; height: 46px; padding: 0 16px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid transparent; color: var(--text);
  font-size: .93rem; transition: border-color .15s, box-shadow .15s, background .15s; outline: none;
}
.textarea, .field textarea, .form-group textarea { height: auto; min-height: 104px; padding: 12px 16px; resize: vertical; line-height: 1.5; }
.input::placeholder, .field input::placeholder, .field textarea::placeholder, .form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .field input:hover, .field select:hover, .field textarea:hover, .form-group input:hover, .form-group select:hover, .form-group textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus, .field input:focus, .field select:focus, .field textarea:focus,
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  background: var(--surface); border-color: var(--amber); box-shadow: 0 0 0 4px var(--focus);
}
select, .select {
  appearance: none; -webkit-appearance: none; padding-right: 40px !important; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath fill='%238C8880' d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 13px;
}
input[type=checkbox], input[type=radio] { accent-color: var(--ink); width: 16px; height: 16px; }
input[type=color] { width: 46px; height: 46px; border: 0; border-radius: 14px; background: var(--surface-2); padding: 6px; cursor: pointer; }
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
input[type=color]::-webkit-color-swatch { border: 0; border-radius: 9px; }
input[type=range] { accent-color: var(--ink); width: 100%; }
input[type=file] { font-size: .85rem; color: var(--text-2); }
input[type=file]::file-selector-button { border: 0; border-radius: var(--r-pill); padding: 8px 14px; margin-right: 10px; background: var(--surface-3); color: var(--text); cursor: pointer; font: inherit; font-size: .82rem; }
.input-group {
  display: flex; align-items: stretch; height: 46px; border-radius: 14px; background: var(--surface-2);
  border: 1px solid transparent; transition: border-color .15s, box-shadow .15s; overflow: hidden;
}
.input-group:hover { border-color: var(--line-strong); }
.input-group:focus-within { background: var(--surface); border-color: var(--amber); box-shadow: 0 0 0 4px var(--focus); }
.input-group > span, .input-group .prefix {
  display: flex; align-items: center; padding: 0 4px 0 16px; color: var(--text-2); font-size: .9rem; white-space: nowrap; background: transparent; border: 0;
}
.input-group input { border: 0 !important; box-shadow: none !important; background: transparent !important; height: 100% !important; padding-left: 2px !important; flex: 1; min-width: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 16px; }
.form-grid .span-2 { grid-column: span 2; }

/* Switch */
.switch, .toggle-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input, .toggle-switch input { opacity: 0; width: 0; height: 0; }
.switch .slider, .toggle-slider {
  position: absolute; inset: 0; cursor: pointer; background: var(--line-strong); border-radius: 24px; transition: background .2s;
}
.switch .slider::before, .toggle-slider::before {
  content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s;
}
.switch input:checked + .slider, .toggle-switch input:checked + .toggle-slider { background: var(--ink); }
.switch input:checked + .slider::before, .toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }
:root[data-theme="dark"] .switch input:checked + .slider::before, :root[data-theme="dark"] .toggle-switch input:checked + .toggle-slider::before { background: #161514; }
.switch input:disabled + .slider, .toggle-switch input:disabled + .toggle-slider { opacity: .45; cursor: not-allowed; }

/* Linha de opção (rótulo + switch) */
.option-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; }
.option-row + .option-row { border-top: 1px solid var(--line); }
.option-row .option-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); font-size: 1.15rem; flex-shrink: 0; }
.option-row .option-text { flex: 1; min-width: 0; }
.option-row .option-title { font-size: .92rem; font-weight: 500; }
.option-row .option-desc { font-size: .78rem; color: var(--text-2); }

/* Disclosure (details/summary) */
.disclosure { border-radius: var(--r); background: var(--surface-2); }
.disclosure + .disclosure { margin-top: 10px; }
.disclosure > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  font-size: .9rem; font-weight: 500; user-select: none;
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary i:first-child { color: var(--text-2); font-size: 1.1rem; }
.disclosure > summary .chev { margin-left: auto; color: var(--text-3); transition: transform .2s; }
.disclosure[open] > summary .chev { transform: rotate(180deg); }
.disclosure .disclosure-body { padding: 4px 16px 16px; }

/* ---------- Tabela ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; position: relative; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th {
  text-align: left; font-weight: 400; font-size: .76rem; color: var(--text-2); padding: 12px 16px; white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 24px; }
.table th:last-child, .table td:last-child { padding-right: 24px; }

/* ---------- Lista de itens (linhas sem tabela) ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 24px; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; }
.list-item:hover { background: var(--surface-2); }

/* ---------- Dropdown de ações ---------- */
.actions-menu, .dropdown { position: relative; display: inline-block; }
.actions-btn {
  width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--text-2); font-size: 1.2rem;
}
.actions-btn:hover, .actions-menu.is-open .actions-btn { background: var(--surface-3); color: var(--text); }
.actions-dropdown, .dropdown-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px;
  background: var(--surface); border-radius: 16px; box-shadow: var(--sh-pop); padding: 6px;
}
.actions-dropdown.is-open, .dropdown-menu.is-open { display: block; animation: pop .14s ease-out; }
.actions-dropdown form { margin: 0; }
.actions-dropdown a, .actions-dropdown button, .dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 10px;
  font-size: .88rem; color: var(--text); text-align: left; background: transparent; border: 0; cursor: pointer;
}
.actions-dropdown a i, .actions-dropdown button i, .dropdown-menu a i, .dropdown-menu button i { font-size: 1.05rem; color: var(--text-2); }
.actions-dropdown a:hover, .actions-dropdown button:hover, .dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); }
.actions-dropdown .delete-btn, .actions-dropdown .delete-btn i, .dropdown-menu .danger, .dropdown-menu .danger i { color: var(--coral); }
.actions-dropdown hr, .dropdown-menu hr { border: 0; height: 1px; background: var(--line); margin: 5px 6px; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px;
  background: rgba(22,18,10,.38); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
:root[data-theme="dark"] .modal-overlay { background: rgba(0,0,0,.6); }
.modal-overlay.is-open { display: flex; }
.modal-content, .modal {
  width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column;
  background: var(--surface); border-radius: 26px; box-shadow: var(--sh-pop); animation: pop .2s ease-out; overflow: hidden;
}
.modal-content.modal-sm { max-width: 560px; }
.modal-content.modal-md { max-width: 680px; }
.modal-content.modal-lg { max-width: 820px; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 26px 6px; flex-shrink: 0; }
.modal-header h2 { font-size: 1.45rem; font-weight: 400; letter-spacing: -0.03em; }
.modal-header p, .modal-header .card-sub { color: var(--text-2); font-size: .86rem; margin-top: 4px; }
.modal-close { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); font-size: 1.15rem; flex-shrink: 0; background: var(--surface-2); }
.modal-close:hover { background: var(--surface-3); color: var(--text); }
.modal-body, .modal-body-scrollable { padding: 16px 26px 8px; overflow-y: auto; min-height: 0; flex: 1; }
.modal-content > form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 26px 22px; flex-shrink: 0; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* Cartões de escolha (Criar…) */
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; padding: 14px 26px 26px; }
.choice-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 20px; border-radius: 20px;
  background: var(--surface-2); color: var(--text); transition: transform .15s, box-shadow .15s, background .15s; border: 0; cursor: pointer; font: inherit;
}
.choice-card:hover:not(:disabled) { background: var(--surface); box-shadow: var(--sh-3); transform: translateY(-2px); }
.choice-card:disabled { opacity: .45; cursor: not-allowed; }
.choice-card .choice-icon, .choice-card > i {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 1.35rem; margin-bottom: 10px;
  background: var(--ink); color: var(--on-ink);
}
.choice-card:nth-child(2) > i, .choice-card:nth-child(2) .choice-icon { background: var(--amber); color: #2b1a00; }
.choice-card:nth-child(3) > i, .choice-card:nth-child(3) .choice-icon { background: var(--lavender); color: #262850; }
:root[data-theme="dark"] .choice-card:nth-child(3) > i { color: #E6E7FF; }
.choice-card h3 { font-size: 1rem; font-weight: 500; letter-spacing: -0.01em; }
.choice-card span, .choice-card p { font-size: .8rem; color: var(--text-2); }

/* ---------- Alertas / toasts ---------- */
.alert {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: 14px; font-size: .88rem; margin-bottom: 16px; line-height: 1.45;
  background: var(--surface-2); color: var(--text);
}
.alert > i { font-size: 1.15rem; margin-top: 1px; flex-shrink: 0; }
.alert a { text-decoration: underline; font-weight: 500; }
.alert-success { background: rgba(var(--green-rgb), .1); color: var(--text); }
.alert-success > i { color: var(--green); }
.alert-error, .alert-danger { background: rgba(var(--coral-rgb), .1); color: var(--text); }
.alert-error > i, .alert-danger > i { color: var(--coral); }
.alert-warning, .alert-info { background: rgba(var(--amber-rgb), .16); }
.alert-warning > i, .alert-info > i { color: #B07A10; }

.toasts { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  display: inline-flex; align-items: center; gap: 10px; padding: 11px 18px; border-radius: var(--r-pill);
  background: var(--ink); color: var(--on-ink); font-size: .88rem; box-shadow: var(--sh-pop); animation: toast-in .22s ease-out;
}
.toast i { font-size: 1.1rem; color: var(--amber); }
.toast.is-leaving { animation: toast-out .2s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ---------- Meter (uso do plano) ---------- */
.meter { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 6px; background: var(--grad-line); }
.meter.is-full > span { background: var(--coral); }
.usage { display: flex; flex-direction: column; gap: 8px; }
.usage-top { display: flex; justify-content: space-between; font-size: .8rem; color: var(--text-2); }
.usage-top b { color: var(--text); font-weight: 500; }

/* ---------- Estado vazio ---------- */
.empty { text-align: center; padding: 56px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-art {
  width: 72px; height: 72px; border-radius: 24px; display: grid; place-items: center; font-size: 2rem; margin-bottom: 6px;
  background: var(--grad-warm); color: #fff; box-shadow: 0 16px 40px -18px rgba(245,150,40,.8);
}
.empty h3 { font-size: 1.25rem; font-weight: 400; }
.empty p { color: var(--text-2); max-width: 380px; font-size: .9rem; }

/* ---------- Link curto (componente) ---------- */
.short-link { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; color: var(--text-2); max-width: 100%; }
.short-link a { color: var(--text); font-weight: 500; }
.short-link a:hover { text-decoration: underline; text-underline-offset: 3px; }
.copy-btn {
  width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--text-2); font-size: .95rem; flex-shrink: 0;
}
.copy-btn:hover { background: var(--surface-3); color: var(--text); }
.copy-btn.is-copied { color: var(--green); }
.favicon { width: 36px; height: 36px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; flex-shrink: 0; overflow: hidden; }
.favicon img { width: 18px; height: 18px; }
.favicon i { color: var(--text-3); }

/* ---------- Busca ---------- */
.search {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: var(--r-pill);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); min-width: 240px; transition: box-shadow .15s;
}
.search:focus-within { box-shadow: inset 0 0 0 1px var(--amber), 0 0 0 4px var(--focus); }
.search i { color: var(--text-3); }
.search input { border: 0; outline: none; background: transparent; flex: 1; min-width: 0; font-size: .88rem; height: 100%; }
.search kbd { font-size: .7rem; color: var(--text-3); background: var(--surface-3); border-radius: 6px; padding: 2px 6px; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 24px; }

/* ---------- Gráficos ---------- */
.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 200px; }
.bar-list { display: flex; flex-direction: column; gap: 12px; }
.bar-list-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px 12px; align-items: center; font-size: .86rem; }
.bar-list-item .bar { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.bar-list-item .bar > span { display: block; height: 100%; border-radius: 6px; background: var(--grad-line); }
.bar-list-item .val { color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ---------- Seletor de tema ---------- */
.theme-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--surface-3); }
.theme-switch button { width: 32px; height: 28px; border-radius: var(--r-pill); display: grid; place-items: center; color: var(--text-2); font-size: .95rem; }
.theme-switch button:hover { color: var(--text); }
.theme-switch button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }
.menu .theme-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 12px; font-size: .88rem; }

/* ---------- Code ---------- */
.code {
  background: #161514; color: #EDE9E0; border-radius: 16px; padding: 16px 18px; overflow-x: auto; font-family: var(--mono); font-size: .82rem; line-height: 1.6;
}
:root[data-theme="dark"] .code { background: #0C0C0B; box-shadow: inset 0 0 0 1px var(--line); }
.code .k { color: #F5B43C; } .code .s { color: #A6E3A1; } .code .c { color: #7F7A70; }
.kbd-inline { font-family: var(--mono); font-size: .8em; background: var(--surface-3); border-radius: 6px; padding: 2px 6px; }

/* ---------- Avisos de limite / upsell ---------- */
.upsell { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: 20px; background: var(--grad-warm); color: #2b1a00; }
.upsell .upsell-text { flex: 1; font-size: .92rem; }
.upsell .upsell-text b { font-weight: 600; }
:root[data-theme="dark"] .upsell { color: #FFF3DF; }

/* ---------- Footer simples ---------- */
.app-foot { max-width: var(--page-w); margin: 0 auto; padding: 0 28px 40px; color: var(--text-3); font-size: .78rem; display: flex; justify-content: space-between; gap: 12px; }

/* ---------- Responsivo ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-aside, .grid-aside-l { grid-template-columns: minmax(0,1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .topbar-inner { padding: 0 16px; gap: 12px; }
  .topbar .nav-pills { display: none; }
  .topbar-actions { margin-left: auto; }
  .hide-mobile { display: none !important; }
  .only-mobile { display: revert !important; }
  .kpi-hint { display: none; }
  .page { padding: 12px 16px 120px; }
  .page-title { font-size: 1.7rem; }
  .page-head { margin: 6px 0 18px; align-items: flex-start; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0,1fr); }
  .form-grid { grid-template-columns: minmax(0,1fr); }
  .form-grid .span-2 { grid-column: auto; }
  .choice-grid { grid-template-columns: minmax(0,1fr); padding: 10px 18px 20px; }
  .metric-strip { gap: 28px; }
  .metric-strip .big-num { font-size: 2.6rem; }
  .card-head { padding: 18px 18px 0; }
  .card-body, .card-pad { padding: 16px 18px 18px; }
  .toolbar { padding: 14px 18px; }
  .table th:first-child, .table td:first-child { padding-left: 18px; }
  .table th:last-child, .table td:last-child { padding-right: 18px; }
  .search { min-width: 0; flex: 1; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-content, .modal { max-width: none !important; border-radius: 26px 26px 0 0; max-height: 92vh; animation: sheet .24s ease-out; }
  .modal-footer { flex-direction: column-reverse; }
  .modal-footer .btn { width: 100%; }
  .app-foot { padding: 0 16px 110px; }
  .dock {
    display: flex; position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 50;
    gap: 2px; padding: 6px; border-radius: var(--r-pill); background: rgba(var(--bg-rgb), .86);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--sh-pop), inset 0 0 0 1px var(--line);
  }
  .dock a { width: 52px; height: 46px; border-radius: var(--r-pill); display: grid; place-items: center; color: var(--text-2); font-size: 1.3rem; }
  .dock a.is-active { background: var(--ink); color: var(--on-ink); }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; }
  .kpi { min-height: 0; padding: 16px; gap: 10px; }
  .kpi-value { font-size: 2.1rem; }
  .grid-4 { grid-template-columns: minmax(0,1fr); }
}
@keyframes sheet { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Painel master / suporte ---------- */
.impersonation-bar {
  position: sticky; top: 0; z-index: 45; display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 16px; background: var(--yellow); color: var(--yellow-ink); font-size: .86rem; text-align: center;
}
.impersonation-bar > i { font-size: 1.1rem; }
.impersonation-bar + .topbar { top: 46px; }
.topbar.is-master .brand-mark { background: var(--grad-warm); color: #2b1a00; }
