/*
 * Console do SHIAI (CRM, Quadro e Operação). Cores e fonte ainda as da ADR-0013 (preto, laranja, dourado,
 * Montserrat) até a identidade nova do SHIAI (decisão 57).
 * Direção visual "pit wall" (spec console-visual): superfícies carbono em camadas, laranja só como sinal
 * (item ativo, ação principal, atenção), números tabulares e rótulos curtos em caixa alta.
 * CSP: style-src 'self' → nada de estilo inline; ícones são máscaras SVG em data URI (img-src data:).
 */
@font-face { font-family: Montserrat; src: url('montserrat-regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Montserrat; src: url('montserrat-semibold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: Montserrat; src: url('montserrat-extrabold.woff2') format('woff2'); font-weight: 800; font-display: swap; }

/* --- Tokens ------------------------------------------------------------------------------------- */
:root {
  /* Superfícies (do fundo para cima) */
  --bg: #0b0b0c;
  --surface: #131315;
  --raised: #1b1b1e;
  --overlay: #232327;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.13);
  /* Texto */
  --text: #f2f2f2;
  --text-2: #a9a9b0;
  --text-3: #85858d;
  /* Marca e sinais */
  --orange: #ff8a00;
  --orange-hover: #ff9d2e;
  --orange-soft: rgba(255, 138, 0, 0.12);
  --orange-line: rgba(255, 138, 0, 0.45);
  --gold: #ffc247;
  --gold-soft: rgba(255, 194, 71, 0.12);
  --ok: #4fd18b;
  --ok-soft: rgba(79, 209, 139, 0.12);
  --error: #ff6b6b;
  --error-soft: rgba(255, 107, 107, 0.12);
  --info: #6aa1ff;
  /* Compatibilidade com nomes antigos */
  --black: var(--bg);
  --card: var(--raised);
  --muted: var(--text-2);
  /* Escalas */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --text-xs: 0.6875rem;
  --text-sm: 0.8125rem;
  --text-base: 0.875rem;
  --text-lg: 1rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --sidebar: 248px;
}

/* --- Base --------------------------------------------------------------------------------------- */
* { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  font: 400 var(--text-base)/1.55 Montserrat, system-ui, sans-serif;
  background:
    radial-gradient(900px 480px at 100% -8%, rgba(255, 138, 0, 0.075), transparent 65%),
    radial-gradient(700px 400px at 0% 110%, rgba(255, 194, 71, 0.035), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--orange); color: #000; }
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--orange); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: var(--radius-sm); }
* { scrollbar-width: thin; scrollbar-color: var(--overlay) transparent; }

h1 { font-weight: 800; font-size: var(--text-xl); line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 var(--space-5); }
h2 { font-weight: 600; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-2); margin: var(--space-5) 0 var(--space-3); }
h3 { font-weight: 600; font-size: var(--text-sm); margin: var(--space-4) 0 var(--space-2); color: var(--text); }
p { margin: 0 0 var(--space-2); }
ul, ol { margin: 0 0 var(--space-2); padding-left: 18px; }
li::marker { color: var(--text-3); }
.muted { color: var(--text-2); font-size: var(--text-sm); }
.error { color: var(--error); }
.ok { color: var(--ok); }
.overdue { color: var(--gold); font-weight: 600; font-size: var(--text-sm); }
.mono { font-family: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, monospace; font-size: var(--text-sm); overflow-wrap: anywhere; }
.big { font-size: var(--text-2xl); font-weight: 800; margin: 0; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
table, .big, .pill, .bars { font-variant-numeric: tabular-nums; }

/* --- Shell: barra lateral + conteúdo ------------------------------------------------------------ */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(19, 19, 21, 0.92), rgba(11, 11, 12, 0.92));
  border-right: 1px solid var(--border);
}
.brand { position: relative; display: flex; align-items: center; justify-content: space-between; padding: var(--space-5) var(--space-5) var(--space-4); }
.brand::after {
  content: ''; position: absolute; left: var(--space-5); right: var(--space-5); bottom: 0; height: 1px;
  background: linear-gradient(90deg, var(--orange), var(--gold) 45%, transparent);
}
.emblem { width: 112px; height: auto; display: block; }
/* Nome do sistema em texto até o logo do SHIAI existir (decisão 57). */
.wordmark { font-weight: 800; font-size: 1.35rem; letter-spacing: 0.32em; color: var(--orange); line-height: 1; }
.menu-toggle { display: none; }

nav { display: flex; flex-direction: column; gap: var(--space-5); padding: var(--space-5) var(--space-3); flex: 1; }
nav[hidden] { display: none; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group[hidden], nav [hidden] { display: none; }
.nav-title { margin: 0 0 var(--space-2); padding: 0 var(--space-3); font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-3); }
nav a, .nav-logout {
  position: relative; display: flex; align-items: center; gap: var(--space-3);
  padding: 8px var(--space-3); border-radius: var(--radius-sm);
  color: var(--text-2); font: 600 var(--text-base)/1.2 Montserrat, system-ui, sans-serif;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
nav a::before, .nav-logout::before, .menu-toggle::before {
  content: ''; flex: 0 0 18px; width: 18px; height: 18px; background-color: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat;
}
nav a:hover, .nav-logout:hover { background: var(--raised); color: var(--text); }
nav a.active { background: var(--orange-soft); color: var(--text); }
nav a.active::before { color: var(--orange); }
nav a.active::after {
  content: ''; position: absolute; left: calc(-1 * var(--space-3)); top: 7px; bottom: 7px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--orange); box-shadow: 0 0 12px var(--orange);
}
.nav-footer { margin-top: auto; padding-top: var(--space-4); border-top: 1px solid var(--border); }
.nav-logout { width: 100%; background: none; border: 0; cursor: pointer; text-align: left; }
.nav-logout:hover { color: var(--error); }

