/* =====================================================================
   NewOS Panel - folha de estilo (identidade NewIO)
   ---------------------------------------------------------------------
   Carregue DEPOIS de tokens.css (o arquivo de tokens do kit NewIO, sem
   alteracoes): todas as cores daqui sao as variaveis de la. Regras da
   casa seguidas:
     - use a variavel, nunca o hexadecimal solto
     - toda cor fixa tem o par no html.dark-mode
     - icones sao Bootstrap Icons: <i class="bi bi-nome"></i>
       (servidos localmente por vendor/bi.css, gerado no build)

   Estados (ok / aviso / erro) NUNCA aparecem so como cor: sempre junto
   do numero ou da palavra, para quem nao distingue as cores.
   ===================================================================== */

/* --- Fonte da interface, embutida (o servidor pode nao ter internet) --
   Inter vem do pacote fonts-inter-variable do Debian. O DM Sans dos
   titulos nao existe no Debian; a pilha do kit ja cai no Inter.       */
@font-face {
    font-family: "Inter";
    src: url("vendor/InterVariable.ttf") format("truetype");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --sidebar-w: 256px;
    --gap: 16px;

    /* Fundo da pagina: o degrade do app shell do kit. */
    --page-bg: linear-gradient(135deg, #e9eefb 0%, #f5f8fd 45%, #e7f8f6 100%);

    /* Paineis de vidro (sidebar e barra superior). */
    --glass-bg:     rgba(255, 255, 255, 0.55);
    --glass-border: rgba(255, 255, 255, 0.70);
    --glass-shadow: 0 12px 40px rgba(24, 59, 144, 0.10);

    /* Navegacao */
    --nav-text:   #5b6677;
    --nav-active: var(--brand-navy);
    --nav-label:  #b9c0cf;

    /* Campos de formulario */
    --input-bg:     #ffffff;
    --input-border: #dfe6f3;
    --input-text:   var(--brand-navy);
    --placeholder:  #aab2c5;

    /* Titulos */
    --title-color: var(--brand-navy);

    /* Trilho dos medidores */
    --track: var(--surface-suave);

    /* Botao principal */
    --btn-bg:   var(--brand-navy);
    --btn-text: #ffffff;
}

html.dark-mode {
    --page-bg: linear-gradient(135deg, #0d0f11 0%, #191d23 55%, #14201f 100%);
    --glass-bg:     rgba(25, 29, 35, 0.55);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    --nav-text:   #aab2c0;
    --nav-active: #ffffff;
    --nav-label:  #6b7480;
    --input-bg:     rgba(255, 255, 255, 0.04);
    --input-border: rgba(255, 255, 255, 0.12);
    --input-text:   var(--text-primary);
    --placeholder:  #6b7480;
    --title-color: #f4f7fe;
    --track: rgba(255, 255, 255, 0.08);
    --btn-bg:   var(--accent-teal);
    --btn-text: #062a2c;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
    font-family: var(--fonte-interface);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--page-bg);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

/* Link de TEXTO. Componentes que sao <a> (menu, botoes) definem a
   propria cor -- por isso o seletor e baixo de proposito (:where zera a
   especificidade): uma regra como "html.dark-mode a" venceria o .btn e
   deixava o botao "Nova conta" com texto teal sobre fundo teal. */
:where(a) { color: var(--brand-navy); text-decoration: none; }
:where(a):hover { text-decoration: underline; }
:where(html.dark-mode) :where(a) { color: var(--accent-teal); }

.mono, td.mono { font-family: var(--fonte-mono); font-size: 0.85em; }

/* =====================================================================
   App shell: sidebar flutuante + conteudo
   ===================================================================== */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: var(--gap);
    height: calc(100vh - 2 * var(--gap));
    margin: var(--gap) 0 var(--gap) var(--gap);
    padding: 20px 16px 16px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    overflow-y: auto;
}

/* Logo: a mesma imagem da NewFront. Colorida no tema claro, branca no
   escuro (a branca sumiria num fundo claro). */
.sidebar-logo { display: block; max-width: 196px; height: auto; margin: 0 auto 4px; }
.logo-dark { display: none; }
html.dark-mode .logo-light { display: none; }
html.dark-mode .logo-dark  { display: block; }

/* Sem text-transform: o nome do produto e "NewOS", nao "NEWOS". */
.sidebar-version {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 18px;
}

.nav { display: flex; flex-direction: column; }

.nav-section {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--nav-label);
    padding: 16px 12px 4px;
}

.nav a,
.nav-group-title {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    font-family: var(--fonte-titulo);
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--nav-text);
    text-decoration: none;
    transform-origin: left center;
    transition: color 0.18s ease, transform 0.18s ease;
}

.nav a .bi, .nav-group-title .bi {
    font-size: 1.05rem;
    transition: color 0.18s ease, transform 0.18s ease;
}

/* Sublinhado teal que cresce da esquerda (assinatura do kit). */
.nav a::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 2px;
    height: 2px;
    background-color: var(--accent-teal);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.22s ease;
}

.nav a:hover, .nav a.active { color: var(--nav-active); font-weight: 700; text-decoration: none; }
.nav a:hover { transform: scale(1.03); }
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); }
.nav a:hover .bi, .nav a.active .bi { color: var(--accent-teal); }

/* ---------------------------------------------------------------------
   Grupos recolhiveis (Network, Armazenamento...)
   - fechado por padrao; .open = fixado pelo clique (nav.js) ou pagina atual
   - mouse por cima abre de passagem (so em aparelho com mouse)
   - altura animada com grid-template-rows 0fr -> 1fr (sem medir em JS)
   --------------------------------------------------------------------- */
.nav-group-title {
    width: 100%;
    background: none; border: 0; margin: 0;
    text-align: left; cursor: pointer;
    border-radius: 10px;
}
.nav-group-title:focus-visible { outline: 2px solid var(--accent-teal); outline-offset: 1px; }
.nav-group-title .nav-caret {
    margin-left: auto;
    font-size: 0.72rem;
    color: var(--nav-label);
    transition: transform 0.3s cubic-bezier(.2, .7, .3, 1), color 0.18s ease;
}
.nav-group-title:hover,
.nav-group.open > .nav-group-title { color: var(--nav-active); }
.nav-group-title:hover .bi:not(.nav-caret),
.nav-group.current > .nav-group-title .bi:not(.nav-caret) { color: var(--accent-teal); }
.nav-group-title:hover .bi:not(.nav-caret) { transform: translateX(2px) rotate(-6deg); }
.nav-group.current > .nav-group-title { font-weight: 700; }

.nav-sub {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.34s cubic-bezier(.2, .7, .3, 1) 0.12s;
}
.nav-sub-inner {
    min-height: 0;
    overflow: hidden;
    margin-left: 22px;
    border-left: 1px solid var(--border-color);
}
.nav-sub a {
    font-size: 0.88rem; padding: 6px 12px;
    opacity: 0;
    translate: -8px 0;
    transition: color 0.18s ease, transform 0.18s ease, opacity 0.2s ease, translate 0.2s ease;
}

.nav-group.open .nav-caret { transform: rotate(90deg); color: var(--accent-teal); }
.nav-group.open .nav-sub { grid-template-rows: 1fr; transition-delay: 0s; }
.nav-group.open .nav-sub a {
    opacity: 1; translate: 0 0;
    transition-delay: 0s, 0s, calc(60ms + var(--i, 0) * 45ms), calc(60ms + var(--i, 0) * 45ms);
}
@media (hover: hover) {
    .nav-group:not(.nav-shut):hover .nav-caret { transform: rotate(90deg); }
    .nav-group:not(.nav-shut):hover .nav-sub { grid-template-rows: 1fr; transition-delay: 0s; }
    .nav-group:not(.nav-shut):hover .nav-sub a {
        opacity: 1; translate: 0 0;
        transition-delay: 0s, 0s, calc(60ms + var(--i, 0) * 45ms), calc(60ms + var(--i, 0) * 45ms);
    }
}
/* Ate o nav.js aplicar o estado lembrado: nada de animar a abertura. */
.nav:not(.nav-ready) .nav-sub,
.nav:not(.nav-ready) .nav-sub a,
.nav:not(.nav-ready) .nav-caret { transition: none !important; }

/* Entrada do menu (1x por sessao, como os cartoes do dashboard). */
.nav.nav-intro > * { animation: nav-in 0.42s cubic-bezier(.2, .7, .3, 1) both; animation-delay: calc(var(--n, 0) * 35ms); }
@keyframes nav-in { from { opacity: 0; translate: -10px 0; } to { opacity: 1; translate: 0 0; } }

/* Rodape da sidebar: usuario + sair */
.sidebar-foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
}
html.dark-mode .sidebar-foot { background: rgba(255, 255, 255, 0.05); }

.foot-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--surface-suave);
    color: var(--brand-navy);
    flex: none;
}
html.dark-mode .foot-avatar { background: rgba(255, 255, 255, 0.08); color: var(--accent-teal); }

.sidebar-foot a.foot-user {
    display: flex; align-items: center; gap: 10px;
    flex: 1; min-width: 0;
    text-decoration: none;
    color: inherit;
}
.foot-user .who {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.foot-user .foot-hint { display: block; font-size: 0.75rem; color: var(--text-muted); }

.sidebar-foot a.foot-exit {
    display: grid; place-items: center;
    width: 34px; height: 34px;
    border-radius: 10px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color .15s, background .15s;
}
.sidebar-foot a.foot-exit:hover { color: var(--estado-erro); background: var(--estado-erro-suave); }
html.dark-mode .sidebar-foot a.foot-exit:hover { background: rgba(230, 53, 61, 0.15); }

/* =====================================================================
   Conteudo + barra superior
   ===================================================================== */
.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: var(--gap) var(--gap) 44px;
}

.topbar {
    position: sticky;
    top: var(--gap);
    z-index: 50;
    min-height: 64px;
    margin-bottom: 22px;
    padding: 10px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--glass-bg);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
}

.topbar-host {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--fonte-titulo);
    font-size: 0.9rem;
    color: var(--text-muted);
    min-width: 0;
}
.topbar-host strong { color: var(--title-color); font-weight: 700; }
.topbar-host .bi { color: var(--accent-teal); font-size: 1.1rem; }

.topbar-actions { display: flex; align-items: center; gap: 12px; }

/* Interruptor de tema (sol / lua) */
.theme-switch {
    position: relative;
    width: 58px; height: 30px;
    border: 1px solid var(--border-color);
    border-radius: 30px;
    background: var(--surface-card);
    cursor: pointer;
    padding: 0;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 8px;
    color: var(--text-muted);
}
html.dark-mode .theme-switch { background: rgba(255, 255, 255, 0.07); }
.theme-switch .bi { font-size: 0.85rem; }
.theme-switch .ts-knob {
    position: absolute;
    top: 3px; left: 3px;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--brand-navy);
    transition: transform .22s cubic-bezier(.4, 0, .2, 1), background .22s;
}
html.dark-mode .theme-switch .ts-knob { transform: translateX(28px); background: var(--accent-teal); }
.theme-switch:focus-visible { outline: 2px solid var(--accent-teal); outline-offset: 2px; }

/* =====================================================================
   Cabecalho da pagina
   ===================================================================== */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.page-head h1 {
    font-family: var(--fonte-titulo);
    font-weight: 700;
    font-size: 1.7rem;
    line-height: 1.2;
    color: var(--title-color);
    margin: 0 0 4px;
}
.page-head .sub { font-size: 0.9rem; color: var(--text-muted); }

/* =====================================================================
   Cartoes e grades
   ===================================================================== */
.card {
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: var(--sombra-card);
    padding: 20px 22px;
}
html.dark-mode .card { border-color: rgba(255, 255, 255, 0.06); }

/* Cartoes EMPILHADOS ganham respiro; dentro de uma grade o espaco e o
   "gap" -- sem esta excecao o 2o cartao de cada linha descia 18px. */
.card + .card { margin-top: 18px; }
.grid > .card + .card { margin-top: 0; }

.card h2 {
    font-family: var(--fonte-titulo);
    font-size: 1rem;
    font-weight: 700;
    color: var(--title-color);
    margin: 0 0 14px;
}

.grid { display: grid; gap: 18px; }
.grid + .card, .card + .grid, .grid + .grid { margin-top: 18px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* =====================================================================
   Medidores do dashboard
   ===================================================================== */
.tile-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.tile-value {
    font-family: var(--fonte-titulo);
    font-size: 2.2rem;
    line-height: 1.1;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--title-color);
}
.tile-value .unit { font-size: 1.05rem; color: var(--text-muted); margin-left: 2px; font-weight: 600; }

.tile-detail {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
}

.meter {
    height: 8px;
    background: var(--track);
    border-radius: 4px;
    overflow: hidden;
    margin: 14px 0 8px;
}
.meter-fill {
    height: 100%;
    min-width: 4px;
    border-radius: 4px;
    background: var(--accent-teal);
    transition: width .45s ease, background-color .3s ease;
}
.meter-fill.is-warning  { background: var(--estado-aviso); }
.meter-fill.is-critical { background: var(--estado-erro); }

