/* Tema "portal de serviço": cabeçalho de marca, menu horizontal, painéis de chamados e indicadores.
   A cor principal vem da marca do cliente (--brand). Tudo aqui sobrepõe app.css. */
:root {
  --brand-dark: color-mix(in srgb, var(--brand) 78%, #000);
  --brand-soft: color-mix(in srgb, var(--brand) 10%, #fff);
  --ink: #17233a; --muted: #62708a; --line: #e1e7f0; --bg: #f3f6fb;
  --sla-ok: #1f9d55; --sla-warn: #e08a00; --sla-bad: #d6382c; --sla-none: #8b97ab;
  --radius: 14px; --shadow: 0 1px 2px rgba(16,32,64,.05), 0 6px 18px rgba(16,32,64,.05);
}
body { background: var(--bg); color: var(--ink); }

/* ---------- cabeçalho e menu ---------- */
.topbar { background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%); padding: 18px 28px; gap: 22px; align-items: center; flex-wrap: nowrap; }
.brandbar { display: flex; align-items: center; gap: 18px; min-width: 0; flex: 1 1 auto; }
.brandbar img { max-height: 44px; max-width: 190px; }
.brandbar .sep { width: 1px; align-self: stretch; background: rgba(255,255,255,.28); }
.brandtext { display: flex; flex-direction: column; min-width: 0; }
.brandtext .kicker { font-size: .66rem; letter-spacing: .09em; text-transform: uppercase; opacity: .85; font-weight: 600; }
.brandtext .ptitle { font-size: 1.55rem; font-weight: 800; line-height: 1.15; }
.brandtext .psub { font-size: .76rem; opacity: .9; }
.topbar .actions { display: flex; gap: 10px; align-items: center; flex: 0 0 auto; }
.topbar .pill { background: rgba(0,0,0,.28); color: #fff; border: 0; border-radius: 999px; padding: .55rem 1.2rem; font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.topbar .pill:hover, .topbar .pill:focus-visible { background: rgba(0,0,0,.42); }
.topbar select { background: rgba(0,0,0,.22); max-width: 260px; }
.mainnav { background: #fff; border-bottom: 1px solid var(--line); padding: 10px 28px; display: flex; gap: 6px; align-items: center; overflow-x: auto; }
.mainnav a { display: inline-flex; align-items: center; gap: 8px; padding: .55rem .95rem; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .88rem; white-space: nowrap; }
.mainnav a:hover { background: var(--brand-soft); }
.mainnav a.active { background: var(--brand); color: #fff; box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 35%, transparent); }
.mainnav svg, .btn svg { width: 17px; height: 17px; flex: 0 0 auto; }
.subnav { background: var(--brand-soft); border-bottom: 1px solid var(--line); padding: 8px 28px; display: flex; gap: 4px; flex-wrap: wrap; }
.subnav a { padding: .35rem .8rem; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: .84rem; font-weight: 600; }
.subnav a:hover { background: #fff; } .subnav a.active { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(16,32,64,.12); }
.layout { display: block; min-height: 0; }
.content { max-width: 1560px; margin: 0 auto; padding: 22px 28px 48px; }
.menu-toggle { display: none; }

/* ---------- cartões e botões ---------- */
.card { border-radius: var(--radius); box-shadow: var(--shadow); border-color: var(--line); }
.btn.primary { background: var(--brand); } .btn.ghost { border-color: #c9d3e3; }
.btn.outline { background: #fff; color: var(--brand); border: 1px solid color-mix(in srgb, var(--brand) 40%, #fff); display: inline-flex; gap: 6px; align-items: center; }
.eyebrow { color: var(--brand); font-size: .68rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.pagehead { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 18px 22px; }
.pagehead h1 { font-size: 1.8rem; margin: .15rem 0 .2rem; } .pagehead p { margin: 0; color: var(--muted); font-size: .85rem; }

/* ---------- indicadores ---------- */
.kpis2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 16px 0; }
.kpi2 { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; gap: 14px; align-items: center; background: #fff; text-align: left; font: inherit; color: inherit; cursor: default; }
button.kpi2 { cursor: pointer; } button.kpi2:hover, button.kpi2.on { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 20%, transparent); }
.kpi2 .ico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: 2px solid currentColor; flex: 0 0 auto; }
.kpi2 .ico svg { width: 18px; height: 18px; }
.kpi2 .l { color: var(--muted); font-size: .8rem; } .kpi2 .n { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.tone-blue { background: linear-gradient(135deg, #f1f6ff, #e6efff); color: #1d5fd1; } .tone-amber { background: linear-gradient(135deg, #fffaf0, #fff0d3); color: #d98200; }
.tone-red { background: linear-gradient(135deg, #fff6f5, #ffe3e0); color: #d6382c; } .tone-purple { background: linear-gradient(135deg, #f8f4ff, #ece2ff); color: #7a3fd0; }
.tone-green { background: linear-gradient(135deg, #f1fbf5, #dcf5e6); color: #1f9d55; } .tone-cyan { background: linear-gradient(135deg, #effcfd, #d6f4f8); color: #0f8fa3; }
.kpi2 .l, .kpi2 .n { color: var(--ink); } .kpi2 .l { color: var(--muted); }

/* ---------- abas de status (pílulas) ---------- */
.pills { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; }
.pillbtn { display: inline-flex; gap: 8px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .42rem .9rem; font: inherit; font-weight: 700; font-size: .78rem; cursor: pointer; white-space: nowrap; color: var(--ink); }
.pillbtn b { background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: .05rem .5rem; font-size: .72rem; }
.pillbtn:hover { border-color: var(--brand); } .pillbtn.on { background: var(--brand); color: #fff; border-color: var(--brand); } .pillbtn.on b { background: rgba(255,255,255,.25); color: #fff; }
.filterbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; padding: 14px; margin-bottom: 16px; align-items: center; }
.filterbar input, .filterbar select { font-size: .85rem; }

/* ---------- fila e atendimento (dois painéis) ---------- */
.split { display: grid; grid-template-columns: minmax(330px, 400px) minmax(0, 1fr); gap: 16px; align-items: start; }
.queue { padding: 14px; position: sticky; top: 8px; max-height: calc(100vh - 24px); display: flex; flex-direction: column; }
.queue-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; } .queue-head h3 { margin: 0; }
.queue-list { overflow-y: auto; padding-right: 4px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.tcard { border: 1px solid var(--line); border-left: 4px solid var(--sla-none); border-radius: 12px; padding: 10px 12px; background: #fff; cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%; }
.tcard:hover { box-shadow: 0 4px 14px rgba(16,32,64,.1); } .tcard.sel { outline: 2px solid var(--brand); box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 25%, transparent); }
.tcard.sla-ok { border-left-color: var(--sla-ok); } .tcard.sla-warn { border-left-color: var(--sla-warn); } .tcard.sla-bad { border-left-color: var(--sla-bad); }
.tcard .r1 { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: .72rem; color: var(--muted); }
.tcard .title { display: flex; gap: 8px; align-items: center; margin: 6px 0 2px; font-weight: 800; font-size: .98rem; }
.tcard .who { color: var(--muted); font-size: .8rem; }
.tcard .r4 { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 6px 0; }
.tag { display: inline-block; border-radius: 6px; padding: .12rem .45rem; font-size: .66rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; background: var(--brand-soft); color: var(--brand); white-space: nowrap; }
.tag.k-incidente { background: #fde8e6; color: #c62d21; } .tag.k-servico { background: #e6f6ee; color: #1b7f48; } .tag.k-duvida { background: #fff3dc; color: #a15c00; } .tag.k-projeto { background: #efe7fb; color: #6a35b8; }
.tag.k-sob { background: #e3f2f9; color: #0b6e8a; } .tag.status { background: #eef1f6; color: #33415c; text-transform: none; font-size: .68rem; }
.who2 { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: inline-grid; place-items: center; font-size: .6rem; font-weight: 800; }
.slabar { height: 6px; background: #e8edf5; border-radius: 99px; overflow: hidden; margin-top: 4px; } .slabar i { display: block; height: 100%; background: var(--sla-ok); border-radius: 99px; }
.sla-warn .slabar i { background: var(--sla-warn); } .sla-bad .slabar i { background: var(--sla-bad); }
.slatxt { display: flex; justify-content: space-between; font-size: .7rem; color: var(--muted); font-weight: 600; }
.chip-sla { border-radius: 999px; padding: .1rem .6rem; font-size: .68rem; font-weight: 800; background: #eef1f6; color: #4a5875; white-space: nowrap; }
.chip-sla.ok { background: #e4f6ec; color: #17803d; } .chip-sla.warn { background: #fff0d4; color: #a15c00; } .chip-sla.bad { background: #fde2df; color: #b42318; } .chip-sla.paused { background: var(--paused-bg); color: var(--paused); }

.dpane { padding: 18px 20px; min-width: 0; }
.dhead { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; } .dhead h2 { margin: 0; font-size: 1.25rem; } .dhead .ref { color: var(--muted); font-size: .76rem; }
.dtags { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 12px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.facts > div { padding: 10px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fbfcfe; min-width: 0; } .facts > div:nth-child(3n) { border-right: 0; }
.facts dt, .facts .k { font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 0 0 3px; } .facts .v { font-weight: 600; font-size: .88rem; word-break: break-word; }
.facts .v a { color: var(--brand); } .facts .v .phone { display: block; color: #0f7a5a; font-weight: 800; }
.descbox { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 12px 0; background: #fff; }
.descbox h3 { margin: 0 0 6px; font-size: .9rem; } .descbox .txt { white-space: pre-wrap; word-break: break-word; max-height: 190px; overflow: auto; font-size: .86rem; }
.slacard { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 12px 0; background: #fff; }
.slacard h3 { margin: 0 0 8px; font-size: .95rem; }
.bigbar { position: relative; height: 24px; background: #e8edf5; border-radius: 99px; overflow: hidden; } .bigbar i { position: absolute; inset: 0 auto 0 0; background: var(--sla-ok); }
.bigbar span { position: absolute; inset: 0; display: grid; place-items: center; font-size: .72rem; font-weight: 800; color: #0f3b24; }
.sla-warn .bigbar i { background: var(--sla-warn); } .sla-bad .bigbar i { background: var(--sla-bad); } .sla-bad .bigbar span { color: #fff; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.metrics > div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fbfcfe; } .metrics .k { font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; } .metrics .v { font-weight: 800; font-size: 1rem; }
.opsec { margin: 16px 0 0; } .opsec > h3 { font-size: 1rem; margin: 0 0 8px; }
.opgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; } .opgrid .card { box-shadow: none; padding: 12px 14px; }
.opgrid .card h3 { font-size: .86rem; margin-bottom: .2rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.opgrid .card.wide { grid-column: 1 / -1; }

/* ---------- painel de indicadores ---------- */
.dash-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-bottom: 14px; }
.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; } .dash-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chart { padding: 14px 16px; } .chart h3 { text-align: center; font-size: .86rem; color: #12408a; margin: 0 0 10px; }
.chart svg { width: 100%; height: auto; display: block; } .hbar { display: grid; grid-template-columns: 78px 1fr 44px; gap: 8px; align-items: center; margin: 7px 0; font-size: .78rem; font-weight: 700; }
.hbar .tr { background: #eef2f8; border-radius: 99px; height: 11px; overflow: hidden; } .hbar .tr i { display: block; height: 100%; border-radius: 99px; background: var(--brand); } .hbar b { text-align: right; }
.legend { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 4px 0 14px; }
.legend span { display: inline-flex; gap: 6px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .25rem .7rem; font-size: .68rem; font-weight: 800; text-transform: uppercase; } .legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.minitable { max-height: 360px; overflow: auto; } .minitable .tbl th { position: sticky; top: 0; background: #dbe9fb; color: #12408a; }
.report-head { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.report-head input, .report-head select { width: auto; min-width: 150px; }
.rep-day td { vertical-align: top; } .rep-day .date { font-weight: 800; white-space: nowrap; width: 110px; } .rep-day .line { margin: 2px 0; font-size: .84rem; } .rep-day .line b { color: #12408a; } .rep-day .line .et { color: #a85b00; }
.rep-wrap { max-height: 65vh; overflow: auto; }

@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } .queue { position: static; max-height: none; } .queue-list { max-height: 420px; } .dash-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; padding: 14px 16px; } .brandbar .sep { display: none; } .brandtext .ptitle { font-size: 1.2rem; }
  .mainnav, .subnav { padding-left: 14px; padding-right: 14px; } .content { padding: 14px; }
  .facts, .metrics, .opgrid, .dash-grid, .dash-grid.two { grid-template-columns: 1fr; } .facts > div { border-right: 0; }
  .pagehead { flex-direction: column; }
}

/* ajustes finos */
.subnav[hidden], .mainnav[hidden] { display: none; }
.content:focus, .content:focus-visible { outline: none; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.queue-head h3 { white-space: nowrap; } .queue-head .muted { font-size: .76rem; text-align: right; }
.who2 { min-width: 0; font-size: .66rem; text-align: right; } .tcard .r4 .tag.status { max-width: 62%; white-space: normal; }
.hbar { grid-template-columns: 132px 1fr 44px; } .hbar span { overflow-wrap: anywhere; line-height: 1.15; }
.filterbar { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.dash-grid .chart { align-self: stretch; }

.opgrid .op0 { order: 0; } .opgrid .op1 { order: 1; } .opgrid .op2 { order: 2; } .opgrid .op3 { order: 3; } .opgrid .op4 { order: 4; } .opgrid .op5 { order: 5; }
.secttl { margin: 6px 0 0; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-top: 1px solid var(--line, #e3e8ee); padding-top: 10px; }