main { padding: var(--space-6) clamp(16px, 3vw, 40px) var(--space-7); max-width: 1480px; width: 100%; min-width: 0; }

/* Sem sessão (login, senha, TOTP): só a marca, centralizada, acima do formulário. */
.shell:has(#nav[hidden]) { grid-template-columns: 1fr; }
.shell:has(#nav[hidden]) .sidebar { position: static; height: auto; background: none; border: 0; align-items: center; }
.shell:has(#nav[hidden]) .brand { padding-top: var(--space-7); }
.shell:has(#nav[hidden]) .brand::after { left: 0; right: 0; background: linear-gradient(90deg, transparent, var(--orange), transparent); }
.shell:has(#nav[hidden]) .menu-toggle { display: none; }
.shell:has(#nav[hidden]) main { margin: 0 auto; padding-top: var(--space-4); }

/* --- Cartões e blocos ----------------------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--space-5); margin: 0 0 var(--space-4); box-shadow: var(--shadow);
}
.card > h2:first-child, .card > form > h2:first-child { margin-top: 0; }
.card.inner { background: var(--raised); box-shadow: none; margin: var(--space-2) 0; padding: var(--space-4); }
.narrow { max-width: 420px; margin: var(--space-6) auto; }
form.card.narrow { padding: var(--space-6); }
form.card.narrow h1 { font-size: 1.25rem; margin-bottom: var(--space-4); }
form.card.narrow .btn { width: 100%; margin-top: var(--space-4); padding: 11px 16px; }
form.card.narrow .link { display: block; margin: var(--space-3) auto 0; }
p.card.narrow { text-align: center; color: var(--text-2); }
.clickable { cursor: pointer; transition: background-color 0.15s var(--ease); }
.clickable:hover { background: var(--raised); }

/* --- Formulário ----------------------------------------------------------------------------------- */
label { display: block; font-weight: 600; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-2); margin: var(--space-3) 0 6px; }
input, select, textarea {
  width: 100%; padding: 9px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font: inherit;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:hover, select:hover, textarea:hover { border-color: rgba(255, 255, 255, 0.22); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--orange); }
input[type=date] { color-scheme: dark; }
select {
  appearance: none; padding-right: 32px; cursor: pointer;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a9a9b0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 10px center / 16px no-repeat;
}
textarea { min-height: 80px; resize: vertical; }
fieldset.labels { border: 1px solid var(--border); border-radius: var(--radius); margin: var(--space-3) 0; padding: var(--space-3); display: flex; flex-wrap: wrap; gap: var(--space-3); }
fieldset.labels legend { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-2); padding: 0 6px; }
label.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; font-size: var(--text-sm); text-transform: none; letter-spacing: 0; color: var(--text); margin: 0; }
input.score { width: 84px; }

/* --- Botões --------------------------------------------------------------------------------------- */
button { cursor: pointer; font: inherit; color: inherit; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  background: var(--orange); color: #0b0b0c; border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 8px 16px; font-weight: 800; font-size: var(--text-sm); letter-spacing: 0.01em; line-height: 1.3; white-space: nowrap;
  box-shadow: 0 0 0 0 transparent, 0 6px 18px -8px rgba(255, 138, 0, 0.7);
  transition: background-color 0.15s var(--ease), transform 0.1s var(--ease), box-shadow 0.15s var(--ease);
}
.btn:hover { background: var(--orange-hover); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--raised); color: var(--text); border-color: var(--border-strong); box-shadow: none; font-weight: 600; }
.btn.secondary:hover { background: var(--overlay); border-color: rgba(255, 255, 255, 0.2); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-weight: 600; color: var(--text-2); text-align: left; }
.link:hover { color: var(--orange); }

/* --- Linhas e grades ------------------------------------------------------------------------------ */
.row { display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center; }
.row > * { flex: 0 0 auto; }
.row.top { align-items: flex-start; }
form.row { align-items: flex-end; }
form.row label { margin-top: 0; }
.row > .card { margin-bottom: 0; }
.row.card, .card.row { align-items: flex-end; }
.grow { flex: 1 1 220px !important; min-width: 0; }
.row.top > .grow > .card { height: 100%; }
.filters { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: flex-end; padding: var(--space-4); }
.filters > div { flex: 1 1 160px; min-width: 0; }
.filters label { margin-top: 0; }
.filters > input, .filters > select { flex: 1 1 160px; width: auto; min-width: 0; }
.qr { background: #fff; border-radius: var(--radius); padding: var(--space-2); width: 200px; display: block; margin: var(--space-3) auto; }

/* --- Etiquetas ------------------------------------------------------------------------------------ */
.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px;
  background: var(--raised); border: 1px solid var(--border); font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.02em; line-height: 1.6;
}
.pill.overdue { background: var(--gold-soft); border-color: rgba(255, 194, 71, 0.3); color: var(--gold); }
.pills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

/* --- Tabelas -------------------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); margin: 0 0 var(--space-4); }
.table-wrap table { margin: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: var(--text-sm); vertical-align: top; }
th { color: var(--text-3); font-weight: 600; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.08em; background: rgba(255, 255, 255, 0.015); white-space: nowrap; }
tbody tr { transition: background-color 0.12s var(--ease); }
tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
tbody tr:last-child td { border-bottom: 0; }
td a { font-weight: 600; }
main > table, .card > table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); border-collapse: separate; border-spacing: 0; overflow: hidden; }
.card > table { background: transparent; border: 0; }
table.data th, table.data td { white-space: nowrap; padding: 9px 12px; }
.rubric td, .rubric th { font-size: var(--text-xs); }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: var(--space-2) 0 var(--space-3); font-size: var(--text-sm); }
dl.kv dt { color: var(--text-3); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }

/* --- Linha do tempo ------------------------------------------------------------------------------- */
.timeline { list-style: none; padding: 0 0 0 var(--space-5); margin: 0 0 var(--space-4); position: relative; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 1px; background: var(--border-strong); }
.timeline li { position: relative; margin: 0 0 var(--space-4); }
.timeline li::before { content: ''; position: absolute; left: calc(-1 * var(--space-5) + 2px); top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 2px solid var(--orange); }
.timeline .muted { margin-top: 2px; }

/* --- Diálogo -------------------------------------------------------------------------------------- */
dialog {
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  max-width: 720px; width: calc(100% - 32px); max-height: 90vh; overflow-y: auto; padding: var(--space-5); box-shadow: var(--shadow-lg);
}
dialog[open] { animation: rise 0.18s var(--ease); }
dialog::backdrop { background: rgba(0, 0, 0, 0.66); backdrop-filter: blur(3px); }
dialog h2:first-child { margin-top: 0; font-size: var(--text-lg); text-transform: none; letter-spacing: -0.01em; color: var(--text); font-weight: 800; }
dialog form > .row:last-child { margin-top: var(--space-5); justify-content: flex-end; }
dialog > .card, dialog > div > .card { background: transparent; border: 0; box-shadow: none; padding: 0; margin: 0; }
dialog:has(.card-form) { max-width: 880px; padding-bottom: 0; }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(0.99); } to { opacity: 1; transform: none; } }

