/* =====================================================================
   Monitor TTW Group — complementos ao Tabler (assets/vendor/tabler)
   Só o que o Tabler não traz: logos por tema, ranking com barras,
   gráfico de colunas, ordenação de tabela e detalhes da tela de login.
   ===================================================================== */

/* ---- Logos claro/escuro (segue o data-bs-theme do Tabler) */
.logo-dark { display: none !important; }
[data-bs-theme="dark"] .logo-light { display: none !important; }
[data-bs-theme="dark"] .logo-dark { display: inline-block !important; }
.brand-logo { height: 38px; width: auto; }
.brand-sep { border-right: 1px solid var(--tblr-border-color); }
@media (max-width: 767.98px) { .brand-logo { height: 30px; } .brand-sep { border-right: 0; } }

/* ---- Botão de tema */
#theme-toggle { background: none; border: 0; color: var(--tblr-secondary); cursor: pointer; }
#theme-toggle:hover { color: var(--tblr-body-color); }
.theme-light-icon { display: none; }
[data-bs-theme="dark"] .theme-light-icon { display: inline-block; }
[data-bs-theme="dark"] .theme-dark-icon { display: none; }

/* ---- Logo Smartlink (arquivo pequeno com fundo branco) */
.sl-logo { height: 15px; width: auto; display: inline-block; }
[data-bs-theme="dark"] .sl-logo { background: #fff; padding: 4px 7px; border-radius: 5px; box-sizing: content-box; }

/* ---- Cards de status */
.status-card { cursor: pointer; transition: box-shadow .15s, transform .15s; }
.status-card:hover { box-shadow: var(--tblr-shadow-card-hover, 0 4px 16px rgba(0,0,0,.08)); }
.status-card.active-tab { outline: 2px solid var(--tblr-primary); outline-offset: -1px; }
.status-card.is-stale { opacity: .65; }
.status-card .datagrid { --tblr-datagrid-padding: .75rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.status-card .datagrid-content { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.status-card .datagrid-title { text-transform: none; letter-spacing: 0; font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.min-w-0 { min-width: 0; }
.kpi .text-secondary { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Abas principais */
.nav-tabs-main .nav-link { font-weight: 600; }
.nav-tabs-main .status-dot { width: .5rem; height: .5rem; }

/* ---- Ranking com barra (tráfego) */
.rank-list .rank { padding: .45rem .25rem; border-radius: var(--tblr-border-radius); }
.rank-list .rank + .rank { border-top: 1px solid var(--tblr-border-color-translucent, var(--tblr-border-color)); }
.rank-list .rank .top { display: flex; justify-content: space-between; gap: .75rem; font-size: .875rem; }
.rank-list .rank .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.rank-list .rank .val { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.rank-list .rank .sub { font-size: .75rem; color: var(--tblr-secondary); margin-top: .15rem; }
.rank-list .rank .progress { margin-top: .35rem; height: .375rem; }
.rank-list.clickable .rank { cursor: pointer; }
.rank-list.clickable .rank:hover { background: var(--tblr-bg-surface-secondary); }
.rank-list .rank.open { background: var(--tblr-primary-lt); }
.rank-list .detail { margin: .25rem 0 .5rem 1rem; padding-left: .75rem; border-left: 2px solid var(--tblr-teal); }
.rank-list .detail .progress-bar { background-color: var(--tblr-teal) !important; }
.rank-list .empty { color: var(--tblr-secondary); font-size: .875rem; padding: .5rem .25rem; }

/* ---- Gráfico de colunas (telefonia) */
.vbars-wrap { padding-bottom: 22px; overflow-x: auto; }
.vbars { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding-top: 6px; border-bottom: 1px solid var(--tblr-border-color); }
.vbars .col { flex: 1 1 0; max-width: 46px; min-width: 6px; display: flex; flex-direction: column; justify-content: flex-end;
  gap: 1px; position: relative; height: 100%; }
.vbars .col:hover { background: var(--tblr-bg-surface-secondary); border-radius: 3px; }
.vbars .seg { border-radius: 2px; }
.vbars .seg.ans { background: var(--tblr-success); } .vbars .seg.miss { background: var(--tblr-danger); }
.vbars .seg.out { background: var(--tblr-primary); opacity: .75; }
.vbars .lbl { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--tblr-secondary); white-space: nowrap; }
.legend { display: inline-block; width: .65rem; height: .65rem; border-radius: 2px; vertical-align: middle; }

/* ---- Tabelas */
table.sortable th[data-k] { cursor: pointer; user-select: none; white-space: nowrap; }
table.sortable th.sorted::after { content: ' ▾'; } table.sortable th.sorted.asc::after { content: ' ▴'; }
.table tr.clickable { cursor: pointer; }
.table tr.selected > td { background: var(--tblr-primary-lt); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.miss { color: var(--tblr-danger); font-weight: 600; }

/* ---- Indicadores de telefonia */
.kpi .h1 { font-variant-numeric: tabular-nums; }

/* ---- Detalhes (3CX / Acronis) */
.kv { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 0; font-size: .875rem; }
.kv dt { color: var(--tblr-secondary); font-weight: 400; }
.kv dd { margin: 0; font-weight: 500; }

/* ---- Tela de login */
.login-logo { height: 56px; width: auto; }

/* ---- Aba Segurança: cards que filtram */
.sec-tile, .sec-cat { cursor: pointer; transition: box-shadow .15s; }
.sec-tile:hover, .sec-cat:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.sec-tile.active, .sec-cat.active { outline: 2px solid var(--tblr-primary); outline-offset: -1px; background: var(--tblr-primary-lt); }
#sec-list { max-height: 560px; overflow: auto; }
#sec-list thead th { position: sticky; top: 0; z-index: 1; background: var(--tblr-bg-surface-tertiary, var(--tblr-bg-surface)); }
