/* ==========================================================================
   Central Comercial Rufino · folha de estilos principal
   Organização: tokens > base > layout > componentes > telas > utilitários > responsivo
   ========================================================================== */

@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("../fonts/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 600; font-display: swap; src: url("../fonts/manrope-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 700; font-display: swap; src: url("../fonts/manrope-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 800; font-display: swap; src: url("../fonts/manrope-latin-800-normal.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  --brand: #0098DA;
  --brand-600: #0085C0;
  --brand-700: #006D9E;
  --brand-800: #0A5276;
  --brand-50: #EBF7FD;
  --brand-100: #D3EEFA;
  --brand-200: #A9DDF4;

  --navy-950: #071423;
  --navy-900: #0B1C2E;
  --navy-800: #12283F;
  --navy-700: #1B3653;
  --navy-500: #4D6782;
  --navy-300: #9FB2C6;

  --ink: #0F1B2A;
  --ink-2: #3B495B;
  --ink-3: #66758A;
  --ink-4: #97A3B3;
  --line: #E3E8EF;
  --line-2: #EEF2F6;
  --bg: #F3F6F9;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --surface-3: #F1F4F8;

  --success: #15803D; --success-bg: #E9F7EE; --success-line: #BFE6CD;
  --warning: #B45309; --warning-bg: #FEF4E6; --warning-line: #F8D9A8;
  --danger: #C62828; --danger-bg: #FDEDED; --danger-line: #F5C2C2;
  --info: #0369A1; --info-bg: #E8F4FB; --info-line: #BFE0F2;
  --violet: #6D28D9; --violet-bg: #F2ECFD; --violet-line: #DCCDFA;
  --teal: #0F766E; --teal-bg: #E6F6F4;
  --amber: #A16207; --amber-bg: #FDF6E3;
  --wa: #128C4A; --wa-bg: #E7F7EE;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow-sm: 0 1px 2px rgba(15, 27, 42, .06);
  --shadow: 0 1px 3px rgba(15, 27, 42, .06), 0 6px 16px -8px rgba(15, 27, 42, .12);
  --shadow-lg: 0 20px 48px -12px rgba(11, 28, 46, .28);
  --ring: 0 0 0 3px rgba(0, 152, 218, .22);

  --sidebar-w: 248px;
  --sidebar-w-collapsed: 72px;
  --topbar-h: 60px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Manrope", "Inter", system-ui, sans-serif;
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 400 14px/1.5 var(--font); color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01";
}
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--ink); margin: 0; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 800; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 700; }
p { margin: 0; }
a { color: var(--brand-700); text-decoration: none; }
a:hover { color: var(--brand-800); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
::selection { background: var(--brand-100); }
.num, .tabular { font-variant-numeric: tabular-nums; }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.ico-sm { width: 14px; height: 14px; }
.ico-lg { width: 22px; height: 22px; }
.ico-xl { width: 28px; height: 28px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Marca tipográfica (substituída pelo logo oficial quando enviado) ---------- */
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.wordmark__mark {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: var(--brand); color: #fff; font: 800 18px/1 var(--font-head);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.14);
}
.wordmark__text { display: flex; flex-direction: column; line-height: 1; }
.wordmark__text strong { font: 800 17px/1 var(--font-head); letter-spacing: .08em; }
.wordmark__text small { font: 600 8.5px/1 var(--font); letter-spacing: .32em; margin-top: 4px; color: var(--ink-3); }
.wordmark--light, .wordmark--light .wordmark__text small { color: #fff; }
.wordmark--light .wordmark__text small { opacity: .62; }

/* ==========================================================================
   Layout da aplicação
   ========================================================================== */
.app { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); transition: grid-template-columns .2s ease; }
html.is-collapsed .app { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); }

/* Menu lateral */
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-950) 100%); color: var(--navy-300);
  border-right: 1px solid rgba(255,255,255,.04); z-index: 40;
}
.sidebar__brand { height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 14px 0 18px; border-bottom: 1px solid rgba(255,255,255,.06); }
.sidebar__brand a { display: flex; align-items: center; min-width: 0; }
.sidebar__brand img { max-height: 34px; width: auto; }
.sidebar__collapse { border: 0; background: transparent; color: var(--navy-300); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; }
.sidebar__collapse:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar__nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 10px 18px; scrollbar-width: thin; scrollbar-color: var(--navy-700) transparent; }
.nav-section { margin-top: 14px; }
.nav-section:first-child { margin-top: 2px; }
.nav-section__label { font: 600 10.5px/1 var(--font); text-transform: uppercase; letter-spacing: .12em; color: var(--navy-500); padding: 0 10px 8px; white-space: nowrap; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 10px; margin: 1px 0;
  border-radius: 9px; color: #C3D0DD; font-weight: 500; white-space: nowrap;
}
.nav-link .ico { color: var(--navy-300); }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link:hover .ico { color: #fff; }
.nav-link.is-active { background: rgba(0,152,218,.16); color: #fff; }
.nav-link.is-active .ico { color: #5CC6F2; }
.nav-link.is-active::before { content: ""; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav-link__label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--brand); color: #fff; font: 600 11px/20px var(--font); text-align: center; }
.nav-count--danger { background: #E5484D; }
.sidebar__foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.06); }
.phase-card { border-radius: 10px; padding: 11px 12px; background: rgba(0,152,218,.1); border: 1px solid rgba(0,152,218,.22); color: #CFE9F7; font-size: 12px; line-height: 1.4; }
.phase-card strong { display: block; color: #fff; font: 700 12.5px/1.3 var(--font-head); margin-bottom: 2px; }

html.is-collapsed .nav-section__label, html.is-collapsed .nav-link__label, html.is-collapsed .nav-count,
html.is-collapsed .sidebar__foot, html.is-collapsed .sidebar__brand .wordmark__text, html.is-collapsed .sidebar__brand img { display: none; }
html.is-collapsed .sidebar__brand { justify-content: center; padding: 0; }
html.is-collapsed .sidebar__brand a { display: none; }
html.is-collapsed .nav-link { justify-content: center; padding: 0; }
html.is-collapsed .nav-section { margin-top: 8px; border-top: 1px solid rgba(255,255,255,.06); padding-top: 8px; }
html.is-collapsed .nav-section:first-child { border-top: 0; padding-top: 0; }
html.is-collapsed .nav-link.has-count::after { content: ""; position: absolute; top: 8px; right: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 2px var(--navy-900); }

/* Fundo escuro do menu no celular (fora do grid) */
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(7,20,35,.45); z-index: 39; }

/* Área principal */
.shell { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: 12px;
  padding: 0 24px; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line);
}
.topbar__menu { display: none; }
.topbar__search {
  flex: 1; max-width: 520px; height: 38px; display: flex; align-items: center; gap: 10px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink-3); text-align: left;
}
.topbar__search:hover { border-color: #CDD6E1; background: #fff; }
.topbar__search span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.kbd { font: 600 11px/1 var(--font); color: var(--ink-3); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 3px 6px; background: #fff; }
.topbar__spacer { flex: 1; }
.topbar__actions { display: flex; align-items: center; gap: 6px; }
.preview-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 14px;
  background: var(--amber-bg); color: var(--amber); font-weight: 600; font-size: 12px; white-space: nowrap; border: 1px solid #F3E2B5;
}
.icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--ink-2);
  display: inline-grid; place-items: center;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn__dot { position: absolute; top: 7px; right: 7px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #E5484D; color: #fff; font: 700 10px/16px var(--font); box-shadow: 0 0 0 2px #fff; }
.user-btn { display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 8px 0 4px; border: 0; background: transparent; border-radius: 10px; text-align: left; }
.user-btn:hover { background: var(--surface-3); }
.user-btn__name { display: flex; flex-direction: column; line-height: 1.2; }
.user-btn__name strong { font-size: 13px; font-weight: 600; }
.user-btn__name small { font-size: 11.5px; color: var(--ink-3); }

.main { padding: 24px; flex: 1; min-width: 0; }
.main--flush { padding: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head__title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.page-head__title p { color: var(--ink-3); }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 12.5px; margin-bottom: 2px; }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--brand-700); }
.phase-tag { display: inline-flex; align-items: center; gap: 5px; font: 600 11px/1 var(--font); color: var(--violet); background: var(--violet-bg); border: 1px solid var(--violet-line); padding: 4px 8px; border-radius: 20px; vertical-align: middle; white-space: nowrap; }