/* --- Ícones do menu (traço no estilo Lucide, licença ISC) ---------------------------------------- */
nav a[href="#/hoje"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18M9 16l2 2 4-4'/%3E%3C/svg%3E"); }
nav a[href="#/campo"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E"); }
nav a[href="#/kanban"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Cpath d='M8 7v7M12 7v4M16 7v9'/%3E%3C/svg%3E"); }
nav a[href="#/leads"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); }
nav a[href="#/placar"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Ccircle cx='12' cy='12' r='6'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3C/svg%3E"); }
nav a[href="#/quadro"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='9' rx='1'/%3E%3Crect x='14' y='3' width='7' height='5' rx='1'/%3E%3Crect x='14' y='12' width='7' height='9' rx='1'/%3E%3Crect x='3' y='16' width='7' height='5' rx='1'/%3E%3C/svg%3E"); }
nav a[href="#/notas"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15.5 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5L15.5 3Z'/%3E%3Cpath d='M15 3v6h6'/%3E%3C/svg%3E"); }
nav a[href="#/ideias"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5'/%3E%3Cpath d='M9 18h6M10 22h4'/%3E%3C/svg%3E"); }
nav a[href="#/aprendizados"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2zM22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z'/%3E%3C/svg%3E"); }
nav a[href="#/quadro/config"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 21v-7M4 10V3M12 21v-9M12 8V3M20 21v-5M20 12V3M1 14h6M9 8h6M17 16h6'/%3E%3C/svg%3E"); }
nav a[href="#/agora"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-4l-3 9L9 3l-3 9H2'/%3E%3C/svg%3E"); }
nav a[href="#/organograma"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='2' width='6' height='6' rx='1'/%3E%3Crect x='2' y='16' width='6' height='6' rx='1'/%3E%3Crect x='16' y='16' width='6' height='6' rx='1'/%3E%3Cpath d='M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3M12 12V8'/%3E%3C/svg%3E"); }
nav a[href="#/execucoes"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 2 3 14h9l-1 8 10-12h-9l1-8z'/%3E%3C/svg%3E"); }
nav a[href="#/atividade"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8'/%3E%3Cpath d='M3 3v5h5M12 7v5l4 2'/%3E%3C/svg%3E"); }
nav a[href="#/saude"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z'/%3E%3Cpath d='M3.22 12H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27'/%3E%3C/svg%3E"); }
nav a[href="#/conversas"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E"); }
.nav-logout { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9'/%3E%3C/svg%3E"); }
.menu-toggle { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h16M4 12h16M4 18h16'/%3E%3C/svg%3E"); }
body.nav-open .menu-toggle { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E"); }

/* --- CRM: Funil ------------------------------------------------------------------------------------ */
.board { display: grid; grid-template-columns: repeat(8, minmax(200px, 1fr)); gap: var(--space-3); overflow-x: auto; padding-bottom: var(--space-2); }
/* Funil (spec crm-funil-visual): as colunas vêm de columnTemplate() (vazia mais estreita, divisória antes do Relacionamento). */
.funnel { display: grid; gap: var(--space-3); overflow-x: auto; padding-bottom: var(--space-2); align-items: stretch; }
.funnel .column { min-width: 0; }
.funnel .column.empty { opacity: 0.7; }
.funnel .column.side { background: transparent; border-style: dashed; }
.funnel-divider { background: var(--border-strong); border-radius: 1px; }
.funnel .column h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 2px var(--space-2); flex-wrap: wrap; letter-spacing: 0.04em; }
.funnel-count { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.funnel-late { color: var(--error); text-transform: none; letter-spacing: 0; font-weight: 600; }
.funnel .lead > a, .funnel-closed-grid .lead > a { display: block; overflow-wrap: break-word; hyphens: auto; }
.funnel-move {
  display: block; margin: 8px 0 0 auto; background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-2);
  font: inherit; font-size: var(--text-xs); padding: 1px 7px; cursor: pointer;
}
.funnel-move:hover, .funnel-move:focus-visible { border-color: var(--orange); color: var(--text); }
.funnel-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-top: 6px; font-size: var(--text-xs); }
.funnel-next { font-weight: 600; color: var(--text); }
.funnel-next.late { color: var(--error); }
.funnel-next.soon { color: var(--gold); }
.funnel-signals { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.funnel-signal { padding: 0 7px; font-size: 0.625rem; font-weight: 500; line-height: 1.7; }
.funnel-signal.hot { background: var(--error-soft); border-color: var(--error); color: var(--error); }
.funnel-signal.warm, .funnel-signal.registered { background: var(--gold-soft); border-color: var(--gold); }
.funnel-signal.school { background: var(--ok-soft); border-color: var(--ok); }
.funnel-filters .row { flex-wrap: wrap; margin-bottom: var(--space-2); }
.funnel-filters .row input { min-width: 200px; }
.funnel-top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); }
.funnel-top h1 { margin: 0; }
.funnel-closed { display: flex; gap: var(--space-2); }
.funnel-box {
  display: flex; align-items: baseline; gap: 8px; cursor: pointer; min-width: 132px;
  background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 8px 14px;
  color: var(--text); font: inherit; transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.funnel-box strong { font-size: var(--text-lg); font-variant-numeric: tabular-nums; }
.funnel-box.won strong { color: var(--ok); }
.funnel-box.over, .funnel-box[aria-expanded="true"] { border-color: var(--orange); background: var(--orange-soft); }
.funnel-closed-list h2 { margin-top: 0; }
.funnel-closed-list:not(:empty) { margin-bottom: var(--space-4); }
.funnel-closed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-2); }
.column {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--space-3); min-height: 260px; transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.column.over { border-color: var(--orange); background: var(--orange-soft); outline: 0; }
.column h3 {
  margin: 0 0 var(--space-3); padding: 2px var(--space-1) var(--space-2); font-size: var(--text-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-2); border-bottom: 1px solid var(--border);
}
.lead, .tile, .note {
  background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin: 0 0 var(--space-2);
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.lead { cursor: grab; }
.lead:hover, .tile:hover, .note:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.8); }
.lead a { color: var(--text); font-weight: 600; }
.lead .muted { font-size: var(--text-xs); margin-top: 2px; }

/* CRM: Hoje (tarefa) e Placar */
main > .card > .row:first-child strong { font-size: var(--text-lg); }
.bars { display: flex; gap: var(--space-2); align-items: flex-end; height: 180px; padding-top: var(--space-3); }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; font-size: var(--text-xs); color: var(--text-2); }
.bar { width: 100%; max-width: 48px; background: linear-gradient(180deg, var(--gold), var(--orange)); border-radius: 4px 4px 1px 1px; min-height: 2px; }

/* --- Quadro --------------------------------------------------------------------------------------- */
.lane h2 { margin-top: var(--space-4); }
.kanban { display: grid; grid-template-columns: repeat(var(--columns, 5), minmax(196px, 1fr)); gap: var(--space-3); overflow-x: auto; padding-bottom: var(--space-2); }
.kanban .column.done { opacity: 0.8; }
.col-tabs { display: none; gap: 6px; flex-wrap: wrap; margin: 0 0 var(--space-3); }
.tile, .note { cursor: pointer; border-left: 3px solid var(--border-strong); }
.tile { cursor: grab; }
.tile strong, .note strong { font-weight: 600; }
.tile .meta { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: 6px; font-size: var(--text-xs); }
.tile .move-to { display: none; margin-top: var(--space-2); padding: 4px 8px; }
.tile .meta { align-items: center; }
.tile .pills { gap: 3px; }
.tile .pill { padding: 0 7px; font-size: 0.625rem; font-weight: 500; line-height: 1.7; }
.tile .avatar {
  display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: auto; border-radius: 50%;
  background: var(--overlay); border: 1px solid var(--border-strong); color: var(--text); font-size: 0.625rem; font-weight: 700;
}
.tile.late { border-left-color: var(--error); }
.tile .overdue { color: var(--error); font-size: var(--text-xs); }
.column h3 .late-count { color: var(--error); text-transform: none; letter-spacing: 0; }
.kanban .column { display: flex; flex-direction: column; }
.lane:not(:has(h2)) .kanban .column { min-height: calc(100vh - 240px); }
.add-task {
  width: 100%; margin: 0 0 var(--space-2); padding: 7px 10px; font-size: var(--text-sm);
  background: transparent; border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--text);
}
.add-task:focus { background: var(--raised); border-style: solid; border-color: var(--orange-line); }
.add-task::placeholder { color: var(--text-3); }
.drop-hint {
  flex: 1; display: grid; place-items: center; min-height: 80px; margin: 0; border: 1px dashed var(--border); border-radius: var(--radius);
  color: transparent; font-size: var(--text-sm); transition: color 0.15s var(--ease);
}
.column.over .drop-hint { color: var(--text-2); border-color: var(--orange-line); }
.color-red { border-left-color: #e5534b; } .color-orange { border-left-color: var(--orange); } .color-yellow { border-left-color: var(--gold); }
.color-green { border-left-color: var(--ok); } .color-teal { border-left-color: #2bb3a3; } .color-blue { border-left-color: var(--info); }
.color-purple { border-left-color: #a371f7; } .color-gray { border-left-color: #8b8b8b; }
.tone-red { background: rgba(229, 83, 75, 0.16); border-color: rgba(229, 83, 75, 0.35); }
.tone-orange { background: rgba(255, 138, 0, 0.14); border-color: rgba(255, 138, 0, 0.35); }
.tone-yellow { background: rgba(255, 194, 71, 0.14); border-color: rgba(255, 194, 71, 0.35); }
.tone-green { background: rgba(79, 209, 139, 0.14); border-color: rgba(79, 209, 139, 0.35); }
.tone-teal { background: rgba(43, 179, 163, 0.16); border-color: rgba(43, 179, 163, 0.35); }
.tone-blue { background: rgba(106, 161, 255, 0.14); border-color: rgba(106, 161, 255, 0.35); }
.tone-purple { background: rgba(163, 113, 247, 0.16); border-color: rgba(163, 113, 247, 0.35); }
.tone-gray, .tone-default { background: var(--raised); }
.notes { columns: 4 260px; column-gap: var(--space-3); }
.note { break-inside: avoid; display: block; padding: var(--space-3) var(--space-4); }
.note p { white-space: pre-wrap; margin: 6px 0; }
.checks { list-style: none; padding: 0; margin: 6px 0; font-size: var(--text-sm); }
.checks li { padding: 2px 0; }
.checks li::before { content: '☐ '; color: var(--text-3); }
.checks li.done { text-decoration: line-through; color: var(--text-3); }
.checks li.done::before { content: '☑ '; color: var(--ok); }
.matrix-box { flex: 0 0 400px !important; max-width: 100%; }
.matrix-box > h2 { margin-top: 0; }
.matrix { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.matrix .axis { stroke: var(--border-strong); stroke-width: 1.5; }
.matrix .quadrant { fill: var(--text-3); font-size: 11px; font-weight: 600; }
.matrix .axis-label { fill: var(--text-3); font-size: 10px; }
.matrix .dot { fill-opacity: 0.85; cursor: pointer; stroke: var(--bg); stroke-width: 2; transition: fill-opacity 0.15s var(--ease); }
.matrix .dot:hover { fill-opacity: 1; }
.matrix .quick_win { fill: var(--ok); } .matrix .big_bet { fill: var(--orange); } .matrix .fill_in { fill: var(--info); } .matrix .money_pit { fill: #8b8b8b; }
.card-form textarea { min-height: 64px; }
.photos { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.photos figure { margin: 0; }
.photo { width: 120px; height: 120px; object-fit: cover; border-radius: var(--radius); display: block; border: 1px solid var(--border); }
.card-form .row { align-items: flex-end; }
.card-form .row > div { flex: 1 1 180px; }
.card-form .row.actions { position: sticky; bottom: 0; z-index: 1; background: var(--surface); border-top: 1px solid var(--border); padding: var(--space-3) 0 var(--space-4); margin-top: var(--space-4); align-items: center; }

/* --- Operação: Agora ------------------------------------------------------------------------------ */
.console-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-3); }
.console-grid > h1 { grid-column: 1 / -1; margin: 0; }
.console-grid > p { grid-column: 1 / -1; margin: 0 0 var(--space-3); display: flex; align-items: center; gap: var(--space-2); }
.console-grid > p::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); animation: pulse 2.4s ease-in-out infinite; }
.console-card { position: relative; margin: 0; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.console-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 2px; background: var(--border-strong); }
.console-card:has(> p.ok)::before { background: linear-gradient(90deg, var(--ok), transparent); }
.console-card:has(> p.error)::before { background: linear-gradient(90deg, var(--error), transparent); }
.console-card h2 { margin: 0 0 var(--space-3); }
.console-card > p:first-of-type:not(.muted) { font-size: var(--text-lg); font-weight: 600; margin: 0; }
.console-card > p.ok:first-of-type, .console-card > p.error:first-of-type { font-size: var(--text-lg); }
.console-card ul { list-style: none; margin: 0; padding: 0; font-size: var(--text-sm); }
.console-card li { padding: 6px 0; border-top: 1px solid var(--border); }
.console-card li:first-child { border-top: 0; padding-top: 0; }
.console-card > a { margin-top: auto; padding-top: var(--space-3); font-size: var(--text-sm); font-weight: 600; color: var(--orange); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px transparent; } }

/* --- Operação: Organograma e Ficha --------------------------------------------------------------- */
.org > select { max-width: 280px; margin-bottom: var(--space-4); }
.org-tree, .org-tree ul { list-style: none; margin: 0; padding: 0; }
.org-tree ul { margin-left: 13px; padding-left: var(--space-5); border-left: 1px solid var(--border-strong); }
.org-tree ul > li { position: relative; }
.org-tree ul > li::before { content: ''; position: absolute; left: calc(-1 * var(--space-5)); top: 21px; width: 18px; height: 1px; background: var(--border-strong); }
.org-tree ul > li:last-child::after { content: ''; position: absolute; left: calc(-1 * var(--space-5) - 1px); top: 22px; bottom: 0; width: 2px; background: var(--surface); }
.org-member {
  display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; margin: 3px 0; padding: 7px 12px;
  background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius); max-width: 100%;
  transition: border-color 0.15s var(--ease);
}
.org-member:hover { border-color: var(--border-strong); }
.org-member a, .org-member strong { font-weight: 600; }
.org-member .muted { font-size: var(--text-xs); }
.org-vacant, .org-planned { opacity: 0.6; border-style: dashed; background: transparent; }
.org-icon { display: inline-block; width: 1.4em; text-align: center; }
.org-list section + section { margin-top: var(--space-2); }
.org-list ul { list-style: none; padding-left: 0; }
.org-mobile { display: none; }
.console-member > a:first-child { display: inline-flex; align-items: center; gap: 6px; margin-bottom: var(--space-4); font-size: var(--text-sm); font-weight: 600; color: var(--text-2); }
.console-member > a:first-child:hover { color: var(--orange); }
.console-member > .card:first-of-type h1 { margin-bottom: var(--space-2); }
.console-member table { width: 100%; border-collapse: collapse; }
.console-member th, .console-member td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }

/* --- Operação: Conversas -------------------------------------------------------------------------- */
.chat-list { list-style: none; padding: 0; margin: var(--space-3) 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.chat-list li { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); transition: background-color 0.12s var(--ease); }
.chat-list li:last-child { border-bottom: 0; }
.chat-list li:hover { background: var(--raised); }
.chat-list .link { color: var(--text); font-size: var(--text-base); }
.chat-list .muted { margin: 2px 0 0; font-size: var(--text-xs); }
.chat-messages { list-style: none; padding: var(--space-4); margin: var(--space-3) 0; display: flex; flex-direction: column; gap: var(--space-2); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); }
.chat-messages li { align-self: flex-start; max-width: min(78%, 680px); background: var(--raised); border: 1px solid var(--border); border-radius: 12px 12px 12px 4px; padding: 8px 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-messages li.out { align-self: flex-end; background: rgba(255, 138, 0, 0.1); border-color: var(--orange-line); border-radius: 12px 12px 4px 12px; }
.chat-messages li.muted { align-self: center; background: none; border: 0; }
.chat-messages p { margin: 2px 0; }
.chat-messages p.muted { font-size: var(--text-xs); color: var(--text-3); }

/* --- Celular e tablet ----------------------------------------------------------------------------- */
/* --- Campo (spec crm-campo §5): prospecção presencial, pensada primeiro para o celular ------------------ */
.field-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: var(--space-2); margin: 0 0 var(--space-4); }
.field-kpi { margin: 0; display: flex; flex-direction: column; gap: 2px; padding: var(--space-2) var(--space-3); }
.field-kpi .muted { font-size: var(--text-sm); line-height: 1.3; }
.field-kpi .big { font-size: var(--text-xl); }
.field-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--space-3); }
.field-chip, .field-tabs button {
  font: inherit; font-size: var(--text-sm); font-weight: 600; color: var(--text-2); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px;
}
.field-chip { padding: 4px 12px; border-radius: 99px; border: 1px solid var(--border-strong); background: var(--raised); }
.field-chip[aria-pressed="true"] { background: var(--orange-soft); border-color: var(--orange-line); color: var(--text); }
.field-chip .count, .field-tabs .count { font-variant-numeric: tabular-nums; font-size: var(--text-xs); color: var(--text-3); }
.field-tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--border); margin: 0 0 var(--space-3); }
.field-tabs button { padding: 8px 12px; background: none; border: 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.field-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--orange); }
.field-search { margin: 0 0 var(--space-3); }
.field-search input { min-width: 0; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--space-3); }
.field-card { margin: 0; display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.field-card.won { border-color: rgba(79, 209, 139, 0.45); }
.field-card p { margin: 0; overflow-wrap: anywhere; }
.field-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-2); }
.field-head h3 { margin: 0; font-size: var(--text-lg); font-weight: 800; }
.field-next { background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); overflow-wrap: anywhere; }
.field-next small { display: block; font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); margin-bottom: 2px; }
.field-links { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: auto; }
.field-links .btn { padding: 6px 10px; min-height: 36px; font-size: var(--text-sm); }
.field-phone { color: var(--text-2); font-size: var(--text-sm); }
.field-empty { grid-column: 1 / -1; padding: var(--space-5); text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--radius); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 30; height: auto; overflow: visible; border-right: 0; border-bottom: 1px solid var(--border); background: rgba(11, 11, 12, 0.97); }
  /* Sem backdrop-filter aqui: ele faria da barra o bloco de contenção do menu fixo (gaveta com 60 px de altura). */
  .brand { padding: 10px 16px; }
  .brand::after { left: 0; right: 0; }
  .emblem { width: 84px; }
  .wordmark { font-size: 1.1rem; }
  .menu-toggle {
    display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
    background: var(--raised); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); color: var(--text);
  }
  .menu-toggle::before { flex-basis: 20px; width: 20px; height: 20px; }
  nav {
    position: fixed; top: 61px; left: 0; bottom: 0; width: min(300px, 86vw); overflow-y: auto; z-index: 40;
    background: var(--surface); border-right: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
    transform: translateX(-102%); transition: transform 0.22s var(--ease);
  }
  body.nav-open nav { transform: none; }
  body.nav-open .shell::after { content: ''; position: fixed; inset: 61px 0 0; z-index: 25; background: rgba(0, 0, 0, 0.6); }
  body.nav-open { overflow: hidden; }
  main { padding: var(--space-5) 16px var(--space-7); }
  .shell:has(#nav[hidden]) .sidebar { position: static; background: none; border: 0; }
}
@media (max-width: 720px) {
  h1 { font-size: 1.3rem; margin-bottom: var(--space-4); }
  .card { padding: var(--space-4); border-radius: var(--radius); }
  .col-tabs { display: flex; }
  .kanban { grid-template-columns: 1fr; }
  .funnel { grid-template-columns: minmax(0, 1fr) !important; }
  .funnel-filters .row input { min-width: 0; flex: 1 1 100%; }
  .funnel .column:not(.active), .funnel-divider { display: none; }
  .funnel-closed { width: 100%; }
  .funnel-box { flex: 1; }
  .kanban .column:not(.active) { display: none; }
  .tile { cursor: pointer; }
  .tile .move-to { display: block; width: 100%; }
  .matrix-box { flex: 1 1 100% !important; }
  .notes { columns: 1; }
  .org-tree { display: none; }
  .org-mobile { display: block; }
  .org > select { max-width: none; }
  .console-member table { font-size: var(--text-xs); }
  .chat-messages { padding: var(--space-2); }
  .chat-messages li { max-width: 92%; }
  .row > .btn { flex: 1 1 auto; }
  dialog { padding: var(--space-4); }
}

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

