/* =========================================================
   Motor · estilo Lendar[IA]
   Barra lateral preta, fundo cinza-quente, cartoes brancos bem
   arredondados, titulos em negrito pesado, avisos coloridos,
   cartoes pretos com texto mono e quadradinhos de cor por area.
   ========================================================= */
@font-face { font-family: "Inter"; src: url("/fontes/inter-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fontes/inter-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fontes/inter-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fontes/inter-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fontes/inter-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fontes/jetbrains-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fontes/jetbrains-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --fundo: #edece8;
  --cartao: #ffffff;
  --preto: #0b0b0c;
  --texto: #111111;
  --texto-2: #6b6b6b;
  --texto-3: #9b9b98;
  --borda: #e3e2dd;
  --borda-2: #d4d3cd;
  --verde: #1f8a4c;
  --verde-claro: #e4f4ea;
  --verde-forte: #22c55e;
  --vermelho: #d33a2c;
  --vermelho-claro: #fdecea;
  --ambar: #b7791f;
  --ambar-claro: #fdf3e1;
  --ambar-borda: #f3d9a6;
  --raio: 16px;
  --sombra: 0 1px 2px rgba(17, 17, 17, 0.04);
  --fonte: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --lateral: 248px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fundo); color: var(--texto); font: 15px/1.45 var(--fonte); letter-spacing: -0.011em; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: inherit; text-decoration: none; }
.num { font-variant-numeric: tabular-nums; }
.sec { color: var(--texto-2); }
:focus-visible { outline: 2px solid var(--preto); outline-offset: 2px; border-radius: 8px; }

