:root {
  --bg: #f5f6f8; --card: #ffffff; --text: #1c2430; --muted: #66707e; --line: #dde1e7;
  --accent: #1f6feb; --accent-text: #ffffff; --ok: #1a7f37; --ok-bg: #e6f4ea;
  --err: #b42318; --err-bg: #fdecea; --warn: #9a6700; --warn-bg: #fff4d6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c; --card: #1a2029; --text: #e6e9ee; --muted: #98a2b0; --line: #2b3340;
    --accent: #4c8dff; --accent-text: #0b1220; --ok: #56d364; --ok-bg: #12261a;
    --err: #ff8a80; --err-bg: #2c1614; --warn: #e3b341; --warn-bg: #2a2310;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
/* estrutura: barra superior + menu lateral */
:root { --side-bg: #3b3558; --side-hover: #4a4470; --side-text: #d9d6e8; --top-bg: #2c2940; }
header.topbar { position: sticky; top: 0; z-index: 5; height: 48px; display: flex; align-items: center; gap: 10px;
  padding: 0 16px; background: var(--top-bg); color: #fff; }
header.topbar .brand { font-weight: 700; font-size: 16px; }
header.topbar .spacer { flex: 1; }
header.topbar a.user { color: #e8e6f2; display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 6px; }
header.topbar a.user.active, header.topbar a.user:hover { background: var(--side-hover); text-decoration: none; }
header.topbar form { margin: 0; }
header.topbar button { background: transparent; color: #e8e6f2; border-color: #6a6490; padding: 4px 12px; }
header.topbar button.burger { border: 0; padding: 6px; line-height: 0; }
header.topbar button.burger:hover { background: var(--side-hover); }
.ico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
header.topbar .burger .ico { width: 22px; height: 22px; }
.shell { display: flex; align-items: flex-start; min-height: calc(100vh - 48px); }
nav.side { width: 232px; flex: none; align-self: stretch; background: var(--side-bg); color: var(--side-text);
  padding: 8px 0 24px; position: sticky; top: 48px; max-height: calc(100vh - 48px); overflow-y: auto; }
nav.side a, nav.side summary { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: var(--side-text);
  cursor: pointer; list-style: none; }
nav.side summary::-webkit-details-marker { display: none; }
nav.side a:hover, nav.side summary:hover { background: var(--side-hover); text-decoration: none; }
nav.side .ico { width: 18px; height: 18px; flex: none; }
nav.side summary::after { content: ""; margin-left: auto; width: 7px; height: 7px; border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
nav.side details[open] > summary::after { transform: rotate(45deg); }
nav.side a.sub { padding: 8px 16px 8px 44px; font-size: 14px; background: rgba(0, 0, 0, .14); }
nav.side a.sub:hover { background: var(--side-hover); }
nav.side .active { color: #fff; font-weight: 650; }
nav.side a.item.active, nav.side a.sub.active { background: var(--accent); }
nav.side summary.active { background: rgba(255, 255, 255, .08); }
body.side-hidden nav.side { display: none; }
@media (max-width: 800px) { nav.side { position: fixed; z-index: 4; left: 0; top: 48px; bottom: 0; } }
.shell > main { flex: 1; min-width: 0; }
body:not(.app) > main { padding: 20px 24px 48px; }
main { padding: 20px 24px 48px; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 17px; margin: 24px 0 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 20px; font-weight: 650; margin-top: 2px; word-break: break-word; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 10px; border: 1px solid var(--line); }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--err-bg); color: var(--err); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-bottom: 12px; flex-wrap: wrap; }
.toolbar h1 { margin: 0; }
table { width: 100%; border-collapse: collapse; background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.badge.on { background: var(--ok-bg); color: var(--ok); }
.badge.off { background: var(--err-bg); color: var(--err); }
.badge.idle { background: var(--warn-bg); color: var(--warn); }
.muted { color: var(--muted); }
.actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.actions form { margin: 0; }
button, .btn { font: inherit; border-radius: 8px; border: 1px solid var(--line); background: var(--card);
  color: var(--text); padding: 7px 14px; cursor: pointer; display: inline-block; }
button:hover, .btn:hover { text-decoration: none; border-color: var(--accent); }
.btn.primary, button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--err); }
form.stack { display: grid; gap: 14px; max-width: none; }
label.field { display: grid; gap: 4px; font-weight: 600; }
label.field small, .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.row { display: flex; gap: 8px; align-items: center; }
.row input { flex: 1; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.checks { display: flex; gap: 16px; flex-wrap: wrap; }
.cols { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 14px; margin: 0; }
legend { font-weight: 650; padding: 0 6px; }
pre { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px;
  overflow-x: auto; font-size: 13px; }
.login { max-width: 360px; margin: 12vh auto 0; }
.empty { padding: 24px; text-align: center; color: var(--muted); }

/* cores dos estados */
:root { --st-green: #3ab03e; --st-orange: #f39200; --st-gray: #8a93a0; }

/* icones de ramais e troncos */
.tiles { display: flex; flex-wrap: wrap; gap: 18px 22px; }
.tile { width: 96px; text-align: center; }
.tile svg { width: 76px; height: 76px; display: block; margin: 0 auto; }
.tile .ring { fill: none; stroke-width: 5; }
.tile .handset path { stroke: none; }
.tile .txt { display: none; font-size: 19px; font-weight: 700; }
.tile-num { font-weight: 700; margin-top: 4px; }
.tile-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tile.st-ativo .ring { stroke: var(--st-green); }
.tile.st-ativo .handset path { fill: var(--st-green); }

.tile.st-ligacao .ring, .tile.st-online .ring { stroke: var(--st-green); fill: var(--st-green); }
.tile.st-ligacao .handset path, .tile.st-online .handset path { fill: #fff; }

.tile.st-ocupado .ring { stroke: var(--st-orange); fill: var(--st-orange); }
.tile.st-ocupado .handset, .tile.st-tocando .handset { display: none; }
.tile.st-ocupado .txt-ocupado { display: block; fill: #fff; }

.tile.st-tocando .ring { stroke: var(--st-orange); }
.tile.st-tocando .txt-tocando { display: block; fill: var(--st-orange); font-size: 17px; }
.tile.st-tocando svg { animation: ring 1s ease-in-out infinite; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } 80% { transform: rotate(5deg); } }
@media (prefers-reduced-motion: reduce) { .tile.st-tocando svg { animation: none; } }

.tile.st-offline, .tile.st-desativado { opacity: .45; }
.tile.st-offline .ring, .tile.st-desativado .ring { stroke: var(--st-gray); }
.tile.st-offline .handset path, .tile.st-desativado .handset path { fill: var(--st-gray); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 16px; color: var(--muted); font-size: 13px; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; border: 2px solid transparent; }
.d-green { border-color: var(--st-green); }
.d-green-fill { background: var(--st-green); border-color: var(--st-green); }
.d-orange { border-color: var(--st-orange); }
.d-orange-fill { background: var(--st-orange); border-color: var(--st-orange); }
.d-gray { border-color: var(--st-gray); opacity: .6; }

/* tabela editavel */
table.edit td { padding: 8px 10px; }
table.edit input[type=text], table.edit input[type=password], table.edit input[type=number] { padding: 5px 8px; min-width: 110px; }
table.edit input.narrow { width: 80px; min-width: 0; }
table.edit .row input { min-width: 130px; }
button.small { padding: 4px 9px; font-size: 13px; }
.codecs-cell { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.codecs-cell .checks { gap: 10px; }
tr.newrow td { background: var(--bg); }
.fgrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); align-items: start; }
@media (max-width: 520px) { .fgrid { grid-template-columns: 1fr; } }

/* gravacoes */
.filters { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: end; margin: 16px 0; }
.filters .field { min-width: 160px; }
.filters .row { padding-bottom: 2px; }
input[type=date] { font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
audio { height: 34px; width: 260px; max-width: 100%; }
.badge.rec-interna { background: var(--warn-bg); color: var(--warn); }
.badge.rec-saida { background: rgba(76, 141, 255, .16); color: var(--accent); }
.badge.rec-entrada { background: var(--ok-bg); color: var(--ok); }
.pager { display: flex; gap: 14px; align-items: center; justify-content: center; margin: 16px 0; }
.ytabs { margin: 12px 0; }
input[type=time], input[type=file] { font: inherit; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.calls-title { display: flex; align-items: center; gap: 10px; }
#calls table { margin-bottom: 0; }
.score { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12.5px; font-weight: 600;
  background: var(--warn-bg); color: var(--warn); }
.score.s4, .score.s5 { background: var(--ok-bg); color: var(--ok); }
.score.s1, .score.s2 { background: var(--err-bg); color: var(--err); }
.charts { display: grid; gap: 12px; grid-template-columns: minmax(0, 3fr) minmax(260px, 1fr); margin: 16px 0; }
@media (max-width: 900px) { .charts { grid-template-columns: 1fr; } }
.chart-card h2 { margin: 0 0 8px; }
svg.chart { width: 100%; height: auto; display: block; }
svg .grid-line { stroke: var(--line); stroke-width: 1; }
svg .axis-line { stroke: var(--muted); stroke-width: 1; }
svg text.axis { fill: var(--muted); font-size: 12px; }
svg text.tot { fill: var(--text); font-weight: 600; }
.seg-ok { fill: var(--ok); background: var(--ok); }
.seg-err { fill: var(--err); background: var(--err); }
.seg-warn { fill: var(--warn); background: var(--warn); }
.seg-mute { fill: var(--muted); background: var(--muted); }
.legend-row { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
svg.donut { width: 200px; max-width: 100%; display: block; margin: 0 auto; }
svg .donut-bg { fill: none; stroke: var(--line); stroke-width: 26; }
svg .donut-seg { fill: none; stroke-width: 26; }
svg .donut-seg.seg-ok { stroke: var(--ok); } svg .donut-seg.seg-err { stroke: var(--err); }
svg .donut-seg.seg-warn { stroke: var(--warn); } svg .donut-seg.seg-mute { stroke: var(--muted); }
svg text.donut-n { fill: var(--text); font-size: 30px; font-weight: 700; }
.donut-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; }
.badge.st-ok { background: var(--ok-bg); color: var(--ok); }
.badge.st-err { background: var(--err-bg); color: var(--err); }
.badge.st-warn { background: var(--warn-bg); color: var(--warn); }
.badge.st-mute { background: var(--line); color: var(--muted); }

/* pagina Voz */
details.card > summary { cursor: pointer; }
details.card[open] > summary { margin-bottom: 4px; }
code { background: var(--line); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
audio { max-width: 100%; }

/* fluxo da ligacao (pagina Voz) */
ol.flow { list-style: none; padding: 0; margin: 0 0 10px; }
ol.flow > li { position: relative; margin-bottom: 18px; }
ol.flow > li:not(:last-child)::after { content: "\2193"; position: absolute; left: 22px; bottom: -19px; color: var(--muted); font-size: 18px; line-height: 18px; }
ol.flow > li.off { opacity: .55; }
ol.flow > li > details.card { margin: 0; }
.step-n { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; align-items: center; justify-content: center;
          background: var(--accent); color: #fff; font-weight: 650; font-size: 13px; margin-right: 6px; }
details.card summary { cursor: pointer; }
details.card.depth-1 { margin-left: 28px; } details.card.depth-2 { margin-left: 56px; }
details.card.depth-3 { margin-left: 84px; } details.card.depth-4 { margin-left: 112px; }
details.card.depth-5 { margin-left: 140px; }

/* resumo no topo das paginas (rosca + lista) */
.summary { display: flex; align-items: center; gap: 22px; padding: 14px 20px; margin-bottom: 14px; width: fit-content; max-width: 100%; }
.summary svg.donut { width: 150px; margin: 0; flex: none; }
.summary .sum-list h2 { margin: 0 0 8px; font-size: 15px; border-bottom: 2px solid var(--accent); display: inline-block; padding-bottom: 2px; }
.summary ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; min-width: 220px; }
.summary li { display: flex; align-items: center; gap: 8px; }
.summary .sl { flex: 1; }
.summary .cnt { background: var(--muted); color: var(--card); border-radius: 999px; padding: 0 8px; font-size: 12px; font-weight: 650; min-width: 24px; text-align: center; }
.summary .dot { border-radius: 50%; }
.seg-c1 { fill: #4c8dff; background: #4c8dff; } .seg-c2 { fill: #f0b429; background: #f0b429; }
.seg-c3 { fill: #a06bd6; background: #a06bd6; } .seg-c4 { fill: #2fb5a8; background: #2fb5a8; }
.seg-c5 { fill: #e0674f; background: #e0674f; }
svg .donut-seg.seg-c1 { stroke: #4c8dff; } svg .donut-seg.seg-c2 { stroke: #f0b429; } svg .donut-seg.seg-c3 { stroke: #a06bd6; }
svg .donut-seg.seg-c4 { stroke: #2fb5a8; } svg .donut-seg.seg-c5 { stroke: #e0674f; }
.listbar { display: flex; gap: 8px; align-items: center; margin: 0 0 12px; }
.listbar .tsearch { flex: 1; font: inherit; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); }
.t-hide { display: none !important; }
.charts.one { grid-template-columns: 1fr; }
details.card.ura { margin-bottom: 10px; }
details.card.ura > summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
details.card.ura h3 { margin: 18px 0 8px; font-size: 15px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.ura-sum { display: grid; gap: 2px; margin: 8px 0 4px; }
details.card.ura details.card { margin: 8px 0; }

header.topbar a.user small { opacity: .75; }
.flash.ro { background: var(--warn-bg); color: var(--warn); }
body[data-ro] main form[method="post"] button, body[data-ro] main .listbar a.btn, body[data-ro] main a.btn[href*="/edit"],
body[data-ro] main a.btn[href*="/new"], body[data-ro] main [data-togglepass], body[data-ro] main [data-genpass] { display: none; }
.perm-box { margin: 4px 0 0; }
.perm-box table { margin: 6px 0; }
.perm-box td, .perm-box th { padding: 6px 12px; }
.perm-box td.c { text-align: center; }
.perm-fixed { margin: 4px 0 0; }
.profiles { margin: 0 0 14px; }
.profiles ul { margin: 6px 0 0; padding-left: 18px; }
[hidden] { display: none !important; }

/* softphone web */
.sp { display: grid; gap: 16px; max-width: 460px; }
.sp-card { display: grid; gap: 12px; }
.sp-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.sp-status { font-size: 13px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); }
.sp-status.ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok); }
.sp-status.err { color: var(--err); background: var(--err-bg); border-color: var(--err); }
.sp-status.off { color: var(--muted); }
.sp-callbox { text-align: center; padding: 10px; border-radius: 10px; background: var(--ok-bg); }
.sp-who { font-size: 20px; font-weight: 600; }
.sp-state { color: var(--muted); }
.sp-timer { font-variant-numeric: tabular-nums; font-size: 22px; }
.sp-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sp-pad button { font-size: 20px; padding: 10px 0; }
.sp-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sp-actions button { flex: 1; padding: 10px 12px; }
.sp-go { font-size: 16px; }
.sp-xfer input { flex: 1; }
.sp-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sp-log li { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; }
.sp-log li.missed span { color: var(--err); }

/* softphone: indicador na barra superior e janela propria */
header.topbar a.sptop { color: #e8e6f2; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 6px; border: 1px solid #6a6490; font-size: 14px; }
header.topbar a.sptop:hover { background: var(--side-hover); text-decoration: none; }
.sptop .sp-dot { width: 9px; height: 9px; border-radius: 50%; background: #8a86a6; }
.sptop.ok .sp-dot { background: #3fb950; }
.sptop.err .sp-dot { background: #f85149; }
.sptop.off .sp-dot { background: #d29922; }
.sptop.call .sp-dot { background: #58a6ff; }
.sptop.closed { opacity: .75; }
.sptop.ring { background: #9a6700; border-color: #e3b341; animation: sp-pulse 1s infinite; }
.sptop.ring .sp-dot { background: #ffd33d; }
@keyframes sp-pulse { 50% { opacity: .55; } }
@media (max-width: 700px) { .sptop:not(.ring) .sp-lbl { display: none; } }
body.janela header.topbar, body.janela nav.side { display: none; }
body.janela main { padding: 12px; }
body.janela .sp { max-width: none; }
.sp .sp-busy { display: none; gap: 10px; }
.sp.busy .sp-busy { display: grid; }
.sp.busy .sp-card { display: none; }
.sp-snd { font-size: 13px; color: var(--muted); }
.sptop .sp-ext { font-weight: 700; padding: 0 6px; border-radius: 4px; background: rgba(255, 255, 255, .16); font-variant-numeric: tabular-nums; }
.sptop .sp-lbl:empty { display: none; }
.sp-drawer { position: fixed; top: 54px; right: 12px; width: 380px; max-width: calc(100vw - 24px); max-height: calc(100vh - 66px);
  overflow: auto; z-index: 30; padding: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.sp-drawer .sp { max-width: none; }
#sp-close { display: none; }
.sp-drawer #sp-close { display: inline-block; }
body.janela #sp-pop { display: none; }
.sp-tabs { display: flex; gap: 6px; }
.sp-tabs button { flex: 1; padding: 6px 10px; }
.sp-tabs button.on { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.sp-panel { display: grid; gap: 12px; }
.sp-video { position: relative; background: #000; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 9; }
.sp-video #sp-rvid { width: 100%; height: 100%; object-fit: contain; background: #000; }
.sp-video #sp-lvid { position: absolute; right: 8px; bottom: 8px; width: 28%; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .4); transform: scaleX(-1); background: #111; }
.sp-video #sp-full { position: absolute; left: 8px; top: 8px; opacity: .8; }
.sp-vstat { font-size: 12px; text-align: center; }

/* sala de video (galeria) */
.cf-box { display: grid; gap: 6px; padding: 6px; background: #000; border-radius: 10px; min-height: 120px; align-content: start; }
.cf-box.cf-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.cf-box.cf-focus { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
.cf-tile { position: relative; aspect-ratio: 16 / 9; background: #111; border-radius: 8px; overflow: hidden; cursor: pointer; }
.cf-tile video { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }   /* corta a faixa escondida na base */
.cf-tile.cf-pinned::after { content: "fixo"; position: absolute; right: 6px; top: 6px; font-size: 11px; padding: 1px 6px; border-radius: 999px; background: rgba(0, 0, 0, .6); color: #fff; }
.cf-focus .cf-main { grid-column: 1 / -1; grid-row: 1; width: min(100%, calc((100vh - var(--cf-reserve, 200px)) * 16 / 9)); justify-self: center; }   /* --cf-reserve: altura que sobra para o resto da pagina */
.cf-box:fullscreen { width: 100vw; height: 100vh; max-height: none; border-radius: 0; }
.cf-box:fullscreen.cf-focus .cf-main { width: min(100%, calc(78vh * 16 / 9)); }
.sp-conf { display: grid; gap: 6px; }
.sp-conf-bar { display: flex; gap: 6px; }
.sp-conf-bar button { flex: 1; }
.sp-rooms { display: grid; gap: 6px; }
.sp-rooms .sp-room { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.sp-invite { display: grid; gap: 8px; border-color: var(--accent); }
/* pagina do convidado */
.cv-card { max-width: 420px; margin: 40px auto; display: grid; gap: 12px; }
.cv-room { display: grid; gap: 10px; max-width: 1400px; margin: 0 auto; }
.cv-top { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.cf-src { position: fixed; left: -20px; top: 0; width: 2px; height: 2px; opacity: 0; pointer-events: none; }
.lkbox { display: grid; gap: 6px; }
.lkbox input[readonly] { min-width: 180px; flex: 1; }
.sp-rooms-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sp-room-wrap { display: grid; gap: 4px; }
.sp-link input { flex: 1; min-width: 0; }
body[data-ro] [data-genlink] { display: none; }

/* dashboard: todos os graficos reunidos + ligacoes em curso */
.dash-title { margin: 22px 0 10px; }
.dash-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); margin: 0 0 18px; }
.dash-grid > .summary { width: auto; margin: 0; flex-wrap: wrap; }
.dash-grid .summary ul { min-width: 0; }
.dash-grid .summary .sum-list { flex: 1; min-width: 150px; }
.dash-grid > .wide { grid-column: 1 / -1; margin: 0; }
@media (max-width: 480px) { .dash-grid { grid-template-columns: 1fr; } }
#dash-live .summary { width: auto; margin: 14px 0; flex-wrap: wrap; gap: 14px 28px; }
.summary.live .sum-list { flex: 0 1 300px; }
.summary.live li.grp { font-weight: 650; border-top: 1px solid var(--line); padding-top: 5px; margin-top: 2px; }
.summary.live li.grp .sl { padding-left: 19px; }
.summary.live li.sub { padding-left: 19px; }
.live-st { flex: 1 1 260px; }
.live-st table { width: auto; min-width: 260px; margin-bottom: 8px; }
.live-st th, .live-st td { padding: 4px 12px; text-align: right; }
.live-st th:first-child, .live-st td:first-child { text-align: left; }
.live-st .muted { font-size: 12.5px; }
.badge.rec-sala { background: rgba(160, 107, 214, .18); color: #a06bd6; }
.lc-wrap { flex: 1 0 100%; border-top: 1px solid var(--line); padding-top: 10px; }
.lc-title { margin: 10px 0 6px; font-size: 13px; font-weight: 650; }
.lc-title .muted { font-weight: 400; margin-left: 4px; }
.lc-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-bottom: 8px; }
.lc { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; min-width: 0; }
.lc-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; min-height: 20px; }
.lc-top .badge { font-size: 11.5px; padding: 0 7px; }
.lc-dur { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 12px; }
.lc-line { display: flex; align-items: center; gap: 8px; }
.lc-end { display: grid; min-width: 0; flex: 1; }
.lc-end small { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }
.lc-end strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-end .muted { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-arrow { color: var(--muted); font-size: 16px; flex: none; }
.lc-meta { font-size: 11.5px; margin-top: 4px; }

/* sala: palco com a imagem, icones transparentes na base dela e mensagens na lateral.
   Para ajustar: --cf-ico (icone), --cf-btn (area de toque), --cf-op (opacidade), --cf-chat-w (largura do painel). */
.cf-stage { --cf-ico: 22px; --cf-btn: 42px; --cf-op: .88; --cf-chat-w: 300px; position: relative; display: flex; align-items: stretch;
  background: #000; border-radius: 10px; overflow: hidden; }
.cf-stage > .cf-box { flex: 1 1 auto; min-width: 0; border-radius: 0; }
.cf-stage:fullscreen { width: 100vw; height: 100vh; border-radius: 0; --cf-reserve: 110px; }
.cf-stage:fullscreen > .cf-box { height: 100vh; max-height: none; overflow: auto; align-content: center; }
.cf-ctl { position: absolute; left: 0; right: 0; bottom: 10px; z-index: 5; display: flex; justify-content: center; gap: 4px;
  pointer-events: none; transition: opacity .25s ease; }
.cf-stage.cf-chat-open:not(.cf-chat-over) .cf-ctl { right: var(--cf-chat-w); }
.cf-stage.cf-idle .cf-ctl { opacity: 0; }
.cf-stage .cf-b { pointer-events: auto; position: relative; width: var(--cf-btn); height: var(--cf-btn); padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: #fff; opacity: var(--cf-op); display: inline-flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .9)); }
.cf-stage .cf-b:hover, .cf-stage .cf-b:focus-visible { background: rgba(255, 255, 255, .2); opacity: 1; border: 0; }
.cf-stage .cf-b[hidden] { display: none; }
.cf-stage .cf-b.cf-alt.cf-act-mic, .cf-stage .cf-b.cf-alt.cf-act-cam { color: #ff7b7b; }
.cf-stage .cf-b.cf-alt.cf-act-chat { background: rgba(255, 255, 255, .22); opacity: 1; }
.cf-stage .cf-b.cf-act-leave { color: #ff6b6b; }
.cf-i { display: inline-flex; }
.cf-i svg, .cf-chat-x svg, .cf-chat-s svg { width: var(--cf-ico); height: var(--cf-ico); fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.cf-act-leave .cf-i svg { fill: currentColor; }
.cf-badge { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #e5484d;
  color: #fff; font-size: 11px; font-weight: 700; line-height: 16px; text-align: center; }
.cf-badge[hidden] { display: none; }
@media (max-width: 700px) { .cf-stage { --cf-btn: 46px; } }

/* mensagens da sala (painel na lateral; em tela estreita cobre a imagem e deixa a barra de icones aparecendo) */
.cf-chat { position: relative; flex: 0 0 var(--cf-chat-w); width: var(--cf-chat-w); background: #10151d; border-left: 1px solid #263041; color: #e6edf3; }
.cf-chat[hidden] { display: none; }
.cf-chat-in { position: absolute; left: 0; right: 0; top: 0; bottom: 0; display: flex; flex-direction: column; min-height: 0; }
.cf-stage.cf-chat-open { min-height: 360px; }
.cf-stage.cf-chat-over .cf-chat { position: absolute; left: 0; right: 0; top: 0; bottom: 60px; width: auto; flex: none; border-left: 0; z-index: 4; }
.cf-chat-h { display: flex; justify-content: space-between; align-items: center; padding: 8px 8px 8px 14px; border-bottom: 1px solid #263041; }
.cf-stage .cf-chat-x { background: transparent; border: 0; color: #c9d4e2; padding: 6px; line-height: 0; border-radius: 6px; }
.cf-stage .cf-chat-x:hover { background: rgba(255, 255, 255, .12); border: 0; }
.cf-chat-l { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.cf-msg { max-width: 88%; align-self: flex-start; }
.cf-msg.me { align-self: flex-end; text-align: right; }
.cf-msg-w { font-size: 11px; color: #8b98a9; margin-bottom: 2px; }
.cf-msg-t { display: inline-block; text-align: left; background: #1b2430; border-radius: 10px; padding: 6px 10px; font-size: 14px; line-height: 1.35;
  white-space: pre-wrap; overflow-wrap: anywhere; }
.cf-msg.me .cf-msg-t { background: #1f4f8f; }
.cf-chat-n { padding: 4px 12px; font-size: 12px; color: #ffb4a8; }
.cf-chat-n[hidden] { display: none; }
.cf-chat-f { display: flex; gap: 6px; padding: 8px; border-top: 1px solid #263041; }
.cf-stage .cf-chat-f input { flex: 1; min-width: 0; width: auto; background: #0b0f15; color: #e6edf3; border-color: #263041; }
.cf-stage .cf-chat-s { background: #1f4f8f; border: 0; color: #fff; padding: 0 12px; border-radius: 8px; line-height: 0; }
.cf-stage .cf-chat-s:hover { background: #2a62ad; border: 0; }
/* softphone: na sala, mudo/camera/desligar/galeria/tela cheia passam para os icones sobre a imagem */
.sp.in-room #sp-mute, .sp.in-room #sp-cam, .sp.in-room #sp-hang, .sp.in-room #sp-layout, .sp.in-room #sp-gfull { display: none; }

/* reuniao em andamento (pagina do convidado): some a barra do app e o menu lateral, sobra so a imagem */
body.reuniao header.topbar, body.reuniao nav.side { display: none; }
body.reuniao .shell { min-height: 100vh; }
body.reuniao main { padding: 10px 14px 14px; }
body.reuniao { overflow: hidden; }                     /* a reuniao ocupa exatamente a janela: sem barra de rolagem */
body.reuniao main > .flash.ro { display: none; }
body.reuniao .cv-room { max-width: none; display: flex; flex-direction: column; height: calc(100vh - 24px); height: calc(100dvh - 24px); }
body.reuniao .cv-room .cf-stage { flex: 1 1 auto; min-height: 0; }
/* ajuste automatico: o conf.js calcula o maior video que cabe e o aplica nos quadros (sem rolagem) */
.cf-stage.cf-fit > .cf-box { overflow: hidden; min-height: 0; }

/* ---- reunioes instantaneas: icone de 3 pontinhos (sala e softphone) ---- */
.cf-act-more .cf-i svg { fill: currentColor; stroke: none; }
.cf-stage .cf-b.cf-alt.cf-act-more { background: rgba(255, 255, 255, .22); opacity: 1; }
.cf-menu { position: absolute; z-index: 7; min-width: 230px; max-width: calc(100% - 16px); overflow-y: auto; padding: 6px; display: grid; gap: 2px;
  background: rgba(16, 21, 29, .96); border: 1px solid #263041; border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); color: #e6edf3; }
.cf-menu[hidden] { display: none; }
.cf-stage .cf-mi { display: block; width: 100%; text-align: left; background: transparent; border: 0; color: #e6edf3; padding: 10px 12px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.cf-stage .cf-mi:hover, .cf-stage .cf-mi:focus-visible { background: rgba(255, 255, 255, .12); border: 0; }
.cf-mh { display: flex; align-items: center; gap: 6px; padding: 0 4px 4px; }
.cf-mh strong { font-size: 13px; color: #c9d4e2; }
.cf-stage .cf-mh .cf-mback { width: auto; padding: 6px 8px; color: #9fb0c5; }
.cf-ml { display: grid; gap: 2px; }
.cf-mp { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px; font-size: 14px; }
.cf-mp:hover { background: rgba(255, 255, 255, .06); }
.cf-mp .cf-mn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-mp small { color: #8b9bb0; }
.cf-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #5b6676; }
.cf-dot.on { background: #3ecf8e; }
.cf-stage .cf-mp button { flex: none; background: #1f4f8f; border: 0; color: #fff; padding: 5px 11px; font-size: 13px; border-radius: 8px; cursor: pointer; }
.cf-stage .cf-mp button:hover { background: #2a62ad; border: 0; }
.cf-stage .cf-mp button:disabled { background: #2b3340; color: #9fb0c5; cursor: default; }
.cf-mnote { padding: 4px 10px 2px; font-size: 12px; color: #9fb0c5; }
.cf-mnote.err { color: #ffb4a8; }
/* softphone: 3 pontinhos no cabecalho e menu */
.sp-head { position: relative; }
.sp-more { background: transparent; border: 0; color: inherit; padding: 4px 6px; line-height: 0; border-radius: 8px; opacity: .8; cursor: pointer; }
.sp-more:hover, .sp-more[aria-expanded="true"] { background: rgba(127, 127, 127, .2); opacity: 1; border: 0; }
.sp-more svg { width: 22px; height: 22px; fill: currentColor; }
.sp-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 6; min-width: 240px; max-width: 100%; display: grid; gap: 2px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
.sp-menu[hidden] { display: none; }
.sp-menu button { display: block; width: 100%; text-align: left; background: transparent; border: 0; padding: 9px 10px; border-radius: 8px; }
.sp-menu button:hover:not(:disabled) { background: var(--bg); border: 0; }
.sp-menu button:disabled { color: var(--muted); cursor: default; }
.sp-menu .hint { padding: 0 10px 6px; margin: 0; }

/* verificacao em duas etapas */
.qr svg { width: 200px; height: 200px; background: #fff; padding: 6px; border-radius: 8px; }
