/* Portal ArkRoom — visual limpo: sem contornos, sombra suave e discreta (sem desfoque),
   vermelho Arklok como destaque. Nos dados: verde = ok, amarelo = atencao, vermelho = falha. */

:root {
  --brand: #d91a21;
  --brand-2: #ff4d55;
  --brand-deep: #a8141a;
  --brand-soft: rgba(217, 26, 33, .09);

  --ok: #12a46a;   --ok-soft: rgba(18, 164, 106, .12);
  --warn: #e08a00; --warn-soft: rgba(224, 138, 0, .13);
  --bad: #e5333b;  --bad-soft: rgba(229, 51, 59, .11);
  --info: #5b8dff; --info-soft: rgba(91, 141, 255, .12);

  --text: #14161b;
  --text-2: #5a606b;
  --text-3: #8b909b;
  --bg: #f4f5f9;
  --surface: #ffffff;
  --soft: #f3f5f9;
  --line: #eef0f4;

  --shadow: 0 1px 2px rgba(16, 18, 24, .05), 0 3px 10px rgba(16, 18, 24, .05);
  --shadow-hover: 0 2px 4px rgba(16, 18, 24, .06), 0 8px 18px rgba(16, 18, 24, .07);
  --radius: 20px;
  --font: "Plus Jakarta Sans", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); color: var(--text); font-size: 14px; line-height: 1.45; min-height: 100vh;
  background:
    radial-gradient(700px 420px at 8% -5%, rgba(255, 77, 85, .08), transparent 60%),
    radial-gradient(700px 500px at 105% 0%, rgba(91, 141, 255, .07), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
[hidden], .is-hidden { display: none !important; }
h1, h2, h3, p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; }
i[data-icon] svg, i[data-lucide] svg, svg.lucide { width: 18px; height: 18px; display: block; }

.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--surface); color: var(--brand); padding: 8px 12px; border-radius: 10px; z-index: 100; }
.skip-link:focus { left: 8px; }
.eyebrow { font-size: 11.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }

/* ==================== LOGIN ==================== */
.auth-gate {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(600px 400px at 20% 10%, rgba(255, 77, 85, .18), transparent 60%),
    radial-gradient(600px 400px at 85% 90%, rgba(91, 141, 255, .14), transparent 60%),
    var(--bg);
}
.auth-gate-card { width: min(420px, 100%); background: var(--surface); border-radius: 28px; box-shadow: var(--shadow); padding: 32px; display: flex; flex-direction: column; gap: 10px; text-align: center; }
.auth-gate-card .marca { box-shadow: none; padding: 0 0 6px; }
.auth-gate-card .marca img { max-width: 180px; }
.auth-gate-card h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.auth-gate-card p:not(.eyebrow) { color: var(--text-2); }
.auth-gate-button { margin-top: 8px; border: 0; border-radius: 14px; padding: 13px 16px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand-2), var(--brand) 60%); box-shadow: 0 6px 16px rgba(217, 26, 33, .25); }
.auth-gate-button:hover { filter: brightness(1.05); }
.auth-gate small { color: var(--text-3); font-size: 12px; }

/* ==================== ESTRUTURA ==================== */
.portal-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; align-items: start; }
.portal-shell.is-loading .main-area { opacity: .6; }