.state {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.78rem; font-weight: 600;
    color: var(--estado-ok);
}
.state .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--estado-ok); flex: none; }
.state.is-warning  { color: #b7770f; }
.state.is-warning .dot  { background: var(--estado-aviso); }
.state.is-critical { color: var(--estado-erro); }
.state.is-critical .dot { background: var(--estado-erro); }
html.dark-mode .state.is-warning { color: var(--estado-aviso); }

.mini-meter {
    display: inline-block;
    vertical-align: middle;
    width: 130px; height: 6px;
    background: var(--track);
    border-radius: 3px;
    overflow: hidden;
}
.mini-meter > span { display: block; height: 100%; border-radius: 3px; background: var(--accent-teal); }
.mini-meter > span.is-warning  { background: var(--estado-aviso); }
.mini-meter > span.is-critical { background: var(--estado-erro); }

.updated { font-size: 0.8rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* =====================================================================
   Tabelas
   ===================================================================== */
table.data { width: 100%; border-collapse: collapse; font-size: 0.88rem; }

table.data th {
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--brand-navy);
    padding: 0 12px 10px 0;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}
html.dark-mode table.data th { color: var(--brand-navy-claro); }

table.data td {
    padding: 11px 12px 11px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    vertical-align: middle;
}
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover td { background: var(--surface-suave); }
html.dark-mode table.data tbody tr:hover td { background: rgba(255, 255, 255, 0.03); }
table.data td.strong { font-weight: 600; color: var(--title-color); }

/* =====================================================================
   Formularios
   ===================================================================== */
.field { margin-bottom: 16px; }

.field label {
    display: block;
    font-family: var(--fonte-titulo);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.field .hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 5px; }

input[type=text], input[type=password], input[type=number], input[type=email],
input[type=url], input[type=time], select, textarea {
    width: 100%;
    padding: 11px 14px;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    color: var(--input-text);
    font-family: var(--fonte-interface);
    font-size: 0.95rem;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { font-family: var(--fonte-mono); font-size: 0.85rem; line-height: 1.5; }

input:focus, select:focus, textarea:focus {
    border-color: var(--brand-navy);
    box-shadow: 0 0 0 3px rgba(24, 59, 144, 0.12);
}
html.dark-mode input:focus, html.dark-mode select:focus, html.dark-mode textarea:focus {
    border-color: var(--accent-teal);
    box-shadow: 0 0 0 3px rgba(0, 184, 192, 0.18);
}
input::placeholder, textarea::placeholder { color: var(--placeholder); }
input[disabled], select[disabled] { opacity: .6; cursor: not-allowed; }

.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > .field { flex: 1 1 200px; }

label.check {
    display: flex; align-items: flex-start; gap: 9px;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 10px;
    cursor: pointer;
    line-height: 1.45;
}
label.check input[type=checkbox] {
    accent-color: var(--brand-navy);
    width: 16px; height: 16px; margin-top: 2px; flex: none; cursor: pointer;
}

.radio-row { display: flex; gap: 20px; margin-bottom: 6px; flex-wrap: wrap; }
.radio-row label { display: flex; align-items: center; gap: 7px; font-size: 0.92rem; color: var(--text-primary); cursor: pointer; }
.radio-row input[type=radio] { accent-color: var(--brand-navy); }
html.dark-mode label.check input[type=checkbox],
html.dark-mode .radio-row input[type=radio] { accent-color: var(--accent-teal); }

/* =====================================================================
   Botoes
   ===================================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 44px;
    padding: 0 24px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--btn-bg);
    color: var(--btn-text);
    font-family: var(--fonte-titulo);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: filter .15s ease, transform .15s ease, background .15s ease;
}
.btn:hover { filter: brightness(1.1); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }

.btn-ghost {
    background: var(--surface-card);
    border-color: var(--border-color);
    color: var(--brand-navy);
}
.btn-ghost:hover { background: var(--surface-suave); filter: none; }
html.dark-mode .btn-ghost { background: transparent; color: var(--text-primary); border-color: rgba(255, 255, 255, 0.14); }
html.dark-mode .btn-ghost:hover { background: rgba(255, 255, 255, 0.06); }

.btn-danger { background: var(--estado-erro); color: #ffffff; }

.btn-sm { height: 34px; padding: 0 14px; font-size: 0.82rem; border-radius: 8px; }

/* =====================================================================
   Avisos, selos e vazio
   ===================================================================== */
.alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 0.9rem;
    border: 1px solid;
}
.alert .ico { flex: none; font-weight: 700; }

.alert-ok    { background: #eaf7ef; border-color: #b7e4c7; color: #11793a; }
.alert-erro  { background: var(--estado-erro-suave); border-color: #f5c2c4; color: #b4232a; }
.alert-aviso { background: #fff6e6; border-color: #f8dba5; color: #8a5a00; }
html.dark-mode .alert-ok    { background: rgba(22, 163, 74, .12);  border-color: rgba(22, 163, 74, .35);  color: #5ad48a; }
html.dark-mode .alert-erro  { background: rgba(230, 53, 61, .12);  border-color: rgba(230, 53, 61, .35);  color: #ff8a8f; }
html.dark-mode .alert-aviso { background: rgba(245, 166, 35, .12); border-color: rgba(245, 166, 35, .35); color: var(--estado-aviso); }

.danger-zone { border-color: #f5c2c4; }
html.dark-mode .danger-zone { border-color: rgba(230, 53, 61, .35); }

/* Selos no formato "pill" do kit (sd-pill). */
.badge {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge-up   { background: #e3f6eb; color: #11793a; }
.badge-down { background: var(--surface-suave); color: var(--text-muted); }
html.dark-mode .badge-up   { background: rgba(22, 163, 74, .16); color: #5ad48a; }
html.dark-mode .badge-down { background: rgba(255, 255, 255, .06); }

.empty { text-align: center; padding: 30px 10px; color: var(--text-muted); font-size: 0.9rem; }

/* =====================================================================
   Interruptor (Modulos e Servicos)
   ---------------------------------------------------------------------
   O input real continua no DOM (so visualmente oculto): teclado e leitor
   de tela funcionam. Ao lado sempre aparece a palavra do estado.
   ===================================================================== */
.switch { position: relative; display: inline-block; width: 50px; height: 28px; flex: none; vertical-align: middle; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.switch .slider {
    position: absolute; inset: 0;
    background: #cfd7e6;
    border-radius: 28px;
    transition: background-color .22s ease;
    pointer-events: none;
}
html.dark-mode .switch .slider { background: rgba(255, 255, 255, .14); }
.switch .slider::before {
    content: "";
    position: absolute;
    height: 22px; width: 22px; left: 3px; top: 3px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform .22s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.switch input:checked + .slider { background: var(--accent-teal); }
.switch input:checked + .slider::before { transform: translateX(22px); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px rgba(0, 184, 192, .35); }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + .slider { opacity: .45; }
.switch.is-busy .slider { opacity: .55; }
.switch.is-busy .slider::before { animation: switch-pulse .8s ease-in-out infinite; }
@keyframes switch-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

.switch-row { display: flex; align-items: center; gap: 12px; }
.switch-label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); min-width: 72px; }
.switch-label.on  { color: var(--estado-ok); }
.switch-label.off { color: var(--text-muted); }

/* --- Cartao de modulo ----------------------------------------------- */
.module-card {
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: var(--sombra-card);
    padding: 20px 22px;
    display: flex; flex-direction: column; gap: 12px;
    transition: border-color .2s;
}
.module-card.is-on { border-color: var(--accent-teal); }
html.dark-mode .module-card { border-color: rgba(255, 255, 255, .06); }
html.dark-mode .module-card.is-on { border-color: rgba(0, 184, 192, .55); }

.module-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.module-title {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--fonte-titulo);
    font-size: 1.05rem; font-weight: 700;
    color: var(--title-color);
}
.module-title .mico {
    width: 36px; height: 36px;
    display: grid; place-items: center;
    border-radius: 10px;
    background: var(--surface-suave);
    color: var(--accent-teal);
    font-size: 1.15rem;
}
html.dark-mode .module-title .mico { background: rgba(0, 184, 192, .12); }
.module-cat { font-size: 0.72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-top: 3px; }
.module-desc { font-size: 0.88rem; color: var(--text-primary); line-height: 1.6; }
.module-components { border-top: 1px solid var(--border-color); padding-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.component-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.component-info { min-width: 0; }
.component-name { font-size: 0.92rem; font-weight: 600; color: var(--title-color); }
.component-desc { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.module-notes { font-size: 0.8rem; color: var(--text-muted); line-height: 1.6; border-top: 1px solid var(--border-color); padding-top: 12px; }
.module-notes li { margin-bottom: 4px; }

/* Barra indeterminada para acoes demoradas */
.working { display: none; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--text-muted); margin-top: 10px; }
.working.show { display: flex; }
.working .bar { flex: 1; height: 4px; background: var(--track); border-radius: 2px; overflow: hidden; position: relative; }
.working .bar::after {
    content: ""; position: absolute; left: -40%; width: 40%; height: 100%;
    background: var(--accent-teal); border-radius: 2px;
    animation: indeterminate 1.1s ease-in-out infinite;
}
@keyframes indeterminate { 0% { left: -40%; } 100% { left: 100%; } }

/* =====================================================================
   Tela de login
   ===================================================================== */
.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: #10208f url("login-bg.jpg") center / cover no-repeat;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface-card);
    border-radius: 24px;
    padding: 40px 36px 34px;
    box-shadow: 0 24px 60px rgba(8, 18, 80, 0.35);
}

.login-logo { display: block; max-width: 270px; height: auto; margin: 0 auto 12px; }

.login-sub {
    text-align: center;
    font-family: var(--fonte-titulo);
    font-size: 0.88rem;
    color: var(--text-muted);
    margin: 0 0 28px;
}

.login-foot { text-align: center; font-size: 0.75rem; color: var(--text-muted); margin-top: 22px; }

/* =====================================================================
   Telas pequenas: a sidebar vira um bloco no topo
   ===================================================================== */
@media (max-width: 1000px) {
    .grid-3, .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .layout { flex-direction: column; }
    .sidebar { position: static; width: auto; height: auto; flex: none; margin: 12px 12px 0; }
    .main { padding: 12px 12px 36px; }
    .topbar { position: static; }
}

/* Rotulo lido por leitor de tela, invisivel na pagina. */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =====================================================================
   Rede: interfaces, bonds, VLANs, rotas (v1.1)
   ===================================================================== */
[hidden] { display: none !important; }

.opt { font-weight: 400; color: var(--text-muted); }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.form-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.card-hint { margin-top: 14px; }
.card-text { font-size: 0.88rem; color: var(--text-muted); margin: 0 0 14px; }
.sep { border: 0; border-top: 1px solid var(--border-color); margin: 6px 0 18px; }

/* Acoes da linha: quebram para baixo em cartoes estreitos em vez de
   vazar para fora da tabela (o "Remover" do bond ficava cortado). */
td.actions { text-align: right; }
td.actions > * { margin: 2px 0 2px 6px; }
td.actions form { display: inline-block; }

.nic-name { display: flex; align-items: center; gap: 8px; }
.nic-name .bi { color: var(--accent-teal); }
.nic-alias { font-size: 0.82rem; font-weight: 600; color: var(--title-color); margin-top: 2px; }
.nic-sub { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.nic-sub.warn { color: #b7770f; }
html.dark-mode .nic-sub.warn { color: var(--estado-aviso); }

.badge-warn { background: #fff3dc; color: #8a5a00; }
html.dark-mode .badge-warn { background: rgba(245, 166, 35, .16); color: var(--estado-aviso); }
.badge-role { background: var(--surface-suave); color: var(--brand-navy); letter-spacing: .04em; }
.badge-role.role-wan  { background: rgba(24, 59, 144, .10); color: var(--brand-navy); }
.badge-role.role-lan  { background: rgba(0, 184, 192, .14); color: #00787d; }
.badge-role.role-mgmt { background: rgba(245, 166, 35, .16); color: #8a5a00; }
.badge-role.role-dmz  { background: rgba(230, 53, 61, .10); color: #b4232a; }
html.dark-mode .badge-role { background: rgba(255, 255, 255, .06); color: var(--text-primary); }
html.dark-mode .badge-role.role-wan  { background: rgba(138, 160, 230, .18); color: var(--brand-navy-claro); }
html.dark-mode .badge-role.role-lan  { background: rgba(0, 184, 192, .16); color: var(--accent-teal); }
html.dark-mode .badge-role.role-mgmt { background: rgba(245, 166, 35, .16); color: var(--estado-aviso); }
html.dark-mode .badge-role.role-dmz  { background: rgba(230, 53, 61, .16); color: #ff8a8f; }

.howto { margin: 0; padding-left: 18px; font-size: 0.88rem; line-height: 1.7; color: var(--text-primary); }
.howto li { margin-bottom: 6px; }

/* Faixa de confirmacao da rede */
.pending-bar {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 14px 18px;
    margin-bottom: 18px;
    border-radius: 16px;
    background: #fff6e6;
    border: 1px solid #f8dba5;
    color: #6b4600;
    font-size: 0.9rem;
}
.pending-bar > .bi { font-size: 1.4rem; color: var(--estado-aviso); }
.pending-bar .pending-text { flex: 1; min-width: 240px; }
.pending-bar .pending-changes { font-family: var(--fonte-mono); font-size: 0.78rem; margin-top: 4px; opacity: .85; }
.pending-bar form { margin: 0; }
#netPendingSecs { font-variant-numeric: tabular-nums; font-weight: 700; }
html.dark-mode .pending-bar { background: rgba(245, 166, 35, .12); border-color: rgba(245, 166, 35, .35); color: #f8d08a; }

/* =====================================================================
   Dashboard animado (v1.1)
   ===================================================================== */
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1300px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px)  { .grid-4 { grid-template-columns: 1fr; } }
.grid + .grid, .grid + .card { margin-top: 18px; }

/* Entrada: cada bloco sobe e aparece, um apos o outro (--i = ordem). */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.reveal { animation: rise .5s cubic-bezier(.2, .7, .3, 1) both; animation-delay: calc(var(--i, 0) * 70ms); }

.tile { display: flex; flex-direction: column; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--sombra-flutuante); }
.tile-label { display: flex; align-items: center; gap: 7px; }
.tile-label .bi { color: var(--accent-teal); font-size: 1rem; }
/* Numero grande: algarismos proporcionais (tabular so em colunas). */
.tile-value { font-variant-numeric: normal; }

.net-value { display: flex; flex-direction: column; gap: 2px; font-size: 1.35rem; }
.net-dir { display: flex; align-items: center; gap: 8px; }
.net-dir .bi { font-size: 1rem; color: var(--accent-teal); }

/* "Ao vivo": ponto que pulsa a cada atualizacao. */
.live-dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    background: var(--estado-ok); margin-right: 4px; vertical-align: middle;
    box-shadow: 0 0 0 0 rgba(22, 163, 74, .5);
    animation: live 2s ease-out infinite;
}
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .45); } 100% { box-shadow: 0 0 0 9px rgba(22, 163, 74, 0); } }
body.is-offline .live-dot { background: var(--estado-erro); animation: none; }

/* Grafico do medidor: uma serie (o titulo do cartao a nomeia). */
.spark {
    --spark: #00949b;            /* paleta validada, tema claro */
    position: relative;
    height: 56px;
    margin: 12px -22px -20px;   /* encosta nas bordas do cartao */
    cursor: crosshair;
    outline: none;
}
html.dark-mode .spark { --spark: #00a3aa; }
.spark svg { display: block; width: 100%; height: 100%; overflow: visible; }
.spark-line  { fill: none; stroke: var(--spark); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round;
               vector-effect: non-scaling-stroke; transition: d .45s ease; }
.spark-area  { fill: var(--spark); opacity: .12; transition: d .45s ease; }
.spark-base  { stroke: var(--border-color); stroke-width: 1; vector-effect: non-scaling-stroke; }
.spark-cross { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.spark-dot   { fill: var(--spark); stroke: var(--surface-card); stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark-hover { fill: var(--surface-card); stroke: var(--spark); stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-teal); }

/* Dica (graficos e mapa de disco): valor forte, rotulo de apoio. */
.chart-tip {
    position: absolute; z-index: 100;
    transform: translate(-50%, -100%);
    pointer-events: none;
    display: flex; flex-direction: column; gap: 1px;
    padding: 7px 11px;
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--sombra-flutuante);
    font-size: 0.78rem; color: var(--text-muted);
    white-space: nowrap;
}
.chart-tip strong { font-size: 0.95rem; color: var(--title-color); }

/* Taxa por interface */
td.rate { font-variant-numeric: tabular-nums; white-space: nowrap; }
.kv td:first-child { color: var(--text-muted); width: 34%; }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.sub-title { font-family: var(--fonte-titulo); font-size: 0.9rem; font-weight: 700; color: var(--title-color); margin: 22px 0 8px; }
.col-meter { white-space: nowrap; width: 200px; }
.mini-pct { display: inline-block; min-width: 46px; text-align: right; font-variant-numeric: tabular-nums; }

/* =====================================================================
   Mapa de disco
   Paleta validada (validate_palette.js, todos os pares): claro
   #2f55c4/#00949b/#b5660b, escuro #5577ea/#00a3aa/#c27a1c. Livre =
   neutro com hachura (nao so cor).
   ===================================================================== */
.disk-list { display: flex; flex-direction: column; gap: 14px; }
.disk-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.disk-title > .bi { color: var(--accent-teal); }
.disk-size { font-weight: 600; color: var(--title-color); }

/* Cores do mapa no :root (e nao no .disk-map) porque a legenda fica
   fora do mapa e precisa das mesmas variaveis. */
:root { --seg-system: #2f55c4; --seg-lvm: #00949b; --seg-data: #b5660b; }
html.dark-mode { --seg-system: #5577ea; --seg-lvm: #00a3aa; --seg-data: #c27a1c; }
.disk-map {
    display: flex; gap: 2px;              /* 2px de folga entre trechos */
    height: 30px;
    border-radius: 8px;
    overflow: hidden;
}
.seg {
    flex-basis: 0; min-width: 4px;
    display: flex; align-items: center; justify-content: center;
    color: #ffffff; font-size: 0.72rem; font-weight: 600;
    overflow: hidden; white-space: nowrap;
    transform-origin: left;
    animation: grow .7s cubic-bezier(.2, .7, .3, 1) both;
    outline: none;
    transition: filter .15s;
}
.seg:hover, .seg:focus-visible { filter: brightness(1.12); }
.seg:focus-visible { box-shadow: inset 0 0 0 2px #ffffff; }
@keyframes grow { from { transform: scaleX(0); } to { transform: none; } }
.seg-label { padding: 0 8px; overflow: hidden; text-overflow: ellipsis; }
.seg-system, .sw.seg-system { background: var(--seg-system); }
.seg-lvm,    .sw.seg-lvm    { background: var(--seg-lvm); }
.seg-data,   .sw.seg-data   { background: var(--seg-data); }
.seg-free, .sw.seg-free {
    color: var(--text-muted);
    background: repeating-linear-gradient(135deg, var(--surface-suave) 0 6px, var(--border-color) 6px 7px);
}
html.dark-mode .seg-free, html.dark-mode .sw.seg-free {
    background: repeating-linear-gradient(135deg, rgba(255,255,255,.04) 0 6px, rgba(255,255,255,.12) 6px 7px);
}
.disk-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 0.78rem; color: var(--text-muted); }
.disk-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* Quem pediu menos movimento no sistema nao ve animacao nenhuma. */
@media (prefers-reduced-motion: reduce) {
    .reveal, .seg, .live-dot { animation: none !important; }
    .spark-line, .spark-area, .meter-fill, .tile { transition: none !important; }
    .nav.nav-intro > * { animation: none !important; }
    .nav-sub, .nav-sub a, .nav-caret, .nav-group-title .bi { transition: none !important; }
}

/* Arvore de particoes / volumes */
table.tree { margin-top: 14px; }
.tree-indent { display: inline-block; width: calc(var(--depth, 0) * 22px); }
table.tree td .bi { color: var(--accent-teal); margin-right: 4px; }
.disk-title h2, h2.disk-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; }

/* Acoes de disco: formulario que abre na propria linha */
.disk-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.disk-meta { margin: -6px 0 12px; }
details.act { display: inline-block; position: relative; text-align: left; }
details.act > summary { list-style: none; cursor: pointer; }
details.act > summary::-webkit-details-marker { display: none; }
details.act[open] > summary.btn-ghost { background: var(--surface-suave); }
details.act[open] > summary.btn:not(.btn-ghost) { filter: brightness(1.15); }
/* A animacao de entrada (.reveal) deixa cada cartao numa camada propria:
   sem isto o cartao SEGUINTE e desenhado por cima do menu aberto. */
.card:has(details.act[open]),
.reveal:has(details.act[open]),
.page-head:has(details.act[open]),
.st-section-row:has(details.act[open]) { position: relative; z-index: 40; }
.act-body {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 60;
    width: 340px;
    padding: 16px;
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: var(--sombra-flutuante);
    white-space: normal;
}
.act-body .row > .field { flex: 1 1 130px; }
.act-body .card-text { margin-bottom: 10px; }
.act-body form + form.act-alt { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-color); }
.confirm-field input { border-color: #f5c2c4; }
html.dark-mode .confirm-field input { border-color: rgba(230, 53, 61, .4); }
#diskWorking { margin: 0 0 18px; }

/* LVM */
.vg-block + .vg-block { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border-color); }
.vg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.vg-head .bi-stack { color: var(--accent-teal); margin-right: 4px; }
.vg-bar { height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; margin: 10px 0 6px; }
.vg-bar > span { display: block; height: 100%; border-radius: 4px; background: var(--seg-lvm); }
.vg-bar > span.seg-system { background: var(--seg-system); }

/* =====================================================================
   Tela Discos: resumo + blocos recolhiveis (disco, grupo LVM, pool ZFS)
   ---------------------------------------------------------------------
   - o cabecalho (botao) abre/fecha; a barra do disco fica sempre a vista
   - altura animada com grid-template-rows 0fr -> 1fr; com o bloco aberto
     e a animacao terminada (.settled) o conteudo deixa de ser cortado,
     senao os menus de acao (Montar, Apagar...) ficariam escondidos
   - linhas da tabela entram em cascata; barras crescem da esquerda
   ===================================================================== */
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.st-tiles { margin-bottom: 8px; }
.st-tiles .unit.word { margin-left: 6px; }
.st-meter { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; margin: 10px 0 6px; }
.st-meter > span {
    display: block; height: 100%; width: var(--w); border-radius: 3px;
    background: var(--accent-teal);
    transform-origin: left; animation: grow .9s cubic-bezier(.2, .7, .3, 1) .25s both;
}
.st-section {
    display: flex; align-items: center; gap: 10px;
    margin: 28px 0 12px; font-size: 1.05rem;
}
.st-section > .bi { color: var(--accent-teal); }
.st-section-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
.st-section-row .st-section { margin: 0; }
.st-legend { margin: 10px 4px 0; }
.muted { color: var(--text-muted); }
.badge.mini { font-size: 0.68rem; padding: 2px 7px; margin-left: 4px; vertical-align: 1px; }

.card.fold { padding: 0; }
.card.fold + .card.fold { margin-top: 12px; }
.fold > .disk-map, .fold > .vg-bar { margin: 0 22px 18px; }
.fold-head {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px;
    width: 100%; padding: 18px 22px 14px;
    background: none; border: 0; border-radius: 18px 18px 0 0;
    font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.fold-head:focus-visible { outline: 2px solid var(--accent-teal); outline-offset: -2px; }
.fold-ico { font-size: 1.15rem; color: var(--accent-teal); transition: transform .3s cubic-bezier(.2, .7, .3, 1); }
.fold-head:hover .fold-ico { transform: rotate(-8deg) scale(1.08); }
.fold-title { font-family: var(--fonte-titulo); font-weight: 700; color: var(--title-color); font-size: 1rem; }
.fold-sum { color: var(--text-muted); font-size: 0.84rem; }
.fold-caret {
    margin-left: auto; width: 30px; height: 30px; display: grid; place-items: center;
    border-radius: 50%; background: var(--surface-suave); color: var(--title-color);
    border: 1px solid var(--border-color); font-size: 0.8rem;
    transition: transform .35s cubic-bezier(.2, .7, .3, 1), background .2s ease, color .2s ease;
}
.fold-head:hover .fold-caret { background: var(--accent-teal); color: #fff; }
.fold.open .fold-caret { transform: rotate(180deg); }

.fold-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .42s cubic-bezier(.2, .7, .3, 1); }
.fold.open .fold-body { grid-template-rows: 1fr; }
.fold-inner { min-height: 0; overflow: hidden; padding: 0 22px; }
.fold.open .fold-inner { padding-bottom: 18px; }
.fold.open.settled .fold-inner { overflow: visible; }
.fold-toolbar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
    padding-top: 4px; margin-bottom: 4px;
}
.fold-toolbar .disk-meta { margin: 0; }

.fold .data tbody tr { opacity: 0; translate: 0 6px; transition: opacity .3s ease, translate .3s ease; }
.fold.open .data tbody tr {
    opacity: 1; translate: 0 0;
    transition-delay: calc(120ms + var(--r, 0) * 40ms);
}
/* Terminada a abertura, as linhas perdem o deslocamento: "translate"
   (mesmo 0) cria uma camada por linha e a linha de baixo cobriria o menu
   de acao aberto na linha de cima. */
.fold.open.settled .data tbody tr { translate: none; transition: none; }
.data tbody tr:has(details.act[open]) { position: relative; z-index: 5; }
.fold:not(.fold-ready) .fold-body,
.fold:not(.fold-ready) .data tbody tr,
.fold:not(.fold-ready) .fold-caret { transition: none !important; }

.vg-bar > span { width: var(--w, 0); transform-origin: left; animation: grow .9s cubic-bezier(.2, .7, .3, 1) .3s both; }

@media (prefers-reduced-motion: reduce) {
    .fold-body, .fold .data tbody tr, .fold-caret, .fold-ico { transition: none !important; }
    .st-meter > span, .vg-bar > span { animation: none !important; }
}
@media (max-width: 760px) {
    .fold-head { padding: 16px; }
    .fold > .disk-map, .fold > .vg-bar { margin: 0 16px 14px; }
    .fold-inner { padding: 0 16px; }
}

/* =====================================================================
   Modulo Backup
   ===================================================================== */
.bk-up, .badge.bk-up { background: #e3f6eb; color: #11793a; }
.badge.bk-warn { background: #fff3dc; color: #8a5a00; }
.badge.bk-err  { background: #fde8e9; color: #b4232a; }
.badge.bk-run  { background: rgba(0, 148, 155, .12); color: #00787d; }
.badge.bk-muted { background: var(--surface-suave); color: var(--text-muted); }
html.dark-mode .badge.bk-warn { background: rgba(245, 166, 35, .16); color: var(--estado-aviso); }
html.dark-mode .badge.bk-err  { background: rgba(230, 53, 61, .16); color: #ff7b81; }
html.dark-mode .badge.bk-run  { background: rgba(0, 163, 170, .18); color: var(--accent-teal); }
html.dark-mode .badge.bk-muted { background: rgba(255, 255, 255, .06); }
.bk-pulse {
    display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px;
    background: currentColor; vertical-align: 1px; animation: bk-pulse 1.2s ease-in-out infinite;
}
@keyframes bk-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
.tile-alert .tile-value { color: var(--estado-erro); }
.sub-inline { font-size: .8rem; font-weight: 500; color: var(--text-muted); margin-left: 6px; }
.muted { color: var(--text-muted); }

/* comeco guiado */
.bk-start { display: flex; gap: 18px; align-items: flex-start; }
.bk-start-ico { font-size: 2rem; color: var(--accent-teal); }
.bk-steps { margin: 6px 0 0 18px; padding: 0; line-height: 1.9; }

/* grafico de barras: uma serie, 4px arredondado no topo, barra fina */
.bk-chart { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding: 8px 0 0; }
.bk-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; cursor: default; outline: none; }
.bk-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bk-bar {
    width: min(26px, 70%); height: var(--h); min-height: 2px; border-radius: 4px 4px 0 0;
    background: var(--seg-lvm); transform-origin: bottom;
    animation: bk-grow .7s cubic-bezier(.2, .7, .3, 1) both; animation-delay: calc(var(--i, 0) * 35ms + .2s);
    transition: filter .15s ease;
}
.bk-bar.zero { background: var(--track); }
.bk-bar.has-err { box-shadow: inset 0 3px 0 var(--estado-erro); }
.bk-col:hover .bk-bar, .bk-col:focus-visible .bk-bar { filter: brightness(1.15); }
.bk-day { font-size: .7rem; color: var(--text-muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.bk-chart-foot { margin-top: 8px; }
@keyframes bk-grow { from { transform: scaleY(0); } to { transform: none; } }

.bk-target + .bk-target { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-color); }
.bk-target-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bk-target-head .bi { color: var(--accent-teal); }
.st-meter > span.is-warning { background: var(--estado-aviso); }
.st-meter > span.is-critical { background: var(--estado-erro); }

/* assistente da nova rotina */
.bk-wizard { padding-top: 6px; }
.bk-step { display: flex; gap: 16px; padding: 16px 0; border-top: 1px solid var(--border-color); }
.bk-step:first-child { border-top: 0; }
.bk-step-n {
    flex: 0 0 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
    background: var(--brand-navy); color: #fff; font-weight: 700; font-family: var(--fonte-titulo);
}
.bk-step-body { flex: 1; min-width: 0; }
.bk-step-body h3 { margin: 4px 0 12px; font-size: 1rem; }
.bk-wizard-foot { display: flex; justify-content: flex-end; padding-top: 8px; }
.bk-choice { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 12px; }
.bk-opt {
    display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; cursor: pointer;
    border: 1px solid var(--border-color); border-radius: 12px; transition: border-color .15s ease, background .15s ease;
}
.bk-opt:hover { border-color: var(--accent-teal); }
.bk-opt:has(input:checked) { border-color: var(--accent-teal); background: rgba(0, 148, 155, .06); }
.bk-opt input { margin-top: 3px; }
.bk-opt > span { display: flex; flex-direction: column; gap: 2px; }
.bk-opt small { color: var(--text-muted); font-size: .78rem; }
.bk-opt small.warn { color: #8a5a00; }
.bk-days { display: flex; gap: 6px; flex-wrap: wrap; }
.bk-days label { cursor: pointer; }
.bk-days input { display: none; }
.bk-days span {
    display: inline-block; min-width: 46px; text-align: center; padding: 6px 8px; border-radius: 8px;
    border: 1px solid var(--border-color); font-size: .82rem;
}
.bk-days input:checked + span { background: var(--brand-navy); border-color: var(--brand-navy); color: #fff; }
.bk-last { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.bk-last + .fold-caret { margin-left: 8px; }
.bk-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 18px; margin: 14px 0 0; }
.bk-kv div { min-width: 0; }
.bk-kv dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 700; }
.bk-kv dd { margin: 2px 0 0; overflow-wrap: anywhere; }

/* historico */
.bk-filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.bk-filters .field { margin: 0; min-width: 160px; }
.bk-filters-btn { display: flex; gap: 6px; }
.bk-pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 14px; }
.bk-status-big .badge { font-size: .95rem; padding: 6px 14px; }
.tile-value.bk-small { font-size: 1.5rem; }
.bk-log { max-height: 520px; overflow: auto; font-family: var(--fonte-mono, ui-monospace, monospace); font-size: .8rem; }
.bk-log-line { display: flex; gap: 12px; padding: 3px 6px; border-radius: 6px; }
.bk-log-line:nth-child(odd) { background: var(--surface-suave); }
.bk-log-line.err { color: var(--estado-erro); }
.bk-log-line.warn { color: #8a5a00; }
.bk-log-time { flex: 0 0 64px; color: var(--text-muted); }
.bk-log-text { white-space: pre-wrap; overflow-wrap: anywhere; }

/* restaurar */
.bk-flow { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.bk-flow-step {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px;
    background: var(--surface-card); border: 1px solid var(--border-color); color: var(--text-muted); font-size: .85rem;
}
.bk-flow-step b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-suave); }
.bk-flow-step.active { color: var(--title-color); border-color: var(--accent-teal); }
.bk-flow-step.active b { background: var(--accent-teal); color: #fff; }
.bk-flow-step.done b { background: var(--brand-navy); color: #fff; }
.bk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 18px; }
.bk-pick { display: flex; flex-direction: column; gap: 4px; text-decoration: none; transition: transform .18s ease, border-color .18s ease; }
.bk-pick > .bi { font-size: 1.4rem; color: var(--accent-teal); }
.bk-pick:hover { transform: translateY(-2px); text-decoration: none; }
.bk-pick.selected { border-color: var(--accent-teal); box-shadow: 0 0 0 2px rgba(0, 148, 155, .25); }
.bk-day-title { font-weight: 700; margin: 14px 0 6px; color: var(--title-color); }
.bk-points { display: flex; flex-direction: column; gap: 6px; }
.bk-point {
    display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 12px;
    border: 1px solid var(--border-color); text-decoration: none; color: inherit; transition: border-color .15s ease, transform .15s ease;
}
.bk-point:hover { border-color: var(--accent-teal); transform: translateX(3px); text-decoration: none; }
.bk-point-time { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 48px; color: var(--title-color); }
.bk-point-main { flex: 1; display: flex; flex-direction: column; }
.bk-restore-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .bk-restore-grid { grid-template-columns: 1fr; } }
.bk-restore-grid > .card + .card { margin-top: 0; }
.bk-crumbs { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bk-crumbs > a .bi { color: var(--accent-teal); }
.bk-files .bk-chk { width: 34px; }
.bk-files tr.picked { background: rgba(0, 148, 155, .06); }
.bk-folder { color: #e0a43a; }
.bk-mark-bar { display: flex; justify-content: flex-end; margin-top: 10px; }
.bk-cart { position: sticky; top: 18px; }
.bk-cart h2 { display: flex; align-items: center; gap: 8px; }
.bk-cart-list { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow: auto; font-size: .85rem; }
.bk-cart-list li { padding: 4px 0; border-bottom: 1px solid var(--border-color); overflow-wrap: anywhere; }
.bk-cart-actions { display: flex; gap: 6px; margin: 8px 0 14px; }
.bk-dest { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--border-color); padding-top: 12px; }
.bk-dest h3 { margin: 0 0 4px; font-size: .95rem; }
.bk-dest .field { margin: 0 0 0 26px; }

.bk-dl { display: flex; gap: 22px; align-items: center; }
.bk-dl-ico { font-size: 3rem; }
.bk-dl-ico .bi { display: none; }
.bk-dl-ico[data-state="restoring"] .st-restoring { display: inline-block; color: var(--accent-teal); animation: bk-spin 2s linear infinite; }
.bk-dl-ico[data-state="ready"] .st-ready { display: inline-block; color: var(--estado-ok); }
.bk-dl-ico[data-state="error"] .st-error { display: inline-block; color: var(--estado-erro); }
.bk-dl-ico[data-state="expired"] .st-expired { display: inline-block; color: var(--text-muted); }
@keyframes bk-spin { to { transform: rotate(360deg); } }
.bk-dl-body { flex: 1; }
.bk-dl-body h2 { margin: 0 0 4px; }
.bk-dl .st-restoring, .bk-dl .st-ready, .bk-dl .st-error, .bk-dl .st-expired { display: none; }
.bk-dl[data-status="restoring"] .bk-dl-body .st-restoring,
.bk-dl[data-status="ready"] .bk-dl-body .st-ready,
.bk-dl[data-status="error"] .bk-dl-body .st-error,
.bk-dl[data-status="expired"] .bk-dl-body .st-expired { display: block; }
.bk-dl[data-status="ready"] a.st-ready { display: inline-flex; }
.bk-dl-actions .working { margin: 0; }

/* clientes */
.bk-sub { font-size: .95rem; margin: 16px 0 8px; }
.bk-code {
    background: #0f1b33; color: #d6e2ff; border-radius: 12px; padding: 14px 16px; overflow-x: auto;
    font-size: .8rem; line-height: 1.6; white-space: pre;
}
.bk-secret { user-select: all; background: var(--surface-suave); padding: 1px 6px; border-radius: 6px; }
.bk-services { display: flex; gap: 14px; flex-wrap: wrap; }
.bk-svc { display: flex; align-items: center; gap: 8px; }

@media (prefers-reduced-motion: reduce) {
    .bk-bar, .bk-pulse, .bk-dl-ico .bi { animation: none !important; }
    .bk-point, .bk-pick { transition: none !important; }
}

/* =====================================================================
   Modulos e Servicos
   ===================================================================== */
.sys-filter { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 16px; }
.sys-chip {
    display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
    border: 1px solid var(--border-color); background: var(--surface-card); color: var(--nav-text);
    font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer;
    transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.sys-chip span { font-size: .72rem; padding: 1px 7px; border-radius: 999px; background: var(--surface-suave); color: var(--text-muted); }
.sys-chip:hover { border-color: var(--accent-teal); transform: translateY(-1px); }
.sys-chip.active { background: var(--brand-navy); border-color: var(--brand-navy); color: #fff; }
.sys-chip.active span { background: rgba(255, 255, 255, .18); color: #fff; }
.sys-tools { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 4px 0 16px; }
.sys-tools .sys-filter { margin: 0; }
.sys-search {
    display: flex; align-items: center; gap: 8px; flex: 1 1 280px; max-width: 420px;
    padding: 0 14px; border: 1px solid var(--border-color); border-radius: 12px; background: var(--surface-card);
}
.sys-search .bi { color: var(--text-muted); }
.sys-search input { border: 0; outline: 0; background: transparent; padding: 10px 0; width: 100%; font: inherit; color: inherit; }
.sys-search:focus-within { border-color: var(--accent-teal); box-shadow: 0 0 0 3px rgba(0, 184, 192, .15); }
.sys-ok { color: var(--estado-ok); }

/* modulo: cabecalho com o interruptor sempre a vista */
.sys-mod { transition: border-color .25s ease, box-shadow .25s ease; }
.sys-mod.is-on { border-color: var(--accent-teal); }
.sys-mod.is-on .sys-ico { background: var(--accent-teal); color: #fff; }
.sys-top { display: flex; align-items: center; gap: 12px; padding-right: 22px; }
.sys-top .fold-head { flex: 1; min-width: 0; padding-right: 8px; flex-wrap: nowrap; }
.sys-ico {
    flex: 0 0 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem;
    background: var(--surface-suave); color: var(--accent-teal); transition: background .25s ease, color .25s ease, transform .3s ease;
}
.fold-head:hover .sys-ico { transform: rotate(-6deg) scale(1.06); }
.sys-title { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.sys-title .fold-sum { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sys-top .fold-caret { margin-left: auto; }
.sys-working { margin: 0 22px 12px; }
.sys-meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: .82rem; color: var(--text-muted); margin-bottom: 12px; }
.sys-meta .bi { color: var(--accent-teal); margin-right: 4px; }
.sys-links { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--border-color); padding-top: 12px; margin-top: 12px; }
.sys-mod .module-components, .sys-mod .module-notes { margin-top: 12px; }

/* servicos */
.sys-dots { display: inline-flex; gap: 4px; margin-left: auto; }
.sys-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--track); }
.sys-dots i.on { background: var(--estado-ok); }
.sys-dots i.bad { background: var(--estado-erro); }
.sys-dots + .fold-caret { margin-left: 10px; }
.sys-state { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; background: var(--track); vertical-align: 1px; }
.sys-state.on { background: var(--estado-ok); box-shadow: 0 0 0 0 rgba(22, 163, 74, .45); animation: live 2s ease-out infinite; }
.sys-state.bad { background: var(--estado-erro); }
.sys-svc td .nic-sub { display: block; }
.sys-flash { animation: sys-flash 1.6s ease 1; }
@keyframes sys-flash { 0%, 100% { box-shadow: var(--sombra-card); } 30% { box-shadow: 0 0 0 3px var(--accent-teal); } }

@media (max-width: 760px) {
    .sys-top { padding-right: 16px; }
    .sys-dots { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .sys-state.on, .sys-flash { animation: none !important; }
    .sys-chip, .sys-ico { transition: none !important; }
}

/* Menu: item filho (Monitoramento > Zabbix > Zabbix Agent) */
.nav-sub a.nav-child { padding-left: 26px; font-size: .84rem; }
.nav-sub a.nav-child::after { left: 26px; }
.nav-child-ico { font-size: .72rem !important; color: var(--nav-label); margin-right: -4px; }
.nav-sub a.in-branch { color: var(--nav-active); font-weight: 600; }

/* =====================================================================
   Monitoramento: Zabbix
   ===================================================================== */
.zbx-ver { font-size: 2.2rem; }
.zbx-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: 2px; }
.zbx-dot.on { background: var(--estado-ok); animation: live 2s ease-out infinite; }
.zbx-dot.bad { background: var(--estado-erro); }
.zbx-bad { color: var(--estado-erro); }
.zbx-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.zbx-comp { transition: border-color .25s ease, transform .2s ease; }
.zbx-comp.is-on { border-color: var(--accent-teal); }
.zbx-comp.is-on .sys-ico { background: var(--accent-teal); color: #fff; }
.zbx-comp:hover { transform: translateY(-2px); }
.zbx-comp-head { display: flex; align-items: center; gap: 14px; }
.zbx-comp-title { flex: 1; min-width: 0; }
.zbx-comp-title h2 { margin: 0; }
.zbx-open { margin-top: 14px; }
.zbx-versions { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.zbx-grid { align-items: start; }
.zbx-log { min-height: 200px; max-height: 470px; }
.zbx-raw { width: 100%; font-size: 12.5px; line-height: 1.5; white-space: pre; overflow-x: auto; margin-bottom: 12px; }
.zbx-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.zbx-r {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px;
    background: var(--surface-suave); animation: rise .35s cubic-bezier(.2, .7, .3, 1) both; animation-delay: calc(var(--i, 0) * 80ms);
}
.zbx-r.ok .bi { color: var(--estado-ok); }
.zbx-r.fail .bi { color: var(--estado-erro); }
.zbx-r.skip .bi, .zbx-r.run .bi { color: var(--text-muted); }
.zbx-r.run .bi { animation: bk-spin 1s linear infinite; }
@media (prefers-reduced-motion: reduce) { .zbx-r, .zbx-dot.on, .zbx-r.run .bi { animation: none !important; } }

/* =====================================================================
   Monitoramento: Prometheus
   ===================================================================== */
.prom-job + .prom-job { margin-top: 12px; }
.prom-job-head { display: flex; align-items: center; gap: 10px; }
.prom-job .st-meter > span:not(.is-critical) { background: var(--estado-ok); }
.prom-versions { margin-bottom: 8px; }
.prom-versions tbody tr { animation: rise .35s cubic-bezier(.2, .7, .3, 1) both; animation-delay: calc(var(--r, 0) * 60ms); }
.prom-test { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding: 14px 18px; animation: rise .3s ease both; }
.prom-test .ico { font-size: 1.3rem; }
.prom-test.ok .ico { color: var(--estado-ok); }
.prom-test.fail .ico { color: var(--estado-erro); }
.prom-test.run .ico .bi { display: inline-block; animation: bk-spin 1s linear infinite; color: var(--accent-teal); }
.prom-discover { border: 1px solid var(--border-color); border-radius: 14px; padding: 14px 16px; margin: 6px 0 14px; animation: rise .35s ease both; }
.prom-discover.ok { border-color: var(--estado-ok); background: rgba(22, 163, 74, .05); }
.prom-discover.fail { border-color: var(--estado-erro); background: rgba(230, 53, 61, .05); }
.prom-discover-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.prom-discover.ok .prom-discover-head .bi { color: var(--estado-ok); }
.prom-discover.fail .prom-discover-head .bi { color: var(--estado-erro); }
.prom-mods { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.prom-discover-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.prom-discover-form .field { margin: 0; min-width: 200px; }
.prom-cfg { align-items: start; }
.prom-rw { border: 1px solid var(--border-color); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; animation: rise .3s ease both; animation-delay: calc(var(--r, 0) * 60ms); }
.prom-rw-actions { display: flex; justify-content: space-between; gap: 8px; }
.prom-yml { max-height: 520px; overflow: auto; margin-bottom: 12px; }
@media (prefers-reduced-motion: reduce) { .prom-versions tbody tr, .prom-test, .prom-discover, .prom-rw { animation: none !important; } }
.prom-alert-mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin: 10px 0 14px; }
.prom-alert-mods .bk-opt:has(input:disabled) { opacity: .85; cursor: default; }

/* =====================================================================
   Atualizacoes
   ===================================================================== */
.update-bar {
    display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 12px 18px;
    border-radius: 14px; text-decoration: none; color: #fff;
    background: linear-gradient(110deg, var(--brand-navy), #00949b);
    box-shadow: var(--sombra-card); animation: rise .5s cubic-bezier(.2, .7, .3, 1) both;
}
.update-bar:hover { text-decoration: none; filter: brightness(1.06); }
.update-bar .bi-stars { font-size: 1.2rem; animation: upd-twinkle 2.4s ease-in-out infinite; }
.update-bar-go { margin-left: auto; font-weight: 700; white-space: nowrap; }
@keyframes upd-twinkle { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(.85) rotate(-8deg); } }
.nav-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: 6px; background: #00b8c0; box-shadow: 0 0 0 0 rgba(0, 184, 192, .5); animation: live 2s ease-out infinite; }
.upd-ver { font-size: 2.2rem; }
.upd-new { border-color: var(--accent-teal); }
.upd-avail { color: var(--accent-teal); }
.upd-run.is-hidden { display: none; }
.upd-log { max-height: 360px; }
.upd-notes { padding: 14px 0; border-top: 1px solid var(--border-color); animation: rise .35s ease both; animation-delay: calc(var(--r, 0) * 80ms); }
.upd-notes:first-of-type { border-top: 0; }
.upd-notes-head { margin-bottom: 6px; }
.upd-md h4 { margin: 12px 0 4px; font-size: .92rem; color: var(--title-color); }
.upd-md ul { margin: 4px 0 8px 18px; padding: 0; line-height: 1.6; font-size: .88rem; }
.upd-md code { font-size: .82rem; background: var(--surface-suave); padding: 1px 5px; border-radius: 5px; }
.upd-apply { display: grid; grid-template-columns: 1fr 240px auto; gap: 16px; align-items: end; border-top: 1px solid var(--border-color); padding-top: 16px; margin-top: 8px; }
.upd-apply .field { margin: 0; }
@media (max-width: 900px) { .upd-apply { grid-template-columns: 1fr; } }
.upd-big { font-size: 2.4rem; }
@media (prefers-reduced-motion: reduce) { .update-bar, .update-bar .bi-stars, .nav-dot, .upd-notes { animation: none !important; } }

/* Sistema > Servidor */
.srv-fqdn { margin: 4px 0 12px; padding: 10px 14px; border-radius: 10px; background: var(--surface-suave); font-size: .9rem; }
.srv-fqdn strong { color: var(--accent-teal); }
.srv-sync { border-left: 3px solid var(--accent-teal); padding: 4px 0 4px 12px; margin: 10px 0; animation: rise .3s ease both; }
.srv-raw { max-height: 320px; overflow: auto; }
.srv-hosts input { width: 100%; }
.srv-hosts tbody tr { animation: rise .3s ease both; animation-delay: calc(var(--r, 0) * 50ms); }
@media (prefers-reduced-motion: reduce) { .srv-hosts tbody tr, .srv-sync { animation: none !important; } }

/* ===================================================================
   Sistema > Backup e restauracao
   =================================================================== */
.sbk-gen-act .act-body { width: 380px; }
.sbk-gen .bk-choice { margin-bottom: 10px; }
.sbk-dests { display: flex; gap: 14px; }
.sbk-dests span { display: inline-flex; align-items: center; gap: 5px; transition: color .3s, opacity .3s; }
.sbk-dests .on { color: var(--estado-ok); }
.sbk-dests .off { color: var(--text-muted); opacity: .6; text-decoration: line-through; }
.sbk-table td { vertical-align: middle; }
.sbk-acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.sbk-acts form { display: inline; margin: 0; }
.sbk-table tbody tr { animation: rise .3s ease both; animation-delay: calc(var(--r, 0) * 45ms); }
.sbk-cols { align-items: start; gap: 28px; margin-bottom: 14px; }
.sbk-cols > div > .bk-sub:first-child { margin-top: 0; }
.sbk-dest { border: 1px solid var(--border-color); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.sbk-dest-body { margin-top: 10px; overflow: hidden; max-height: 600px; transition: max-height .35s ease, opacity .3s ease, margin .3s ease; }
.sbk-dest-body.is-off { max-height: 0; opacity: 0; margin-top: 0; pointer-events: none; }
.sbk-keep { flex: 0 0 110px !important; }
.sbk-test { margin-left: 8px; font-size: .85rem; }
.sbk-test.good { color: var(--estado-ok); }
.sbk-test.bad { color: var(--estado-erro); }
.sbk-drop {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    min-height: 170px; margin-bottom: 12px; padding: 20px; text-align: center; cursor: pointer;
    border: 2px dashed var(--border-color); border-radius: 14px; background: var(--surface-suave);
    transition: border-color .2s, background .2s, transform .2s;
}
.sbk-drop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.sbk-drop > .bi { font-size: 2rem; color: var(--accent-teal); transition: transform .3s; }
.sbk-drop:hover, .sbk-drop.drag { border-color: var(--accent-teal); }
.sbk-drop.drag { transform: scale(1.01); }
.sbk-drop.drag > .bi, .sbk-drop.has-file > .bi { transform: translateY(-3px); }
.sbk-drop.has-file { border-style: solid; border-color: var(--estado-ok); }
.sbk-howto ol { margin: 0 0 10px 18px; padding: 0; line-height: 1.7; }
.sbk-sections { display: grid; gap: 10px; }
.sbk-sec {
    display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; cursor: pointer;
    border: 1px solid var(--border-color); border-radius: 12px;
    transition: border-color .2s, background .2s;
    animation: rise .3s ease both; animation-delay: calc(var(--r, 0) * 60ms);
}
.sbk-sec:hover { border-color: var(--accent-teal); }
.sbk-sec:has(input:checked) { border-color: var(--accent-teal); background: var(--surface-suave); }
.sbk-sec.is-off { opacity: .55; cursor: not-allowed; }
.sbk-sec > input { margin-top: 4px; }
.sbk-sec-ico { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border-radius: 10px;
               background: var(--surface-suave); color: var(--accent-teal); font-size: 1.05rem; }
.sbk-sec-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sbk-sec-detail { font-size: .85rem; color: var(--text-primary); overflow-wrap: anywhere; }
.sbk-sec-warn { font-size: .8rem; color: var(--estado-aviso); }
.sbk-mounts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.sbk-confirm { display: grid; grid-template-columns: 1fr auto auto; gap: 18px; align-items: end; }
.sbk-pass { max-width: 520px; }
@media (max-width: 900px) { .sbk-confirm { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
    .sbk-table tbody tr, .sbk-sec, .sbk-dest-body, .sbk-drop { animation: none !important; transition: none !important; }
}

/* ===================================================================
   Prometheus: jobs, clusters, hosts e importar
   =================================================================== */
.prom-cl { background: color-mix(in srgb, var(--accent-teal) 14%, transparent); color: var(--title-color);
           border: 1px solid color-mix(in srgb, var(--accent-teal) 40%, transparent); white-space: nowrap; }
.prom-explain { margin: 0 0 14px; line-height: 1.6; }
.prom-org { align-items: start; gap: 22px; }
.prom-org .fold-toolbar { margin-bottom: 6px; }
.prom-org .bk-sub { margin: 0; }
.prom-warns { margin: 6px 0 0 18px; padding: 0; line-height: 1.6; }
.prom-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.prom-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; cursor: pointer;
    border: 1px solid var(--border-color); border-radius: 999px; background: var(--surface-card);
    color: var(--text-primary); font: inherit; font-size: .85rem;
    transition: border-color .2s, background .2s, color .2s, transform .15s;
}
.prom-chip:hover { border-color: var(--accent-teal); transform: translateY(-1px); }
.prom-chip small { color: var(--text-muted); }
.prom-chip.on, .prom-chip:has(input:checked) { border-color: var(--accent-teal);
    background: color-mix(in srgb, var(--accent-teal) 14%, var(--surface-card)); color: var(--title-color); }
.prom-chip input { margin: 0; }
.prom-jobpick { display: flex; flex-wrap: wrap; gap: 8px; }
.prom-jobs { display: flex; flex-wrap: wrap; gap: 6px; }
.prom-jc {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
    font-size: .8rem; font-family: var(--fonte-mono, ui-monospace, monospace);
    border: 1px solid var(--border-color); background: var(--surface-suave);
}
.prom-jc small { color: var(--text-muted); }
.prom-jc i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); flex: none; }
.prom-jc.up i { background: var(--estado-ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--estado-ok) 60%, transparent);
                 animation: prom-pulse 2.4s ease-out infinite; }
.prom-jc.down { border-color: color-mix(in srgb, var(--estado-erro) 50%, transparent); }
.prom-jc.down i { background: var(--estado-erro); }
.prom-jc.wait i { background: var(--estado-aviso); }
@keyframes prom-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--estado-ok) 55%, transparent); }
                        70%, 100% { box-shadow: 0 0 0 6px transparent; } }
.prom-hosts tbody tr { animation: rise .3s ease both; animation-delay: calc(var(--r, 0) * 40ms); }
.prom-hosts tbody tr.prom-in { animation: rise .3s ease both; animation-delay: calc(var(--r, 0) * 40ms); }
.prom-hosts td .nic-sub.mono { display: block; }
.prom-bar { display: block; height: 6px; margin-top: 6px; border-radius: 3px; background: var(--surface-suave); overflow: hidden; }
.prom-bar i { display: block; height: 100%; width: var(--w); border-radius: 3px; background: var(--estado-ok);
              animation: prom-grow 1s cubic-bezier(.2,.8,.2,1) both; }
@keyframes prom-grow { from { width: 0; } }
.tile-unit { font-size: .95rem; color: var(--text-muted); margin-left: 4px; font-weight: 500; }
.prom-imp-grid { gap: 16px; margin-bottom: 16px; }
.prom-imp { border: 1px solid var(--border-color); border-radius: 14px; padding: 12px; background: var(--surface-card);
            transition: border-color .2s, transform .2s; }
.prom-imp.req { border-color: color-mix(in srgb, var(--accent-teal) 50%, var(--border-color)); }
.prom-imp.drag { border-color: var(--accent-teal); transform: scale(1.01); }
.prom-imp.has-file { border-color: var(--estado-ok); }
.prom-imp-drop { display: flex; gap: 12px; align-items: center; cursor: pointer; padding: 6px 4px 10px; }
.prom-imp-drop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.prom-imp-drop > .bi { font-size: 1.6rem; color: var(--accent-teal); transition: transform .3s; }
.prom-imp.has-file .prom-imp-drop > .bi { transform: translateY(-2px); color: var(--estado-ok); }
.prom-imp-drop small { display: block; color: var(--text-muted); font-size: .8rem; }
.prom-imp textarea { width: 100%; font-family: var(--fonte-mono, ui-monospace, monospace); font-size: .8rem; }
.prom-imp-foot, .prom-imp-apply { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.prom-imp-btns { display: flex; gap: 8px; }
.prom-plan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .9rem; }
.prom-plan-list .bi { color: var(--accent-teal); margin-right: 6px; }
.prom-custom { display: flex; flex-wrap: wrap; gap: 8px; }
.prom-custom small { opacity: .7; }
@media (prefers-reduced-motion: reduce) {
    .prom-jc.up i, .prom-bar i, .prom-hosts tbody tr, .prom-imp, .prom-chip { animation: none !important; transition: none !important; }
}
/* .nic-sub e block (legenda abaixo do texto); numa celula de tabela isso
   tirava o <td> do layout da tabela e a linha da borda saia torta. */
table.data td.nic-sub { display: table-cell; margin-top: 0; }
.prom-jobs { align-items: center; }
.prom-jc { height: 24px; box-sizing: border-box; line-height: 1; }

/* ===================================================================
   Prometheus > Alertas: pacotes de regras, ajuste por regra, mensagem
   =================================================================== */
.act-wide .act-body { width: 480px; max-width: calc(100vw - 40px); }
.rules-head { margin-top: 26px; }
.sec-title { margin: 0 0 4px; font-family: var(--fonte-titulo); color: var(--title-color); font-size: 1.25rem; }
.rule-pack-head { display: flex; align-items: center; gap: 4px; padding-left: 16px; }
.rule-pack-head .fold-head { flex: 1; padding-left: 8px; }
.rule-pack.is-off .fold-title, .rule-pack.is-off .fold-ico { opacity: .55; }
.rule-meter { flex: 0 0 90px; height: 6px; border-radius: 3px; background: var(--surface-suave); overflow: hidden; }
.rule-meter i { display: block; height: 100%; width: var(--w); background: var(--accent-teal); border-radius: 3px;
                transition: width .6s cubic-bezier(.2,.8,.2,1); animation: prom-grow 1s cubic-bezier(.2,.8,.2,1) both; }
.rule-pack.is-off .rule-meter i { background: var(--text-muted); }
.rtog-form { display: inline-flex; align-items: center; margin: 0; vertical-align: middle; }
.rule-pack-head .rtog-form { align-self: center; }
.rtog {
    position: relative; display: block; flex: none; width: 38px; height: 22px; border-radius: 999px; border: 0; padding: 0; cursor: pointer;
    background: color-mix(in srgb, var(--text-muted) 35%, transparent); transition: background .25s;
}
.rtog i { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
          background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .25s cubic-bezier(.3,1.4,.5,1); }
.rtog.on { background: var(--accent-teal); }
.rtog.on i { transform: translateX(16px); }
.rtog:focus-visible { outline: 2px solid var(--accent-teal); outline-offset: 2px; }
.rule-table tbody tr { animation: rise .3s ease both; animation-delay: calc(var(--r, 0) * 30ms); }
.rule-table tr.is-off td:not(:first-child) { opacity: .5; }
.rule-table tr.rule-group td { padding-top: 16px; font-size: .75rem; font-weight: 700; letter-spacing: .06em;
                               text-transform: uppercase; color: var(--brand-navy); border-bottom: 1px solid var(--border-color); }
.rule-table td .nic-sub { white-space: normal; }
.rule-expr { display: inline-block; max-width: 420px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
             font-size: .78rem; padding: 2px 6px; border-radius: 6px; background: var(--surface-suave); color: var(--text-primary); }
.rule-edit textarea.mono { font-family: var(--fonte-mono, ui-monospace, monospace); font-size: .8rem; }
.rule-limits .field input { font-size: 1.1rem; font-weight: 600; color: var(--title-color); }
.rule-edit-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.apa-picks { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.apa-picks form { margin: 0; }
.apa-pick { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; cursor: pointer;
            border: 1px solid var(--border-color); background: var(--surface-card); color: var(--title-color);
            font: inherit; font-size: .82rem; transition: border-color .2s, transform .15s, background .2s; }
.apa-pick:hover:not(:disabled) { border-color: var(--accent-teal); transform: translateY(-1px); }
.apa-pick:disabled { opacity: .55; cursor: default; }
.apa-url { border-top: 1px solid var(--border-color); padding-top: 12px; }
.alerts-cfg { margin-top: 18px; align-items: start; }
.tmpl-edit { width: 100%; min-height: 360px; font-size: .78rem; line-height: 1.5; tab-size: 2; }
.tmpl-help { margin: 10px 0; }
.tmpl-help summary { cursor: pointer; color: var(--accent-teal); font-size: .85rem; }
.tmpl-vars { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 10px 0; font-size: .8rem; }
.tmpl-vars code { color: var(--title-color); }
.tmpl-vars span { color: var(--text-muted); }
@media (prefers-reduced-motion: reduce) {
    .rule-table tbody tr, .rule-meter i, .rtog, .rtog i, .apa-pick { animation: none !important; transition: none !important; }
}
.snmp-creds { margin-bottom: 10px; }
.snmp-new { margin-top: 8px; }
.snmp-new > summary { list-style: none; display: inline-flex; }
.snmp-new > summary::-webkit-details-marker { display: none; }
.snmp-new[open] > form { margin-top: 10px; padding: 12px; border: 1px solid var(--border-color); border-radius: 12px; animation: rise .25s ease both; }

/* ===================================================================
   Firewall
   =================================================================== */
.fw-zone { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: .74rem;
           font-weight: 700; letter-spacing: .03em; border: 1px solid transparent; white-space: nowrap; }
.fw-z-wan  { background: color-mix(in srgb, #e5484d 14%, transparent); color: #c22d33; border-color: color-mix(in srgb, #e5484d 35%, transparent); }
.fw-z-lan  { background: color-mix(in srgb, var(--estado-ok) 14%, transparent); color: var(--estado-ok); border-color: color-mix(in srgb, var(--estado-ok) 35%, transparent); }
.fw-z-dmz  { background: color-mix(in srgb, var(--estado-aviso) 16%, transparent); color: #a35c00; border-color: color-mix(in srgb, var(--estado-aviso) 40%, transparent); }
.fw-z-mgmt { background: color-mix(in srgb, var(--accent-teal) 14%, transparent); color: var(--title-color); border-color: color-mix(in srgb, var(--accent-teal) 40%, transparent); }
.fw-z-any, .fw-z-none { background: var(--surface-suave); color: var(--text-muted); border-color: var(--border-color); }
html.dark-mode .fw-z-wan { color: #ff8a8e; } html.dark-mode .fw-z-dmz { color: #ffc067; }
.fw-act { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 8px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.fw-act.acc { background: color-mix(in srgb, var(--estado-ok) 12%, transparent); color: var(--estado-ok); }
.fw-act.drp { background: color-mix(in srgb, var(--estado-erro) 12%, transparent); color: var(--estado-erro); }
.fw-act.rej { background: color-mix(in srgb, var(--estado-aviso) 14%, transparent); color: #a35c00; }
.fw-act.blk { background: var(--estado-erro); color: #fff; }
.fw-top { align-items: start; margin-bottom: 18px; }
.fw-zones { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 10px; }
.fw-zcard { border-radius: 12px; padding: 12px 14px; border: 1px solid var(--border-color); animation: rise .35s ease both;
            animation-delay: calc(var(--r, 0) * 60ms); border-left-width: 4px; }
.fw-zcard.fw-z-wan { border-left-color: #e5484d; } .fw-zcard.fw-z-lan { border-left-color: var(--estado-ok); }
.fw-zcard.fw-z-dmz { border-left-color: var(--estado-aviso); } .fw-zcard.fw-z-mgmt { border-left-color: var(--accent-teal); }
.fw-zcard.empty { opacity: .55; }
.fw-zcard { background: var(--surface-card); color: var(--text-primary); }
.fw-zname { font-weight: 700; font-family: var(--fonte-titulo); color: var(--title-color); }
.fw-zifs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; font-size: .82rem; }
.fw-top-list { display: grid; gap: 8px; }
.fw-top-row { display: grid; grid-template-columns: 140px 1fr 50px auto; align-items: center; gap: 10px;
              animation: rise .3s ease both; animation-delay: calc(var(--r, 0) * 50ms); }
.fw-top-row form { margin: 0; }
.fw-top-bar { height: 8px; border-radius: 4px; background: var(--surface-suave); overflow: hidden; }
.fw-top-bar i { display: block; height: 100%; width: var(--w); background: var(--estado-erro); border-radius: 4px;
                animation: prom-grow .9s cubic-bezier(.2,.8,.2,1) both; }
.fw-top-n { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.fw-live { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; font-size: .75rem; font-weight: 600; color: var(--estado-ok); }
.fw-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--estado-ok); animation: live 1.6s ease-out infinite; }
.fw-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.fw-feed tbody tr { animation: rise .3s ease both; animation-delay: calc(var(--r, 0) * 25ms); }
.fw-feed tbody tr.fw-new { animation: fw-in .9s ease both; }
@keyframes fw-in { 0% { opacity: 0; transform: translateX(-12px); background: color-mix(in srgb, var(--accent-teal) 22%, transparent); }
                   30% { opacity: 1; transform: none; } 100% { background: transparent; } }
.fw-rules tbody tr { animation: rise .3s ease both; animation-delay: calc(var(--r, 0) * 35ms); }
.fw-rules tr.is-off td:not(:nth-child(2)) { opacity: .45; }
.fw-rules tr.fw-sys td { color: var(--text-muted); font-size: .86rem; background: var(--surface-suave); }
.fw-rules tr.fw-sys .bi-lock-fill { color: var(--text-muted); }
.fw-order { white-space: nowrap; }
.fw-order form { display: inline; margin: 0; }
.fw-ord { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.fw-ord:hover:not(:disabled) { color: var(--accent-teal); background: var(--surface-suave); }
.fw-ord:disabled { opacity: .25; cursor: default; }
.fw-addr { display: inline-block; padding: 1px 6px; border-radius: 6px; background: var(--surface-suave); font-size: .8rem; }
.fw-hits { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--title-color); display: inline-block; }
.fw-hits.bump { animation: fw-bump .6s ease; }
@keyframes fw-bump { 0% { transform: scale(1); color: var(--accent-teal); } 40% { transform: scale(1.18); color: var(--accent-teal); } 100% { transform: scale(1); } }
.fw-act-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.fw-act-opt input { position: absolute; opacity: 0; }
.fw-act-opt span { display: flex; justify-content: center; gap: 6px; padding: 8px; border-radius: 10px; cursor: pointer;
                   border: 1px solid var(--border-color); font-weight: 600; font-size: .85rem; transition: all .2s; }
.fw-act-opt.accept input:checked + span { background: color-mix(in srgb, var(--estado-ok) 14%, transparent); border-color: var(--estado-ok); color: var(--estado-ok); }
.fw-act-opt.drop input:checked + span { background: color-mix(in srgb, var(--estado-erro) 12%, transparent); border-color: var(--estado-erro); color: var(--estado-erro); }
.fw-act-opt.reject input:checked + span { background: color-mix(in srgb, var(--estado-aviso) 14%, transparent); border-color: var(--estado-aviso); color: #a35c00; }
.fw-presets { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.fw-presets .prom-chip { padding: 3px 9px; font-size: .78rem; }
.fw-nat-list { display: grid; gap: 10px; }
.fw-nat { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px;
          border: 1px solid var(--border-color); animation: rise .3s ease both; animation-delay: calc(var(--r, 0) * 60ms); }
.fw-nat form { margin: 0; }
.fw-nat.is-off { opacity: .55; }
.fw-nat-hits { margin-left: auto; }
.fw-flow { display: inline-flex; gap: 4px; }
.fw-flow i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-teal); animation: fw-dot 1.2s ease-in-out infinite; }
.fw-flow i:nth-child(2) { animation-delay: .2s; } .fw-flow i:nth-child(3) { animation-delay: .4s; }
.fw-nat.is-off .fw-flow i { animation: none; background: var(--text-muted); }
@keyframes fw-dot { 0%, 100% { opacity: .2; transform: translateX(-2px); } 50% { opacity: 1; transform: translateX(2px); } }
.fw-admin-pick { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.fw-admin-pick .prom-chip:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.fw-geo .bk-choice { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.fw-geo-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; max-height: 148px; overflow-y: auto; }
.fw-geo-pick .prom-chip small { opacity: .6; margin-left: 3px; }
.fw-geo-tab { margin: 6px 0 4px; }
.fw-protect { display: grid; gap: 8px; }
.fw-prot { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; cursor: pointer;
           border: 1px solid var(--border-color); transition: border-color .2s, background .2s;
           animation: rise .3s ease both; animation-delay: calc(var(--r, 0) * 45ms); }
.fw-prot:has(input:checked) { border-color: color-mix(in srgb, var(--accent-teal) 60%, var(--border-color)); background: var(--surface-suave); }
.fw-prot input { position: absolute; opacity: 0; }
.fw-prot-sw { position: relative; flex: 0 0 38px; height: 22px; border-radius: 999px; background: color-mix(in srgb, var(--text-muted) 35%, transparent); transition: background .25s; }
.fw-prot-sw i { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .25s cubic-bezier(.3,1.4,.5,1); }
.fw-prot input:checked + .fw-prot-sw { background: var(--accent-teal); }
.fw-prot input:checked + .fw-prot-sw i { transform: translateX(16px); }
.fw-prot-text { display: flex; flex-direction: column; flex: 1; }
.fw-prot-text small { color: var(--text-muted); font-size: .8rem; }
.fw-prot-hits { font-size: .8rem; color: var(--text-muted); }
@media (prefers-reduced-motion: reduce) {
    .fw-zcard, .fw-top-row, .fw-top-bar i, .fw-feed tbody tr, .fw-rules tbody tr, .fw-nat, .fw-flow i, .fw-prot, .fw-live i, .fw-hits.bump { animation: none !important; }
}
/* Sistema > Servidor: hora certa */
.ntp-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 10px; }
.ntp-servers tbody tr { animation: rise .3s ease both; animation-delay: calc(var(--r, 0) * 50ms); }
.ntp-st { display: inline-block; padding: 2px 9px; border-radius: 8px; font-size: .78rem; font-weight: 600; }
.ntp-use { background: var(--estado-ok); color: #fff; }
.ntp-ok { background: color-mix(in srgb, var(--estado-ok) 14%, transparent); color: var(--estado-ok); }
.ntp-warn { background: color-mix(in srgb, var(--estado-aviso) 16%, transparent); color: #a35c00; }
.ntp-bad { background: color-mix(in srgb, var(--estado-erro) 12%, transparent); color: var(--estado-erro); }
/* Minha conta / login: verificacao em duas etapas */
.mfa-box h2 .bi { color: var(--accent-teal); }
.mfa-on { display: flex; gap: 14px; align-items: center; margin: 8px 0 14px; }
.mfa-shield { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem;
              color: #fff; background: var(--estado-ok); animation: mfa-pop .6s cubic-bezier(.3,1.5,.5,1) both; }
@keyframes mfa-pop { from { transform: scale(.4); opacity: 0; } }
.mfa-more { margin-top: 8px; }
.mfa-more > summary { list-style: none; display: inline-flex; }
.mfa-more > summary::-webkit-details-marker { display: none; }
.mfa-more[open] > form { margin-top: 10px; padding: 12px; border: 1px solid var(--border-color); border-radius: 12px; animation: rise .25s ease both; }
.mfa-setup { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: start; }
.mfa-qr-wrap { padding: 8px; background: #fff; border-radius: 14px; box-shadow: var(--sombra-card); animation: mfa-pop .5s ease both; }
.mfa-qr { width: 100%; height: auto; display: block; }
.mfa-secret { display: inline-block; padding: 6px 10px; border-radius: 8px; background: var(--surface-suave);
              font-size: .85rem; letter-spacing: .05em; word-break: break-all; margin-bottom: 12px; }
.mfa-steps { margin: 0 0 10px 18px; padding: 0; }
.mfa-code { font-family: var(--fonte-mono, ui-monospace, monospace); font-size: 1.3rem; letter-spacing: .25em; text-align: center; }
.mfa-codes-box { border: 1px dashed var(--estado-aviso); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px;
                 background: color-mix(in srgb, var(--estado-aviso) 8%, transparent); }
.mfa-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 8px 0; }
.mfa-codes code { padding: 5px 8px; border-radius: 6px; background: var(--surface-card); text-align: center;
                  animation: rise .3s ease both; animation-delay: calc(var(--r, 0) * 50ms); }
.mfa-lock { width: 56px; height: 56px; margin: 6px auto 4px; border-radius: 18px; display: grid; place-items: center;
            font-size: 1.6rem; color: #fff; background: var(--accent-teal); animation: mfa-pop .6s cubic-bezier(.3,1.5,.5,1) both; }
@media (max-width: 700px) { .mfa-setup { grid-template-columns: 1fr; } .mfa-qr-wrap { max-width: 220px; } }
@media (prefers-reduced-motion: reduce) { .mfa-shield, .mfa-qr-wrap, .mfa-codes code, .mfa-lock { animation: none !important; } }
.fw-count { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: .74rem; font-weight: 700;
            background: var(--surface-suave); color: var(--title-color); font-variant-numeric: tabular-nums; }
/* Sessao inativa */
.idle-warn { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
             background: rgba(8, 15, 35, .45); backdrop-filter: blur(3px); animation: idle-fade .3s ease both; }
.idle-card { display: flex; align-items: center; gap: 16px; max-width: 460px; margin: 16px; padding: 20px 22px;
             border-radius: 18px; background: var(--surface-card); box-shadow: var(--sombra-flutuante);
             animation: mfa-pop .45s cubic-bezier(.3,1.4,.5,1) both; }
.idle-card > .bi { font-size: 2rem; color: var(--estado-aviso); animation: bk-spin 3s linear infinite; }
.idle-card strong { display: block; color: var(--title-color); font-family: var(--fonte-titulo); }
.idle-card span { color: var(--text-muted); font-size: .9rem; }
.idle-card .idle-n { color: var(--estado-erro); font-variant-numeric: tabular-nums; }
@keyframes idle-fade { from { opacity: 0; } }
.sess-pick { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
@media (prefers-reduced-motion: reduce) { .idle-warn, .idle-card, .idle-card > .bi { animation: none !important; } }
/* Sistema > Terminal */
.term-gate { max-width: 460px; margin: 10px auto; text-align: center; }
.term-gate .field { text-align: left; }
.term-lock { width: 60px; height: 60px; margin: 4px auto 10px; border-radius: 18px; display: grid; place-items: center;
             font-size: 1.7rem; color: #fff; background: var(--brand-navy); animation: mfa-pop .6s cubic-bezier(.3,1.5,.5,1) both; }
.term-wrap { border-radius: 16px; overflow: hidden; box-shadow: var(--sombra-card); border: 1px solid var(--border-color);
             background: #14161b; }
.term-wrap[data-theme="claro"] { background: #fbfcfe; }
.term-wrap[data-theme="newio"] { background: #0b1733; }
.term-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
            padding: 10px 14px; background: var(--surface-card); border-bottom: 1px solid var(--border-color); }
.term-title { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: var(--title-color); }
.term-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); }
.term-dot.on { background: var(--estado-ok); animation: live 1.8s ease-out infinite; }
.term-dot.wait { background: var(--estado-aviso); animation: bk-pulse 1s ease-in-out infinite; }
.term-dot.off { background: var(--estado-erro); }
.term-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.term-tools select { width: auto; padding: 6px 10px; }
.term-font { display: inline-flex; align-items: center; border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; }
.term-font button { border: 0; background: var(--surface-card); color: var(--title-color); width: 30px; height: 30px;
                    cursor: pointer; font-size: 1rem; }
.term-font button:hover { background: var(--surface-suave); }
.term-font span { min-width: 30px; text-align: center; font-variant-numeric: tabular-nums; }
.term-screen { height: calc(100vh - 290px); min-height: 360px; padding: 8px 4px 4px 10px; opacity: 0; transition: opacity .4s ease; }
.term-screen.on { opacity: 1; }
.term-foot { margin-top: 10px; }

/* =====================================================================
   Benchmark (fio, iperf3, internet)
   ===================================================================== */
.badge-err { background: var(--estado-erro-suave); color: #b4232a; }
html.dark-mode .badge-err { background: rgba(230, 53, 61, .16); color: #ff8a8f; }
.badge.bn-run { background: color-mix(in srgb, var(--accent-teal) 16%, transparent); color: #00787d; display: inline-flex; align-items: center; gap: 6px; }
html.dark-mode .badge.bn-run { color: var(--accent-teal); }
.bn-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-teal); animation: bnPulse 1.2s ease-in-out infinite; }
@keyframes bnPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(0, 184, 192, .55); } 50% { box-shadow: 0 0 0 6px rgba(0, 184, 192, 0); } }
.bn-ring { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--accent-teal); border-right-color: transparent; animation: bnSpin 0.9s linear infinite; }
@keyframes bnSpin { to { transform: rotate(360deg); } }
.bn-kico { color: var(--accent-teal); margin-right: 4px; }
.bn-sum { font-weight: 600; color: var(--title-color); font-variant-numeric: tabular-nums; }
.bn-hist td.actions { white-space: nowrap; text-align: right; }

.bn-sec-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 700; margin: 18px 0 8px; }
.bn-targets { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.bn-target, .bn-profile { position: relative; display: grid; grid-template-columns: 42px 1fr; gap: 4px 12px; align-items: center; padding: 12px 14px;
    border: 1.5px solid var(--border-color); border-radius: 14px; background: var(--surface-card); cursor: pointer;
    transition: border-color .2s, transform .15s, box-shadow .2s, background .2s; }
.bn-target:hover, .bn-profile:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(24, 59, 144, .10); }
.bn-target.on, .bn-profile.on { border-color: var(--accent-teal); background: color-mix(in srgb, var(--accent-teal) 7%, var(--surface-card));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-teal) 18%, transparent); }
.bn-target input, .bn-profile input { position: absolute; opacity: 0; pointer-events: none; }
.bn-t-ico { grid-row: span 2; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem;
    background: color-mix(in srgb, var(--brand-navy) 10%, transparent); color: var(--brand-navy); }
html.dark-mode .bn-t-ico { color: var(--brand-navy-claro); }
.bn-t-ico.zfs { background: color-mix(in srgb, var(--accent-teal) 14%, transparent); color: #00787d; }
.bn-t-ico.raw { background: rgba(245, 166, 35, .16); color: #8a5a00; }
.bn-t-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bn-t-free { grid-column: 2; font-size: .8rem; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.bn-t-free .mini-meter { width: 80px; }
.bn-kind { font-size: .66rem; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--surface-suave); color: var(--text-muted); }
.bn-kind.k-nvme { background: rgba(0, 184, 192, .16); color: #00787d; }
.bn-kind.k-ssd { background: rgba(24, 59, 144, .12); color: var(--brand-navy); }
.bn-confirm { width: 110px; margin-left: 6px; padding: 4px 8px; }
.bn-profiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bn-profile { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.bn-p-head { font-weight: 700; color: var(--title-color); display: flex; gap: 8px; align-items: center; }
.bn-p-head i { color: var(--accent-teal); }
.bn-cmd { font-size: .72rem; padding: 3px 8px; border-radius: 6px; background: var(--surface-suave); color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bn-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.bn-pills span { font: 600 .68rem var(--fonte-mono, ui-monospace, monospace); padding: 2px 7px; border-radius: 6px; background: var(--surface-suave); }
.bn-rep { margin-top: 14px; border: 1px dashed var(--border-color); border-radius: 12px; padding: 10px 14px; }
.bn-rep summary { cursor: pointer; font-weight: 600; color: var(--title-color); }
.bn-rep[open] summary { margin-bottom: 10px; }
.bn-ok { color: var(--estado-ok) !important; } .bn-bad { color: var(--estado-erro) !important; }
.bn-form.bn-locked { opacity: .55; pointer-events: none; filter: saturate(.6); transition: opacity .3s; }
.bn-chips .prom-chip { align-self: center; }
.bn-chips input.bn-mini { display: inline-block; width: 58px; height: 24px; padding: 0 6px; margin: 0 0 0 4px; font-size: .82rem; border-radius: 8px; }

/* painel ao vivo */
.bn-live { margin-bottom: var(--gap); overflow: hidden; position: relative; }
.bn-live.bn-in { animation: bnIn .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes bnIn { from { opacity: 0; transform: translateY(-10px) scale(.99); } }
.bn-live.is-running::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-teal), var(--brand-navy), transparent); background-size: 200% 100%; animation: bnFlow 1.6s linear infinite; }
@keyframes bnFlow { from { background-position: 200% 0; } to { background-position: 0 0; } }
.bn-live-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.bn-live-title { font-weight: 700; font-size: 1.05rem; color: var(--title-color); display: flex; gap: 10px; align-items: center; }
.bn-live:not(.is-running) .bn-ring { display: none; }
.bn-live-acts { display: flex; gap: 8px; align-items: center; }
.bn-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin: 14px 0; }
.bn-step { display: grid; grid-template-columns: 18px 1fr; gap: 2px 8px; align-items: center; font-size: .8rem; padding: 8px 10px; border-radius: 10px; background: var(--surface-suave); color: var(--text-muted); }
.bn-step i { font-size: .95rem; }
.bn-step-bar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--track); overflow: hidden; }
.bn-step-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-navy), var(--accent-teal)); transition: width 1s linear; }
.bn-step.s-running { color: var(--title-color); background: color-mix(in srgb, var(--accent-teal) 10%, var(--surface-card)); }
.bn-step.s-running i { color: var(--accent-teal); animation: bnSpin 1.2s linear infinite; }
.bn-step.s-done { color: var(--text-primary); } .bn-step.s-done i { color: var(--estado-ok); }
.bn-step.s-failed i { color: var(--estado-erro); } .bn-step.s-stopped i { color: var(--estado-aviso); }
.bn-big { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.bn-big:empty { display: none; }
.bn-num { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border-color); background: var(--surface-card); position: relative; overflow: hidden; }
.bn-num::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.bn-num-v { font-size: 1.7rem; font-weight: 800; color: var(--title-color); font-variant-numeric: tabular-nums; }
.bn-num small { margin-left: 4px; color: var(--text-muted); font-weight: 600; }
.bn-num-l { display: block; font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.bn-chart-wrap { position: relative; }
.bn-chart-wrap canvas { width: 100%; height: 220px; display: block; }
.bn-chart-leg { display: flex; gap: 14px; font-size: .78rem; color: var(--text-muted); margin-top: 4px; }
.bn-chart-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.bn-done { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--estado-ok) 10%, var(--surface-card)); color: var(--text-primary); animation: bnIn .4s; }
.bn-done i { color: var(--estado-ok); }
.bn-toast { position: fixed; right: 22px; bottom: 22px; z-index: 50; max-width: 420px; box-shadow: 0 12px 30px rgba(0, 0, 0, .18); animation: bnIn .3s; transition: opacity .6s, transform .6s; }
.bn-toast.out { opacity: 0; transform: translateY(10px); }

/* rede */
.bn-net { align-items: start; }
.bn-srv { position: relative; overflow: hidden; }
.bn-radar { position: absolute; right: 18px; top: 58px; width: 64px; height: 64px; display: grid; place-items: center; color: var(--text-muted); font-size: 1.4rem; }
.bn-radar span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent-teal); opacity: 0; }
.bn-srv.on .bn-radar { color: var(--accent-teal); }
.bn-srv.on .bn-radar span { animation: bnRadar 2.4s ease-out infinite; }
.bn-srv.on .bn-radar span:nth-child(2) { animation-delay: .8s; } .bn-srv.on .bn-radar span:nth-child(3) { animation-delay: 1.6s; }
@keyframes bnRadar { from { transform: scale(.3); opacity: .9; } to { transform: scale(1.4); opacity: 0; } }
.bn-cmdline { padding: 10px 12px; border-radius: 10px; background: #0b1733; color: #9fe8ec; font-size: .85rem; margin: 6px 90px 10px 0; }
.bn-srv-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.bn-srv-form .field { margin: 0; width: 130px; }
.bn-recv tr.bn-new td { animation: bnFlash 2s ease; }
@keyframes bnFlash { from { background: color-mix(in srgb, var(--accent-teal) 25%, transparent); } }

/* internet */
.bn-gauges { display: grid; grid-template-columns: 1fr 1fr 220px; gap: 18px; align-items: center; }
.bn-gauge { position: relative; text-align: center; }
.bn-gauge svg { width: 100%; max-width: 300px; display: block; margin: 0 auto; }
.bn-gauge path { fill: none; stroke-width: 14; stroke-linecap: round; }
.bn-gauge .g-track { stroke: var(--track); }
.bn-gauge .g-fill { stroke: var(--brand-navy); stroke-dasharray: 377; stroke-dashoffset: 377; transition: stroke-dashoffset .9s cubic-bezier(.2, .8, .2, 1); }
.bn-gauge[data-gauge="up"] .g-fill { stroke: var(--accent-teal); }
.bn-gauge.active .g-fill { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent-teal) 70%, transparent)); }
.bn-gauge .g-val { position: absolute; left: 0; right: 0; top: 46%; font-size: 2.2rem; font-weight: 800; color: var(--title-color); font-variant-numeric: tabular-nums; }
.bn-gauge .g-val small { font-size: .85rem; margin-left: 4px; color: var(--text-muted); }
.bn-gauge .g-label { margin-top: -6px; font-weight: 600; color: var(--text-muted); }
.bn-ping { display: flex; flex-direction: column; gap: 10px; }
.bn-ping > div { display: flex; align-items: baseline; gap: 8px; }
.bn-ping strong { font-size: 1.6rem; color: var(--title-color); font-variant-numeric: tabular-nums; }
.bn-ping .nic-sub { width: 64px; }
.bn-isp { display: block !important; line-height: 1.4; }
.bn-inet-form { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.bn-inet-form .field { margin: 0; }
.bn-go-big { padding: 12px 34px; font-size: 1rem; border-radius: 999px; }

/* visao geral */
.bn-tools { margin-bottom: var(--gap); }
.bn-tool { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; transition: transform .2s, box-shadow .2s; position: relative; overflow: hidden; }
.bn-tool:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(24, 59, 144, .14); }
.bn-tool-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.35rem; color: #fff;
    background: linear-gradient(135deg, var(--brand-navy), var(--accent-teal)); box-shadow: 0 8px 18px rgba(0, 184, 192, .25); }
.bn-tool-name { font-size: 1.15rem; font-weight: 800; color: var(--title-color); }
.bn-tool-last { display: flex; flex-direction: column; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--border-color); }
.bn-tool-last strong { color: var(--title-color); font-variant-numeric: tabular-nums; }
.bn-tool-go { font-weight: 700; color: var(--accent-teal); font-size: .85rem; }
.bn-tool:hover .bn-tool-go i { transform: translateX(4px); }
.bn-tool-go i { display: inline-block; transition: transform .2s; }

@media (max-width: 900px) {
    .bn-profiles, .bn-gauges { grid-template-columns: 1fr; }
    .bn-cmdline { margin-right: 0; }
    .bn-radar { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .bn-pulse, .bn-ring, .bn-live.is-running::before, .bn-srv.on .bn-radar span, .bn-step.s-running i { animation: none; }
}

/* =====================================================================
   Trafego ao vivo
   ===================================================================== */
.tr-live { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--text-muted); }
.tr-live.paused .live-dot { animation: none; opacity: .4; }
.tr-ifaces { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.tr-if { padding: 14px 16px; }
.tr-if.down { opacity: .55; }
.tr-if-head { display: flex; align-items: center; gap: 8px; }
.tr-if-name { font-weight: 800; color: var(--title-color); }
.tr-if-state { margin-left: auto; }
.tr-if-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0 4px; }
.tr-if-nums div { display: flex; flex-direction: column; }
.tr-if-nums i { font-size: .8rem; color: var(--text-muted); }
.tr-if-nums strong { font-size: 1.25rem; color: var(--title-color); font-variant-numeric: tabular-nums; transition: color .3s; }
.tr-if-nums div:first-child strong { color: var(--brand-navy); }
html.dark-mode .tr-if-nums div:first-child strong { color: var(--brand-navy-claro); }
.tr-if-nums div:last-child strong { color: #00949b; }
.tr-if-nums small { font-size: .72rem; color: var(--text-muted); }
.tr-spark { width: 100%; height: 54px; display: block; }
.tr-if-meter { height: 4px; border-radius: 4px; background: var(--track); overflow: hidden; margin-top: 6px; }
.tr-if-meter span { display: block; height: 100%; width: 0; background: var(--accent-teal); transition: width .8s ease; }
.tr-if-meter span.warm { background: var(--estado-aviso); } .tr-if-meter span.hot { background: var(--estado-erro); }
.tr-if-foot { font-size: .72rem; margin-top: 6px; }
.tr-tiles .tile-value span { font-variant-numeric: tabular-nums; }
.tr-main { align-items: start; }
.tr-list { display: flex; flex-direction: column; gap: 6px; }
.tr-row { padding: 8px 10px; border-radius: 10px; background: var(--surface-suave); transition: background .4s; }
.tr-row.tr-new { animation: bnIn .5s ease; background: color-mix(in srgb, var(--accent-teal) 16%, var(--surface-card)); }
.tr-row-main { display: grid; grid-template-columns: 26px auto 1fr auto; gap: 8px; align-items: center; font-size: .85rem; }
.tr-row-main .nic-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-ip { font-weight: 700; color: var(--title-color); }
.tr-rates { display: flex; gap: 10px; font-variant-numeric: tabular-nums; font-weight: 600; font-size: .8rem; white-space: nowrap; }
.tr-rates .rx { color: var(--brand-navy); } .tr-rates .tx { color: #00949b; }
html.dark-mode .tr-rates .rx { color: var(--brand-navy-claro); }
.tr-bar { display: flex; height: 4px; margin-top: 6px; border-radius: 4px; overflow: hidden; background: var(--track); }
.tr-bar span { display: block; height: 100%; transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.tr-bar .rx { background: var(--brand-navy); } .tr-bar .tx { background: var(--accent-teal); }
.tr-dir { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; font-size: .8rem; }
.tr-dir.d-in { background: rgba(24, 59, 144, .12); color: var(--brand-navy); }
.tr-dir.d-out { background: rgba(0, 184, 192, .16); color: #00787d; }
.tr-dir.d-fwd { background: rgba(245, 166, 35, .16); color: #8a5a00; }
.tr-dir.d-mix { background: var(--surface-card); color: var(--text-muted); }
.tr-flows td.n { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 700px) { .tr-row-main { grid-template-columns: 26px 1fr; } .tr-row-main .nic-sub, .tr-rates { grid-column: 2; } }

.tr-dirpick { display: flex; flex-wrap: wrap; gap: 4px; }
.tr-dirpick button { border: 1px solid var(--border-color); background: var(--surface-card); color: var(--text-muted); border-radius: 999px;
    padding: 3px 10px; font: inherit; font-size: .76rem; cursor: pointer; transition: all .2s; }
.tr-dirpick button:hover { border-color: var(--accent-teal); }
.tr-dirpick button.on { background: var(--brand-navy); border-color: var(--brand-navy); color: #fff; }
html.dark-mode .tr-dirpick button.on { background: var(--accent-teal); border-color: var(--accent-teal); color: #062a2c; }
.tr-flows td { white-space: nowrap; vertical-align: middle; }
.tr-flows td .tr-dir { margin-right: 4px; }

/* Dashboard: IP publico de saida, discreto abaixo do "Atualizado" */
.pubip { margin-top: 4px; font-size: .78rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.pubip .mono { color: var(--title-color); font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--surface-suave); }
.pubip .mono.flash { animation: bnFlash 1.6s ease; }
.pubip-copy { border: 0; background: none; color: var(--text-muted); cursor: pointer; padding: 2px; font-size: .8rem; }
.pubip-copy:hover { color: var(--accent-teal); }

/* Prometheus: "Monitorar um host novo" */
.prom-howto { margin-bottom: var(--gap); }
.prom-steps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 14px; }
.prom-steps li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; }
.prom-steps li > div { min-width: 0; overflow-wrap: anywhere; }
.prom-step-n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff;
    background: linear-gradient(135deg, var(--brand-navy), var(--accent-teal)); }
.prom-cmd { display: flex; gap: 8px; align-items: center; margin: 8px 0 6px; padding: 8px 8px 8px 12px; border-radius: 10px; background: #0b1733; }
.prom-cmd code { color: #9fe8ec; font-size: .8rem; overflow-x: auto; white-space: nowrap; flex: 1; min-width: 0; background: none; }
.prom-cmd .btn { color: #9fe8ec; border-color: rgba(159, 232, 236, .3); flex: none; }
.prom-dash { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }

/* Backup: restaurar de outro NewOS (S3) */
.s3n-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.s3n-acts { display: flex; gap: 8px; align-items: center; }
.s3n-alt { margin: 8px 0 12px; }
.s3n-msg { min-height: 20px; font-size: .85rem; margin-bottom: 6px; }
.s3n-hosts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.s3n-host { display: grid; grid-template-columns: 34px 1fr; gap: 2px 10px; text-align: left; padding: 12px 14px; cursor: pointer; font: inherit;
    border: 1.5px solid var(--border-color); border-radius: 14px; background: var(--surface-card); color: var(--text-primary);
    animation: bnIn .4s ease both; animation-delay: calc(var(--i, 0) * 30ms); transition: border-color .2s, transform .15s, box-shadow .2s; }
.s3n-host:hover { border-color: var(--accent-teal); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(24, 59, 144, .10); }
.s3n-host > i { grid-row: span 3; font-size: 1.3rem; color: var(--accent-teal); align-self: center; }
.s3n-name { font-weight: 800; color: var(--title-color); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s3n-host .nic-sub { grid-column: 2; }
.s3n-items-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }

/* Servicos: log ao vivo */
.svl { margin-bottom: var(--gap); }
.svl .card-head { flex-wrap: wrap; gap: 10px; }
.svl-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.svl-tools select { width: auto; max-width: 220px; padding: 5px 10px; font-size: .82rem; }
.svl-search { min-width: 180px; }
.svl-counts { display: flex; gap: 14px; font-size: .8rem; color: var(--text-muted); margin: 2px 0 8px; min-height: 18px; }
.svl-counts .c-warn { color: #b9770b; } .svl-counts .c-err { color: var(--estado-erro); }
.svl-feed { max-height: 420px; overflow-y: auto; border-radius: 12px; background: #0b1733; padding: 6px 0; font-size: .78rem; }
.svl-feed .empty { color: #9aa5b1; }
.svl-line { display: grid; grid-template-columns: 112px 150px 46px minmax(0, 1fr); gap: 8px; align-items: baseline;
    padding: 3px 12px; color: #cdd6ea; border-left: 3px solid transparent; }
.svl-line:hover { background: rgba(255, 255, 255, .04); }
.svl-line.svl-new { animation: svlIn 1.6s ease; }
@keyframes svlIn { from { background: rgba(0, 184, 192, .22); transform: translateX(-6px); } }
.svl-t { color: #7f8db0; }
.svl-unit { border: 0; background: none; padding: 0; font: inherit; color: #6fd3d8; cursor: pointer; text-align: left;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svl-unit:hover { text-decoration: underline; }
.svl-p { font-size: .68rem; text-transform: uppercase; color: #7f8db0; }
.svl-msg { white-space: pre-wrap; overflow-wrap: anywhere; }
.svl-line.p-err { border-left-color: var(--estado-erro); background: rgba(230, 53, 61, .10); }
.svl-line.p-err .svl-p, .svl-line.p-err .svl-msg { color: #ff9a9f; }
.svl-line.p-warn { border-left-color: var(--estado-aviso); }
.svl-line.p-warn .svl-p, .svl-line.p-warn .svl-msg { color: #ffd479; }
.svl-line.p-dbg .svl-msg { color: #8a96b5; }
.svl-row-btn { border: 0; background: none; color: var(--text-muted); cursor: pointer; padding: 0 4px; font-size: .85rem; }
.svl-row-btn:hover { color: var(--accent-teal); }
@media (max-width: 800px) { .svl-line { grid-template-columns: 1fr; gap: 0; } }

/* Login: corredor de datacenter animado atras do cartao (login-bg.js) */
.login-wrap { position: relative; overflow: hidden; isolation: isolate; }
.login-wrap .dc-bg { position: absolute; inset: 0; z-index: -1; display: block; }
.login-wrap.has-dc { background: #030917; }
.login-wrap.has-dc .login-card { position: relative; animation: dcCard .9s cubic-bezier(.2, .8, .2, 1) both;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .06), 0 0 60px rgba(0, 184, 192, .12); }
@keyframes dcCard { from { opacity: 0; transform: translateY(18px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .login-wrap.has-dc .login-card { animation: none; } }
