/* Painel IPTV - tema escuro (padrao) e claro via html[data-tema]. Base visual do PLAYTOP/pulsasync. */
:root, html[data-tema="escuro"] {
    color-scheme: dark;
    --fundo: #0b0e17; --superficie: #131826; --superficie2: #181e2e; --superficie3: #1f2638;
    --borda: #252c40; --borda-forte: #353e58;
    --texto: #e9ebf3; --texto2: #a7adc2; --texto3: #8f96ad;
    --campo: #0f1320; --campo-borda: #3a4360; --campo-hover: #535e80;
    --ac: #7c3aed; --ac-hover: #8b5cf6; --ac-suave: rgba(139, 92, 246, .16); --ac-txt: #c4b5fd; --ac-borda: rgba(139, 92, 246, .45);
    --roxo: #8b5cf6; --roxo-suave: rgba(139, 92, 246, .16); --roxo-txt: #c4b5fd;
    --verde: #16a34a; --verde-suave: rgba(34, 197, 94, .14); --verde-txt: #4ade80;
    --vermelho: #dc2626; --vermelho-suave: rgba(239, 68, 68, .15); --vermelho-txt: #fca5a5;
    --amarelo: #eab308; --amarelo-suave: rgba(234, 179, 8, .14); --amarelo-txt: #fde047; --amarelo-borda: rgba(234, 179, 8, .4);
    --laranja: #f97316; --laranja-suave: rgba(249, 115, 22, .15); --laranja-txt: #fdba74;
    --ciano: #06b6d4; --ciano-suave: rgba(34, 211, 238, .13); --ciano-txt: #67e8f9;
    --cinza-suave: rgba(148, 163, 184, .13); --cinza-txt: #d5dbe6;
    --sombra: 0 1px 2px rgba(0, 0, 0, .3), 0 1px 3px rgba(0, 0, 0, .25);
    --sombra-g: 0 24px 60px rgba(0, 0, 0, .6);
    --foco: 0 0 0 3px rgba(167, 139, 250, .5);
    --esq1: #1b2133; --esq2: #232a3f;
    --toast: #252c40; --toast-txt: #f3f4f8;
    --r: 12px; --r-sm: 8px; --r-g: 16px; --lateral: 248px;
}
html[data-tema="claro"] {
    color-scheme: light;
    --fundo: #f4f5f9; --superficie: #ffffff; --superficie2: #f8f9fc; --superficie3: #eef0f5;
    --borda: #e3e6ee; --borda-forte: #cdd2de;
    --texto: #151826; --texto2: #505669; --texto3: #6a7085;
    --campo: #ffffff; --campo-borda: #c9cedb; --campo-hover: #a9b0c2;
    --ac: #7c3aed; --ac-hover: #6d28d9; --ac-suave: #f1ebff; --ac-txt: #6d28d9; --ac-borda: #d6c6fb;
    --roxo: #7c3aed; --roxo-suave: #f1ebff; --roxo-txt: #6d28d9;
    --verde: #15803d; --verde-suave: #e7f6ec; --verde-txt: #166534;
    --vermelho: #dc2626; --vermelho-suave: #fdecec; --vermelho-txt: #b91c1c;
    --amarelo: #ca8a04; --amarelo-suave: #fef6d8; --amarelo-txt: #854d0e; --amarelo-borda: #f5d77a;
    --laranja: #ea580c; --laranja-suave: #ffedd5; --laranja-txt: #9a3412;
    --ciano: #0e7490; --ciano-suave: #e2f5f9; --ciano-txt: #0e6377;
    --cinza-suave: #eceef3; --cinza-txt: #374151;
    --sombra: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
    --sombra-g: 0 24px 60px rgba(16, 24, 40, .22);
    --foco: 0 0 0 3px rgba(124, 58, 237, .35);
    --esq1: #e9ecf2; --esq2: #f4f6fa;
    --toast: #1f2433; --toast-txt: #fff;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--fundo); color: var(--texto); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; overflow-x: clip; }
body:has(.fundo-modal) { overflow: hidden; }
a { color: var(--ac-txt); }
[hidden] { display: none !important; }
h2, h3, h4 { color: var(--texto); }
b, strong { font-weight: 650; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }
::selection { background: rgba(14, 165, 233, .3); }
* { scrollbar-width: thin; scrollbar-color: var(--borda-forte) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--borda-forte); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }
.btn-sm .ic { width: 15px; height: 15px; }