.menu { position: sticky; top: 0; height: 100vh; background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; padding: 20px 16px; z-index: 10; }
.marca { background: var(--surface); border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow); }
.marca img { width: 100%; max-width: 160px; display: block; margin: 0 auto; }
.menu-produto { text-align: center; font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin: 10px 0 20px; }
.menu nav { display: flex; flex-direction: column; gap: 4px; }
.menu-link { text-decoration: none; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text-2); font-weight: 700; transition: background .15s, color .15s; }
.menu-link:hover { background: var(--soft); color: var(--text); }
.menu-link.active { color: #fff; background: linear-gradient(135deg, var(--brand-2), var(--brand) 60%); box-shadow: 0 6px 16px rgba(217, 26, 33, .25); }
.menu-rodape { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 16px; background: var(--soft); }
.menu-usuario { display: flex; align-items: center; gap: 10px; min-width: 0; }
.menu-usuario img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--surface); flex: none; }
.menu-usuario div { min-width: 0; display: flex; flex-direction: column; }
.menu-usuario strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-usuario span { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-sair { border: 0; background: var(--surface); box-shadow: var(--shadow); border-radius: 10px; padding: 7px 10px; font-weight: 700; font-size: 13px; color: var(--text-2); }
.menu-sair:hover { color: var(--brand); }

.main-area { min-width: 0; padding: 26px 32px 48px; }

/* cabeçalho da página */
.topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.topo h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.topo .sub { margin-top: 4px; color: var(--text-2); font-size: 13.5px; max-width: 680px; }
.topo-acoes { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.selo-data { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.selo-data strong { color: var(--text); font-weight: 800; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; animation: ping 1.8s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(18, 164, 106, .5); } 80%, 100% { box-shadow: 0 0 0 8px rgba(18, 164, 106, 0); } }
.topo-botao { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; border: 0; background: var(--surface); box-shadow: var(--shadow); color: var(--text-2); }
.topo-botao:hover { color: var(--brand); box-shadow: var(--shadow-hover); }

/* filtros */
.filtros { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 18px; }
.filtro-campo { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 700; color: var(--text-3); min-width: 150px; }
.filtro-busca { flex: 1; min-width: 220px; }
.filtro-campo input, .filtro-campo select { background: var(--soft); border: 0; border-radius: 10px; padding: 9px 12px; font-size: 13.5px; color: var(--text); font-weight: 500; }
.filtro-campo input:focus, .filtro-campo select:focus { outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.limpar { margin-left: auto; background: none; border: 0; color: var(--brand); font-weight: 800; padding: 9px 4px; }
.filtros-nota { flex-basis: 100%; font-size: 12px; color: var(--text-3); }

/* ==================== NÚMEROS ==================== */
.kpis { display: grid; grid-template-columns: 1.3fr repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpis-4 { grid-template-columns: 1.3fr repeat(3, minmax(0, 1fr)); }
.kpis-3 { grid-template-columns: 1.3fr repeat(2, minmax(0, 1fr)); }
.kpis-iguais { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { position: relative; overflow: hidden; background: var(--surface); border: 0; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; text-align: left; min-width: 0; transition: box-shadow .15s; }
.kpi .rotulo { color: var(--text-2); font-size: 13px; font-weight: 700; display: flex; gap: 10px; align-items: center; }
.icone-kpi { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.kpi.tom-ok .icone-kpi { background: var(--ok-soft); color: var(--ok); }
.kpi.tom-warn .icone-kpi { background: var(--warn-soft); color: var(--warn); }
.kpi.tom-bad .icone-kpi { background: var(--bad-soft); color: var(--bad); }
.kpi.tom-info .icone-kpi { background: var(--info-soft); color: var(--info); }
.kpi .valor { font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin-top: auto; font-variant-numeric: tabular-nums; }
.kpi .valor-texto { font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .detalhe { font-size: 12.5px; color: var(--text-3); }
.kpi-barra { background: var(--soft); border-radius: 6px; height: 6px; overflow: hidden; }
.kpi-barra span { display: block; height: 100%; width: 8%; border-radius: 6px; background: var(--brand); transition: width .4s ease; }
.kpi.tom-ok .kpi-barra span { background: var(--ok); }
.kpi.tom-warn .kpi-barra span { background: var(--warn); }
.kpi.tom-bad .kpi-barra span { background: var(--bad); }
.kpi.tom-info .kpi-barra span { background: var(--info); }
/* destaque em degradê vermelho */
.kpi.principal { color: #fff; background: linear-gradient(135deg, var(--brand-2) 0%, var(--brand) 45%, var(--brand-deep) 100%); box-shadow: 0 8px 20px rgba(217, 26, 33, .22); }
.kpi.principal::after { content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%; right: -70px; top: -90px; background: rgba(255, 255, 255, .10); pointer-events: none; }
.kpi.principal .rotulo, .kpi.principal .detalhe { color: rgba(255, 255, 255, .85); }
.kpi.principal .valor { font-size: 38px; }
.kpi.principal .icone-kpi { background: rgba(255, 255, 255, .18); color: #fff; }
.kpi.principal .kpi-barra { background: rgba(255, 255, 255, .2); }
.kpi.principal .kpi-barra span { background: #fff; }
.kpi-filtro { cursor: pointer; font: inherit; color: inherit; }
.kpi-filtro:hover { box-shadow: var(--shadow-hover); }
.kpi-filtro.is-selected { background: linear-gradient(160deg, #ffffff 30%, #ffeef0 100%); }
.kpi-filtro.is-selected .valor { color: var(--brand); }

/* ==================== CARDS ==================== */
.grade { display: grid; gap: 16px; margin-bottom: 18px; }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; min-width: 0; }
.card h2 { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.card .nota { color: var(--text-3); font-size: 12.5px; margin: 3px 0 16px; }
.card-cabecalho { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.acoes { display: flex; gap: 8px; flex-wrap: wrap; }
.acoes-form { justify-content: flex-end; margin-top: 20px; }

/* botões */
.botao, .ghost-button { border: 0; border-radius: 12px; padding: 9px 16px; font-weight: 800; font-size: 13px; white-space: nowrap; color: #fff; background: linear-gradient(135deg, var(--brand-2), var(--brand) 60%); box-shadow: 0 4px 12px rgba(217, 26, 33, .22); }
.botao:hover, .ghost-button:hover { filter: brightness(1.05); }
.botao.secundario, .ghost-button.soft { background: var(--soft); color: var(--text); box-shadow: none; }
.botao.secundario:hover, .ghost-button.soft:hover { background: #e9ecf2; filter: none; }

/* ==================== TABELAS ==================== */
.table-wrap { overflow-x: auto; }
.tabela { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tabela th { background: var(--soft); color: var(--text-3); font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; text-align: left; padding: 11px 12px; white-space: nowrap; }
.tabela th:first-child { border-radius: 12px 0 0 12px; }
.tabela th:last-child { border-radius: 0 12px 12px 0; }
.tabela td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tabela tbody tr:last-child td { border-bottom: 0; }
.tabela tbody tr:hover td { background: #fafbfd; }
.tabela .num { text-align: right; font-variant-numeric: tabular-nums; }
.empty-state-row td { text-align: center; color: var(--text-3); padding: 22px; }
.log-cell-title { display: block; font-weight: 700; }
.log-cell-meta { display: block; color: var(--text-3); font-size: 11.5px; }
.log-time-grid { display: flex; flex-direction: column; gap: 2px; white-space: nowrap; }
.log-time-grid small { display: inline-block; min-width: 82px; color: var(--text-3); font-size: 11.5px; }
.logs-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.logs-footer .nota { margin: 0; }
.logs-pagination { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.logs-page-size { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.logs-page-size select { border: 0; background: var(--soft); border-radius: 10px; padding: 6px 10px; }
.logs-page-info { font-size: 12px; color: var(--text-2); }

/* selos */
.badge, .selo { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 4px 10px; font-size: 11.5px; font-weight: 800; white-space: nowrap; background: var(--soft); color: var(--text-2); }
.badge.success { background: var(--ok-soft); color: var(--ok); }
.badge.warning { background: var(--warn-soft); color: var(--warn); }
.badge.error, .badge.danger { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.success-text { color: var(--ok); }
.warning-text { color: var(--warn); }
.error-text { color: var(--bad); }

/* ==================== API/STATUS ==================== */
.legenda { display: flex; gap: 14px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.ponto { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.ponto-1 { background: var(--brand); }
.ponto-3 { background: var(--info); }
.chart-stage { position: relative; }
#healthChart { width: 100%; height: 260px; display: block; }
.chart-tooltip { position: absolute; pointer-events: none; background: var(--text); color: #fff; border-radius: 10px; padding: 8px 10px; font-size: 12px; box-shadow: var(--shadow); z-index: 5; white-space: nowrap; }
.api-health-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.api-health-hero strong { display: block; font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.api-health-hero small { color: var(--text-3); font-size: 12px; }
.api-health-mini-chart, .mini-users-chart { display: flex; align-items: flex-end; gap: 5px; min-height: 64px; }
.api-health-bar, .mini-users-bar { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.api-health-bar span, .mini-users-bar span { width: 100%; max-width: 18px; background: #dfe3ec; border-radius: 6px; display: block; }
.api-health-bar:last-child span, .mini-users-bar:first-child span { background: linear-gradient(180deg, var(--brand-2), var(--brand)); }
.api-health-bar small, .mini-users-bar small { font-size: 10px; color: var(--text-3); white-space: nowrap; }
.api-health-bar small { display: none; }
.stat-stack { display: flex; flex-direction: column; }
.stack-row { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.stack-row:last-child { border-bottom: 0; }
.stack-row span { color: var(--text-2); }
.stack-row strong { font-variant-numeric: tabular-nums; }

/* ==================== REUNIÕES ==================== */
.room-drilldown-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.room-drilldown-stat { background: var(--soft); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.room-drilldown-stat span { font-size: 12px; color: var(--text-2); }
.room-drilldown-stat strong { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.room-drilldown-activity { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.room-drilldown-card { background: var(--soft); border-radius: 14px; padding: 12px 14px; }
.room-drilldown-card strong { display: block; font-size: 13px; }
.room-drilldown-card p { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.ranking-list { display: flex; flex-direction: column; gap: 4px; }
.ranking-button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; background: transparent; border: 0; text-align: left; }
.ranking-button:hover { background: var(--soft); }
.ranking-button.is-active { background: var(--brand-soft); }
.ranking-badge { width: 28px; height: 28px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 12px; background: var(--soft); color: var(--text-2); flex: none; }
.ranking-badge.rank-1 { background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff; }
.ranking-badge.rank-2, .ranking-badge.rank-3 { background: var(--brand-soft); color: var(--brand); }
.ranking-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ranking-meta span { font-size: 11.5px; color: var(--text-3); }
.ranking-meta strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranking-score { font-weight: 800; font-variant-numeric: tabular-nums; }

.user-highlight { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, rgba(255, 77, 85, .08), rgba(91, 141, 255, .06)); border-radius: 16px; padding: 12px 14px; margin-bottom: 12px; }
.top-user-photo { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: var(--surface); flex: none; }
.top-user-meta strong { display: block; font-size: 14px; }
.top-user-meta p { font-size: 12px; color: var(--text-3); }
.mini-users-chart { margin-bottom: 10px; }
.mini-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.mini-list li:last-child { border-bottom: 0; }
.mini-list-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mini-list-user strong { display: block; font-size: 13px; }
.mini-list-user span { display: block; font-size: 12px; color: var(--text-3); }
.top-users-list-photo { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--soft); flex: none; }

.activity-list { display: flex; flex-direction: column; gap: 8px; }
.activity-list li { display: block; position: relative; background: var(--soft); border-radius: 14px; padding: 10px 12px 10px 18px; font-size: 12.5px; color: var(--text-2); }
.activity-list li::before { content: ""; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 4px; border-radius: 4px; background: var(--text-3); }
.activity-list li[data-tone="success"]::before { background: var(--ok); }
.activity-list li[data-tone="warning"]::before { background: var(--warn); }
.activity-list li[data-tone="error"]::before { background: var(--bad); }
.activity-header { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 2px; }
.activity-header strong { color: var(--text); font-size: 13px; }
.activity-chip { font-size: 11px; font-weight: 800; color: var(--text-2); background: var(--surface); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.activity-room-button { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 700; }
.empty-state { color: var(--text-3); font-size: 13px; padding: 12px 0; }

/* ==================== TABLETS ==================== */
.devices-hero { display: flex; align-items: center; gap: 14px; }
.devices-hero strong { display: block; font-size: 22px; font-weight: 800; text-align: right; }
.devices-hero small { display: block; font-size: 12px; color: var(--text-3); }
.devices-donut { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; position: relative; flex: none; }
.devices-donut::before { content: ""; position: absolute; inset: 8px; background: var(--surface); border-radius: 50%; }
.devices-donut span { position: relative; font-weight: 800; font-size: 13px; }
.tablet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }

/* ==================== PLANTA VIVA (aba Salas) ==================== */
.vivo-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.vivo-chip { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.vivo-chip b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.vivo-chip span { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.vivo-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.vivo-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; margin-bottom: 18px; }
.vivo-mapa { position: relative; border-radius: var(--radius); overflow: hidden; background: linear-gradient(180deg, #eef1f8 0%, #e3e8f2 100%); box-shadow: var(--shadow); height: 640px; }
.vivo-mapa canvas { display: block; width: 100%; height: 100%; }
.vivo-dica, .vivo-tag, .vivo-legenda { position: absolute; padding: 8px 12px; border-radius: 12px; box-shadow: var(--shadow); font-size: 12px; font-weight: 600; }
.vivo-dica { left: 16px; top: 14px; background: var(--surface); color: var(--text-2); }
.vivo-tag { right: 16px; top: 14px; background: #fff4e0; color: #a35f00; font-weight: 700; }
.vivo-legenda { left: 16px; bottom: 14px; background: var(--surface); color: var(--text-2); display: flex; gap: 12px; flex-wrap: wrap; }
.vivo-legenda span { display: inline-flex; align-items: center; gap: 6px; }
.vivo-lado { display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.vivo-detalhe .tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.vivo-detalhe .nome { margin: 8px 0 2px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.vivo-detalhe .local { color: var(--text-3); font-size: 12.5px; }
.vivo-grid { display: grid; grid-template-columns: auto 1fr; gap: 10px; margin-top: 14px; }
.vivo-equip { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.vivo-equip i { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
.vivo-equip svg { width: 17px; height: 17px; }
.vivo-caixa { padding: 10px 12px; border-radius: 14px; background: var(--soft); }
.vivo-caixa span { display: block; font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.vivo-caixa strong { font-size: 13.5px; }
.vivo-reuniao { margin-top: 12px; padding: 12px; border-radius: 14px; background: linear-gradient(135deg, rgba(255, 77, 85, .07), rgba(91, 141, 255, .06)); }
.vivo-reuniao span { font-size: 11.5px; color: var(--text-3); }
.vivo-reuniao strong { display: block; margin-top: 2px; font-size: 13.5px; }
.vivo-feed { flex: 1; overflow: hidden; display: flex; flex-direction: column; max-height: 400px; }
.vivo-feed-lista { display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.vivo-ev { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: var(--soft); animation: vivo-entra .4s ease; }
.vivo-ev i { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-style: normal; font-size: 15px; flex: none; }
.vivo-ev strong { display: block; font-size: 13px; }
.vivo-ev span { font-size: 12px; color: var(--text-3); }
@keyframes vivo-entra { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ==================== MODAIS ==================== */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20, 22, 30, .35); display: grid; place-items: center; padding: 20px; z-index: 50; }
.modal-card { position: relative; width: min(520px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); border-radius: 24px; box-shadow: 0 10px 30px rgba(16, 18, 24, .16); padding: 24px; }
.modal-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 10px; border: 0; background: var(--soft); display: grid; place-items: center; color: var(--text-2); }
.modal-close:hover { color: var(--brand); }
.modal-cabecalho { display: flex; gap: 12px; align-items: flex-start; margin: 0 40px 18px 0; }
.modal-cabecalho h3 { font-size: 19px; font-weight: 800; margin: 2px 0; letter-spacing: -.01em; }
.modal-cabecalho span:not(.icone-kpi) { font-size: 12.5px; color: var(--text-3); }
.modal-device-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.modal-detail-card { position: relative; background: var(--soft); border-radius: 14px; padding: 12px 14px 12px 18px; display: flex; flex-direction: column; gap: 2px; }
.modal-detail-card::before { content: ""; position: absolute; left: 7px; top: 12px; bottom: 12px; width: 4px; border-radius: 4px; background: var(--text-3); }
.modal-detail-card[data-tone="success"]::before { background: var(--ok); }
.modal-detail-card[data-tone="warning"]::before { background: var(--warn); }
.modal-detail-card[data-tone="error"]::before { background: var(--bad); }
.modal-detail-card span { font-size: 12px; color: var(--text-2); }
.modal-detail-card strong { font-size: 15px; }

/* formulários */
.campo { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--text-2); margin-top: 12px; }
.campo:first-of-type { margin-top: 0; }
.campo input { border: 0; background: var(--soft); border-radius: 12px; padding: 11px 13px; font-size: 14px; font-weight: 500; color: var(--text); }
.campo input:focus { outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.campo input[readonly] { color: var(--text-3); }
.room-equipments { border: 0; background: var(--soft); border-radius: 14px; margin: 14px 0 0; padding: 12px 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.room-equipments legend { float: left; width: 100%; padding: 0; margin-bottom: 4px; font-size: 12.5px; font-weight: 700; color: var(--text-2); grid-column: 1 / -1; }
.check-option { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); cursor: pointer; }
.check-option input { width: 17px; height: 17px; accent-color: var(--brand); flex: none; }
.room-active { margin-top: 14px; }
.aviso-form { margin-top: 10px; background: var(--warn-soft); color: #a35f00; border-radius: 12px; padding: 9px 12px; font-size: 12.5px; font-weight: 600; }
.erro-form { margin-top: 10px; background: var(--bad-soft); color: var(--bad); border-radius: 12px; padding: 9px 12px; font-size: 12.5px; font-weight: 700; }

/* ==================== RESPONSIVO ==================== */
@media (max-width: 1250px) {
  .vivo-layout { grid-template-columns: 1fr; }
}
@media (max-width: 1180px) {
  .portal-shell { grid-template-columns: 84px 1fr; }
  .menu-link span, .menu-produto, .menu-usuario div, .menu-sair { display: none; }
  .menu-link { justify-content: center; }
  .marca { padding: 8px; }
  .menu-rodape { padding: 8px; align-items: center; }
  .kpis, .kpis-4, .kpis-3, .kpis-iguais { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi.principal { grid-column: 1 / -1; }
  .g-2-1, .g-3 { grid-template-columns: 1fr; }
  .room-drilldown-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .main-area { padding: 16px 14px 32px; }
  .kpis, .kpis-4, .kpis-3, .kpis-iguais { grid-template-columns: 1fr; }
  .modal-device-body, .room-equipments { grid-template-columns: 1fr; }
  .vivo-mapa { height: 460px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* ---------- avatares com iniciais ---------- */
.avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-size: 12.5px; font-weight: 800; letter-spacing: .02em; box-shadow: 0 2px 6px rgba(16, 18, 24, .12); }
.avatar.grande { width: 50px; height: 50px; font-size: 17px; }
.mini-list-user .avatar { display: grid; color: #fff; font-size: 12.5px; font-weight: 800; }

/* ---------- cards de tablet ---------- */
.tablet-card { --tom: var(--text-3); --tom-a: #b9bec8; --tom-b: #8b909b; --tom-soft: var(--soft);
  position: relative; display: flex; flex-direction: column; gap: 14px; text-align: left; padding: 18px; border: 0; border-radius: 20px;
  background: var(--surface); box-shadow: var(--shadow); cursor: pointer; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease; font: inherit; color: inherit; }
.tablet-grupo { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 12px; margin-top: 10px; }
.tablet-grupo:first-child { margin-top: 0; }
.tablet-grupo h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; }
.tablet-grupo h3 span { min-width: 26px; padding: 2px 9px; border-radius: 999px; font-size: 12px; text-align: center; background: var(--ok-soft); color: var(--ok); }
.tablet-grupo[data-tone="error"] h3 span { background: var(--bad-soft); color: var(--bad); }
.tablet-grupo p { font-size: 12.5px; color: var(--text-3); }
.tablet-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(16, 18, 24, .06), 0 10px 22px rgba(16, 18, 24, .08); }
.tablet-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.tablet-card[data-tone="success"] { --tom: var(--ok); --tom-a: #2bd18f; --tom-b: #0c8a58; --tom-soft: var(--ok-soft); }
.tablet-card[data-tone="warning"] { --tom: var(--warn); --tom-a: #ffb444; --tom-b: #d07a00; --tom-soft: var(--warn-soft); }
.tablet-card[data-tone="error"] { --tom: var(--bad); --tom-a: #ff6a70; --tom-b: #c81f27; --tom-soft: var(--bad-soft); }
.tablet-card-top { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; }
.tablet-card-icon { width: 54px; height: 54px; border-radius: 16px; flex: none; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--tom-a), var(--tom-b)); box-shadow: 0 4px 12px color-mix(in srgb, var(--tom) 30%, transparent); }
.tablet-card-icon svg { width: 26px; height: 26px; }
.tablet-card-title { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; }
.tablet-card-title strong { font-size: 15.5px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tablet-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 800; color: var(--tom); background: var(--tom-soft); }
.tablet-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tablet-card[data-tone="success"] .tablet-pill::before { animation: pulso 2s infinite; }
@keyframes pulso { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 50%, transparent); } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.tablet-card-battery { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--soft); color: var(--text-3); }
.tablet-card-battery svg { width: 18px; height: 18px; flex: none; }
.tablet-card-battery b { font-size: 13px; font-weight: 800; color: var(--text); min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.tablet-battery { flex: 1; height: 7px; border-radius: 6px; background: #e1e5ec; overflow: hidden; }
.tablet-battery span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #2bd18f, var(--ok)); }
.tablet-card-battery[data-level="ok"] svg { color: var(--ok); }
.tablet-card-battery[data-level="low"] svg { color: var(--warn); }
.tablet-card-battery[data-level="low"] .tablet-battery span { background: linear-gradient(90deg, #ffb444, var(--warn)); }
.tablet-stats { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tablet-stat { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 14px; background: var(--soft); min-width: 0; }
.tablet-stat svg { width: 16px; height: 16px; color: var(--info); margin-bottom: 4px; }
.tablet-stat b { font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tablet-stat small { font-size: 11px; color: var(--text-3); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tablet-stat.ok svg { color: var(--ok); }
.tablet-stat.warn svg, .tablet-stat.warn b { color: var(--warn); }
.tablet-stat.bad svg, .tablet-stat.bad b { color: var(--bad); }

/* ---------- tabela de logs ---------- */
.tabela-logs td { padding: 14px 14px; vertical-align: middle; }
.tabela-logs th { padding: 11px 14px; }
.tabela-logs .log-quando strong { display: block; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tabela-logs .log-quando small { display: block; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.tabela-logs .log-sala, .tabela-logs .log-tablet, .tabela-logs td:nth-child(4), .tabela-logs td:last-child { white-space: nowrap; }
.tabela-logs td:nth-child(5), .tabela-logs td:nth-child(6) { min-width: 160px; max-width: 240px; }
.log-tablet-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 999px; background: var(--soft); font-size: 12px; font-weight: 600; color: var(--text-2); }
.log-tablet-chip svg { width: 14px; height: 14px; color: var(--info); }
.log-tablet-chip[data-tone="ok"] svg { color: var(--ok); }
.log-tablet-chip[data-tone="warn"] svg { color: var(--warn); }
.log-tablet-chip[data-tone="brand"] svg { color: var(--brand); }
.log-vazio { color: var(--text-3); }
.tabela-logs .log-time-grid { gap: 4px; }
.tabela-logs .log-time-grid span { display: flex; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; font-weight: 600; }
.tabela-logs .log-time-grid small { min-width: 62px; }