/* --- Placar (cartões por pessoa) ----------------------------------------------------------------- */
.score-header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-5); }
.score-header h1 { margin: 0; }
.score-summary { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: baseline; font-variant-numeric: tabular-nums; }
.score-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: var(--space-4); }
.score-card {
  display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-5); min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.score-card.me { border-color: var(--orange-line); }
.score-card.met { border-color: rgba(79, 209, 139, 0.45); background: linear-gradient(180deg, var(--ok-soft), transparent 60%), var(--surface); }
.score-card p { margin: 0; }
.score-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.score-name { font-weight: 700; font-size: var(--text-lg); margin-right: auto; }
.pill.ok { background: var(--ok-soft); border-color: rgba(79, 209, 139, 0.3); color: var(--ok); }
.score-main { display: flex; align-items: baseline; gap: var(--space-2); font-variant-numeric: tabular-nums; }
.score-main .big { font-size: 2.75rem; line-height: 1; }
.score-of { color: var(--text-2); font-size: var(--text-lg); font-weight: 600; }
.score-pct { margin-left: auto; font-weight: 700; color: var(--orange); }
.score-card.met .score-pct, .score-card.met .big { color: var(--ok); }
.score-bar { appearance: none; width: 100%; height: 8px; border: 0; border-radius: 999px; background: var(--overlay); overflow: hidden; }
.score-bar::-webkit-progress-bar { background: var(--overlay); border-radius: 999px; }
.score-bar::-webkit-progress-value { background: var(--orange); border-radius: 999px; transition: width 0.4s var(--ease); }
.score-bar::-moz-progress-bar { background: var(--orange); border-radius: 999px; }
.score-card.met .score-bar::-webkit-progress-value { background: var(--ok); }
.score-card.met .score-bar::-moz-progress-bar { background: var(--ok); }
.score-card .pills { margin: 0; }
.score-goal { color: var(--text-2); font-size: var(--text-sm); }
.score-goal.link { align-self: flex-start; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-size: var(--text-sm); color: var(--text-2); }
.score-goal.link:hover { color: var(--orange); }
.goal-form { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.goal-form[hidden] { display: none; }
.goal-form input { width: 64px; text-align: center; }
.goal-form .step { width: 36px; padding-left: 0; padding-right: 0; }
@media (max-width: 720px) {
  .score-grid { grid-template-columns: minmax(0, 1fr); }
  .score-card { padding: var(--space-4); }
}

/* --- Placar por período e Hoje novo (spec placar-hoje) -------------------------------------------- */
.score-header p { margin: 4px 0 0; }
.period-tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.period-tabs a { padding: 9px 18px; min-height: 40px; box-sizing: border-box; display: inline-flex; align-items: center; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 600; font-size: var(--text-sm); text-decoration: none; }
.period-tabs a:hover { color: var(--text); background: var(--raised); }
.period-tabs a.active { background: var(--orange); color: #111; font-weight: 800; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); margin-bottom: var(--space-5); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-4); min-width: 0; }
.kpi.alert { border-color: rgba(255, 107, 107, 0.35); }
.kpi.warn { border-color: rgba(255, 194, 71, 0.35); }
.kpi-label { font-size: var(--text-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-2); }
.kpi.alert .kpi-label { color: var(--error); }
.kpi.warn .kpi-label { color: var(--gold); }
.kpi-value { font-size: 1.75rem; font-weight: 800; line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi-note { font-size: var(--text-xs); color: var(--text-2); margin-top: 2px; }
.team-table h2 { margin: 0; }
.table-scroll { overflow-x: auto; margin-top: var(--space-3); }
.team-table table { width: 100%; border-collapse: collapse; }
.team-table th { text-align: right; white-space: nowrap; }
.team-table th:first-child, .team-table td:first-child { text-align: left; }
.team-table td { white-space: nowrap; }
.team-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.team-table td.strong { color: var(--orange); font-weight: 800; }
.team-table td.alert { color: var(--error); }
.team-table tr.off td { color: var(--text-3); }
.team-table input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--orange); }
.score-grid.wide { grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); }
.score-groups { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: var(--space-2) var(--space-3); align-items: start; }
.group-label { font-size: var(--text-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-2); padding-top: 6px; }
.group-label span { display: block; letter-spacing: 0; text-transform: none; color: var(--text-3); }
.group-label.effort { color: var(--orange); }
.group-label.funnel { color: var(--ok); }
.score-groups .pills { margin: 0; }
.pill.zero { color: var(--text-3); background: transparent; }
.week-bars { display: flex; flex-direction: column; gap: 4px; }
.bar-row { display: flex; gap: var(--space-3); }
.bar-row span { flex: 1; text-align: center; min-width: 0; white-space: nowrap; }
.bar-values span { font-size: var(--text-sm); font-weight: 800; font-variant-numeric: tabular-nums; }
.bar-days span { font-size: var(--text-xs); color: var(--text-2); }
.bar-days span.today { color: var(--orange); font-weight: 700; }
.bar-area { position: relative; display: flex; gap: var(--space-3); height: 140px; border-bottom: 1px solid var(--border-strong); }
.bar-area.has-goal::after { content: ''; position: absolute; left: 0; right: 0; bottom: var(--goal); border-top: 2px dashed var(--gold); pointer-events: none; }
.bar-slot { flex: 1; display: flex; align-items: flex-end; justify-content: center; min-width: 0; }
.bar { width: 100%; max-width: 64px; height: var(--h); min-height: 2px; border-radius: 6px 6px 0 0; background: var(--orange); }
.bar.met { background: var(--ok); }
.bar.low, .bar.zero { background: rgba(255, 138, 0, 0.45); }
.bar.nogoal { background: var(--text-2); }
.bar.future { background: transparent; }
.legend { display: flex; flex-wrap: wrap; gap: var(--space-3); font-size: var(--text-xs); color: var(--text-2); margin-bottom: var(--space-2); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; }
.month-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.month-head { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); text-align: center; }
.cell { min-height: 52px; border-radius: var(--radius-sm); padding: 6px 8px; display: flex; flex-direction: column; justify-content: space-between; background: var(--overlay); color: var(--text-2); }
.cell.blank { background: transparent; }
.cell-day { font-size: var(--text-xs); font-weight: 600; }
.cell-value { font-size: var(--text-lg); font-weight: 800; font-variant-numeric: tabular-nums; }
.cell.met, .swatch.met { background: var(--ok); color: #0b0b0c; }
.cell.near, .swatch.near { background: var(--orange); color: #0b0b0c; }
.cell.low, .swatch.low { background: rgba(255, 138, 0, 0.28); color: var(--text); }
.cell.zero, .swatch.zero { background: var(--overlay); }
.cell.future { background: transparent; border: 1px solid var(--border); color: var(--text-3); }
.cell.nogoal { background: var(--raised); color: var(--text); }
.cell.today { box-shadow: 0 0 0 2px var(--text) inset; }
.month .muted { margin-top: var(--space-3); }

.today-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-5); margin-bottom: var(--space-5); }
.today-head h1 { margin: 4px 0 0; }
.today-head p { margin: 6px 0 0; }
.eyebrow { font-size: var(--text-xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-2); }
.goal-box { display: flex; align-items: center; gap: var(--space-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-3) var(--space-5); }
.goal-box strong { font-size: var(--text-lg); font-weight: 800; }
.goal-box a { font-size: var(--text-sm); font-weight: 600; color: var(--orange); }
.goal-ring { width: 84px; height: 84px; flex: none; }
.goal-ring circle { fill: none; }
.goal-ring .track { stroke: var(--overlay); }
.goal-ring .value { stroke: var(--orange); stroke-linecap: round; transition: stroke-dasharray 0.4s var(--ease); }
.goal-ring.met .value { stroke: var(--ok); }
.goal-ring text { fill: var(--text); font-weight: 800; font-size: 20px; font-family: inherit; }
.say-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-5); }
.say-box label { margin: 0 0 6px; }
.say-row { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: stretch; }
.say-row textarea { flex: 1 1 320px; min-height: 44px; resize: vertical; }
.say-row .btn { min-height: 44px; }
.say-status { margin: 6px 0 0; font-size: var(--text-xs); }
.today-layout { display: flex; flex-wrap: wrap; gap: var(--space-5); align-items: flex-start; }
.today-queue { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.today-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.queue-group { display: flex; align-items: baseline; gap: var(--space-3); margin-top: var(--space-2); }
.queue-group h2 { margin: 0; }
.queue-group.late h2 { color: var(--error); }
.task-card { background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
.task-card.late { border-color: rgba(255, 107, 107, 0.25); }
.task-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.temp { font-size: var(--text-xs); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 8px; border-radius: var(--radius-sm); }
.temp.hot { background: var(--orange-soft); color: var(--orange-hover); }
.temp.warm { background: var(--gold-soft); color: var(--gold); }
.temp.cold { background: rgba(106, 161, 255, 0.14); color: #8fb8ff; }
.task-store { font-size: var(--text-lg); font-weight: 800; color: var(--text); }
.task-step { font-size: var(--text-xs); color: var(--text-3); }
.task-badge { margin-left: auto; font-size: var(--text-xs); font-weight: 600; color: var(--text-2); }
.task-badge.late { color: var(--error); }
.task-lines { display: flex; flex-wrap: wrap; gap: 4px var(--space-5); font-size: var(--text-sm); }
.task-lines .muted { margin: 0; }
.suggestion { color: var(--gold); }
.task-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.task-actions .btn { min-height: 40px; }
.how { font-size: var(--text-xs); color: var(--text-3); padding: 0 4px 0 var(--space-2); }
.chip { font: inherit; font-size: var(--text-sm); font-weight: 600; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; }
.chip:hover { background: var(--orange-soft); border-color: var(--orange-line); }
.spacer { flex: 1 1 0; }
.task-more { display: inline-flex; gap: 2px; margin-left: auto; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); box-shadow: none; font-weight: 600; }
.btn.ghost:hover { color: var(--text); background: var(--overlay); }
.btn.wide { width: 100%; justify-content: center; box-sizing: border-box; }
.side-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4); }
.side-card h2 { margin: 0 0 var(--space-3); }
.side-card.warn { border-color: rgba(255, 194, 71, 0.3); }
.side-card.warn h2 { color: var(--gold); }
.side-card.event { border-color: var(--orange-line); }
.side-card.event h2 { color: var(--orange); }
.side-card > p.muted { margin: 0 0 var(--space-3); }
.side-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.side-list li { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-sm); }
.side-list .muted { margin: 2px 0 0; font-size: var(--text-xs); }
.timeline-mini li { align-items: flex-start; }
.timeline-mini .time { color: var(--text-3); font-variant-numeric: tabular-nums; width: 42px; flex: none; }
.event-stats { display: flex; gap: var(--space-5); margin-bottom: var(--space-3); }
.event-stats .muted { margin: 0; font-size: var(--text-xs); }
@media (max-width: 720px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .score-grid.wide { grid-template-columns: minmax(0, 1fr); }
  .score-groups { grid-template-columns: minmax(0, 1fr); }
  .group-label { padding-top: 0; }
  .goal-box { width: 100%; box-sizing: border-box; }
  .task-actions .btn, .chip { min-height: 44px; }
  .task-actions .chip { flex: 1 1 40%; }
  .task-actions a.btn { flex: 1 1 40%; justify-content: center; }
  .spacer { display: none; }
  .how { flex-basis: 100%; padding: 0; }
  .task-badge { margin-left: 0; flex-basis: 100%; }
}

/* Área Clientes: passos do onboarding (spec console-clientes §4). */
ol.steps { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: grid; gap: 4px; font-size: var(--text-sm); }
ol.steps .step { padding-left: 1.5em; position: relative; }
ol.steps .step::before { position: absolute; left: 0; content: '○'; color: var(--text-3); }
ol.steps .step.done::before { content: '●'; color: var(--text-2); }
ol.steps .step.current { font-weight: 600; }
ol.steps .step.current::before { content: '▶'; color: var(--gold); }