/* ---------- estrutura */
.app { display: flex; min-height: 100vh; }
.lateral { width: var(--lateral); flex: none; position: sticky; top: 0; height: 100vh; background: linear-gradient(180deg, var(--superficie), var(--fundo)); border-right: 1px solid var(--borda); padding: 20px 14px 12px; display: flex; flex-direction: column; gap: 18px; z-index: 30; }
.logo { display: flex; align-items: center; gap: 12px; color: var(--texto); padding: 0 8px; white-space: nowrap; }
.logo > div { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.logo-nome { font-weight: 800; font-size: 18px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; }
.logo-sub { font-size: 10px; letter-spacing: .22em; color: var(--texto3); font-weight: 700; }
.logo-marca { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, #38bdf8, #0284c7); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(14, 165, 233, .35); flex: none; }
.logo-marca .ic { width: 18px; height: 18px; fill: #fff; stroke: none; }
.menu { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; min-height: 0; margin: 0 -4px; padding: 0 4px; }
.menu a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--texto2); text-decoration: none; font-weight: 600; font-size: 14px; transition: background .15s, color .15s; }
.menu a:hover { background: var(--superficie3); color: var(--texto); }
.menu a.ativo { background: var(--ac-suave); color: var(--ac-txt); }
.menu .grupo { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--texto3); font-weight: 700; padding: 12px 12px 4px; }
.lateral-pe { display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid var(--borda); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--superficie3); display: grid; place-items: center; font-weight: 700; color: var(--texto2); flex: none; }
.pe-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.pe-txt b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; }
.pe-txt small { color: var(--texto3); font-size: 12px; }
.principal { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topo { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: color-mix(in srgb, var(--fundo) 85%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--borda); min-height: 60px; }
.topo-titulo { font-weight: 700; font-size: 15px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topo-dir { display: flex; gap: 8px; align-items: center; }
.relogio { color: var(--texto2); font-size: 13px; font-variant-numeric: tabular-nums; }
.btn-icone { background: var(--superficie); border: 1px solid var(--borda); color: var(--texto2); border-radius: 10px; width: 38px; height: 38px; cursor: pointer; display: inline-grid; place-items: center; transition: background .15s, color .15s, border-color .15s; padding: 0; flex: none; }
.btn-icone:hover { color: var(--texto); border-color: var(--borda-forte); background: var(--superficie3); }
.btn-icone-sm { width: 32px; height: 32px; }
.so-mobile { display: none; }
.cortina { display: none; }
.tela { padding: 24px; width: 100%; max-width: 1560px; margin: 0 auto; }
@media (max-width: 960px) {
    .so-mobile { display: inline-grid; }
    .lateral { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--sombra-g); }
    .app.menu-aberto .lateral { transform: none; }
    .app.menu-aberto .cortina { display: block; position: fixed; inset: 0; background: rgba(5, 8, 15, .55); z-index: 25; }
    .topo { padding: 10px 16px; }
    .tela { padding: 16px 12px; }
    .relogio { display: none; }
}

/* ---------- cards e cabecalhos */
.card { background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--r-g); padding: 20px; box-shadow: var(--sombra); min-width: 0; }
.card + .card { margin-top: 16px; }
.card h3 { margin: 0 0 14px; font-size: 15px; font-weight: 720; display: flex; align-items: center; gap: 8px; }
.card h3 .ic { color: var(--ac-txt); }
.cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.cab h2 { margin: 0; font-size: 22px; font-weight: 780; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.cab h2 small { font-size: 16px; color: var(--texto3); font-weight: 500; }
.sub { color: var(--texto2); font-size: 13px; margin: 2px 0 0; }
.linha { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; }
.espaco { flex: 1; }
.grade2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.grade3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.barra-filtros { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.painel-filtros { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; padding: 14px 16px; border: 1px solid var(--borda); border-radius: var(--r); background: var(--superficie); margin-bottom: 14px; }
@media (max-width: 600px) { .card { padding: 14px; border-radius: var(--r); } .cab h2 { font-size: 19px; } }

/* ---------- botoes */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 10px; padding: 9px 15px; font: inherit; font-weight: 650; font-size: 13.5px; line-height: 1.2; cursor: pointer; color: #fff; background: var(--cinza-txt); text-decoration: none; white-space: nowrap; transition: background .15s, box-shadow .15s, transform .05s, filter .15s; user-select: none; }
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--foco); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; transform: none; }
.btn.ocupado { position: relative; color: transparent !important; pointer-events: none; }
.btn.ocupado::after { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .9); border-right-color: transparent; animation: gira .7s linear infinite; }
.btn-largo { width: 100%; padding: 11px 16px; }
.btn-azul { background: linear-gradient(135deg, #0ea5e9, #0284c7); box-shadow: 0 2px 10px rgba(14, 165, 233, .3); }
.btn-roxo { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.btn-verde { background: linear-gradient(135deg, #22c55e, #15803d); }
.btn-vermelho { background: var(--vermelho); }
.btn-amarelo { background: linear-gradient(135deg, #facc15, #eab308); color: #231300; }
.btn-laranja { background: linear-gradient(135deg, #fb923c, #ea580c); }
.btn-cinza { background: var(--superficie); color: var(--texto); border-color: var(--borda-forte); }
.btn-cinza:hover { background: var(--superficie3); filter: none; }
.btn-sm { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; gap: 5px; }
.btn-sm.btn-azul { background: var(--ac-suave); color: var(--ac-txt); box-shadow: none; }
.btn-sm.btn-roxo { background: var(--roxo-suave); color: var(--roxo-txt); }
.btn-sm.btn-verde { background: var(--verde-suave); color: var(--verde-txt); }
.btn-sm.btn-vermelho { background: var(--vermelho-suave); color: var(--vermelho-txt); }
.btn-sm.btn-amarelo { background: var(--amarelo-suave); color: var(--amarelo-txt); }
.btn-sm.btn-cinza { background: var(--cinza-suave); color: var(--cinza-txt); border-color: transparent; }
.btn-sm:hover { filter: none; box-shadow: inset 0 0 0 1px currentColor; }
.btn-sm.ocupado::after { border-color: var(--texto2); border-right-color: transparent; }
.acao { background: none; border: 0; color: var(--texto3); width: 30px; height: 30px; border-radius: 8px; display: inline-grid; place-items: center; cursor: pointer; padding: 0; }
.acao:hover { background: var(--superficie3); color: var(--texto); }
.acao.az:hover { color: var(--ac-txt); } .acao.vd:hover { color: var(--verde-txt); } .acao.vm:hover { color: var(--vermelho-txt); } .acao.am:hover { color: var(--amarelo-txt); }
.acao .ic { width: 17px; height: 17px; }

/* ---------- campos */
.campo, select.campo, textarea.campo { background: var(--campo); border: 1px solid var(--campo-borda); color: var(--texto); border-radius: 10px; padding: 9px 12px; font: inherit; font-size: 14px; outline: none; min-width: 0; max-width: 100%; width: 100%; transition: border-color .15s, box-shadow .15s; }
.campo:hover { border-color: var(--campo-hover); }
.campo:focus { border-color: var(--ac); box-shadow: var(--foco); }
.campo::placeholder { color: var(--texto3); opacity: 1; }
.campo:disabled { opacity: .6; }
select.campo { cursor: pointer; padding-right: 32px; appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--texto2) 50%), linear-gradient(135deg, var(--texto2) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
select.campo option, select.campo optgroup { background: var(--superficie); color: var(--texto); }
textarea.campo { min-height: 90px; resize: vertical; }
textarea.mono { font-size: 12.5px; }
input[type=checkbox] { accent-color: var(--ac); width: 17px; height: 17px; cursor: pointer; margin: 0; flex: none; }
.busca { position: relative; flex: 0 1 300px; min-width: 180px; }
.busca .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--texto3); width: 16px; height: 16px; pointer-events: none; }
.busca .campo { padding-left: 34px; }
.rotulo { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--texto2); min-width: 0; }
.rotulo small { font-weight: 400; color: var(--texto3); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--texto); font-weight: 500; font-size: 13.5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid.g3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid .inteiro { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid, .form-grid.g3 { grid-template-columns: 1fr; } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--borda-forte); background: var(--superficie); color: var(--texto2); font-weight: 600; font-size: 13px; cursor: pointer; user-select: none; }
.chip.on { background: var(--ac); border-color: var(--ac); color: #fff; }
.chip .ic { width: 14px; height: 14px; }

/* ---------- abas / pilulas */
.pilulas { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pilula { padding: 6px 14px; border-radius: 99px; background: var(--superficie3); color: var(--texto2); font-weight: 600; font-size: 13px; cursor: pointer; border: 0; font-family: inherit; white-space: nowrap; }
.pilula:hover { color: var(--texto); }
.pilula.ativa { background: var(--ac); color: #fff; }
.pilula span { opacity: .75; font-weight: 500; }
.sep-v { width: 1px; height: 22px; background: var(--borda-forte); margin: 0 4px; }
.abas { display: flex; gap: 4px; border-bottom: 1px solid var(--borda); margin-bottom: 16px; overflow-x: auto; }
.aba { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; color: var(--texto2); font-weight: 600; cursor: pointer; border: 0; background: none; font: inherit; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.aba:hover { color: var(--texto); }
.aba.ativa { color: var(--ac-txt); border-bottom-color: var(--ac); }
.aba .ic { width: 16px; height: 16px; }

/* ---------- tabelas */
.tabela-wrap { overflow-x: auto; border: 1px solid var(--borda); border-radius: var(--r); background: var(--superficie); max-width: 100%; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--texto3); padding: 12px 14px; background: var(--superficie2); border-bottom: 1px solid var(--borda); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--borda); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--superficie2); }
tbody tr.sel td { background: var(--ac-suave); }
td.acoes { white-space: nowrap; text-align: right; }
.col-chk { width: 42px; }
.nowrap { white-space: nowrap; }
.direita { text-align: right; }
.centro { text-align: center; }
.trunc { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nome-item { font-weight: 650; color: var(--texto); display: flex; align-items: center; gap: 10px; min-width: 0; }
.poster { width: 40px; height: 56px; border-radius: 6px; background: var(--superficie3); display: grid; place-items: center; overflow: hidden; color: var(--texto3); flex: none; }
.poster.quad { width: 40px; height: 40px; }
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster .ic { width: 16px; height: 16px; }
.vazio { text-align: center; padding: 40px 16px; color: var(--texto2); }
.vazio .ic { width: 36px; height: 36px; margin: 0 auto 10px; color: var(--texto3); stroke-width: 1.5; }
.vazio b { display: block; color: var(--texto); font-size: 15px; margin-bottom: 2px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 650; background: var(--cinza-suave); color: var(--cinza-txt); white-space: nowrap; }
.tag.ponto::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tag-verde { background: var(--verde-suave); color: var(--verde-txt); }
.tag-vermelho { background: var(--vermelho-suave); color: var(--vermelho-txt); }
.tag-amarelo { background: var(--amarelo-suave); color: var(--amarelo-txt); }
.tag-azul { background: var(--ac-suave); color: var(--ac-txt); }
.tag-roxo { background: var(--roxo-suave); color: var(--roxo-txt); }
.tag-laranja { background: var(--laranja-suave); color: var(--laranja-txt); }
.st { display: inline-flex; align-items: center; gap: 7px; font-weight: 650; font-size: 13.5px; }
.st::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st.ok { color: var(--verde-txt); } .st.er { color: var(--vermelho-txt); } .st.av { color: var(--amarelo-txt); } .st.ne { color: var(--texto3); }
.txt-ok { color: var(--verde-txt); } .txt-er { color: var(--vermelho-txt); } .txt-av { color: var(--amarelo-txt); } .txt-az { color: var(--ac-txt); } .txt-3 { color: var(--texto3); }
.paginacao { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.pg { min-width: 36px; height: 36px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; border: 1px solid var(--borda); background: var(--superficie); color: var(--texto); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; }
.pg:hover { background: var(--superficie3); }
.pg.ativa { background: var(--ac); border-color: var(--ac); color: #fff; }
.pg:disabled { opacity: .4; cursor: default; }
.barra-massa { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--r); background: var(--ac-suave); border: 1px solid var(--ac-borda); margin-bottom: 12px; }
.barra-massa > b { color: var(--ac-txt); margin-right: 4px; }
.barra-massa .campo { width: auto; padding: 6px 10px; }
.arrasta { cursor: grab; color: var(--texto3); }
tr.arrastando td { opacity: .4; }

/* ---------- switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; background: none; border: 0; padding: 0; color: var(--texto); font: inherit; }
.switch i { position: relative; width: 44px; height: 24px; border-radius: 12px; background: var(--borda-forte); transition: background .2s; flex: none; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: left .2s; }
.switch.on i { background: var(--ac); }
.switch.on i::after { left: 23px; }
.opcao { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--borda); }
.opcao:last-child { border-bottom: 0; }
.opcao b { display: block; font-size: 14px; }
.opcao small { color: var(--texto3); font-size: 12.5px; }

/* ---------- aviso / caixa */
.aviso { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--r); background: var(--amarelo-suave); border: 1px solid var(--amarelo-borda); color: var(--texto); margin: 0 0 12px; font-size: 13px; }
.aviso > .ic { color: var(--amarelo-txt); margin-top: 1px; }
.aviso.info { background: var(--ac-suave); border-color: var(--ac-borda); }
.aviso.info > .ic { color: var(--ac-txt); }
.aviso.erro { background: var(--vermelho-suave); border-color: rgba(239, 68, 68, .45); }
.aviso.erro > .ic { color: var(--vermelho-txt); }
.caixa { background: var(--superficie2); border: 1px solid var(--borda); border-radius: var(--r); padding: 14px 16px; }
.caixa-cod { background: var(--campo); border: 1px solid var(--borda); border-radius: 10px; padding: 12px 14px; font: 12.5px/1.55 ui-monospace, Consolas, monospace; color: var(--verde-txt); white-space: pre-wrap; word-break: break-all; max-height: 380px; overflow: auto; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13.5px; }
.kv > span { color: var(--texto3); }
.kv > b { text-align: right; overflow-wrap: anywhere; }
.log { white-space: pre-wrap; max-height: 300px; overflow: auto; font: 12.5px/1.55 ui-monospace, Consolas, monospace; background: var(--superficie2); border: 1px solid var(--borda); border-radius: var(--r); padding: 12px 14px; }
details > summary { cursor: pointer; color: var(--texto2); font-size: 13px; font-weight: 600; padding: 6px 0; }
.progresso { height: 10px; border-radius: 99px; background: var(--superficie3); overflow: hidden; }
.progresso > i { display: block; height: 100%; background: linear-gradient(90deg, var(--ac), #22d3ee); border-radius: 99px; transition: width .4s; }

/* ---------- carregando */
.girando { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--borda-forte); border-top-color: var(--ac); animation: gira .7s linear infinite; vertical-align: middle; }
.carregando { display: flex; align-items: center; gap: 10px; color: var(--texto2); padding: 30px 0; justify-content: center; }
.esq { background: linear-gradient(90deg, var(--esq1) 25%, var(--esq2) 50%, var(--esq1) 75%); background-size: 200% 100%; animation: brilho 1.3s ease-in-out infinite; border-radius: 12px; }
@keyframes gira { to { transform: rotate(360deg); } }
@keyframes brilho { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@keyframes pulsa { 50% { opacity: .35; } }
@keyframes entra { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes surge { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; } }

/* ---------- janelas */
.fundo-modal { position: fixed; inset: 0; background: rgba(3, 6, 12, .7); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; animation: surge .15s ease; }
.modal { background: var(--superficie); color: var(--texto); border: 1px solid var(--borda); border-radius: 18px; width: 100%; max-width: 640px; max-height: calc(100dvh - 32px); display: flex; flex-direction: column; box-shadow: var(--sombra-g); animation: entra .18s ease; }
.modal.pequeno { max-width: 460px; }
.modal.grande { max-width: 980px; }
.modal-cab { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--borda); flex: none; }
.modal-cab h3 { margin: 0; font-size: 17px; font-weight: 720; display: flex; align-items: center; gap: 9px; min-width: 0; }
.modal-cab h3 .ic { color: var(--amarelo-txt); }
.modal-corpo { padding: 18px 22px; overflow-y: auto; flex: 1; min-height: 0; }
.modal-rodape { display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; padding: 14px 22px; border-top: 1px solid var(--borda); background: var(--superficie2); border-radius: 0 0 18px 18px; flex: none; }
.modal-rodape .btn { min-width: 110px; }
.fechar { background: none; border: none; color: var(--texto2); cursor: pointer; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.fechar:hover { background: var(--superficie3); color: var(--texto); }
@media (max-width: 640px) { .fundo-modal { padding: 8px; align-items: flex-end; } .modal-cab, .modal-corpo, .modal-rodape { padding-left: 16px; padding-right: 16px; } }

/* ---------- toasts */
.toasts { position: fixed; top: 20px; right: 20px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; z-index: 99; pointer-events: none; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-radius: 12px; background: #fff; color: #1f2937; box-shadow: var(--sombra-g); font-weight: 550; font-size: 14.5px; max-width: 420px; pointer-events: auto; animation: entra .2s ease; }
.toast .ic { color: #16a34a; width: 22px; height: 22px; }
.toast.erro .ic { color: #dc2626; }
.toast.sai { opacity: 0; transform: translateY(-6px); transition: opacity .2s, transform .2s; }

/* ---------- login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: radial-gradient(900px 500px at 50% -10%, var(--ac-suave), transparent 70%), var(--fundo); }
.login-card { position: relative; width: 100%; max-width: 390px; display: flex; flex-direction: column; gap: 14px; background: var(--superficie); border: 1px solid var(--borda); border-radius: 20px; padding: 32px 28px 24px; box-shadow: var(--sombra-g); }
.logo-grande { justify-content: center; flex-direction: column; text-align: center; gap: 12px; }
.logo-grande > div { align-items: center; }
.logo-grande .logo-marca { width: 54px; height: 54px; border-radius: 15px; }
.logo-grande .logo-nome { font-size: 22px; }
.login-sub { text-align: center; margin: -4px 0 6px; }
.login-tema { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; }
.erro-login { color: var(--vermelho-txt); text-align: center; min-height: 20px; font-size: 13px; font-weight: 600; }

/* ---------- dashboard / KPIs / graficos */
.db { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.db-topo { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.db-topo h2 { margin: 0; font-size: 24px; font-weight: 780; letter-spacing: -.02em; }
.vivo { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--texto2); }
.vivo i { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: pulso 2s infinite; }
@keyframes pulso { 70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kpi { position: relative; display: flex; justify-content: space-between; gap: 12px; padding: 18px; border-radius: 16px; border: 1px solid var(--borda); background: linear-gradient(160deg, var(--superficie2), var(--superficie) 70%); box-shadow: var(--sombra); min-width: 0; min-height: 112px; text-decoration: none; color: inherit; transition: transform .18s, border-color .18s; }
a.kpi:hover { transform: translateY(-2px); border-color: var(--kc, var(--ac)); }
.kpi .k-txt { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.kpi .k-rot { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--texto3); }
.kpi b { font-size: 30px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi small { font-size: 12.5px; color: var(--texto3); }
.kpi .k-ico { flex: none; width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; background: var(--kc, var(--ac)); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--kc, var(--ac)) 40%, transparent); }
.kpi .k-ico .ic { width: 24px; height: 24px; }
.kpi .k-ponto { position: absolute; top: 14px; right: 14px; width: 9px; height: 9px; border-radius: 50%; background: #22c55e; }
.saude-g { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.medidor { border: 1px solid var(--borda); background: var(--superficie2); border-radius: 14px; padding: 16px 18px; }
.medidor .m-cab { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; color: var(--texto2); font-weight: 600; text-transform: uppercase; font-size: 13px; letter-spacing: .03em; }
.medidor .m-cab span { display: flex; align-items: center; gap: 8px; }
.medidor .m-cab b { font-size: 24px; color: var(--verde-txt); letter-spacing: -.01em; text-transform: none; }
.medidor.alto .m-cab b { color: var(--amarelo-txt); } .medidor.critico .m-cab b { color: var(--vermelho-txt); }
.barra { height: 9px; border-radius: 99px; background: var(--superficie3); overflow: hidden; }
.barra > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #16a34a, #4ade80); transition: width .6s ease; }
.medidor.alto .barra > i { background: linear-gradient(90deg, #ca8a04, #facc15); } .medidor.critico .barra > i { background: linear-gradient(90deg, #b91c1c, #f87171); }
.svg-g { width: 100%; height: auto; display: block; overflow: visible; }
.svg-g text { fill: var(--texto3); font-size: 10.5px; font-family: inherit; }
.svg-g .grade { stroke: var(--borda); stroke-width: 1; stroke-dasharray: 3 4; }
.svg-g .barra-g { transition: opacity .15s; } .svg-g .barra-g:hover { opacity: .7; }
.svg-g .ponto-h { opacity: 0; } .svg-g .alvo:hover + .ponto-h, .svg-g .alvo:hover ~ .ponto-h { opacity: 1; }
.donut { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: center; }
.donut svg { width: 170px; height: 170px; flex: none; }
.leg { display: flex; flex-direction: column; gap: 9px; font-size: 13px; min-width: 0; }
.leg div { display: flex; align-items: center; gap: 9px; }
.leg i { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.leg b { font-variant-numeric: tabular-nums; margin-left: auto; padding-left: 14px; }
.leg-h { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; font-size: 13px; color: var(--texto2); margin-top: 10px; }
.leg-h span { display: inline-flex; align-items: center; gap: 6px; }
.leg-h i { width: 10px; height: 10px; border-radius: 50%; }
.st-grade { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.st-box { border-radius: 14px; padding: 18px 12px; text-align: center; border: 1px solid var(--borda); }
.st-box b { display: block; font-size: 30px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.st-box span { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.st-box.ok { background: var(--verde-suave); color: var(--verde-txt); } .st-box.er { background: var(--vermelho-suave); color: var(--vermelho-txt); }
.st-box.av { background: var(--amarelo-suave); color: var(--amarelo-txt); } .st-box.ne { background: var(--cinza-suave); color: var(--texto3); }
.servicos { display: flex; flex-wrap: wrap; gap: 10px; }
.servico { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 10px; font-weight: 650; border: 1px solid; }
.servico.ok { background: var(--verde-suave); color: var(--verde-txt); border-color: rgba(34, 197, 94, .3); }
.servico.er { background: var(--vermelho-suave); color: var(--vermelho-txt); border-color: rgba(239, 68, 68, .3); }
.ranking { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; }
.ranking li { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--borda); font-size: 13.5px; }
.ranking li:last-child { border-bottom: 0; }
.ranking .pos { width: 22px; color: var(--texto3); text-align: right; font-variant-numeric: tabular-nums; }
.ranking .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.ranking .vl { font-variant-numeric: tabular-nums; color: var(--texto2); }
.tier-g { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.tier-rec { border-radius: 14px; padding: 18px; background: linear-gradient(160deg, #475569, #334155); color: #fff; }
html[data-tema="claro"] .tier-rec { background: linear-gradient(160deg, #e2e8f0, #cbd5e1); color: #0f172a; }
.tier-rec h4 { margin: 4px 0 8px; font-size: 21px; color: inherit; }
.tier-rec p { font-size: 13px; opacity: .85; margin: 0 0 12px; }
.mini-rot { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--texto3); margin-bottom: 8px; }
.tier-rec .mini-rot { color: inherit; opacity: .75; }

/* ---------- cards de entidade (planos, bouquets, mensagens) */
.ent { border: 1px solid var(--borda); background: var(--superficie); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--sombra); min-width: 0; }
.ent-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ent-cab h4 { margin: 0; font-size: 16px; font-weight: 720; }
.ent-info { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; font-size: 13.5px; color: var(--texto2); }
.ent-info span { display: flex; align-items: center; gap: 7px; min-width: 0; }
.ent-info .ic { width: 15px; height: 15px; color: var(--texto3); }
.ent-pe { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--borda); padding-top: 10px; margin-top: auto; }
.ent-ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--ac-suave); color: var(--ac-txt); }
.lista-mini { max-height: 150px; overflow-y: auto; font-size: 13.5px; }
.lista-mini div { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.lista-mini span:last-child { color: var(--texto3); font-variant-numeric: tabular-nums; }
.msg-prev { background: var(--campo); border-radius: 10px; padding: 12px; font: 12.5px/1.55 ui-monospace, Consolas, monospace; color: var(--verde-txt); white-space: pre-wrap; max-height: 130px; overflow: hidden; }
.vars { display: flex; flex-wrap: wrap; gap: 6px; }
.vars button { font: 12px ui-monospace, Consolas, monospace; padding: 5px 9px; border-radius: 8px; border: 1px solid var(--borda-forte); background: var(--superficie2); color: var(--texto2); cursor: pointer; }
.vars button:hover { border-color: var(--ac); color: var(--ac-txt); }
.resultado-tmdb { display: flex; gap: 12px; padding: 10px; border-radius: 12px; border: 1px solid var(--borda); background: var(--superficie2); cursor: pointer; margin-bottom: 8px; }
.resultado-tmdb:hover { border-color: var(--ac); }
.resultado-tmdb img, .resultado-tmdb .sem { width: 54px; height: 80px; border-radius: 6px; object-fit: cover; background: var(--superficie3); flex: none; }
.resultado-tmdb p { margin: 4px 0 0; font-size: 12.5px; color: var(--texto3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.canal-card { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--borda); border-radius: 12px; background: var(--superficie); }
.canal-card img, .canal-card .sem { width: 46px; height: 46px; border-radius: 8px; object-fit: contain; background: var(--superficie3); flex: none; }
.cred { display: flex; flex-direction: column; gap: 8px; }

/* ================= padrao visual PLAYTOP / pulsasync ================= */
.lateral { background: var(--superficie); padding: 24px 16px; gap: 24px; }
.logo { gap: 10px; padding: 0 8px; }
.logo > div { flex-direction: row; align-items: baseline; gap: 6px; }
.logo-nome { font-size: 16px; font-weight: 800; letter-spacing: .02em; }
.logo-sub { font-size: 16px; font-weight: 800; letter-spacing: .02em; color: var(--ac-txt); }
.logo-marca { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #8b5cf6, #6d28d9); box-shadow: 0 4px 12px rgba(124, 58, 237, .35); }
.logo-grande > div { flex-direction: row; justify-content: center; }
.logo-grande .logo-nome, .logo-grande .logo-sub { font-size: 20px; }
.menu { gap: 4px; }
.menu a { padding: 10px 12px; gap: 10px; }
.menu a.ativo .ic { color: var(--ac-txt); }
.lateral-pe { display: none; }
.topo-usuario { display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; height: 38px; border: 1px solid var(--borda); border-radius: 10px; background: var(--superficie); font-weight: 600; font-size: 13.5px; }
.topo-usuario small { color: var(--texto3); font-weight: 500; }
.tela { padding: 24px; max-width: 1440px; }

/* botoes: roxo solido como o pulsasync */
.btn-azul, .btn-roxo { background: var(--ac); box-shadow: 0 1px 2px rgba(124, 58, 237, .3); }
.btn-azul:hover, .btn-roxo:hover { background: var(--ac-hover); filter: none; }
.btn-verde { background: var(--verde); } .btn-amarelo { background: #f59e0b; color: #231300; } .btn-laranja { background: var(--laranja); }
.btn-sm.btn-azul, .btn-sm.btn-roxo { background: var(--ac-suave); color: var(--ac-txt); box-shadow: none; }

/* filtros: abas segmentadas */
.pilulas { display: inline-flex; gap: 2px; padding: 3px; background: var(--superficie3); border-radius: 11px; max-width: 100%; overflow-x: auto; }
.pilula { background: none; border-radius: 8px; padding: 7px 13px; font-size: 13.5px; }
.pilula.ativa { background: var(--superficie); color: var(--texto); box-shadow: var(--sombra); }
.pilula span { display: inline-block; padding: 0 7px; border-radius: 20px; background: var(--borda); color: var(--texto2); font-size: 11.5px; font-weight: 700; line-height: 18px; opacity: 1; }
.pilula.ativa span { background: var(--ac-suave); color: var(--ac-txt); }
.sep-v { align-self: center; }

/* KPIs: icone quadrado a esquerda, numero grande, rotulo e detalhe embaixo */
.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 12px; padding: 16px; min-height: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--kc, var(--ac)) 16%, var(--superficie)), var(--superficie) 70%); }
a.kpi:hover { box-shadow: 0 8px 22px rgba(0, 0, 0, .12); }
.kpi .k-ico { width: 42px; height: 42px; border-radius: 12px; box-shadow: none; }
.kpi .k-ico .ic { width: 21px; height: 21px; }
.kpi .k-txt { gap: 0; }
.kpi b { order: 1; font-size: 26px; font-weight: 780; line-height: 1.1; }
.kpi .k-rot { order: 2; text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 500; color: var(--texto2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi small { order: 3; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .k-ponto { top: 10px; right: 10px; width: 8px; height: 8px; }
@media (max-width: 520px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi b { font-size: 22px; } .kpi { padding: 12px; gap: 9px; } .kpi .k-ico { width: 34px; height: 34px; } }

/* cards do dashboard com o mesmo degrade */
.card { background: linear-gradient(180deg, var(--superficie), var(--superficie2)); }
.card h3 { font-size: 14.5px; }
.db-topo h2, .cab h2 { font-size: 22px; }

/* toasts escuros no canto inferior direito */
.toasts { top: auto; bottom: 20px; }
.toast { background: var(--toast); color: var(--toast-txt); border-left: 4px solid #22c55e; font-size: 14px; padding: 12px 16px; }
.toast .ic { color: #4ade80; width: 18px; height: 18px; }
.toast.erro { border-left-color: #ef4444; }
.toast.erro .ic { color: #f87171; }
.login { background: radial-gradient(1000px 500px at 50% -10%, var(--ac-suave), transparent 70%), var(--fundo); }

/* rodape do menu (avatar, usuario, sino, sair) como o MasterX */
.lateral-pe { display: flex; align-items: center; gap: 10px; padding: 12px 6px 0; border-top: 1px solid var(--borda); }
.lateral-pe .btn-icone-sm { border: 0; background: none; width: 32px; height: 32px; }
.lateral-pe .btn-icone-sm:hover { background: var(--superficie3); }
.sino { position: relative; }
.sino i { position: absolute; top: -2px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #ef4444; color: #fff; font: 700 10px/18px system-ui, sans-serif; font-style: normal; text-align: center; box-shadow: 0 0 0 2px var(--superficie); }
.sino span .ic { width: 18px; height: 18px; }
.tipo-imp.on { border-color: var(--ac); color: var(--ac-txt); background: var(--ac-suave); }
.limpar .switch.on i { background: var(--vermelho); }