/* ==========================================================================
   Componentes
   ========================================================================== */

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 600; font-size: 13.5px;
  white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s; text-decoration: none;
}
.btn:hover { background: var(--surface-2); border-color: #CDD6E1; color: var(--ink); }
.btn .ico { width: 16px; height: 16px; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(0,109,158,.3), inset 0 1px 0 rgba(255,255,255,.15); }
.btn--primary:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn--dark { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.btn--dark:hover { background: var(--navy-800); color: #fff; }
.btn--ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn--ghost:hover { background: var(--surface-3); border-color: transparent; }
.btn--danger { color: var(--danger); }
.btn--danger:hover { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger); }
.btn--success { background: var(--success); border-color: var(--success); color: #fff; }
.btn--success:hover { background: #116B33; color: #fff; }
.btn--wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn--wa:hover { background: #0E7A40; color: #fff; }
.btn--sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn--lg { height: 44px; padding: 0 20px; font-size: 15px; border-radius: 11px; }
.btn--icon { width: 36px; padding: 0; }
.btn--sm.btn--icon { width: 30px; }
.btn--block { width: 100%; }
.btn-group { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.btn-group a, .btn-group button { height: 34px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--ink-2); font-weight: 600; font-size: 13px; }
.btn-group > * + * { border-left: 1px solid var(--line) !important; }
.btn-group .is-active { background: var(--brand-50); color: var(--brand-700); }

/* Cartões */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.card__head h2 { font-size: 15px; }
.card__head p { color: var(--ink-3); font-size: 12.5px; }
.card__body { padding: 16px 18px 18px; }
.card__foot { padding: 12px 18px; border-top: 1px solid var(--line-2); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card--pad { padding: 18px; }
.card--flat { box-shadow: none; }
.card-link { font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }

/* Grid */
.grid { display: grid; gap: 16px; }
.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-main-side { grid-template-columns: minmax(0, 1fr) 340px; }
.grid-side-main { grid-template-columns: 300px minmax(0, 1fr); }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 8px; }
.row-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px 14px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 6px; min-width: 0; color: inherit; }
a.kpi:hover { border-color: var(--brand-200); color: inherit; }
.kpi__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-3); font-size: 12.5px; font-weight: 500; }
.kpi__icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); }
.kpi__icon .ico { width: 16px; height: 16px; }
.kpi__value { font: 800 24px/1.1 var(--font-head); letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi__meta { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kpi--danger .kpi__icon { background: var(--danger-bg); color: var(--danger); }
.kpi--warning .kpi__icon { background: var(--warning-bg); color: var(--warning); }
.kpi--success .kpi__icon { background: var(--success-bg); color: var(--success); }
.kpi--violet .kpi__icon { background: var(--violet-bg); color: var(--violet); }
.trend { font-weight: 600; display: inline-flex; align-items: center; gap: 2px; }
.trend--up { color: var(--success); }
.trend--down { color: var(--danger); }

/* Etiquetas */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; font: 600 11.5px/1 var(--font); white-space: nowrap; border: 1px solid transparent; }
.badge .ico { width: 12px; height: 12px; }
.badge--neutral { background: var(--surface-3); color: var(--ink-2); border-color: var(--line); }
.badge--brand { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-100); }
.badge--info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.badge--success { background: var(--success-bg); color: var(--success); border-color: var(--success-line); }
.badge--warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-line); }
.badge--danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }
.badge--violet { background: var(--violet-bg); color: var(--violet); border-color: var(--violet-line); }
.badge--teal { background: var(--teal-bg); color: var(--teal); }
.badge--wa { background: var(--wa-bg); color: var(--wa); }
.badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; background: var(--surface-3); color: var(--ink-2); font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.stage-pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 8px; border-radius: 12px; background: var(--surface-3); font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.stage-pill i { width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* Avatares */
.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; font: 700 11px/1 var(--font); color: #fff; background: var(--navy-500); letter-spacing: .02em; }
.avatar--xs { width: 22px; height: 22px; font-size: 9.5px; }
.avatar--sm { width: 28px; height: 28px; }
.avatar--md { width: 36px; height: 36px; font-size: 13px; }
.avatar--lg { width: 52px; height: 52px; font-size: 18px; }
.avatar--empty { background: var(--surface-3); color: var(--ink-4); border: 1px dashed var(--line); }
.avatar--empty .ico { width: 14px; height: 14px; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px #fff; }
.avatar-stack .avatar + .avatar { margin-left: -7px; }
.cmark { display: inline-grid; place-items: center; flex: none; border-radius: 10px; font: 800 13px/1 var(--font-head); }
.cmark--sm { width: 32px; height: 32px; font-size: 11.5px; border-radius: 8px; }
.cmark--md { width: 40px; height: 40px; }
.cmark--lg { width: 60px; height: 60px; font-size: 20px; border-radius: 14px; }
.tone-1 { background: #0098DA; color: #fff; } .cmark.tone-1 { background: #E3F4FC; color: #006D9E; }
.tone-2 { background: #0F766E; color: #fff; } .cmark.tone-2 { background: #E2F4F1; color: #0F766E; }
.tone-3 { background: #6D28D9; color: #fff; } .cmark.tone-3 { background: #EFE8FC; color: #5B21B6; }
.tone-4 { background: #B45309; color: #fff; } .cmark.tone-4 { background: #FDF0DE; color: #92400E; }
.tone-5 { background: #BE185D; color: #fff; } .cmark.tone-5 { background: #FCE7F1; color: #9D174D; }
.tone-6 { background: #1D4ED8; color: #fff; } .cmark.tone-6 { background: #E6EDFD; color: #1E40AF; }
.tone-7 { background: #15803D; color: #fff; } .cmark.tone-7 { background: #E6F5EB; color: #166534; }
.tone-8 { background: #334155; color: #fff; } .cmark.tone-8 { background: #EAEEF3; color: #334155; }

/* Formulários */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span, .label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--ink-3); font-size: 12px; }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2366758A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.textarea { height: auto; min-height: 92px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:hover, .select:hover, .textarea:hover { border-color: #CDD6E1; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.input[disabled], .select[disabled], .textarea[disabled] { background: var(--surface-2); color: var(--ink-3); }
.input-icon { position: relative; }
.input-icon .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-4); width: 16px; height: 16px; pointer-events: none; }
.input-icon .input { padding-left: 34px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.switch { position: relative; display: inline-flex; width: 36px; height: 20px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.switch span { position: absolute; inset: 0; border-radius: 10px; background: #CBD5E1; transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(16px); }

/* Barra de filtros */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input-icon { flex: 1; min-width: 220px; max-width: 360px; }
.toolbar .select { width: auto; min-width: 150px; height: 36px; }
.toolbar .input { height: 36px; }
.toolbar__spacer { flex: 1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.chip:hover { border-color: #CDD6E1; color: var(--ink); }
.chip.is-active { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.chip__count { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 9px; background: var(--surface-3); color: var(--ink-2); }
.chip.is-active .chip__count { background: rgba(255,255,255,.18); color: #fff; }

/* Abas */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 12px; border: 0; background: transparent; color: var(--ink-3); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--brand-700); }
.tab.is-active::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand); }
.tab__count { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 9px; background: var(--surface-3); color: var(--ink-3); }
.tab.is-active .tab__count { background: var(--brand-50); color: var(--brand-700); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* Tabelas */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th { text-align: left; font: 600 11.5px/1 var(--font); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th:first-child { border-top-left-radius: var(--radius); }
.table th:last-child { border-top-right-radius: var(--radius); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: #FAFCFE; }
.table tr[data-href] { cursor: pointer; }
.table .right, .right { text-align: right; }
.table .muted, .muted { color: var(--ink-3); }
.cell-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.cell-main__text { display: flex; flex-direction: column; min-width: 0; }
.cell-main__text strong { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.cell-main__text small { color: var(--ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.table-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line-2); color: var(--ink-3); font-size: 12.5px; flex-wrap: wrap; }
.pager { display: flex; gap: 4px; }
.pager a, .pager span { min-width: 30px; height: 30px; padding: 0 8px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); color: var(--ink-2); font-weight: 600; background: #fff; }
.pager .is-current { background: var(--navy-900); color: #fff; border-color: var(--navy-900); }
.pager .is-disabled { opacity: .45; }

/* Listas simples */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); min-width: 0; color: inherit; }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { color: inherit; }
a.list-item:hover .list-item__title { color: var(--brand-700); }
.list-item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.list-item__title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item__meta { color: var(--ink-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item__aside { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 12.5px; }

/* Ícone de tipo de atividade */
.atype { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.atype .ico { width: 16px; height: 16px; }
.atype--blue { background: var(--brand-50); color: var(--brand-700); }
.atype--sky { background: var(--info-bg); color: var(--info); }
.atype--green { background: var(--wa-bg); color: var(--wa); }
.atype--violet { background: var(--violet-bg); color: var(--violet); }
.atype--amber { background: var(--amber-bg); color: var(--amber); }
.atype--teal { background: var(--teal-bg); color: var(--teal); }
.atype--slate { background: var(--surface-3); color: var(--ink-2); }

/* Alertas */
.alert { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 10px; border: 1px solid; font-size: 13px; font-weight: 500; color: var(--ink); }
.alert + .alert { margin-top: 8px; }
.alert .ico { flex: none; }
.alert__go { margin-left: auto; color: var(--ink-3); }
a.alert:hover { color: var(--ink); filter: brightness(.98); }
.alert--danger { background: var(--danger-bg); border-color: var(--danger-line); } .alert--danger > .ico { color: var(--danger); }
.alert--warning { background: var(--warning-bg); border-color: var(--warning-line); } .alert--warning > .ico { color: var(--warning); }
.alert--info { background: var(--info-bg); border-color: var(--info-line); } .alert--info > .ico { color: var(--info); }
.alert--success { background: var(--success-bg); border-color: var(--success-line); } .alert--success > .ico { color: var(--success); }
.notice { display: flex; gap: 12px; padding: 13px 15px; border-radius: 11px; background: linear-gradient(90deg, var(--violet-bg), #F8F5FE); border: 1px solid var(--violet-line); color: #4C1D95; font-size: 13px; margin-bottom: 16px; }
.notice .ico { color: var(--violet); flex: none; margin-top: 1px; }
.notice strong { color: #3B0F7A; }

/* Progresso */
.progress { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 4px; background: var(--brand); }
.progress--success > i { background: var(--success); }

/* Linha do tempo */
.timeline { position: relative; display: flex; flex-direction: column; }
.tl-day { font: 700 11.5px/1 var(--font); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 18px 0 10px 46px; }
.tl-day:first-child { margin-top: 0; }
.tl-item { position: relative; display: flex; gap: 12px; padding-bottom: 14px; }
.tl-item::before { content: ""; position: absolute; left: 16px; top: 34px; bottom: 0; width: 2px; background: var(--line-2); }
.tl-item:last-child::before { display: none; }
.tl-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--ink-2); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); z-index: 1; }
.tl-icon .ico { width: 15px; height: 15px; }
.tl-icon--brand { background: var(--brand-50); color: var(--brand-700); }
.tl-icon--success { background: var(--success-bg); color: var(--success); }
.tl-icon--danger { background: var(--danger-bg); color: var(--danger); }
.tl-icon--violet { background: var(--violet-bg); color: var(--violet); }
.tl-icon--amber { background: var(--amber-bg); color: var(--amber); }
.tl-icon--sky { background: var(--info-bg); color: var(--info); }
.tl-icon--green { background: var(--wa-bg); color: var(--wa); }
.tl-icon--teal { background: var(--teal-bg); color: var(--teal); }
.tl-icon--info { background: var(--info-bg); color: var(--info); }
.tl-body { flex: 1; min-width: 0; padding-top: 6px; }
.tl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.tl-title { font-weight: 600; font-size: 13.5px; }
.tl-title a { color: var(--ink); }
.tl-title a:hover { color: var(--brand-700); }
.tl-time { color: var(--ink-4); font-size: 12px; white-space: nowrap; }
.tl-text { color: var(--ink-2); font-size: 13px; margin-top: 3px; white-space: pre-line; }
.tl-text--box { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 9px; padding: 9px 11px; margin-top: 6px; }
.tl-note .tl-text--box { background: #FFFBEA; border-color: #F6E7B0; }
.tl-by { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); margin-top: 5px; }
.tl-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }

/* Menus suspensos */
.dropdown { position: relative; }
.dropdown__menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; display: none;
}
.dropdown.is-open .dropdown__menu { display: block; animation: pop .14s ease-out; }
.dropdown__menu--left { left: 0; right: auto; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font-size: 13.5px; text-align: left; }
.menu-item .ico { color: var(--ink-3); width: 16px; height: 16px; }
.menu-item:hover { background: var(--surface-3); color: var(--ink); }
.menu-sep { height: 1px; background: var(--line-2); margin: 6px 0; }
.menu-head { padding: 8px 10px 6px; font: 600 11px/1 var(--font); color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

/* Notificações */
.notif-panel { width: 380px; padding: 0; }
.notif-panel__head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 10px; }
.notif-list { max-height: 420px; overflow-y: auto; }
.notif { display: flex; gap: 11px; padding: 11px 16px; border-top: 1px solid var(--line-2); color: var(--ink); }
.notif:hover { background: var(--surface-2); color: var(--ink); }
.notif.is-unread { background: #F6FBFE; }
.notif.is-unread .notif__title::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-left: 6px; vertical-align: middle; }
.notif__icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.notif__icon .ico { width: 16px; height: 16px; }
.notif__title { font-weight: 600; font-size: 13px; }
.notif__body { font-size: 12.5px; color: var(--ink-3); }
.notif__time { font-size: 11.5px; color: var(--ink-4); margin-top: 2px; }
.tone-bg-brand { background: var(--brand-50); color: var(--brand-700); }
.tone-bg-green { background: var(--wa-bg); color: var(--wa); }
.tone-bg-info { background: var(--info-bg); color: var(--info); }
.tone-bg-violet { background: var(--violet-bg); color: var(--violet); }
.tone-bg-danger { background: var(--danger-bg); color: var(--danger); }
.tone-bg-warning { background: var(--warning-bg); color: var(--warning); }
.tone-bg-success { background: var(--success-bg); color: var(--success); }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal.is-open { display: flex; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(7, 20, 35, .48); backdrop-filter: blur(2px); animation: fade .15s ease-out; }
.modal__dialog { position: relative; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); animation: rise .18s ease-out; }
.modal__dialog--lg { max-width: 760px; }
.modal__dialog--sm { max-width: 440px; }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.modal__head p { color: var(--ink-3); font-size: 13px; margin-top: 3px; }
.modal__body { padding: 16px 20px; }
.modal__foot { padding: 14px 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.985); } }

/* Painel lateral (drawer) */
.drawer { position: fixed; inset: 0; z-index: 80; display: none; }
.drawer.is-open { display: block; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(7, 20, 35, .32); animation: fade .15s ease-out; }
.drawer__panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--bg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .2s ease-out; }
.drawer__close { position: absolute; top: 12px; right: 12px; z-index: 2; }
.drawer__content { flex: 1; overflow-y: auto; }
.drawer__loading { display: grid; place-items: center; height: 100%; color: var(--ink-3); }
@keyframes slide { from { transform: translateX(30px); opacity: .4; } }

/* Toast */
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; max-width: 400px; padding: 12px 14px; border-radius: 12px; background: var(--navy-900); color: #fff; box-shadow: var(--shadow-lg); font-size: 13.5px; animation: rise .2s ease-out; }
.toast .ico { flex: none; margin-top: 1px; }
.toast--success .ico { color: #4ADE80; }
.toast--warning .ico { color: #FBBF24; }
.toast--danger .ico { color: #F87171; }
.toast--info .ico { color: #5CC6F2; }
.toast ul { margin: 6px 0 0; padding-left: 18px; color: #CFE0EE; }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: .2s; }

/* Busca global (paleta de comandos) */
.palette .modal__dialog { max-width: 640px; align-self: flex-start; margin-top: 9vh; }
.palette__input { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.palette__input input { flex: 1; border: 0; outline: none; font-size: 16px; background: transparent; }
.palette__results { max-height: 60vh; overflow-y: auto; padding: 8px; }
.palette__group { font: 600 11px/1 var(--font); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); padding: 12px 10px 6px; }
.palette__item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 9px; color: var(--ink); }
.palette__item .ico { color: var(--ink-3); }
.palette__item.is-selected, .palette__item:hover { background: var(--brand-50); color: var(--ink); }
.palette__item.is-selected .ico { color: var(--brand-700); }
.palette__item strong { font-weight: 600; display: block; }
.palette__item small { color: var(--ink-3); font-size: 12px; }
.palette__hint { padding: 22px 16px; color: var(--ink-3); text-align: center; font-size: 13px; }
.palette__foot { display: flex; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--line-2); color: var(--ink-3); font-size: 12px; }

/* Vazio */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 36px 20px; color: var(--ink-3); }
.empty .ico { width: 32px; height: 32px; color: var(--ink-4); }
.empty strong { color: var(--ink-2); font-size: 14px; }

/* Botão flutuante de comentários da prévia */
.feedback-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 70; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 14px;
  border-radius: 22px; border: 0; background: var(--violet); color: #fff; font-weight: 600; box-shadow: 0 10px 24px -8px rgba(109,40,217,.6);
}
.feedback-fab:hover { background: #5B21B6; }
.kind-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.kind-option { position: relative; }
.kind-option input { position: absolute; opacity: 0; }
.kind-option span { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; font-weight: 600; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.kind-option input:checked + span { border-color: var(--violet); background: var(--violet-bg); color: var(--violet); }
.kind-option input:focus-visible + span { box-shadow: var(--ring); }

/* Gráficos (HTML/CSS, sem biblioteca) */
.vbars { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: end; gap: 8px; height: 210px; padding-top: 10px; }
.vbars__grid { position: absolute; inset: 10px 0 24px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.vbars__grid i { border-top: 1px dashed var(--line); }
.vbars__grid i:last-child { border-top: 1px solid var(--line); }
.vbar { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.vbar__track { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.vbar__fill { width: min(30px, 70%); border-radius: 4px 4px 0 0; background: var(--brand-200); transition: background .15s; min-height: 2px; }
.vbar.is-current .vbar__fill { background: var(--brand); }
.vbar:hover .vbar__fill { background: var(--brand-600); }
.vbar__label { font-size: 11.5px; color: var(--ink-3); height: 18px; white-space: nowrap; }
.vbar__value { position: absolute; top: -2px; font: 700 11px/1 var(--font); color: var(--ink-2); white-space: nowrap; }
.hbars { display: flex; flex-direction: column; gap: 11px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 160px) minmax(0, 1fr) auto; align-items: center; gap: 12px; font-size: 13px; }
.hbar__label { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 7px; }
.hbar__label i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.hbar__track { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.hbar__fill { height: 100%; border-radius: 0 4px 4px 0; background: var(--brand); min-width: 2px; }
.hbar__fill--muted { background: var(--brand-200); }
.hbar__value { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; min-width: 64px; }
.hbar__value small { color: var(--ink-3); font-weight: 500; margin-left: 4px; }
.funnel { display: flex; flex-direction: column; gap: 6px; }
.funnel__row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 96px; gap: 12px; align-items: center; font-size: 13px; color: inherit; }
a.funnel__row:hover { color: inherit; }
a.funnel__row:hover .funnel__bar { background: var(--brand-600); }
.funnel__name { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.funnel__track { height: 26px; display: flex; justify-content: center; }
.funnel__bar { height: 100%; border-radius: 5px; background: var(--brand); color: #fff; font: 700 12px/26px var(--font); text-align: center; min-width: 26px; transition: background .15s; }
.funnel__value { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.tip { position: fixed; z-index: 130; pointer-events: none; background: var(--navy-900); color: #fff; font-size: 12px; padding: 7px 9px; border-radius: 8px; box-shadow: var(--shadow-lg); white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); }
.tip strong { display: block; font-size: 12.5px; }
.goal { display: flex; align-items: center; gap: 14px; }
.ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--surface-3) 0); }
.ring span { width: 50px; height: 50px; border-radius: 50%; background: #fff; display: grid; place-items: center; font: 800 14px/1 var(--font-head); }

/* ==========================================================================
   Telas
   ========================================================================== */

/* Dashboard */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; }
.greeting { display: flex; flex-direction: column; gap: 4px; }
.greeting h1 { font-size: 24px; }

/* Kanban */
.board-wrap { margin: 0 -24px; padding: 0 24px 16px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; }
.board { display: flex; gap: 12px; align-items: flex-start; min-height: calc(100vh - 250px); }
.col { width: 284px; flex: none; display: flex; flex-direction: column; max-height: calc(100vh - 220px); background: #EAEFF4; border-radius: 13px; scroll-snap-align: start; }
.col__head { padding: 12px 12px 10px; display: flex; flex-direction: column; gap: 6px; border-top: 3px solid var(--c, var(--brand)); border-radius: 13px 13px 0 0; }
.col__title { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-weight: 700; font-size: 13.5px; font-family: var(--font-head); }
.col__count { font: 700 11.5px/1 var(--font); background: #fff; color: var(--ink-2); padding: 4px 7px; border-radius: 9px; }
.col__meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); }
.col__meta strong { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.col__rule { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--ink-3); }
.col__rule .ico { width: 12px; height: 12px; }
.col__body { flex: 1; overflow-y: auto; padding: 2px 8px 8px; display: flex; flex-direction: column; gap: 8px; min-height: 80px; scrollbar-width: thin; }
.col.is-over { background: #DDEBF4; box-shadow: inset 0 0 0 2px var(--brand-200); }
.col.is-blocked { background: #F8E3E3; box-shadow: inset 0 0 0 2px var(--danger-line); }
.col__empty { border: 1.5px dashed #C8D3DE; border-radius: 10px; padding: 18px 10px; text-align: center; color: var(--ink-4); font-size: 12px; }
.kcard { position: relative; background: #fff; border-radius: 10px; border: 1px solid #DDE4EC; padding: 11px 12px 10px; box-shadow: 0 1px 2px rgba(15,27,42,.05); cursor: grab; transition: box-shadow .15s, transform .15s, border-color .15s; user-select: none; }
.kcard:hover { border-color: var(--brand-200); box-shadow: var(--shadow); }
.kcard.is-dragging { opacity: .5; transform: rotate(1.5deg); }
.kcard.is-won { border-left: 3px solid var(--success); }
.kcard--alert-3 { box-shadow: inset 3px 0 0 #E5484D, 0 1px 2px rgba(15,27,42,.05); }
.kcard--alert-2 { box-shadow: inset 3px 0 0 #F59E0B, 0 1px 2px rgba(15,27,42,.05); }
.kcard__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.kcard__company { font-weight: 700; font-size: 13.5px; line-height: 1.3; color: var(--ink); }
.kcard__title { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kcard__value { font: 800 15px/1 var(--font-head); margin-top: 9px; font-variant-numeric: tabular-nums; }
.kcard__row { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--ink-3); min-width: 0; }
.kcard__row .ico { width: 13px; height: 13px; flex: none; }
.kcard__row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kcard__row.is-late { color: var(--danger); font-weight: 600; }
.kcard__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line-2); font-size: 11.5px; color: var(--ink-3); }
.kcard__alerts { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.kalert { display: flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 4px 7px; border-radius: 6px; }
.kalert .ico { width: 12px; height: 12px; }
.kalert--3 { background: var(--danger-bg); color: var(--danger); }
.kalert--2 { background: var(--warning-bg); color: var(--warning); }
.kalert--1 { background: var(--surface-3); color: var(--ink-3); }
.kcard__move { display: none; }
.lost-zone { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 75; padding: 16px 28px; border-radius: 14px; border: 2px dashed var(--danger-line); background: var(--danger-bg); color: var(--danger); font-weight: 700; box-shadow: var(--shadow-lg); }
.lost-zone.is-over { background: var(--danger); color: #fff; border-color: var(--danger); }
.board-summary { display: flex; gap: 18px; flex-wrap: wrap; color: var(--ink-3); font-size: 13px; }
.board-summary strong { color: var(--ink); font-variant-numeric: tabular-nums; }

/* Detalhe de oportunidade / empresa */
.hero { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.hero__top { display: flex; align-items: flex-start; gap: 16px; justify-content: space-between; flex-wrap: wrap; }
.hero__id { display: flex; gap: 14px; align-items: flex-start; min-width: 0; flex: 1; }
.hero__id h1 { font-size: 21px; line-height: 1.25; }
.hero__sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--ink-3); font-size: 13px; margin-top: 5px; }
.hero__sub a { color: var(--ink-2); font-weight: 600; }
.hero__value { text-align: right; }
.hero__value strong { display: block; font: 800 26px/1.1 var(--font-head); font-variant-numeric: tabular-nums; }
.hero__value span { color: var(--ink-3); font-size: 12.5px; }
.hero__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.fact { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fact span { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; }
.fact strong { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.stagebar { display: flex; gap: 3px; margin-top: 16px; }
.stagebar__step { flex: 1; min-width: 0; position: relative; height: 34px; border: 0; background: var(--surface-3); color: var(--ink-3); font-size: 11.5px; font-weight: 600; padding: 0 6px 0 14px; display: flex; align-items: center; justify-content: center; clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%, 9px 50%); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stagebar__step:first-child { clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%); border-radius: 8px 0 0 8px; padding-left: 8px; }
.stagebar__step:last-child { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 9px 50%); border-radius: 0 8px 8px 0; }
.stagebar__step.is-done { background: var(--brand-100); color: var(--brand-800); }
.stagebar__step.is-current { background: var(--brand); color: #fff; }
.stagebar__step:hover:not(.is-current) { background: var(--brand-200); color: var(--brand-800); }
.stagebar__step span { overflow: hidden; text-overflow: ellipsis; }
.checklist { display: flex; flex-direction: column; gap: 6px; }
.checkitem { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 13px; }
.checkitem .ico { width: 16px; height: 16px; }
.checkitem.is-done { color: var(--ink-3); }
.checkitem.is-done span { text-decoration: line-through; }
.checkitem.is-done .ico { color: var(--success); }
.checkitem:not(.is-done) .ico { color: var(--warning); }
.kv { display: flex; flex-direction: column; }
.kv__row { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.kv__row:last-child { border-bottom: 0; }
.kv__row span { color: var(--ink-3); flex: none; }
.kv__row strong { font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.composer { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.composer__tabs { display: flex; gap: 2px; padding: 6px 6px 0; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.composer__tab { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 0; background: transparent; border-radius: 8px 8px 0 0; font-weight: 600; font-size: 13px; color: var(--ink-3); }
.composer__tab.is-active { background: #fff; color: var(--brand-700); box-shadow: 0 1px 0 #fff, 0 0 0 1px var(--line); }
.composer__body { padding: 12px; }
.composer__body .textarea { border: 0; padding: 4px 2px; min-height: 64px; box-shadow: none; }
.composer__foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.contact-card { display: flex; gap: 12px; align-items: flex-start; }
.contact-card__body { flex: 1; min-width: 0; }
.contact-card__body strong { display: block; }
.contact-card__body small { color: var(--ink-3); }
.quick-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.file-row:last-child { border-bottom: 0; }
.file-icon { width: 36px; height: 40px; border-radius: 6px; display: grid; place-items: center; font: 800 9.5px/1 var(--font); color: #fff; background: #C62828; flex: none; letter-spacing: .03em; }
.file-icon--cad { background: #1D4ED8; } .file-icon--zip { background: #6B7280; } .file-icon--image { background: #0F766E; }
.equip { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.equip__card { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.equip__art { width: 64px; height: 64px; border-radius: 10px; background: var(--brand-50); display: grid; place-items: center; flex: none; color: var(--brand-700); }
.equip__art svg { width: 48px; height: 48px; }
.equip__body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.equip__body strong { font-size: 13.5px; }
.equip__body small { color: var(--ink-3); font-size: 12px; }
.age { display: inline-flex; margin-top: 6px; }

/* Atividades */
.act-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.act-row:last-child { border-bottom: 0; }
.act-row.is-done .act-row__title { text-decoration: line-through; color: var(--ink-3); }
.act-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #C5D0DC; background: #fff; display: grid; place-items: center; flex: none; color: transparent; padding: 0; }
.act-check:hover { border-color: var(--success); color: var(--success); }
.act-check .ico { width: 12px; height: 12px; stroke-width: 3; }
.act-row.is-done .act-check { background: var(--success); border-color: var(--success); color: #fff; }
.act-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.act-row__title { font-weight: 600; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.act-row__meta { color: var(--ink-3); font-size: 12.5px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.act-row__meta a { color: var(--ink-2); }
.act-row__when { text-align: right; flex: none; font-size: 12.5px; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; min-width: 96px; }
.act-row__when strong { font-variant-numeric: tabular-nums; }
.is-late-text { color: var(--danger); font-weight: 600; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.week__day { min-height: 340px; border-right: 1px solid var(--line-2); padding: 10px 8px; display: flex; flex-direction: column; gap: 6px; }
.week__day:last-child { border-right: 0; }
.week__day.is-today { background: #F6FBFE; }
.week__head { display: flex; align-items: baseline; gap: 6px; font-size: 12px; color: var(--ink-3); text-transform: capitalize; margin-bottom: 4px; }
.week__head strong { font: 800 18px/1 var(--font-head); color: var(--ink); }
.week__day.is-today .week__head strong { color: var(--brand-700); }
.wevent { display: block; border-radius: 8px; padding: 6px 8px; font-size: 12px; border-left: 3px solid var(--brand); background: var(--brand-50); color: var(--ink); }
.wevent strong { display: block; font-weight: 600; line-height: 1.3; }
.wevent small { color: var(--ink-3); }
.wevent.is-done { opacity: .55; }
.wevent.is-late { border-left-color: var(--danger); background: var(--danger-bg); }

/* Central de comunicação */
.comm { display: grid; grid-template-columns: 330px minmax(0, 1fr) 320px; height: calc(100vh - var(--topbar-h)); background: #fff; }
.comm__list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.comm__list-head { padding: 14px 14px 10px; border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 10px; }
.comm__items { flex: 1; overflow-y: auto; }
.conv { display: flex; gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); color: var(--ink); position: relative; }
.conv:hover { background: var(--surface-2); color: var(--ink); }
.conv.is-active { background: var(--brand-50); }
.conv.is-active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); }
.conv__body { flex: 1; min-width: 0; }
.conv__top { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.conv__name { font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv__time { font-size: 11.5px; color: var(--ink-4); white-space: nowrap; }
.conv__company { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv__preview { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.conv__preview span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv.is-unread .conv__preview span { font-weight: 600; color: var(--ink); }
.conv__unread { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand); color: #fff; font: 700 10.5px/18px var(--font); text-align: center; flex: none; }
.chan { width: 18px; height: 18px; border-radius: 5px; display: inline-grid; place-items: center; flex: none; }
.chan .ico { width: 11px; height: 11px; }
.chan--email { background: var(--info-bg); color: var(--info); }
.chan--whatsapp { background: var(--wa-bg); color: var(--wa); }
.comm__thread { display: flex; flex-direction: column; min-height: 0; background: #F5F7FA; }
.comm__thread-head { padding: 12px 18px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.comm__messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: min(560px, 82%); display: flex; flex-direction: column; gap: 4px; }
.msg--in { align-self: flex-start; }
.msg--out { align-self: flex-end; align-items: flex-end; }
.msg__meta { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-3); }
.msg__bubble { padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; white-space: pre-line; box-shadow: 0 1px 1px rgba(15,27,42,.06); }
.msg--in .msg__bubble { background: #fff; border: 1px solid var(--line); border-top-left-radius: 4px; }
.msg--out .msg__bubble { border-top-right-radius: 4px; }
.msg--out.msg--email .msg__bubble { background: #E3F2FB; border: 1px solid #C8E4F5; }
.msg--out.msg--whatsapp .msg__bubble { background: #DDF6E6; border: 1px solid #C2EBD1; }
.msg--in.msg--whatsapp .msg__bubble { border-left: 3px solid #34C46F; }
.msg--in.msg--email .msg__bubble { border-left: 3px solid #4DB2E6; }
.msg__subject { font-weight: 700; font-size: 12.5px; display: block; margin-bottom: 4px; color: var(--ink); }
.msg__att { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 9px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; font-weight: 600; margin-right: 6px; }
.msg-event { align-self: center; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-3); background: #fff; border: 1px solid var(--line); padding: 5px 11px; border-radius: 14px; }
.msg-event .ico { width: 13px; height: 13px; }
.msg-auto { display: inline-flex; align-items: center; gap: 4px; color: var(--violet); font-weight: 600; }
.comm__composer { background: #fff; border-top: 1px solid var(--line); padding: 10px 14px 12px; }
.reply-via { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12.5px; color: var(--ink-3); flex-wrap: wrap; }
.via { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 15px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 12.5px; color: var(--ink-2); }
.via.is-active.via--email { background: var(--info-bg); border-color: var(--info-line); color: var(--info); }
.via.is-active.via--whatsapp { background: var(--wa-bg); border-color: #BFE6CD; color: var(--wa); }
.comm__input { display: flex; gap: 8px; align-items: flex-end; }
.comm__input .textarea { min-height: 44px; max-height: 160px; }
.comm__side { border-left: 1px solid var(--line); overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; background: #fff; }
.side-block h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); margin-bottom: 8px; font-family: var(--font); font-weight: 700; }
.comm__back { display: none; }

/* E-mails */
.mail { display: grid; grid-template-columns: 220px 360px minmax(0, 1fr); height: calc(100vh - var(--topbar-h)); background: #fff; }
.mail__folders { border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; background: var(--surface-2); }
.folder { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 8px; color: var(--ink-2); font-weight: 500; }
.folder:hover { background: var(--surface-3); color: var(--ink); }
.folder.is-active { background: #fff; color: var(--brand-700); font-weight: 600; box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.folder span { flex: 1; }
.folder em { font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--ink-3); }
.folder.is-active em { color: var(--brand-700); }
.mail__list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.mail__list-head { padding: 12px; border-bottom: 1px solid var(--line-2); }
.mail__items { flex: 1; overflow-y: auto; }
.mitem { display: block; padding: 12px 14px; border-bottom: 1px solid var(--line-2); color: var(--ink); position: relative; }
.mitem:hover { background: var(--surface-2); color: var(--ink); }
.mitem.is-active { background: var(--brand-50); }
.mitem.is-active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); }
.mitem.is-unread .mitem__from, .mitem.is-unread .mitem__subject { font-weight: 700; }
.mitem__top { display: flex; justify-content: space-between; gap: 8px; }
.mitem__from { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mitem__time { font-size: 11.5px; color: var(--ink-4); white-space: nowrap; }
.mitem__subject { font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mitem__preview { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.mitem__tags { display: flex; gap: 5px; margin-top: 6px; flex-wrap: wrap; }
.mail__read { overflow-y: auto; display: flex; flex-direction: column; min-height: 0; }
.mail__read-head { padding: 18px 24px 14px; border-bottom: 1px solid var(--line-2); }
.mail__read-head h2 { font-size: 18px; margin-bottom: 12px; }
.mail__links { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.link-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px; background: var(--surface-3); color: var(--ink-2); font-size: 12px; font-weight: 600; border: 1px solid var(--line); }
.link-chip:hover { border-color: var(--brand-200); color: var(--brand-700); }
.link-chip .ico { width: 13px; height: 13px; }
.mail__body { padding: 20px 24px; white-space: pre-line; font-size: 14px; line-height: 1.65; color: var(--ink); }
.mail__actions { padding: 0 24px 24px; display: flex; gap: 8px; flex-wrap: wrap; }
.tpl-preview { white-space: pre-line; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 16px; font-size: 13.5px; line-height: 1.6; }
.var { display: inline-block; padding: 0 5px; border-radius: 5px; background: var(--brand-50); color: var(--brand-700); font: 600 12.5px/1.6 ui-monospace, "SFMono-Regular", Menlo, monospace; border: 1px solid var(--brand-100); }

/* Automações */
.auto-card { display: flex; flex-direction: column; gap: 12px; color: inherit; }
.auto-card:hover { color: inherit; border-color: var(--brand-200); }
.auto-card__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini-stat { background: var(--surface-2); border-radius: 9px; padding: 8px 10px; }
.mini-stat strong { display: block; font: 800 17px/1.1 var(--font-head); font-variant-numeric: tabular-nums; }
.mini-stat span { font-size: 11.5px; color: var(--ink-3); }
.flow { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 8px 0; }
.flow__node { width: min(440px, 100%); display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.flow__icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.flow__icon .ico { width: 17px; height: 17px; }
.flow__kind { font: 700 10.5px/1 var(--font); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-bottom: 4px; }
.flow__title { font-weight: 700; font-size: 14px; }
.flow__detail { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.flow__arrow { width: 2px; height: 22px; background: #C9D4DF; position: relative; }
.flow__arrow::after { content: ""; position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: #C9D4DF; border-bottom: 0; }
.flow__node--trigger { border-color: var(--brand-200); background: linear-gradient(180deg, #F2FAFE, #fff); }
.flow__node--trigger .flow__icon { background: var(--brand); color: #fff; }
.flow__node--wait .flow__icon { background: var(--surface-3); color: var(--ink-2); }
.flow__node--condition { border-color: #F3D9A6; }
.flow__node--condition .flow__icon { background: var(--warning-bg); color: var(--warning); }
.flow__node--email .flow__icon { background: var(--info-bg); color: var(--info); }
.flow__node--task .flow__icon { background: var(--violet-bg); color: var(--violet); }
.flow__node--notify .flow__icon { background: var(--danger-bg); color: var(--danger); }
.flow__node--end { width: auto; padding: 8px 14px; border-radius: 20px; background: var(--surface-3); box-shadow: none; }
.flow__node--end .flow__icon { display: none; }
.flow__branches { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.branch { font-size: 11.5px; font-weight: 600; padding: 4px 8px; border-radius: 6px; display: inline-flex; gap: 4px; align-items: center; }
.branch--yes { background: var(--success-bg); color: var(--success); }
.branch--no { background: var(--surface-3); color: var(--ink-2); }

/* Campanhas */
.criteria { display: flex; flex-direction: column; gap: 8px; }
.criterion { display: grid; grid-template-columns: 1.2fr .8fr 1fr auto; gap: 8px; align-items: center; }
.criterion__and { font: 700 11px/1 var(--font); color: var(--ink-3); letter-spacing: .08em; padding-left: 4px; }
.audience-count { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; background: var(--brand-50); border: 1px solid var(--brand-100); }
.audience-count strong { font: 800 28px/1 var(--font-head); color: var(--brand-800); }

/* Configurações */
.settings { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings__nav { position: sticky; top: calc(var(--topbar-h) + 16px); display: flex; flex-direction: column; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.settings__nav a { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 8px; color: var(--ink-2); font-weight: 500; font-size: 13.5px; }
.settings__nav a:hover { background: var(--surface-3); color: var(--ink); }
.settings__nav a.is-active { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.settings__nav a .ico { width: 16px; height: 16px; color: var(--ink-3); }
.settings__nav a.is-active .ico { color: var(--brand-700); }
.perm-table td, .perm-table th { text-align: center; }
.perm-table td:first-child, .perm-table th:first-child { text-align: left; }
.stage-edit { display: grid; grid-template-columns: 28px 14px minmax(140px, 1fr) 80px 90px minmax(160px, 1.4fr) 120px; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.stage-edit:last-child { border-bottom: 0; }
.stage-edit__handle { color: var(--ink-4); cursor: grab; }
.stage-edit__color { width: 14px; height: 14px; border-radius: 4px; }
.stage-edit--head { background: var(--surface-2); font: 600 11px/1 var(--font); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); border-radius: var(--radius) var(--radius) 0 0; }

/* Página de perfil e notificações */
.profile-head { display: flex; gap: 16px; align-items: center; }

/* Erros */
.error-page { min-height: 60vh; display: grid; place-items: center; text-align: center; }
.error-page__code { font: 800 64px/1 var(--font-head); color: var(--brand-200); }

/* ==========================================================================
   Utilitários
   ========================================================================== */
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.p-0 { padding: 0 !important; }
.text-sm { font-size: 12.5px; } .text-xs { font-size: 11.5px; }
.text-muted { color: var(--ink-3); } .text-strong { font-weight: 600; } .text-success { color: var(--success); } .text-danger { color: var(--danger); } .text-warning { color: var(--warning); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }
.hide-desktop { display: none; }
.divider { height: 1px; background: var(--line-2); margin: 14px 0; }

/* ==========================================================================
   Navegação inferior (celular)
   ========================================================================== */
.bottom-nav { display: none; }

/* ==========================================================================
   Responsivo
   ========================================================================== */
@media (max-width: 1360px) {
  .comm { grid-template-columns: 300px minmax(0, 1fr); }
  .comm__side { display: none; }
  .comm.show-side .comm__side { display: flex; position: fixed; right: 0; top: var(--topbar-h); bottom: 0; width: 340px; z-index: 50; box-shadow: var(--shadow-lg); }
  .comm__side-toggle { display: inline-grid !important; }
}
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid, .grid-main-side { grid-template-columns: minmax(0, 1fr); }
  .mail { grid-template-columns: 200px 300px minmax(0, 1fr); }
}
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings { grid-template-columns: minmax(0, 1fr); }
  .settings__nav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .settings__nav a { flex: none; }
  .mail { grid-template-columns: 64px 300px minmax(0, 1fr); }
  .mail__folders .folder span, .mail__folders .folder em, .mail__folders .label { display: none; }
  .mail__folders .folder { justify-content: center; }
  .stage-edit { grid-template-columns: 20px 14px minmax(120px, 1fr) 70px 80px; }
  .stage-edit > :nth-child(6), .stage-edit > :nth-child(7) { display: none; }
  .grid-side-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  :root { --topbar-h: 56px; }
  .app, html.is-collapsed .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  html.is-collapsed .sidebar .nav-section__label, html.is-collapsed .sidebar .nav-link__label, html.is-collapsed .sidebar .nav-count, html.is-collapsed .sidebar__foot { display: revert; }
  html.menu-open .sidebar { transform: none; }
  html.menu-open .sidebar-backdrop { display: block; }
  .sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(7,20,35,.45); z-index: 39; }
  .sidebar__collapse { display: none; }
  .topbar { padding: 0 12px; gap: 6px; }
  .topbar__menu { display: inline-grid; }
  .topbar__search { height: 38px; }
  .topbar__search .kbd, .user-btn__name, .preview-pill span, .topbar .hide-mobile { display: none; }
  .preview-pill { padding: 0 8px; }
  .main { padding: 16px 16px 92px; }
  .board-wrap { margin: 0 -16px; padding: 0 16px 16px; scroll-snap-type: x mandatory; }
  .col { width: 86vw; max-width: 320px; max-height: none; }
  .board { min-height: 0; }
  .kcard { cursor: pointer; }
  .kcard__move { display: block; margin-top: 8px; }
  .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px; }
  .kpi__value { font-size: 20px; }
  .page-head { margin-bottom: 14px; align-items: flex-start; }
  .page-head__actions { width: 100%; }
  h1 { font-size: 20px; }
  .hero { padding: 16px; }
  .hero__value { text-align: left; }
  .stagebar { overflow-x: auto; scrollbar-width: none; }
  .stagebar__step { min-width: 96px; }
  .hide-mobile { display: none !important; }
  .hide-desktop { display: initial; }
  .feedback-fab { bottom: 78px; right: 14px; height: 40px; padding: 0 12px; }
  .feedback-fab span { display: none; }
  .toasts { bottom: 84px; right: 12px; left: 12px; align-items: stretch; }
  .notif-panel { width: calc(100vw - 24px); position: fixed; left: 12px; right: 12px; top: 62px; }
  .toolbar .input-icon { min-width: 100%; max-width: none; }
  .toolbar .select { flex: 1; min-width: 0; }
  .funnel__row { grid-template-columns: 100px minmax(0, 1fr) 72px; gap: 8px; }
  .hbar { grid-template-columns: 96px minmax(0, 1fr) auto; gap: 8px; }
  .vbars { gap: 4px; }
  .vbar__value { display: none; }
  .criterion { grid-template-columns: 1fr 1fr; }

  /* Tabelas viram cartões */
  .table--cards thead { display: none; }
  .table--cards, .table--cards tbody, .table--cards tr, .table--cards td { display: block; width: 100%; }
  .table--cards tr { padding: 12px 14px; border-bottom: 1px solid var(--line-2); position: relative; }
  .table--cards td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table--cards td::before { content: attr(data-label); color: var(--ink-3); font-size: 12px; font-weight: 500; text-align: left; flex: none; }
  .table--cards td.cell-primary { display: block; text-align: left; padding-bottom: 6px; }
  .table--cards td.cell-primary::before { display: none; }
  .table--cards td.cell-hide-mobile { display: none; }
  .cell-main__text strong, .cell-main__text small { max-width: 70vw; }

  /* Central de comunicação: uma coluna por vez */
  .comm { grid-template-columns: minmax(0, 1fr); height: calc(100vh - var(--topbar-h) - 64px); }
  .comm__thread { display: none; }
  .comm.show-thread .comm__list { display: none; }
  .comm.show-thread .comm__thread { display: flex; }
  .comm__back { display: inline-grid; }
  .comm.show-side .comm__side { width: 100vw; top: var(--topbar-h); bottom: 64px; }
  .msg { max-width: 92%; }

  .mail { grid-template-columns: minmax(0, 1fr); height: auto; min-height: calc(100vh - var(--topbar-h) - 64px); }
  .mail__folders { flex-direction: row; overflow-x: auto; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .mail__folders .folder span, .mail__folders .folder em { display: inline; }
  .mail__folders .folder { flex: none; }
  .mail__read { display: none; }
  .mail.show-read .mail__list { display: none; }
  .mail.show-read .mail__read { display: flex; }
  .mail__list { border-right: 0; }

  .week { grid-template-columns: minmax(0, 1fr); }
  .week__day { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line-2); }

  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: 64px;
    background: rgba(255,255,255,.97); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: transparent; color: var(--ink-3); font-size: 10.5px; font-weight: 600; position: relative; }
  .bottom-nav .is-active { color: var(--brand-700); }
  .bottom-nav .ico { width: 21px; height: 21px; }
  .bottom-nav em { position: absolute; top: 7px; left: calc(50% + 6px); font-style: normal; min-width: 16px; height: 16px; border-radius: 8px; background: #E5484D; color: #fff; font: 700 10px/16px var(--font); padding: 0 4px; }
}
@media (max-width: 480px) {
  .kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .kpi__value { font-size: 18px; }
  .kpi__icon { display: none; }
}

@media print {
  .sidebar, .topbar, .bottom-nav, .feedback-fab, .toasts { display: none !important; }
  .app { display: block; }
  .main { padding: 0; }
  body { background: #fff; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Ajustes finos */
.topbar .topbar__menu { display: none; }
.table td.num, .table td.right { white-space: nowrap; }
@media (max-width: 860px) { .topbar .topbar__menu { display: inline-grid; } }
.topbar__search { min-width: 0; }
@media (max-width: 860px) { .topbar__search span { font-size: 13px; } .topbar__actions { flex: none; } }
@media (max-width: 860px) {
  .preview-pill { display: none; }
  .toolbar .select { flex: 1 1 140px; }
  .hero__top { flex-direction: column; align-items: stretch; }
  .hero__top > .stack-sm { align-items: flex-start !important; }
  .hero__id { flex-wrap: wrap; }
  .hero__id .cmark--lg { width: 48px; height: 48px; font-size: 16px; }
  .hero__id h1 { font-size: 19px; }
  .act-row { padding: 12px; gap: 10px; align-items: flex-start; }
  .act-row .atype { display: none; }
  .act-row__when { min-width: 72px; }
  .comm__input [data-send] span { display: none; }
  .comm__input [data-send] { width: 40px; padding: 0; }
}
.composer__tabs { overflow-x: auto; scrollbar-width: none; } .composer__tab { white-space: nowrap; flex: none; }

/* Logo e fotos vindos do site da Rufino */
.brand-img { height: 34px; width: auto; display: block; }
.login__brand-top .brand-img { height: 42px; }
.login__mobile-logo .brand-img { height: 40px; }
.product-photo { width: 100%; height: 100%; object-fit: contain; display: block; }
.equip__art:has(.product-photo:not([hidden])) { background: #fff; border: 1px solid var(--line-2); padding: 3px; }
