/* ============================================================
   SOM — Sistema Operacional Maracatu
   Design system (variáveis no topo: fácil de rebrandar)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');
:root {
  /* Marca Maracatu Digital: preto + dourado + creme (extraído do site) */
  --primary:   #0A0A0A;   /* preto */
  --primary-2: #242424;
  --accent:      #141210;   /* preto (destaques/ativos) */
  --accent-2:    #2e2b27;   /* preto um tom mais claro (gradientes/hover) */
  --accent-soft: #EDEBE4;   /* cinza/creme claro (fundos/tints — caixa de submenu, hover) */
  --accent-ink:  #141210;   /* texto escuro sobre o tint claro */
  /* Cores do Google (estilo Google): papéis semânticos, uso com parcimônia */
  --g-blue:   #4285F4;
  --g-red:    #EA4335;
  --g-yellow: #FBBC05;
  --g-green:  #34A853;
  --green:     #34A853;   /* positivo/receita → verde Google */
  --red:       #EA4335;   /* negativo → vermelho Google */
  --blue:      #4285F4;   /* info → azul Google */
  --yellow:    #FBBC05;   /* atenção → amarelo Google */
  --cyan:      #0891B2;
  --pink:      #141210;   /* legado → mapeado pro preto */

  --bg:        #F5F5F1;
  --surface:   #FFFFFF;
  --surface-2: #ECECE6;
  --sidebar:   rgba(20,18,16,.20);   /* preto translúcido (~20%) sobre o creme */
  --sidebar-2: rgba(20,18,16,.13);

  --text:   #141210;
  --text-2: #57564E;
  --text-3: #908F86;
  --border: #E5E4DC;   /* linhas/divisórias da página: cinza neutro */
  --line:   #E5E4DC;   /* cinza neutro p/ campos de formulário (não parecer erro) */

  --radius: 14px;
  /* Elevação suave estilo Google Material (leve, sem "pesar") */
  --shadow: 0 1px 2px 0 rgba(60,64,67,.08), 0 1px 3px 1px rgba(60,64,67,.05);
  --font: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
[x-cloak] { display: none !important; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex-shrink: 0; background: #F7F6F2;
  color: var(--text); display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--border);
}
.brand {
  display: block; text-align: center;
  background: #fff; margin: -18px -12px 16px; padding: 8px 14px 22px;
  border-bottom: 1px solid var(--border);
}
.brand-logo {
  width: 100%; max-width: 168px; height: auto; display: block; margin: 0 auto;
}
.brand-name { font-weight: 800; font-size: 13px; line-height: 1; letter-spacing: .6px; color: var(--text); margin-top: 12px; }
.brand-sub  { font-size: 10px; color: var(--text-3); margin-top: 4px; letter-spacing: .3px; }

