/* Altic Serviços — tema claro e calmo (inspirado no Tabler e no painel da Hiper).
   O vermelho Altic fica só como destaque: botões principais, item ativo e alertas. */
:root {
  --red: #D42027; --red-dark: #B21A20; --red-soft: #FDEEEE;
  --ink: #1E293B; --ink-2: #475569; --gray: #6B7A90; --line: #E6E9EF; --line-2: #D5DBE5;
  --bg: #F4F6FA; --white: #fff; --surface-2: #F8FAFC;
  --green: #2F9E44; --green-soft: #E7F5EA; --amber: #C77C02; --amber-soft: #FFF5E0;
  --blue: #206BC4; --blue-soft: #E8F1FB; --purple: #6C47D8; --purple-soft: #F0EBFD; --orange: #E8590C; --orange-soft: #FFF0E6;
  --radius: 10px; --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(30, 41, 59, .04), 0 1px 3px rgba(30, 41, 59, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; }
.mono { letter-spacing: .06em; text-transform: uppercase; font-size: 11px; font-weight: 600; color: var(--gray); }
:focus-visible { outline: 2px solid rgba(32, 107, 196, .45); outline-offset: 2px; }

/* ------------------------------------------------ Estrutura: menu lateral + barra superior */
.layout { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.area { min-width: 0; display: flex; flex-direction: column; }
.side { background: var(--white); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); color: var(--ink); min-height: 60px; }
.side .brand:hover { text-decoration: none; }
.side .brand img { width: 74px; display: block; }
.side .brand span { font-size: 12px; color: var(--gray); line-height: 1.25; }
.side .brand span b { display: block; color: var(--ink); font-size: 13px; }
.side nav { padding: 10px 10px 16px; flex: 1; overflow-y: auto; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.nav-top { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 12px; margin: 1px 0; border: 0; border-radius: 8px; background: none;
  font: inherit; font-size: 14px; font-weight: 500; color: var(--ink-2); cursor: pointer; text-align: left; }
.nav-top .ic { color: #8794A8; }
.nav-top span { flex: 1; }
.nav-top:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav-top.ativo, .nav-grp.tem-ativo > .nav-top { color: var(--ink); font-weight: 600; }
.nav-top.ativo { background: var(--red-soft); color: var(--red-dark); }
.nav-top.ativo .ic, .nav-grp.tem-ativo > .nav-top .ic { color: var(--red); }
.nav-top .seta { width: 15px; height: 15px; transition: transform .18s; }
.nav-grp.aberto > .nav-top .seta { transform: rotate(180deg); }
.nav-sub { display: none; padding: 2px 0 6px 25px; }
.nav-grp.aberto > .nav-sub { display: block; }
.nav-sub a { display: block; position: relative; padding: 7px 12px 7px 16px; margin: 1px 0; border-radius: 6px; color: var(--ink-2); font-size: 13.5px; border-left: 1px solid var(--line); border-radius: 0 6px 6px 0; }
.nav-sub a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav-sub a.ativo { color: var(--red-dark); font-weight: 600; background: var(--red-soft); border-left: 2px solid var(--red); }
.side-versao { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 12px; color: var(--gray); }
.side-versao .ic { width: 15px; height: 15px; }
.side-versao:hover { color: var(--ink); text-decoration: none; }
.side-fundo { display: none; }

.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 28px; background: rgba(255,255,255,.92);
  backdrop-filter: saturate(1.4) blur(6px); border-bottom: 1px solid var(--line); }
.topbar-btn { display: none; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px; cursor: pointer; color: var(--ink-2); line-height: 0; }
.topbar-emp { font-size: 12px; font-weight: 600; letter-spacing: .05em; color: var(--ink-2); display: flex; align-items: center; gap: 10px; }
.tag.tb-tag { background: var(--surface-2); color: var(--gray); border: 1px solid var(--line); font-weight: 500; letter-spacing: 0; }
.topbar-dir { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar-dir .btn .ic { width: 16px; height: 16px; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover { background: var(--surface-2); }
.usermenu summary .seta { width: 14px; height: 14px; color: var(--gray); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); font-weight: 600; font-size: 13px; }
.un { display: flex; flex-direction: column; line-height: 1.2; }
.un b { font-size: 13px; font-weight: 600; } .un small { font-size: 11.5px; color: var(--gray); }
.usermenu-box { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(30,41,59,.12); padding: 6px; }
.usermenu-box a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 6px; color: var(--ink-2); font-size: 13.5px; }
.usermenu-box a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.usermenu-box .ic { width: 16px; height: 16px; color: var(--gray); }

.main { padding: 24px 28px 60px; min-width: 0; width: 100%; max-width: 1480px; }
.topo { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.topo h1 { font-size: 22px; letter-spacing: -.01em; }
.topo .mono { color: var(--gray); margin-bottom: 4px; }
td b { white-space: nowrap; }

/* ------------------------------------------------ Cards e grid */
.card { background: var(--white); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; }
.card > h2 { font-size: 15px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.secao { display: flex; align-items: center; gap: 12px; background: var(--surface-2); margin: -18px -20px 16px; border-radius: var(--radius) var(--radius) 0 0; border-bottom: 1px solid var(--line); }
.secao .n { background: var(--red-soft); color: var(--red); font-weight: 700; padding: 11px 15px; border-radius: var(--radius) 0 0 0; min-width: 44px; text-align: center; }
.secao h2 { font-size: 14px; font-weight: 600; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; } .full { grid-column: 1 / -1; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; position: relative; overflow: hidden; }
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #CBD5E1; }
.kpi.red::before { background: var(--red); } .kpi.green::before { background: var(--green); }
.kpi.blue::before { background: var(--blue); } .kpi.amber::before { background: var(--amber); }
.kpi .v { font-size: 26px; font-weight: 600; margin-top: 4px; letter-spacing: -.01em; }
.kpi .v.m { font-size: 20px; }
.kpi.red .v { color: var(--red); }
.kpi small { color: var(--gray); }

/* ------------------------------------------------ Painel inicial (dashboard) */
.kpis2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi2 { display: flex; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.kpi2:hover { text-decoration: none; border-color: var(--line-2); box-shadow: 0 4px 14px rgba(30,41,59,.08); }
.kpi2-ic { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.kpi2-ic .ic { width: 22px; height: 22px; }
.kpi2-txt { display: flex; flex-direction: column; min-width: 0; }
.kpi2-r { font-size: 12.5px; color: var(--gray); }
.kpi2-v { font-size: 24px; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; white-space: nowrap; }
.kpi2-s { font-size: 12px; color: var(--gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.azul .kpi2-ic, .pc-ic.azul { background: var(--blue-soft); color: var(--blue); }
.vermelho .kpi2-ic, .pc-ic.vermelho { background: var(--red-soft); color: var(--red); }
.kpi2.vermelho .kpi2-v { color: var(--red); }
.verde .kpi2-ic, .pc-ic.verde { background: var(--green-soft); color: var(--green); }
.roxo .kpi2-ic { background: var(--purple-soft); color: var(--purple); }
.laranja .kpi2-ic, .pc-ic.laranja { background: var(--orange-soft); color: var(--orange); }
.painel-grid { margin-bottom: 0; }
.painel-grid > .card { margin-bottom: 18px; }
.painel-card { display: flex; flex-direction: column; }
.pc-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.pc-h h2 { font-size: 15.5px; }
.pc-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.pc-tot { font-size: 22px; font-weight: 600; margin-top: 4px; }
.pc-tot small { font-size: 12.5px; font-weight: 400; color: var(--gray); }
.pc-sub { font-size: 12px; font-weight: 600; color: var(--gray); margin: 14px 0 4px; }
.pc-acoes { display: flex; gap: 8px; justify-content: flex-end; margin-top: auto; padding-top: 14px; }
.pc-rodape { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; font-size: 13px; }
.conta-linha { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 8px; margin-bottom: 8px; color: var(--ink); }
.conta-linha:hover { text-decoration: none; filter: brightness(.98); }
.conta-linha small { display: block; font-size: 11.5px; color: var(--gray); }
.conta-linha b { font-size: 15px; font-weight: 600; white-space: nowrap; }
.conta-linha.azul { background: var(--blue-soft); } .conta-linha.azul b { color: var(--blue); }
.conta-linha.vermelho { background: var(--red-soft); } .conta-linha.vermelho b { color: var(--red); }
.conta-linha.cinza { background: var(--surface-2); border: 1px solid var(--line); }
.prox-lista { list-style: none; margin: 0; padding: 0; }
.prox-lista li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.prox-lista li:last-child { border-bottom: 0; }
.prox-lista li > span { display: flex; flex-direction: column; min-width: 0; }
.prox-lista li > span b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prox-lista li > span.num { align-items: flex-end; text-align: right; white-space: nowrap; }
.prox-lista small { color: var(--gray); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prox-lista li.venc .num small { color: var(--red); }
.prox-lista li.click { cursor: pointer; border-radius: 6px; }
.prox-lista li.click:hover { background: var(--surface-2); }
.vazio-mini { color: var(--gray); justify-content: center !important; padding: 18px 0 !important; }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 3px; gap: 2px; }
.seg button { font: inherit; font-size: 13px; border: 0; background: none; color: var(--ink-2); padding: 6px 12px; border-radius: 6px; cursor: pointer; }
.seg button:hover { background: var(--surface-2); }
.seg button.ativo { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.grafico { position: relative; }
.grafico svg { width: 100%; height: auto; display: block; overflow: visible; }
.g-grade { stroke: var(--line); stroke-width: 1; }
.g-txt { fill: #8A97AA; font-size: 11px; font-family: var(--font); }
.g-bar { transition: opacity .15s; }
.g-bar:hover { opacity: .75; }
.s1 { fill: var(--blue); background: var(--blue); }
.s2 { fill: #8FB8E8; background: #8FB8E8; }
.s3 { fill: var(--green); background: var(--green); }
.g-vazio { position: absolute; inset: 0 0 24px 60px; display: grid; place-items: center; color: var(--gray); font-size: 13px; pointer-events: none; }
.g-leg { display: flex; gap: 16px; justify-content: center; font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.g-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.stats > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.stats span { display: block; font-size: 12px; color: var(--gray); }
.stats b { font-size: 17px; font-weight: 600; white-space: nowrap; }
.prio-barra { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.prio-barra a { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-radius: 8px; font-size: 13px; color: var(--ink-2); }
.prio-barra a:hover { text-decoration: none; filter: brightness(.97); }
.prio-barra b { font-size: 16px; }
.pb-alta { background: var(--red-soft); } .pb-alta b { color: var(--red); }
.pb-media { background: var(--amber-soft); } .pb-media b { color: var(--amber); }
.pb-baixa { background: var(--blue-soft); } .pb-baixa b { color: var(--blue); }

/* ------------------------------------------------ Formulários */
label { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 5px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 8px 10px; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: #90B5E2; box-shadow: 0 0 0 3px rgba(32, 107, 196, .14); }
input[disabled], select[disabled], textarea[disabled] { background: var(--surface-2); color: #5B6576; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--red); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink); font-weight: 400; margin: 0 14px 6px 0; cursor: pointer; }
.with-add { display: flex; gap: 6px; }
.with-add select { flex: 1; }
.hint { font-size: 12px; color: var(--gray); margin-top: 4px; }
.filtros { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filtros > div { min-width: 150px; }
.filtros .grow { flex: 1; min-width: 200px; }
.acoes { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 16px; }

.prio-opcoes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.prio-opcoes label { cursor: pointer; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 12px; color: var(--ink); font-size: 14px; font-weight: 400; margin: 0; }
.prio-opcoes input { display: none; }
.prio-opcoes label:has(input:checked) { border-color: var(--red); background: var(--red-soft); }
.prio-opcoes b { display: block; font-size: 15px; margin-bottom: 2px; }
.prio-opcoes small { color: var(--gray); }
.prevista { background: var(--blue-soft); color: var(--ink); border: 1px solid #CFE0F5; border-radius: var(--radius); padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.prevista b { font-size: 18px; color: var(--blue); }

/* ------------------------------------------------ Botões */
.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 500; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 8px 14px; cursor: pointer; background: var(--red); color: #fff; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--red-dark); text-decoration: none; }
.btn.sec { background: #fff; color: var(--ink); border-color: var(--line-2); }
.btn.sec:hover { background: var(--surface-2); border-color: #C3CBD8; }
.btn.dark { background: var(--ink); }
.btn.dark:hover { background: #0F172A; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.icon { padding: 8px 11px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn .ic { width: 16px; height: 16px; }

/* ------------------------------------------------ Tabelas */
.tabela-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--surface-2); color: var(--gray); text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 10px 12px; white-space: nowrap; border-bottom: 1px solid var(--line); }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: #F5F8FC; }
tr.atraso td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.vazio { text-align: center; color: var(--gray); padding: 30px; }

/* ------------------------------------------------ Etiquetas (tons suaves) */
.tag { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.p-alta { background: var(--red-soft); color: #B4232A; }
.p-media { background: var(--amber-soft); color: #8A5A00; }
.p-baixa { background: var(--blue-soft); color: #1F5AA6; }
.s-aberto { background: #EEF1F5; color: var(--ink-2); }
.s-em_atendimento { background: var(--blue-soft); color: #1F5AA6; }
.s-aguardando { background: var(--amber-soft); color: #8A5A00; }
.s-concluido { background: var(--green-soft); color: #23763A; }
.s-cancelado { background: #E5E7EB; color: #4B5563; }
.atrasado { color: var(--red); font-weight: 600; }
.sit-ativo { background: var(--green-soft); color: #23763A; }
.sit-prospect { background: var(--amber-soft); color: #8A5A00; }
.ps-rascunho { background: #EEF1F5; color: var(--ink-2); }
.ps-enviada { background: var(--blue-soft); color: #1F5AA6; }
.ps-aprovada { background: var(--green-soft); color: #23763A; }
.ps-recusada { background: var(--red-soft); color: #B4232A; }
.ps-cancelada { background: #E5E7EB; color: #4B5563; }
tr.inativo td { opacity: .55; }

/* ------------------------------------------------ Abas */
.abas { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.abas button { font: inherit; font-weight: 500; border: 1px solid var(--line); border-bottom: 0; background: var(--surface-2); color: var(--ink-2); padding: 10px 18px; border-radius: var(--radius) var(--radius) 0 0; cursor: pointer; }
.abas button.ativo { background: #fff; color: var(--red-dark); box-shadow: inset 0 2px 0 var(--red); }
.abas button span { background: #E2E8F0; color: var(--ink-2); border-radius: 999px; font-size: 11px; padding: 1px 7px; margin-left: 6px; }
.abas a { padding: 7px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); font-size: 13px; }
.abas a:hover { text-decoration: none; border-color: var(--line-2); color: var(--ink); }
.abas a.ativo { background: var(--blue-soft); color: var(--blue); border-color: #CFE0F5; font-weight: 600; }
.abas a .n { display: inline-block; min-width: 20px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: #EEF1F5; color: var(--ink-2); font-size: 11px; font-weight: 600; text-align: center; }
.abas a.ativo .n { background: var(--blue); color: #fff; }

/* ------------------------------------------------ Propostas */
.tipo-opcoes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tipo-opcoes label { cursor: pointer; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px; color: var(--ink); font-size: 14px; font-weight: 400; margin: 0; }
.tipo-opcoes input { display: none; }
.tipo-opcoes label:has(input:checked) { border-color: var(--red); background: var(--red-soft); }
.tipo-opcoes label:has(input:disabled) { cursor: default; }
.tipo-opcoes b { display: block; font-size: 15px; margin-bottom: 3px; }
.tipo-opcoes small { color: var(--gray); }
.itens-prop td { vertical-align: top; }
.itens-prop td:first-child { min-width: 280px; }
.itens-prop td:nth-child(n+3) { white-space: nowrap; }
.itens-prop textarea { min-height: 44px; margin-top: 6px; font-size: 13px; }
.itens-prop input { padding: 6px 8px; }
tr.linha-erro td { background: var(--red-soft) !important; }
input.invalido { border-color: var(--red); background: var(--red-soft); }
.totais { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; margin-top: 14px; }
.totais > div { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px; min-width: 170px; }
.totais .mono { color: var(--gray); display: block; font-size: 10.5px; margin-bottom: 4px; }
.totais b { font-size: 18px; font-weight: 600; }
.calc { padding: 8px 0; font-weight: 600; }
.atrasado-tag { background: var(--red-soft); color: var(--red); border: 1px solid #F5C2C4; }

/* ------------------------------------------------ Detalhe */
.info { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; background: #fff; box-shadow: var(--shadow); }
.info > div { padding: 12px 16px; border-right: 1px solid var(--line); }
.info > div:last-child { border-right: 0; }
.info .mono { font-size: 10.5px; margin-bottom: 4px; }
.info b { font-size: 14px; font-weight: 600; }
.hero { background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; padding: 20px 24px; display: flex; justify-content: space-between; gap: 16px; align-items: center; flex-wrap: wrap; box-shadow: inset 4px 0 0 var(--red); }
.hero .mono { color: var(--red); }
.hero h1 { font-size: 24px; margin-top: 4px; }
.hero + .info { border-radius: 0 0 var(--radius) var(--radius); border-top: 0; }
.texto { white-space: pre-wrap; line-height: 1.6; }
.linha-tempo { list-style: none; margin: 0; padding: 0; }
.linha-tempo li { border-left: 2px solid var(--line); padding: 0 0 14px 16px; position: relative; }
.linha-tempo li::before { content: ''; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--blue); }
.linha-tempo .meta { font-size: 12px; color: var(--gray); margin-bottom: 4px; }
.diff { font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; margin-top: 4px; }
.diff div { margin: 2px 0; }
.diff del { color: #A33; } .diff ins { color: #23763A; text-decoration: none; }
.itens-tab td { padding: 6px; }
.itens-tab input { padding: 6px 8px; }

/* ------------------------------------------------ Modal e avisos */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .42); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 50; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 680px; box-shadow: 0 20px 50px rgba(15,23,42,.22); }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal header h3 { font-size: 16px; }
.modal header button { border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--gray); border-radius: 6px; line-height: 1; padding: 2px 8px; }
.modal header button:hover { background: var(--surface-2); }
.modal .corpo { padding: 18px 20px; }
.modal footer { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); border-radius: 0 0 12px 12px; }
#toast { position: fixed; bottom: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
#toast div { background: #fff; color: var(--ink); padding: 12px 16px; border-radius: 8px; border: 1px solid var(--line); border-left: 4px solid var(--green); box-shadow: 0 8px 24px rgba(15,23,42,.14); max-width: 380px; }
#toast div.erro { border-left-color: var(--red); }

/* ------------------------------------------------ Login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--bg); }
.login .arte { background: linear-gradient(150deg, #263347 0%, #1E293B 60%, #2B1D24 100%); display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px; color: #B8C2D1; text-align: center; }
.login .arte img { width: 230px; max-width: 70%; }
.login .arte p { margin-top: 24px; letter-spacing: .08em; font-size: 13px; }
.login form { align-self: center; justify-self: center; width: 100%; max-width: 380px; padding: 34px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(30,41,59,.08); }
.login h1 { font-size: 22px; margin: 6px 0 22px; }
.login .campo { margin-bottom: 14px; }
.login .btn { width: 100%; justify-content: center; padding: 11px; margin-top: 6px; }
.msg-erro { color: var(--red); margin-top: 10px; min-height: 18px; }

.barra { display: flex; gap: 10px; align-items: center; }
.barra-prog { flex: 1; height: 8px; background: #EEF1F5; border-radius: 4px; overflow: hidden; }
.barra-prog span { display: block; height: 100%; background: var(--blue); }

/* ------------------------------------------------ Telefones com WhatsApp */
.fone { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
a.wa { display: inline-flex; align-items: center; line-height: 0; }
a.wa:hover { transform: scale(1.15); }
.fone-campo { display: flex; gap: 8px; align-items: center; }
.fone-campo input[type=text], .fone-campo input:not([type]) { flex: 1; min-width: 0; }
.wa-check { margin: 0; white-space: nowrap; font-size: 12px; }
.btn.wa-btn { background: #25D366; border-color: #25D366; color: #fff; gap: 6px; }
.btn.wa-btn:hover { background: #1EBE5A; }
.btn.wa-btn svg path:first-child { fill: #fff; } .btn.wa-btn svg path:last-child { fill: #25D366; }
a.cli-nome { color: var(--ink); font-weight: 600; cursor: pointer; border-bottom: 1px dashed #B8C2D1; }
a.cli-nome:hover { color: var(--blue); text-decoration: none; border-bottom-color: var(--blue); }
.achou:not(:empty) { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; }
.tag.achou-tag { background: var(--amber-soft); color: #8A5A00; }
.sol-lista { display: grid; gap: 10px; }
.sol-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.sol-item.cliente { background: var(--surface-2); }

/* ------------------------------------------------ Contratos, aditivos e financeiro */
.tag.k-aguardando_assinatura { background: var(--amber-soft); color: #8A5A00; }
.tag.k-assinado { background: var(--green-soft); color: #23763A; }
.tag.k-cancelado { background: #EEF1F5; color: #5B6576; }
.tag.k-finalizado { background: var(--blue-soft); color: var(--blue); }
.tag.k-gerar { background: var(--red-soft); color: var(--red); }
.tag.nfse { background: var(--purple-soft); color: var(--purple); }
.anexo-box { border: 2px dashed var(--line-2); border-radius: var(--radius); padding: 16px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.anexo-box.ok { border-style: solid; border-color: #BFE3CC; background: #F3FAF5; }
.tag.l-aberto { background: var(--amber-soft); color: #8A5A00; }
.tag.l-pago { background: var(--green-soft); color: #23763A; }
.tag.l-cancelado { background: #EEF1F5; color: #5B6576; }
.tag.ad-vigente { background: var(--green-soft); color: #23763A; }
.tag.ad-cancelado { background: #EEF1F5; color: #5B6576; text-decoration: line-through; }
.tag.origem { background: #EEF2F7; color: #44536A; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.cancelado td { color: #98A2B3; }
tr.vencido td:first-child { box-shadow: inset 3px 0 0 var(--red); }
tfoot td { font-weight: 600; border-top: 2px solid var(--line); background: var(--surface-2); }
.pos { color: var(--green); } .neg { color: var(--red); }
.barra-fluxo { display: flex; gap: 2px; align-items: flex-end; height: 34px; min-width: 60px; }
.barra-fluxo span { width: 10px; border-radius: 2px 2px 0 0; }
.barra-fluxo .r { background: var(--green); } .barra-fluxo .p { background: #E57373; }
.rastreio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.rastreio > div { padding: 14px 16px; border-right: 1px solid var(--line); }
.rastreio > div:last-child { border-right: 0; }
.rastreio b.v { display: block; font-size: 20px; margin: 4px 0; font-weight: 600; }

/* ------------------------------------------------ Novidades */
.novidade { border-left: 3px solid var(--blue); padding: 4px 0 4px 16px; margin-bottom: 22px; }
.novidade h3 { font-size: 16px; }
.novidade ul { margin: 8px 0 0; padding-left: 18px; line-height: 1.6; }

/* ------------------------------------------------ Documentação técnica */
.doc-cab-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.doc-cab-h h2 { font-size: 15px; }
.doc-cab-g { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.doc-cab-g > div, .doc-cab-x { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-width: 0; }
.doc-cab-g span, .doc-cab-x > span { display: block; font-size: 12px; color: var(--gray); }
.doc-cab-g b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-cab-g small { color: var(--gray); font-size: 12px; }
.doc-cab-x { margin-top: 10px; }
.doc-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
.doc-nav { position: sticky; top: 76px; padding: 10px; max-height: calc(100vh - 96px); overflow-y: auto; }
.doc-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); font-size: 13.5px; }
.doc-nav a span { flex: 1; }
.doc-nav a em { font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--gray); background: var(--surface-2); border-radius: 999px; padding: 0 7px; }
.doc-nav a em:empty { display: none; }
.doc-nav a .ic { color: #8794A8; }
.doc-nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.doc-nav a.ativo { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.doc-nav a.ativo .ic { color: var(--blue); }
.doc-nav a.ativo em { background: #fff; color: var(--blue); }
.doc-busca { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 10px; margin-bottom: 8px; color: var(--gray); }
.doc-busca input { border: 0; padding: 8px 0; box-shadow: none !important; background: transparent; }
.doc-sec-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.doc-sec-h h2 { font-size: 15.5px; display: flex; align-items: center; gap: 8px; }
.doc-sec-h h2 .ic { color: var(--blue); }
.doc-tab { font-size: 13px; }
.doc-tab th { white-space: nowrap; }
.doc-tab td { padding: 8px 10px; }
.doc-tab code { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.doc-tab td.doc-longo { white-space: pre-wrap; min-width: 180px; }
.doc-obs { white-space: pre-wrap; max-width: 320px; }
tr.doc-grupo td { background: var(--surface-2); font-weight: 600; color: var(--ink-2); font-size: 13px; padding: 7px 10px; }
tr.doc-grupo td span { font-weight: 500; color: var(--gray); margin-left: 6px; }
.doc-acoes { white-space: nowrap; text-align: right; width: 1%; }
.doc-ib { border: 0; background: none; padding: 4px; border-radius: 6px; color: var(--gray); cursor: pointer; line-height: 0; vertical-align: middle; }
.doc-ib:hover { background: var(--surface-2); color: var(--ink); }
.doc-ib.perigo:hover { background: var(--red-soft); color: var(--red); }
.doc-ib .ic { width: 16px; height: 16px; }
.doc-senha { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.doc-senha code { letter-spacing: .08em; color: var(--ink-2); }
.doc-senha.aberta code { background: var(--amber-soft); color: #6B4500; border-radius: 4px; padding: 1px 5px; letter-spacing: 0; user-select: all; }
.doc-pw { display: flex; gap: 6px; }
.doc-pw .btn .ic { width: 16px; height: 16px; }
.cx-txt { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.cx-tab select { min-width: 140px; padding: 5px 6px; font-size: 12.5px; text-transform: none; letter-spacing: 0; }
.cx-tab th { text-transform: none; letter-spacing: 0; vertical-align: top; }
.doc-subgrupo td { background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; font-weight: 600; padding: 5px 12px 5px 26px; }
.doc-subgrupo td span { color: var(--gray); font-weight: 400; margin-left: 4px; }
.doc-ciclo { font-size: 12.5px; line-height: 1.55; white-space: nowrap; }
.doc-tag { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 9px; margin-left: 2px; }
.doc-tag.vencida, .doc-tag.corretiva { background: var(--red-soft); color: var(--red); }
.doc-tag.vence { background: var(--amber-soft); color: var(--amber); }
.doc-tag.preventiva { background: var(--green-soft); color: var(--green); }
[data-quando][hidden] { display: none !important; }
.doc-alterna { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; }
.doc-alterna button { border: 0; background: var(--white); color: var(--ink-2); padding: 5px 10px; font: inherit; font-size: 12.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.doc-alterna button + button { border-left: 1px solid var(--line-2); }
.doc-alterna button.ativo { background: var(--blue-soft); color: var(--blue); }
.doc-alterna .ic { width: 14px; height: 14px; }
.doc-disp { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-top: 12px; }
.doc-disp-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.doc-disp-h h3 { margin: 0 0 2px; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.doc-disp-h h3 .ic { width: 18px; height: 18px; color: var(--gray); }
.doc-portas { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.doc-porta { display: flex; flex-direction: column; justify-content: space-between; gap: 4px; height: 56px; padding: 5px 8px; text-align: left; font: inherit;
  border: 1px dashed var(--line-2); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--gray); cursor: pointer; min-width: 0; }
.doc-porta:hover { border-color: var(--blue); }
.doc-porta:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.doc-porta.ocupada { border-style: solid; }
.doc-porta.ocupada.cobre { background: var(--green-soft); border-color: #9ED3AA; color: #1F6B30; }
.doc-porta.ocupada.fibra { background: var(--purple-soft); border-color: #C3B3F2; color: #4B2FA6; }
.doc-porta.fibra:not(.ocupada) { border-color: #C3B3F2; }
.doc-porta-h { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.doc-porta-h .ic { width: 14px; height: 14px; }
.doc-porta-n { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) { .doc-portas { grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); } .doc-porta { height: 52px; padding: 4px 6px; } }
.doc-soltas { margin-top: 10px; font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.doc-solta { border: 1px solid var(--line-2); background: var(--white); border-radius: 12px; padding: 2px 9px; font: inherit; font-size: 12px; cursor: pointer; }
.ix-bloco { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; background: var(--white); }
.ix-bloco.off { background: var(--surface-2); }
.ix-bloco.off .ix-l1 b { color: var(--gray); }
.ix-l1 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ix-l1 .check { margin: 0; min-width: 220px; }
.ix-l1 select { width: auto; min-width: 230px; padding: 6px 8px; }
.ix-seta { color: var(--gray); }
.ix-qtd { color: var(--ink-2); font-size: 13px; }
.ix-aviso { color: var(--amber); }
p.ix-aviso { background: var(--amber-soft); padding: 8px 12px; border-radius: var(--radius-sm); }
.ix-bloco details { margin-top: 6px; }
.ix-bloco summary { cursor: pointer; color: var(--blue); font-size: 13px; }
.ix-bloco details .tabela-wrap { margin-top: 8px; }
.ix-info { margin-bottom: 10px; }
.ix-total { font-size: 14px; margin-bottom: 0; }
.so-impressao { display: none; }
@media print {
  body { background: #fff; }
  .side, .side-fundo, .topbar, .topo, .doc-cab, .doc-layout, #toast, #modal-root { display: none !important; }
  .layout { display: block; } .main { padding: 0; max-width: none; }
  .so-impressao { display: block !important; font-size: 11px; }
  .so-impressao h1 { font-size: 18px; margin-bottom: 4px; }
  .so-impressao h2 { font-size: 13px; margin: 16px 0 6px; break-after: avoid; }
  .so-impressao .tabela-wrap { overflow: visible; }
  .so-impressao table { font-size: 10.5px; } .so-impressao tr { break-inside: avoid; }
  .so-impressao th { background: #EEF1F5 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ------------------------------------------------ Celular e tablet */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-cab-g { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-layout { grid-template-columns: minmax(0, 1fr); }
  .doc-nav { position: static; max-height: none; display: flex; flex-wrap: wrap; gap: 4px; }
  .doc-nav .doc-busca { flex: 1 1 100%; }
  .doc-nav a { flex: 0 0 auto; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; width: 270px; max-width: 85vw; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(15,23,42,.18); }
  .side.aberto { transform: none; }
  .side.aberto + .side-fundo { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.35); z-index: 35; }
  .topbar { padding: 0 14px; }
  .topbar-btn { display: inline-flex; }
  .topbar-emp, .un { display: none; }
  .main { padding: 16px; }
  .g2, .g3, .g4, .info { grid-template-columns: minmax(0, 1fr); }
  .span2, .span3 { grid-column: auto; }
  .info > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .prio-opcoes, .tipo-opcoes { grid-template-columns: 1fr; }
  .rastreio { grid-template-columns: 1fr; } .rastreio > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .login { grid-template-columns: 1fr; }
  .login .arte { padding: 30px; }
  .login .arte img { width: 150px; }
  .login form { margin: 20px 16px; width: auto; }
}
@media (max-width: 520px) {
  .kpis2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .topbar-dir .btn { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* v1.10 — chamados de cada equipamento na documentação */
.doc-chs { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; min-width: 130px; }
.doc-chs-b { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 0; color: var(--blue); font: inherit; font-weight: 600; cursor: pointer; }
.doc-chs-b:hover, .doc-chs-n:hover { text-decoration: underline; }
.doc-chs-b svg, .doc-chs-n svg { width: 14px; height: 14px; }
.doc-chs-n { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; white-space: nowrap; }
@media print { .doc-chs-n { display: none; } }