/* ---------- estrutura ---------- */
.casca { display: grid; grid-template-columns: var(--lateral) 1fr; min-height: 100vh; }
.lateral { position: sticky; top: 0; height: 100vh; background: var(--preto); color: #fff; padding: 18px 12px; display: flex; flex-direction: column; gap: 22px; }
.lateral-marca { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.lateral-marca .nome-app { font-weight: 800; font-size: 16px; letter-spacing: -0.02em; line-height: 1.1; }
.lateral-marca .org { font-size: 12px; color: #8a8a8a; }
.app-icone { width: 32px; height: 32px; border-radius: 9px; background: #fff; display: grid; place-items: center; flex: none; }
.app-icone svg { width: 18px; height: 18px; stroke: var(--preto); fill: none; stroke-width: 2.2; }
.menu-rot { font-size: 11px; font-weight: 600; color: #6f6f6f; text-transform: uppercase; letter-spacing: 0.06em; padding: 0 10px 6px; }
.menu { display: grid; gap: 2px; }
.menu a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: #c9c9c9; font-size: 14px; font-weight: 500; transition: background .15s, color .15s; }
.menu a svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.menu a:hover { background: #1c1c1e; color: #fff; }
.menu a[aria-current="page"] { background: #232325; color: #fff; }
.menu .contador { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--vermelho); color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.lateral-pe { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: #161618; }
.lateral-pe .nome { font-size: 13.5px; font-weight: 600; }
.lateral-pe button { background: none; border: 0; padding: 0; color: #8a8a8a; font-size: 12.5px; cursor: pointer; }
.lateral-pe button:hover { color: #fff; }

.palco { min-width: 0; padding: 30px 40px 80px; }
.palco-in { max-width: 1120px; margin: 0 auto; }

/* quadradinho de cor (area / papel) */
.ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; color: #fff; }
.ico svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico.p { width: 12px; height: 12px; border-radius: 3px; }
.ico.p svg { display: none; }

/* ---------- titulos ---------- */
.cab { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 4px 0 24px; flex-wrap: wrap; }
.cab > div:first-child { display: flex; flex-direction: column; }
.cab .sobre { font-size: 13.5px; color: var(--texto-2); margin-top: 4px; order: 2; }
.titulo { font-size: 30px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; margin: 0; }
.grupo-tit { font-size: 15px; font-weight: 700; color: var(--texto); margin: 30px 2px 10px; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; letter-spacing: -0.015em; }
.grupo-tit small { display: block; font-size: 13px; font-weight: 400; color: var(--texto-2); letter-spacing: -0.005em; margin-top: 1px; }
.grupo-tit a { font-size: 13px; font-weight: 600; color: var(--texto-2); }
.grupo-tit a:hover { color: var(--texto); }
.grupo-rodape { font-size: 13px; color: var(--texto-2); margin: 10px 2px 0; }
.titulo-sec { font-size: 15px; font-weight: 700; margin: 30px 2px 10px; display: flex; align-items: center; gap: 8px; letter-spacing: -0.015em; }

/* ---------- botoes ---------- */
.botoes { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--borda-2); border-radius: 10px; padding: 8px 14px; font-size: 14px; font-weight: 600; cursor: pointer; background: var(--cartao); color: var(--texto); box-shadow: var(--sombra); transition: background .15s, transform .1s, border-color .15s; white-space: nowrap; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { border-color: var(--texto-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.cheio { background: var(--preto); border-color: var(--preto); color: #fff; }
.btn.cheio:hover { background: #2a2a2c; }
.btn.verde { background: var(--verde-forte); border-color: var(--verde-forte); color: #fff; font-weight: 700; }
.btn.verde:hover { background: #16a34a; }
.btn.perigo { color: var(--vermelho); }
.btn.grande { padding: 12px 18px; font-size: 15px; width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--texto-2); font-size: 14px; font-weight: 600; cursor: pointer; }
.link-btn:hover { color: var(--texto); }

/* ---------- lista em cartao ---------- */
.lista { background: var(--cartao); border-radius: var(--raio); overflow: hidden; box-shadow: var(--sombra); list-style: none; margin: 0; padding: 0; border: 1px solid var(--borda); }
.linha { display: flex; align-items: center; gap: 12px; padding: 0 0 0 16px; min-height: 58px; position: relative; color: var(--texto); width: 100%; background: none; border: 0; text-align: left; }
a.linha, button.linha { cursor: pointer; }
a.linha:hover, button.linha:hover { background: #fafaf8; }
.linha-corpo { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 11px 16px 11px 0; align-self: stretch; }
.lista > .linha + .linha::before { content: ""; position: absolute; left: 16px; right: 16px; top: 0; height: 1px; background: var(--borda); }
.linha-txt { flex: 1; min-width: 0; }
.linha-tit { font-size: 14.5px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linha-sub { font-size: 13px; color: var(--texto-2); line-height: 1.35; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linha-dir { font-size: 13px; color: var(--texto-2); text-align: right; white-space: nowrap; flex: none; }
.linha-dir.alerta { color: var(--vermelho); font-weight: 600; }
.chevron { width: 7px; height: 12px; flex: none; stroke: var(--texto-3); fill: none; stroke-width: 2; }
.avatar { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; flex: none; letter-spacing: 0; }
.avatar.g { width: 64px; height: 64px; font-size: 22px; border-radius: 18px; }
.bolinha { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--vermelho); color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.bolinha.azul { background: var(--preto); }
.vazio { padding: 30px 20px; text-align: center; color: var(--texto-2); font-size: 14px; }

/* ---------- avisos (cartoes) ---------- */
.avisos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.aviso-c { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; background: var(--cartao); border: 1px solid var(--borda); border-radius: 14px; box-shadow: var(--sombra); color: var(--texto); }
.aviso-c svg.i { width: 18px; height: 18px; flex: none; stroke: var(--texto-2); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }
.aviso-c .t { font-size: 14px; font-weight: 600; line-height: 1.3; }
.aviso-c .s { font-size: 12.5px; color: var(--texto-2); margin-top: 2px; }
.aviso-c .seta { margin-left: auto; color: var(--texto-3); font-size: 16px; line-height: 1; align-self: center; }
a.aviso-c:hover { border-color: var(--borda-2); }
.aviso-c.ambar { background: var(--ambar-claro); border-color: var(--ambar-borda); }
.aviso-c.ambar .t { color: var(--ambar); }
.aviso-c.ambar .s { color: #a07a3b; }
.aviso-c.ambar svg.i { stroke: var(--ambar); }
.aviso-c.vermelho { background: var(--vermelho-claro); border-color: #f5c6c0; }
.aviso-c.vermelho .t { color: var(--vermelho); }
.aviso-c.vermelho svg.i { stroke: var(--vermelho); }
.aviso-c.verde { background: var(--verde-claro); border-color: #bfe5cd; }
.aviso-c.verde .t { color: var(--verde); }
.aviso-c.verde svg.i { stroke: var(--verde); }

/* ---------- cartoes de numero ---------- */
.widgets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.widget { background: var(--cartao); border: 1px solid var(--borda); border-radius: var(--raio); padding: 16px 18px; box-shadow: var(--sombra); display: flex; flex-direction: column; gap: 6px; min-height: 108px; }
.widget-rot { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--texto-2); }
.widget-rot .ico { display: none; }
.widget-val { font-size: 26px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; }
.widget-val.verde { color: var(--verde); }
.widget-val.vermelho { color: var(--vermelho); }
.widget-var { font-size: 12.5px; color: var(--texto-2); }
.widget-var.sobe { color: var(--verde); }
.widget-var.desce { color: var(--vermelho); }
.metricas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.metricas .widget { min-height: 98px; }
.metricas .widget-val { font-size: 22px; }

/* funil */
.funil { padding: 8px 18px 12px; }
.funil-l { display: grid; grid-template-columns: 120px 1fr 32px; gap: 12px; align-items: center; padding: 9px 0; font-size: 14px; }
.funil-l .nm { display: flex; align-items: center; gap: 8px; }
.funil-l .nm i { width: 10px; height: 10px; border-radius: 3px; }
.funil-b { height: 8px; border-radius: 4px; background: #f0efeb; overflow: hidden; }
.funil-b i { display: block; height: 100%; border-radius: 4px; }
.funil-l .num { text-align: right; color: var(--texto-2); font-weight: 600; }

/* cartao preto (resumo das 7h, rotinas) */
.preto { background: var(--preto); color: #fff; border-radius: var(--raio); padding: 16px 18px 18px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.preto .janela { display: flex; gap: 6px; margin-bottom: 12px; }
.preto .janela i { width: 9px; height: 9px; border-radius: 50%; background: #ff5f57; }
.preto .janela i:nth-child(2) { background: #febc2e; }
.preto .janela i:nth-child(3) { background: #28c840; }
.preto .tit { font-weight: 700; font-size: 15px; }
.preto .mono { font-family: var(--mono); font-size: 12.5px; color: #a8a8a8; line-height: 1.6; white-space: pre-wrap; margin-top: 6px; }
.rotinas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rotinas .preto { padding: 14px 16px; }
.rotinas .rodape { font-family: var(--mono); font-size: 11.5px; color: #6f6f6f; margin-top: 10px; }
.resumo-pe { font-size: 12.5px; color: var(--texto-2); margin: 8px 2px 0; }
.bolha { white-space: pre-wrap; }

/* ---------- filtros ---------- */
.filtros { display: grid; gap: 10px; margin-bottom: 4px; }
.busca { position: relative; }
.busca input { width: 100%; border: 1px solid var(--borda); background: var(--cartao); border-radius: 12px; padding: 10px 12px 10px 38px; font-size: 14.5px; outline: none; box-shadow: var(--sombra); }
.busca input:focus { border-color: var(--texto-3); }
.busca svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--texto-3); fill: none; stroke-width: 2; }
.segmentado { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.segmentado::-webkit-scrollbar, .pilulas::-webkit-scrollbar { display: none; }
.segmentado button { flex: none; border: 1px solid var(--borda); background: var(--cartao); border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; color: var(--texto-2); }
.segmentado button[aria-pressed="true"] { background: var(--preto); border-color: var(--preto); color: #fff; }
.segmentado .qt { opacity: .6; margin-left: 5px; font-weight: 500; }
.pilulas { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.pilula { border: 0; border-radius: 8px; padding: 5px 10px; background: transparent; font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; color: var(--texto-2); }
.pilula .p { width: 10px; height: 10px; border-radius: 3px; }
.pilula[aria-pressed="true"] { background: var(--cartao); color: var(--texto); box-shadow: 0 0 0 1px var(--borda-2); font-weight: 600; }

/* ---------- folha (painel lateral) ---------- */
.veu { position: fixed; inset: 0; background: rgba(11, 11, 12, 0.45); z-index: 40; animation: fade .2s ease; }
.folha { position: fixed; z-index: 41; top: 12px; right: 12px; bottom: 12px; width: min(560px, calc(100vw - 24px)); background: var(--fundo); border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.3); display: flex; flex-direction: column; overflow: hidden; animation: entra .3s cubic-bezier(.2,.9,.3,1); }
@keyframes fade { from { opacity: 0; } }
@keyframes entra { from { opacity: 0; transform: translateX(20px); } }
.folha-barra { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 14px 18px; background: var(--cartao); border-bottom: 1px solid var(--borda); }
.folha-barra b { font-size: 15px; font-weight: 700; text-align: center; }
.folha-barra .dir { justify-self: end; }
.folha-barra .esq { justify-self: start; }
.folha-corpo { overflow-y: auto; padding: 6px 18px 32px; }
.perfil { display: flex; align-items: center; gap: 14px; padding: 18px 2px 6px; }
.perfil h3 { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; margin: 0; }
.perfil .sec { font-size: 13.5px; margin-top: 2px; }
.acoes-redondas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 2px; }
.acao-r { display: grid; justify-items: center; gap: 4px; background: var(--cartao); border: 1px solid var(--borda); border-radius: 12px; padding: 10px 6px 9px; font-size: 12px; font-weight: 600; color: var(--texto); cursor: pointer; box-shadow: var(--sombra); }
.acao-r svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.acao-r:hover { border-color: var(--borda-2); }
.acao-r:disabled { color: var(--texto-3); cursor: default; box-shadow: none; }
.acao-r.destaque { background: var(--preto); border-color: var(--preto); color: #fff; }

/* campos */
.campo-l { display: flex; align-items: center; gap: 12px; padding: 0 0 0 16px; min-height: 48px; position: relative; }
.campo-l label { width: 120px; flex: none; font-size: 13.5px; color: var(--texto-2); white-space: nowrap; align-self: stretch; display: flex; align-items: center; }
.campo-l .ctrl { flex: 1; min-width: 0; padding: 8px 16px 8px 0; align-self: stretch; display: flex; align-items: center; }
.lista > .campo-l + .campo-l::before { content: ""; position: absolute; left: 16px; right: 16px; top: 0; height: 1px; background: var(--borda); }
.campo-l input, .campo-l select { width: 100%; border: 0; outline: none; background: none; font-size: 14.5px; font-weight: 500; color: var(--texto); text-align: right; padding: 0; }
.campo-l input::placeholder { color: var(--texto-3); font-weight: 400; }
.campo-l select { appearance: none; -webkit-appearance: none; cursor: pointer; text-align-last: right; font-weight: 600; }
.notas { width: 100%; border: 1px solid var(--borda); outline: none; background: var(--cartao); border-radius: var(--raio); padding: 12px 16px; min-height: 96px; font-size: 14.5px; resize: vertical; box-shadow: var(--sombra); display: block; }
.notas:focus { border-color: var(--texto-3); }
.salvo { font-size: 12.5px; font-weight: 600; color: var(--verde); opacity: 0; transition: opacity .3s; }
.salvo.on { opacity: 1; }

.historico { list-style: none; margin: 0; padding: 0; background: var(--cartao); border-radius: var(--raio); border: 1px solid var(--borda); overflow: hidden; }
.historico li { padding: 12px 16px; display: grid; gap: 3px; position: relative; }
.historico li + li::before { content: ""; position: absolute; left: 16px; right: 16px; top: 0; height: 1px; background: var(--borda); }
.historico .meta { font-size: 12px; color: var(--texto-2); display: flex; align-items: center; gap: 7px; font-family: var(--mono); }
.historico .txt { font-size: 14px; white-space: pre-wrap; }
.nota-nova { display: flex; gap: 8px; margin-bottom: 10px; }
.nota-nova input { flex: 1; border: 1px solid var(--borda); background: var(--cartao); border-radius: 10px; padding: 9px 13px; font-size: 14.5px; outline: none; }
.nota-nova input:focus { border-color: var(--texto-3); }

/* ---------- aprovacoes ---------- */
.aprov { background: var(--cartao); border: 1px solid var(--borda); border-radius: 18px; box-shadow: var(--sombra); padding: 16px 18px 18px; display: grid; gap: 12px; }
.aprov + .aprov { margin-top: 10px; }
.aprov-cab { display: flex; gap: 12px; align-items: center; }
.aprov-cab .linha-tit { white-space: normal; font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.aprov .bolha { background: #f6f5f1; border: 1px solid var(--borda); border-radius: 14px; border-top-left-radius: 4px; padding: 12px 14px; font-size: 14.5px; line-height: 1.5; max-width: 640px; }
textarea.bolha { width: 100%; border: 1.5px solid var(--preto) !important; outline: none; min-height: 120px; resize: vertical; font: inherit; font-size: 14.5px; }
.aprov .botoes .btn { flex: 1; }
.aprov.feito { opacity: .7; }
.etiqueta { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #f0efeb; color: var(--texto-2); white-space: nowrap; }
.etiqueta.ambar { background: var(--ambar-claro); color: var(--ambar); }
.etiqueta.verde { background: var(--verde-claro); color: var(--verde); }
.etiqueta.verde::before, .etiqueta.ambar::before { content: "● "; font-size: 9px; vertical-align: 1px; }

/* ---------- entrada ---------- */
.entrada { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.entrada-lado { background: var(--preto); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.entrada-lado h2 { font-size: clamp(34px, 4vw, 52px); font-weight: 800; letter-spacing: -0.045em; line-height: 1; margin: 0; text-transform: uppercase; max-width: 12ch; }
.entrada-lado .ligados { display: grid; gap: 8px; max-width: 340px; }
.entrada-lado .ligado { display: flex; justify-content: space-between; align-items: center; background: #161618; border-radius: 12px; padding: 12px 14px; font-weight: 600; font-size: 14px; }
.entrada-lado .ligado span { font-size: 12px; color: #4ade80; background: rgba(34, 197, 94, .12); padding: 3px 9px; border-radius: 999px; }
.entrada-box { display: grid; place-items: center; padding: 24px; }
.entrada-box form { width: 100%; max-width: 360px; }
.entrada-box h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.035em; margin: 0 0 4px; }
.entrada-box p { color: var(--texto-2); margin: 0 0 22px; font-size: 14px; }
.entrada-box .lista { margin-bottom: 14px; }
.entrada-box .campo-l label { width: 64px; }
.entrada-box .campo-l input { text-align: left; }
.msg-erro { color: var(--vermelho); font-size: 13.5px; min-height: 20px; margin-bottom: 6px; }

/* ---------- avisos flutuantes ---------- */
.aviso { position: fixed; left: 50%; top: 18px; transform: translate(-50%, -16px); background: var(--preto); color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 14px; font-weight: 500; box-shadow: 0 10px 30px rgba(0,0,0,.25); opacity: 0; transition: all .25s ease; z-index: 60; pointer-events: none; }
.aviso.on { opacity: 1; transform: translate(-50%, 0); }
.carregando { display: grid; place-items: center; padding: 80px 0; }
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--borda-2); border-top-color: var(--preto); border-radius: 50%; animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

/* ---------- celular ---------- */
.barra-abas { display: none; }
.topo-cel { display: none; }
@media (max-width: 1050px) {
  .widgets, .metricas { grid-template-columns: repeat(2, 1fr); }
  .rotinas { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .casca { grid-template-columns: 1fr; }
  .lateral { display: none; }
  .palco { padding: 0 14px calc(92px + env(safe-area-inset-bottom)); }
  .topo-cel { display: flex; justify-content: space-between; align-items: center; margin: 0 -14px 18px; padding: 12px 16px; background: var(--preto); color: #fff; position: sticky; top: 0; z-index: 20; }
  .topo-cel .lateral-marca { padding: 0; }
  .topo-cel .link-btn { color: #9a9a9a; }
  .titulo { font-size: 26px; }
  .cab { flex-direction: column; align-items: stretch; gap: 14px; margin-bottom: 18px; }
  .cab .botoes .btn { flex: 1; }
  .avisos { grid-template-columns: 1fr; }
  .rotinas { grid-template-columns: 1fr; }
  .barra-abas { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30; padding: 6px; background: var(--preto); border-radius: 18px; box-shadow: 0 12px 30px rgba(0,0,0,.25); }
  .barra-abas a { display: grid; justify-items: center; gap: 2px; font-size: 10.5px; font-weight: 600; color: #8a8a8a; position: relative; padding: 7px 0 5px; border-radius: 12px; }
  .barra-abas a svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .barra-abas a[aria-current="page"] { color: #fff; background: #232325; }
  .barra-abas .bolinha { position: absolute; top: 2px; left: calc(50% + 5px); min-width: 17px; height: 17px; font-size: 10px; padding: 0 4px; }
  .folha { top: auto; left: 0; right: 0; bottom: 0; width: 100%; height: calc(100vh - 40px); border-radius: 20px 20px 0 0; animation: sobe .35s cubic-bezier(.2,.9,.3,1); }
  @keyframes sobe { from { transform: translateY(100%); } }
  .campo-l label { width: auto; min-width: 84px; padding-right: 8px; }
  .entrada { grid-template-columns: 1fr; }
  .entrada-lado { padding: 28px 22px; gap: 22px; }
  .entrada-lado .ligados { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* =========================================================
   Parte 1: conversas, tarefas, agentes, configuracoes
   ========================================================= */
.avatar svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.etiqueta.vermelho { background: var(--vermelho-claro); color: var(--vermelho); }
.so-celular { display: none; }

/* caixa de entrada */
.caixa { display: grid; grid-template-columns: 360px 1fr; gap: 14px; align-items: start; }
.caixa-lista { position: sticky; top: 20px; max-height: calc(100vh - 150px); overflow-y: auto; scrollbar-width: thin; }
.linha.conv.ativa { background: #f6f5f1; }
.linha.conv.ativa::after { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--preto); }
.conv-dir { display: grid; justify-items: end; gap: 5px; flex: none; }
.linha-sub b { color: var(--texto); font-weight: 600; }
.thread { background: var(--cartao); border: 1px solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra); display: flex; flex-direction: column; height: calc(100vh - 150px); min-height: 480px; overflow: hidden; }
.thread.vazia { display: grid; place-items: center; }
.thread-cab { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--borda); }
.thread-cab .botoes { flex: none; }
.thread-cab .btn { padding: 6px 11px; font-size: 13px; }
.msgs { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 10px; background: #faf9f6; }
.msg { max-width: min(560px, 82%); padding: 10px 13px; border-radius: 14px; font-size: 14.5px; line-height: 1.5; }
.msg.m-in { align-self: flex-start; background: var(--cartao); border: 1px solid var(--borda); border-top-left-radius: 4px; }
.msg.m-out { align-self: flex-end; background: var(--preto); color: #fff; border-top-right-radius: 4px; }
.msg-txt { white-space: pre-wrap; word-wrap: break-word; }
.msg-meta { font-size: 11.5px; margin-top: 5px; color: var(--texto-3); }
.msg.m-out .msg-meta { color: #8a8a8a; }
.msg-assunto { font-size: 12.5px; font-weight: 700; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--borda); }
.msg.m-out .msg-assunto { border-color: #2a2a2c; }
.sugestao { margin: 0 12px 10px; padding: 12px 14px; background: var(--ambar-claro); border: 1px solid var(--ambar-borda); border-radius: 14px; display: grid; gap: 10px; }
.sug-cab { display: flex; gap: 8px; align-items: center; }
.sug-txt { white-space: pre-wrap; font-size: 14.5px; }
textarea.sug-txt { width: 100%; min-height: 100px; border: 1.5px solid var(--preto); border-radius: 10px; padding: 10px 12px; outline: none; background: #fff; resize: vertical; }
.sugestao .botoes .btn { flex: 1; }
.compor { border-top: 1px solid var(--borda); padding: 12px; display: grid; gap: 8px; background: var(--cartao); }
.compor textarea { width: 100%; border: 1px solid var(--borda); border-radius: 12px; padding: 10px 12px; resize: vertical; outline: none; font-size: 14.5px; min-height: 52px; }
.compor textarea:focus { border-color: var(--texto-3); }
.compor-acoes { display: flex; justify-content: space-between; gap: 8px; }
.compor-aviso { font-size: 12.5px; color: var(--ambar); background: var(--ambar-claro); border-radius: 10px; padding: 8px 10px; }

/* tarefas */
.nova-tarefa { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; background: var(--cartao); border: 1px solid var(--borda); border-radius: var(--raio); padding: 8px; box-shadow: var(--sombra); }
.nova-tarefa input, .nova-tarefa select { border: 0; outline: none; background: #f6f5f1; border-radius: 10px; padding: 9px 12px; font-size: 14.5px; min-width: 0; }
.nova-tarefa input[name=titulo] { background: none; }
.tarefa .check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--borda-2); background: none; flex: none; display: grid; place-items: center; cursor: pointer; padding: 0; color: #fff; }
.tarefa .check:hover { border-color: var(--preto); }
.tarefa .check[aria-pressed="true"] { background: var(--verde-forte); border-color: var(--verde-forte); }
.tarefa .check svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 3; }
.tarefa .linha-corpo { color: inherit; font: inherit; width: 100%; }
.tarefa.feita .linha-tit { text-decoration: line-through; color: var(--texto-3); }

/* agentes */
.agentes { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.agente { background: var(--cartao); border: 1px solid var(--borda); border-radius: 18px; padding: 16px; box-shadow: var(--sombra); display: grid; gap: 14px; }
.agente.desligado { background: #f6f5f1; }
.agente.desligado .ico { filter: grayscale(1); opacity: .5; }
.agente-cab { display: flex; gap: 12px; align-items: flex-start; }
.agente-nome { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; }
.agente-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.agente-nums div { background: #f6f5f1; border-radius: 10px; padding: 8px 9px; display: grid; gap: 1px; }
.agente-nums b { font-size: 15px; font-weight: 700; }
.agente-nums b.vermelho { color: var(--vermelho); }
.agente-nums span { font-size: 11px; color: var(--texto-2); line-height: 1.25; }
.agente-regras { display: grid; gap: 6px; }
.agente-regras label { font-size: 12.5px; font-weight: 600; color: var(--texto-2); }
.agente-regras .notas { min-height: 70px; font-size: 14px; }
.agente-pe { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.agente-pe .linha-sub { white-space: normal; }
.interruptor { width: 46px; height: 28px; border-radius: 14px; border: 0; background: #d4d3cd; position: relative; cursor: pointer; flex: none; transition: background .2s; padding: 0; }
.interruptor span { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.interruptor[aria-pressed="true"] { background: var(--verde-forte); }
.interruptor[aria-pressed="true"] span { transform: translateX(18px); }
.interruptor:disabled { opacity: .5; cursor: default; }

@media (max-width: 1050px) {
  .caixa { grid-template-columns: 300px 1fr; }
}
@media (max-width: 820px) {
  .caixa { grid-template-columns: 1fr; }
  .caixa .caixa-thread { display: none; }
  .caixa.com-thread .caixa-lista { display: none; }
  .caixa.com-thread .caixa-thread { display: block; }
  .caixa-lista { position: static; max-height: none; }
  .so-celular { display: inline-flex; }
  .so-celular svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2.2; }
  .thread { height: calc(100vh - 190px); border-radius: 14px; }
  .thread-cab { padding: 10px 12px; gap: 10px; flex-wrap: wrap; }
  .thread-cab .botoes { width: 100%; }
  .thread-cab .botoes .btn { flex: 1; }
  .nova-tarefa { grid-template-columns: 1fr 1fr; }
  .nova-tarefa input[name=titulo] { grid-column: 1 / -1; }
  .nova-tarefa .btn { grid-column: 1 / -1; }
  .agente-nums { grid-template-columns: 1fr 1fr; }
}