.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; flex: 1 1 auto; overflow-y: auto; min-height: 0; }
/* barra de rolagem discreta na navegação */
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px;
  color: var(--text-2); font-weight: 600; cursor: pointer; transition: all .15s; font-size: 13.5px;
}
.nav-item:hover { background: var(--accent-soft); color: var(--accent-ink); }
.nav-item.active { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.22); }
.nav-item.active:hover { background: var(--accent); color: #fff; }
.nav-icon { width: 24px; text-align: center; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; }
.nav-caret { margin-left: auto; font-size: 11px; color: var(--text-3); }
/* Submenu no estilo SIAGO: caixa de tom suave, itens viram pílulas internas */
.nav-sub { display: flex; flex-direction: column; gap: 2px; background: var(--accent-soft); border-radius: 10px; padding: 6px; margin: 3px 0 4px 8px; }
.nav-subitem { margin-left: 0; padding: 7px 10px; font-size: 13px; border-left: none; border-radius: 8px; }
.nav-subitem:hover { background: #E2E0D8; color: var(--accent-ink); }
.nav-subitem.active { background: var(--accent); color: #fff; box-shadow: none; }
.nav-subitem.active:hover { background: var(--accent); color: #fff; }
.nav-subitem .nav-icon { font-size: 14px; }

/* Rodapé recolhível (estilo SIAGO): avatar + 1º nome; expande no hover */
.sidebar-foot { margin-top: auto; padding: 8px 6px; font-size: 11px; color: var(--text-3); border-top: 1px solid var(--border); }
.foot-collapsed { display: flex; align-items: center; gap: 9px; padding: 6px 6px; cursor: pointer; border-radius: 10px; }
.foot-collapsed:hover { background: var(--accent-soft); }
.foot-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; font-size: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; text-transform: uppercase; }
.foot-firstname { font-size: 12px; font-weight: 600; color: var(--text-2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foot-caret { color: var(--text-3); font-size: 11px; }
.foot-expanded { padding: 6px; }
.foot-user { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.foot-name { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.1; }
.foot-mail { font-size: 11px; color: var(--text-3); }
.foot-role { margin-top: 4px; }
.brand-foot { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--border); font-size: 10px; color: var(--text-3); letter-spacing: .2px; }
.brand-foot-name { font-weight: 800; color: var(--text-2); letter-spacing: .5px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 22px; position: sticky; top: 0; z-index: 20;
}
.page-title { font-size: 20px; font-weight: 500; letter-spacing: -.2px; }
.page-sub { font-size: 12px; color: var(--text-3); }
.content { padding: 22px; }

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px){ .grid-4{grid-template-columns:repeat(2,1fr)} .grid-3{grid-template-columns:1fr} }
.card { background: var(--surface); border: 1px solid #EEECE6; border-radius: 16px; padding: 18px; box-shadow: var(--shadow); }
.card-title { font-size: 13.5px; font-weight: 500; color: var(--text-2); }

.kpi { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.kpi-label { font-size: 12.5px; color: var(--text-3); font-weight: 500; display:flex; align-items:center; gap:10px; }
.kpi-value { font-size: 28px; font-weight: 500; letter-spacing: -.5px; color: var(--text); }
.kpi-ico { width: 38px; height: 38px; border-radius: 10px; display:flex; align-items:center; justify-content:center; font-size:19px; flex-shrink:0; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 500; font-size: 13px; cursor: pointer; transition: all .15s; background: var(--surface-2); color: var(--text); }
.btn:hover { filter: brightness(.97); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: none; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text-2); }
.btn-danger { background: var(--red); color: #fff; }
.btn-icon { padding: 8px; }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Badges ---------- */
.badge { display:inline-flex; align-items:center; gap:5px; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ---------- Forms ---------- */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 12px; font-weight: 700; color: var(--text-2); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px;
  font-family: var(--font); background: var(--surface); color: var(--text); outline: none; transition: border-color .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-textarea { min-height: 80px; resize: vertical; }

/* ---------- Table ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-3); padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table td { padding: 12px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.table tr:hover td { background: var(--surface-2); }

/* ---------- Kanban ---------- */
/* Quadro estilo Trello */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.kanban-col { background: #EBECF0; border-radius: 12px; width: 274px; flex-shrink: 0; padding: 8px; }
.kanban-col.drop-on { background: #DCDFE6; outline: 2px dashed #b3b9c4; }
.kanban-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px 10px; }
.kanban-head .count { margin-left: auto; font-size: 11px; font-weight: 700; background: rgba(0,0,0,.07); color: #5e6c84; padding: 1px 8px; border-radius: 10px; }
.kanban-body { display: flex; flex-direction: column; gap: 8px; min-height: 8px; }
.kanban-card { background: #fff; border-radius: 8px; box-shadow: 0 1px 1px rgba(9,30,66,.25); padding: 8px 10px 9px; cursor: grab; transition: background .12s; }
.kanban-card:hover { background: #f7f8f9; }
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: .45; }
.tl-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.tl-label { height: 19px; min-width: 28px; border-radius: 999px; padding: 0 10px; display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; line-height: 1; color: #fff; }
/* rodapé do card: metadados discretos (estilo Trello), ícones cinza de linha */
.tl-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; color: #6b778c; font-size: 12px; font-weight: 600; }
.tl-meta .m { display: inline-flex; align-items: center; gap: 3px; }
.tl-meta .m i.ph { font-size: 14px; }
.tl-type { font-size: 11px; font-weight: 700; color: #5e6c84; background: #f1f2f4; padding: 1px 7px; border-radius: 4px; }
.tl-section { margin-bottom: 16px; }
/* chips de etiqueta no card-detalhe (selecionar) */
.lbl-pick { padding: 6px 13px; border-radius: 999px; font-size: 12px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; line-height: 1; opacity: .55; transition: opacity .12s, transform .1s; }
.lbl-pick:hover { transform: translateY(-1px); opacity: .85; }
.lbl-pick.on { opacity: 1; box-shadow: 0 1px 4px rgba(9,30,66,.25); }
/* dropdown de etiquetas (estilo Trello) */
.lbl-drop { position: absolute; z-index: 60; top: 100%; left: 0; margin-top: 6px; width: 280px; max-height: 360px; overflow: auto; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 28px rgba(9,30,66,.28); padding: 12px; }
.lbl-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 700; margin-bottom: 6px; line-height: 1; }
.lbl-row:hover { filter: brightness(.95); }
/* chat interno do card (estilo WhatsApp) */
.chat-area { background: #efeae2; border: 1px solid var(--border); border-radius: 10px; padding: 10px; max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.chat-msg { display: flex; gap: 6px; max-width: 82%; align-items: flex-end; }
.chat-msg.me { align-self: flex-end; flex-direction: row-reverse; }
.chat-av { width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 10px; overflow: hidden; background-size: cover; background-position: center; }
.chat-bubble { background: #fff; border-radius: 10px; padding: 6px 9px 4px; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.chat-msg.me .chat-bubble { background: #d9fdd3; }
.chat-nome { font-size: 11px; font-weight: 800; color: #0a7a5a; margin-bottom: 1px; }
.chat-txt { font-size: 13px; white-space: pre-wrap; word-break: break-word; line-height: 1.35; }
.chat-hora { font-size: 10px; color: #667781; text-align: right; margin-top: 1px; }
.chat-bar { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.chat-bar input { flex: 1; border: 1px solid var(--border); border-radius: 999px; padding: 9px 14px; font-size: 13px; outline: none; background: var(--surface); }
.chat-send { width: 38px; height: 38px; border-radius: 50%; border: none; background: var(--green); color: #fff; cursor: pointer; flex-shrink: 0; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; }
@keyframes cronpulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.tl-section-label { font-size: 12px; font-weight: 800; color: #5e6c84; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; }
.tl-check-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.tl-check-item.done span.txt { text-decoration: line-through; color: var(--text-3); }
.tl-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.tl-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; }
.tl-avatar { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 11px; margin-left: auto; overflow: hidden; background-size: cover; background-position: center; }
.tl-swatch { height: 30px; border-radius: 6px; cursor: pointer; border: 2px solid transparent; }
.tl-swatch.on { border-color: #172b4d; box-shadow: 0 0 0 2px #fff inset; }
.kanban-add { width: 100%; padding: 8px; border-radius: 8px; background: transparent; color: #5e6c84; font-weight: 600; cursor: pointer; font-size: 13px; text-align: left; border: none; }
.kanban-add:hover { background: rgba(0,0,0,.06); color: var(--text); }

/* ---------- Tabs / segments ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab { padding: 10px 14px; font-weight: 500; font-size: 13.5px; color: var(--text-3); cursor: pointer; border-bottom: 2px solid transparent; }
.tab.active { color: var(--text); border-bottom-color: var(--red); }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20,18,31,.45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 200; overflow-y: auto; } /* acima da ficha full (120) e do pagemode (150): diálogo sempre por cima */
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 560px; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
/* Detalhe em TELA CHEIA — abre como uma PÁGINA: cabeçalho fixo (igual topbar) +
   conteúdo num cartão centralizado sobre o fundo + barra de ações fixa no rodapé.
   --col = largura da coluna central; os cabeçalho/rodapé ficam largura-total mas
   com o conteúdo alinhado a essa coluna via padding calculado. */
.modal-backdrop.pagemode { --col: 880px; background: var(--bg); padding: 0; z-index: 150; display: block; } /* tela-página: acima da ficha full, abaixo dos diálogos */
.modal-backdrop.pagemode > .modal {
  max-width: none; width: 100%; min-height: 100vh; border-radius: 0; box-shadow: none;
  background: transparent; display: flex; flex-direction: column;
}
/* cabeçalho — barra fixa no topo, largura total, conteúdo na coluna central */
.modal-backdrop.pagemode .modal-head {
  position: sticky; top: 0; z-index: 3; background: var(--surface);
  border-bottom: 1px solid var(--border); box-shadow: 0 2px 10px rgba(20,18,31,.04);
  gap: 14px; justify-content: flex-start;
  padding: 15px max(22px, calc((100% - var(--col)) / 2));
}
.modal-backdrop.pagemode .modal-head .modal-title { font-size: 19px; }
/* corpo — cartão central sobre o fundo da página */
.modal-backdrop.pagemode .modal-body {
  width: 100%; max-width: var(--col); margin: 26px auto; flex: 1 0 auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 28px;
}
/* rodapé — barra de ações fixa, largura total, conteúdo na coluna central */
.modal-backdrop.pagemode .modal-foot {
  position: sticky; bottom: 0; z-index: 3; background: var(--surface);
  border-top: 1px solid var(--border); box-shadow: 0 -2px 10px rgba(20,18,31,.04);
  flex-wrap: wrap; padding: 13px max(22px, calc((100% - var(--col)) / 2));
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-title { font-weight: 800; font-size: 16px; }
.modal-body { padding: 20px; max-height: calc(100vh - 170px); overflow-y: auto; }
/* Miniatura de criativo — tamanho BLINDADO por classe (não depende de style inline nem de :style do Alpine) */
.criativo-thumb { position: relative; width: 76px !important; height: 76px !important; flex: 0 0 76px; border-radius: 8px; overflow: hidden; background: var(--surface-2); cursor: grab; }
.criativo-thumb img { width: 100% !important; height: 100% !important; object-fit: cover; display: block; }
.cri-alvo { outline: 2px dashed #16a34a; outline-offset: 2px; } /* alvo do arrastar-pra-reordenar */
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--border); }

/* ---------- Utils ---------- */
.flex { display: flex; } .items-center { align-items: center; } .items-start { align-items: flex-start; } .items-end { align-items: flex-end; } .justify-between { justify-content: space-between; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.mb-2{margin-bottom:8px}.mb-3{margin-bottom:14px}.mb-4{margin-bottom:20px}.mt-2{margin-top:8px}.mt-3{margin-top:14px}
.text-2{color:var(--text-2)}.text-3{color:var(--text-3)}.fw-700{font-weight:700}.fw-800{font-weight:800}
.text-green{color:var(--green)}.text-red{color:var(--red)}.text-primary{color:var(--primary)}
.fs-12{font-size:12px}.fs-13{font-size:13px}.fs-14{font-size:14px}.fs-18{font-size:18px}.fs-22{font-size:22px}
.fw-600{font-weight:600}
.truncate{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* Ícones Phosphor — alinhamento padrão ao lado de texto */
i.ph, i[class*=" ph-"], i[class^="ph-"]{vertical-align:-0.14em;line-height:1;font-style:normal}
/* Menu de ações "⋯" na linha de tabela (orçamento etc.) */
.row-menu{position:absolute;right:8px;top:calc(100% - 4px);z-index:60;background:var(--surface);border:1px solid var(--line);border-radius:11px;box-shadow:0 10px 30px rgba(0,0,0,.16);padding:5px;min-width:218px;text-align:left}
/* `label` junto de `button`: item de menu que abre seletor de arquivo (Carregar
   roteiro) — sem isso ele sai sem padding/hover, destoando dos vizinhos. */
.row-menu button,.row-menu label{display:flex;align-items:center;gap:10px;width:100%;text-align:left;background:none;border:none;padding:9px 11px;border-radius:8px;font-size:13px;font-weight:600;color:var(--text-2);cursor:pointer}
.row-menu button:hover,.row-menu label:hover{background:var(--accent-soft);color:var(--text)}
.row-menu button.danger{color:var(--red)}
.row-menu button.danger:hover{background:#fef2f2;color:var(--red)}
.row-menu-sep{height:1px;background:var(--line);margin:4px 2px}
.ic{font-size:1.05em}
.ic-lg{font-size:1.25em}
/* Ícones coloridos (Fluent 3D, PNG) renderizados inline — legado */
img.ic-img{height:1.55em;width:1.55em;object-fit:contain;vertical-align:-0.36em;display:inline-block}
/* Ícones de LINHA (Phosphor) — monocromáticos, herdam a cor do texto (padrão preto) */
i.ic-ph{font-size:1.25em;line-height:1;vertical-align:-0.18em;display:inline-flex}
.nav-icon i.ic-ph{font-size:18px}
.nav-subitem .nav-icon i.ic-ph{font-size:16px}
/* Impressão: isola só o layout da semana (Salvar como PDF) */
@media print {
  body * { visibility: hidden; }
  #layout-print, #layout-print * { visibility: visible; }
  #layout-print { position: absolute; left: 0; top: 0; width: 100%; max-height: none; overflow: visible; }
}
.empty { text-align: center; padding: 50px 20px; color: var(--text-3); }
.search { position: relative; flex: 1; max-width: 360px; }
.search input { width: 100%; padding: 9px 12px 9px 34px; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; background: var(--surface); outline: none; }
.search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.spacer { flex: 1; }
.progress { height: 7px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* ---------- Fichário (monitoramento) ---------- */
.fichario { display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; margin-bottom: -1px; padding-bottom: 2px; position: relative; z-index: 1; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.fichario::-webkit-scrollbar { height: 6px; }
.fichario::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.fichario::-webkit-scrollbar-track { background: transparent; }
.fichario-tab {
  flex: 0 0 auto; white-space: nowrap;
  padding: 9px 16px; border: 1px solid var(--border); border-bottom: none;
  border-radius: 10px 10px 0 0; background: var(--surface-2); color: var(--text-2);
  font-weight: 700; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 7px; transition: all .12s;
}
.fichario-tab:hover { color: var(--text); }
.fichario-tab.active { background: var(--surface); color: var(--text); border-top: 3px solid var(--accent); padding-top: 7px; }
.ficha { background: var(--surface); border: 1px solid var(--border); border-radius: 0 14px 14px 14px; padding: 22px; box-shadow: var(--shadow); }
.ficha-sec-title { font-size: 11px; font-weight: 800; letter-spacing: .5px; color: var(--text-3); text-transform: uppercase; margin: 18px 0 10px; }
.rede-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.rede-row .rede-nome { width: 130px; font-size: 13px; font-weight: 600; }
.rede-row .rede-pct { width: 46px; text-align: right; font-weight: 800; font-size: 13px; }
/* ───────── MOBILE: sidebar vira DRAWER (antes sumia sem navegação) ───────── */
.menu-btn{ display:none; }
.menu-overlay{ display:none; }
@media (max-width: 820px){
  /* sidebar off-canvas: desliza da esquerda; sem quebrar o desktop */
  .sidebar{
    position:fixed; top:0; left:0; height:100dvh; width:min(82vw,280px); z-index:60;
    transform:translateX(-100%); transition:transform .22s ease; box-shadow:0 0 40px rgba(0,0,0,.25);
    overflow-y:auto;
  }
  .sidebar.aberta{ transform:translateX(0); }
  .menu-overlay.aberta{ display:block; position:fixed; inset:0; background:rgba(0,0,0,.4); z-index:55; }
  /* hambúrguer na topbar */
  .menu-btn{
    display:inline-flex; align-items:center; justify-content:center; width:40px; height:40px;
    border:1px solid var(--border); border-radius:10px; background:var(--surface); cursor:pointer;
    font-size:20px; color:var(--text); flex-shrink:0;
  }
  .topbar{ padding:0 14px; gap:10px; }
  .content{ padding:16px 14px; }
  .page-title{ font-size:17px; }
  /* topbar rola horizontalmente se tiver muitos botões, sem estourar a tela */
  .topbar{ overflow-x:auto; height:auto; min-height:56px; }
  /* título nunca quebra em várias linhas apertadas */
  .topbar > div:first-of-type{ flex:1 1 auto; min-width:0; }
  .page-title{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .spacer{ flex:0 0 6px; }
  .search{ min-width:120px; flex-shrink:0; }
  /* grids colapsam para 1 coluna: 2/3/4 colunas ficam ilegíveis a 375px */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  /* tabelas: o card rola na horizontal em vez de a página estourar */
  .card{ min-width:0; overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .table{ min-width:520px; }
  .table th, .table td{ padding:9px 10px; font-size:12.5px; white-space:nowrap; }
  .modal-body{ overflow-x:auto; }
  .kanban{ scroll-snap-type:x proximity; }
  /* modais ocupam quase a tela e rolam por dentro */
  .modal-backdrop{ padding:16px 10px; align-items:flex-start; }
  .modal{ max-width:96vw; }
  .modal-body{ max-height:calc(100dvh - 200px); }
  .modal-foot{ padding:12px 14px; flex-wrap:wrap; }
  .modal-head{ padding:14px 16px; }
  /* botões da topbar não encolhem a ponto de sumir o texto */
  .btn{ flex-shrink:0; }
}
/* quebra global de segurança: nada gera scroll horizontal na página */
@media (max-width: 820px){
  html, body{ max-width:100%; overflow-x:hidden; }
}

/* Acordeão do modal de cliente (tópicos recolhíveis) */
.accH{cursor:pointer;display:flex;align-items:center;gap:8px;padding:11px 13px;background:var(--surface-2);border:1px solid var(--border);border-radius:9px;margin-top:8px;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.5px;color:var(--text-2)}
.accH:hover{border-color:var(--accent)}
.accX{margin-left:auto;font-size:13px;color:var(--text-3)}
.accB{gap:14px;padding:12px 2px 6px}

/* ── Cards de lançamento (Financeiro, estilo SIAGO · paleta SOM) ── */
.fin-card{background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:14px 16px;margin-bottom:11px;box-shadow:var(--shadow)}
.fin-card-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.fin-card-title{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:14px;color:var(--text-2)}
.fin-card-title b{color:var(--text);font-weight:800}
.fin-dot{width:9px;height:9px;border-radius:50%;flex:0 0 auto;display:inline-block}
.fin-card-sub{font-size:12px;color:var(--text-3);margin-top:4px}
.fin-card-right{text-align:right;flex:0 0 auto;white-space:nowrap}
.fin-valor{font-weight:800;font-size:15px}
.fin-badge{display:inline-block;font-size:11px;font-weight:700;padding:2px 10px;border-radius:20px;margin-top:5px;white-space:nowrap}
.fin-boleto-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:11px;padding:9px 12px;border-radius:10px;background:#fbf7ec;border:1px solid #ecdfb8}
.fin-boleto-bar > b{font-size:12px;color:var(--text-2)}
.fin-boleto-status{font-size:11px;font-weight:700;padding:2px 9px;border-radius:20px;background:#F9A825;color:#fff}
.fin-acoes{display:flex;gap:7px;flex-wrap:wrap;margin-top:11px}
.fin-boleto-bar button,.fin-acoes button{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:600;padding:5px 10px;border-radius:9px;border:1px solid var(--border);background:var(--surface);color:var(--text-2);cursor:pointer;transition:all .12s}
.fin-boleto-bar button{padding:3px 9px}
.fin-boleto-bar button:hover,.fin-acoes button:hover{background:var(--surface-2);color:var(--text)}
.fin-boleto-bar button.danger,.fin-acoes button.danger{color:#dc2626;border-color:#f0cfcf}
.fin-boleto-bar button.danger:hover,.fin-acoes button.danger:hover{background:#fef2f2}
.fin-acoes .fin-btn-receber{background:#FBBC05;color:#1a1a1a;border-color:#FBBC05;font-weight:600}
.fin-acoes .fin-btn-receber:hover{background:#F9AB00;color:#1a1a1a;border-color:#F9AB00}
.fin-acoes .fin-btn-cora{background:var(--text);color:#fff;border-color:var(--text)}
.fin-acoes .fin-btn-cora:hover{background:#000;color:#fff}

/* Barra de filtros do Financeiro */
.seg{display:inline-flex;background:var(--surface-2);border-radius:10px;padding:3px;gap:2px}
.seg button{border:0;background:transparent;color:var(--text-2);font-size:12.5px;font-weight:700;padding:6px 13px;border-radius:8px;cursor:pointer;white-space:nowrap;transition:all .12s}
.seg button:hover{color:var(--text)}
.seg button.on{background:var(--surface);color:var(--text);box-shadow:0 1px 2px rgba(0,0,0,.08)}
.fin-fsel{padding:7px 10px;font-size:12.5px;font-weight:600;width:auto;min-width:0;background-position:right 8px center}
.fin-search{display:flex;align-items:center;gap:7px;background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:0 11px;min-width:230px}
.fin-search i{color:var(--text-3)}
.fin-search input{border:0;outline:0;background:transparent;padding:8px 0;font-size:13px;color:var(--text);flex:1;min-width:0}
.fin-resumo{display:flex;gap:0;flex-wrap:wrap;align-items:stretch;background:var(--surface);border:1px solid var(--border);border-radius:12px;overflow:hidden;margin-bottom:14px;box-shadow:var(--shadow)}
.fin-resumo > div{flex:1;min-width:130px;padding:11px 15px;border-right:1px solid var(--border)}
.fin-resumo > div:last-child{border-right:0}
.fin-resumo .r-lab{font-size:10.5px;font-weight:700;letter-spacing:.4px;text-transform:uppercase;color:var(--text-3)}
.fin-resumo .r-val{font-size:19px;font-weight:800;margin-top:2px;line-height:1.15}

/* "?" de ajuda nos campos (tooltip no hover) */
.hq{display:inline-flex;align-items:center;justify-content:center;width:15px;height:15px;border-radius:50%;background:rgba(20,18,16,.05);color:rgba(20,18,16,.38);font-size:10px;font-weight:800;cursor:help;margin-left:5px;vertical-align:middle;line-height:1;user-select:none}
.hq:hover{background:rgba(20,18,16,.12);color:rgba(20,18,16,.72)}
.hq-tip{position:fixed;z-index:99999;background:#141210;color:#fff;padding:8px 11px;border-radius:8px;font-size:12px;font-weight:500;line-height:1.45;max-width:260px;box-shadow:0 8px 24px rgba(0,0,0,.22);pointer-events:none;text-align:left;white-space:normal;letter-spacing:normal;text-transform:none}
.lbl-row-plain:hover{background:var(--accent-soft)}
.kanban-col.col-dragging{opacity:.45}
.kanban-head[draggable=true]:active{cursor:grabbing}

/* Tráfego › Rotina: layout mesclado — checklist principal à esquerda, coluna lateral (tarefas + log) à direita */
.traf-rotina{display:grid;grid-template-columns:1.55fr 1fr;gap:14px;align-items:start}
.traf-rotina-lateral{display:grid;gap:14px}
@media (max-width:1100px){.traf-rotina{grid-template-columns:1fr}}

/* Radar do dashboard: pulso de sonar no chip quando há pendências */
@keyframes radar-pulse {
  0%   { box-shadow: var(--shadow), 0 0 0 0 rgba(52,168,83,.35); }
  70%  { box-shadow: var(--shadow), 0 0 0 10px rgba(52,168,83,0); }
  100% { box-shadow: var(--shadow), 0 0 0 0 rgba(52,168,83,0); }
}
.radar-pulse { animation: radar-pulse 2.2s ease-out infinite; }

/* Pulso vermelho — usado no card "O que ainda falta hoje" enquanto houver pendência. */
@keyframes pulse-red {
  0%   { box-shadow: var(--shadow), 0 0 0 0 rgba(220,38,38,.45); }
  70%  { box-shadow: var(--shadow), 0 0 0 9px rgba(220,38,38,0); }
  100% { box-shadow: var(--shadow), 0 0 0 0 rgba(220,38,38,0); }
}
.pulse-red { animation: pulse-red 1.8s ease-out infinite; border-color: #FCA5A5 !important; }

/* Pulso azul — usado no card "Dia de Google Meu Negócio" nas quartas-feiras. */
@keyframes pulse-blue {
  0%   { box-shadow: var(--shadow), 0 0 0 0 rgba(66,133,244,.45); }
  70%  { box-shadow: var(--shadow), 0 0 0 9px rgba(66,133,244,0); }
  100% { box-shadow: var(--shadow), 0 0 0 0 rgba(66,133,244,0); }
}
.pulse-blue { animation: pulse-blue 1.8s ease-out infinite; border-color: #A8C7FA !important; }

/* Masonry de 2 colunas (linha da Samara) — cards de alturas diferentes empacotam sem deixar vão entre as colunas. */
.masonry-2 { columns: 2; column-gap: 14px; margin-bottom: 14px; }
.masonry-2 > .card { break-inside: avoid; margin-bottom: 14px; }
@media (max-width: 760px) { .masonry-2 { columns: 1; } }

/* Spinner da IA (timer de carregamento) — ícone girando enquanto os dados não chegam. */
@keyframes ia-rot { to { transform: rotate(360deg); } }
.ia-spin { display: inline-block; animation: ia-rot .9s linear infinite; }
