/* ==========================================================================
   NOC Control — folha de estilo principal
   ========================================================================== */

:root {
    --bg: #080c15;
    --bg-glow-1: rgba(79, 140, 255, .13);
    --bg-glow-2: rgba(124, 92, 255, .10);
    --panel: #0f1626;
    --panel-2: #121b2d;
    --panel-3: #172136;
    --line: #1d2a41;
    --line-soft: rgba(255, 255, 255, .055);
    --text: #e8edf7;
    --text-soft: #c3cde0;
    --muted: #8492a8;
    --muted-2: #63718a;
    --accent: #4f8cff;
    --accent-2: #7c5cff;
    --accent-soft: rgba(79, 140, 255, .12);
    --green: #22c55e;
    --green-soft: rgba(34, 197, 94, .13);
    --amber: #f5a524;
    --amber-soft: rgba(245, 165, 36, .13);
    --red: #ef4444;
    --red-soft: rgba(239, 68, 68, .13);
    --cyan: #22d3ee;
    --sidebar-bg: linear-gradient(180deg, #0d1424 0%, #0a0f1a 100%);
    --sidebar-line: rgba(255, 255, 255, .06);
    --sidebar-text: #aab7cc;
    --sidebar-text-strong: #eef3fc;
    --shadow: 0 18px 50px rgba(0, 0, 0, .28);
    --shadow-sm: 0 8px 24px rgba(0, 0, 0, .18);
    --radius: 14px;
    --sidebar-w: 256px;
    --topbar-h: 64px;
    --font: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

html[data-theme="light"] {
    --bg: #f2f5fa;
    --bg-glow-1: rgba(79, 140, 255, .10);
    --bg-glow-2: rgba(124, 92, 255, .07);
    --panel: #ffffff;
    --panel-2: #f8fafd;
    --panel-3: #eef2f9;
    --line: #e1e7f2;
    --line-soft: rgba(15, 23, 42, .06);
    --text: #101827;
    --text-soft: #2c3a52;
    --muted: #5e6d84;
    --muted-2: #8492a8;
    --accent: #2563eb;
    --accent-2: #6d4aff;
    --accent-soft: rgba(37, 99, 235, .09);
    --green-soft: rgba(34, 197, 94, .12);
    --amber-soft: rgba(217, 119, 6, .12);
    --red-soft: rgba(220, 38, 38, .1);
    --shadow: 0 18px 45px rgba(15, 23, 42, .08);
    --shadow-sm: 0 8px 20px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(1100px 520px at 8% -12%, var(--bg-glow-1), transparent 62%),
        radial-gradient(900px 480px at 98% -6%, var(--bg-glow-2), transparent 60%),
        var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }
svg.icon {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none;
}
code, .mono { font-family: var(--mono); font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

::selection { background: rgba(79, 140, 255, .35); }

/* ------------------------------- Estrutura ------------------------------- */

.app-shell { min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px 14px 18px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-line);
    color: var(--sidebar-text);
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 4px 8px 18px;
    color: var(--sidebar-text-strong);
    border-bottom: 1px solid var(--sidebar-line);
    margin-bottom: 10px;
}
.brand:hover { color: var(--sidebar-text-strong); }
.brand-mark { flex: none; filter: drop-shadow(0 6px 14px rgba(79, 140, 255, .35)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 16px; letter-spacing: -.01em; }
.brand-text small { color: var(--sidebar-text); font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; margin-top: 3px; }

.nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; padding-bottom: 8px; }
.nav-section {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #5e6d87;
    padding: 10px 12px 6px;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--sidebar-text);
    font-size: 13.5px;
    font-weight: 500;
    border: 1px solid transparent;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.nav-link svg { color: #7284a1; transition: color .15s ease; flex: none; }
.nav-link:hover { background: rgba(255, 255, 255, .045); color: var(--sidebar-text-strong); }
.nav-link:hover svg { color: #9fb1cc; }
.nav-link.active {
    background: linear-gradient(90deg, rgba(79, 140, 255, .17), rgba(79, 140, 255, .07));
    border-color: rgba(79, 140, 255, .22);
    color: #fff;
}
.nav-link.active svg { color: #7cabff; }
.nav-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(239, 68, 68, .18);
    border: 1px solid rgba(239, 68, 68, .35);
    color: #ff9c9c;
    display: grid;
    place-items: center;
    font-size: 10.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding: 0 4px; }
.sidebar-hint {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    padding: 11px;
    border-radius: 11px;
    background: rgba(79, 140, 255, .07);
    border: 1px solid rgba(79, 140, 255, .16);
    font-size: 11px;
    line-height: 1.35;
}
.sidebar-hint-icon { color: #7cabff; margin-top: 1px; }
.sidebar-hint strong { display: block; color: #d5e2f8; font-size: 11.5px; }
.sidebar-hint small { color: #7f8fa8; display: block; margin-top: 3px; }
.sidebar-hint code { color: #a9bcda; font-size: 10px; white-space: nowrap; }
.sidebar-version { color: #55627a; font-size: 10.5px; padding-left: 4px; }

.main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.sidebar-overlay { display: none; }

/* --------------------------------- Topbar -------------------------------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 28px;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line-soft);
}
html[data-theme="light"] .topbar { background: rgba(255, 255, 255, .82); }

.icon-btn.menu-btn { display: none; }

.topbar-search {
    position: relative;
    flex: 0 1 360px;
    display: flex;
    align-items: center;
}
.topbar-search svg { position: absolute; left: 12px; color: var(--muted-2); pointer-events: none; }
.topbar-search input {
    width: 100%;
    height: 38px;
    padding: 0 12px 0 36px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    outline: none;
    font-size: 13px;
    transition: border-color .15s, box-shadow .15s;
}
.topbar-search input::placeholder { color: var(--muted-2); }
.topbar-search input:focus { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 3px var(--accent-soft); }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.icon-btn {
    position: relative;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--panel-3); color: var(--text); }
.dot-badge {
    position: absolute;
    top: 3px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    display: grid;
    place-items: center;
    border: 2px solid var(--bg);
}
.theme-icon-light { display: none; }
html[data-theme="light"] .theme-icon-dark { display: none; }
html[data-theme="light"] .theme-icon-light { display: block; }

.user-menu { position: relative; margin-left: 6px; }
.user-menu summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 4px 8px 4px 4px;
    border-radius: 11px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background .15s, border-color .15s;
}
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover, .user-menu[open] summary { background: var(--panel); border-color: var(--line); }
.avatar {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .02em;
    flex: none;
}
.avatar.large { width: 38px; height: 38px; border-radius: 11px; font-size: 13px; }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta strong { font-size: 12.5px; font-weight: 600; color: var(--text); }
.user-meta small { color: var(--muted-2); font-size: 10.5px; }
.user-menu .chev { color: var(--muted-2); }
.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 244px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 13px;
    box-shadow: var(--shadow);
    padding: 6px;
    z-index: 60;
}
.user-dropdown-head {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 9px 9px 12px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 6px;
}
.user-dropdown-head div { display: flex; flex-direction: column; min-width: 0; }
.user-dropdown-head strong { font-size: 12.5px; }
.user-dropdown-head small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown > a, .user-dropdown form button {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 9px 10px;
    border-radius: 8px;
    color: var(--text-soft);
    font-size: 12.5px;
    background: none;
    border: 0;
    cursor: pointer;
    text-align: left;
}
.user-dropdown > a:hover, .user-dropdown form button:hover { background: var(--panel-3); color: var(--text); }
.user-dropdown form { margin: 0; border-top: 1px solid var(--line); padding-top: 5px; margin-top: 5px; }
.user-dropdown form button { color: #f87171; }
.user-dropdown form button:hover { background: var(--red-soft); }

/* --------------------------------- Página -------------------------------- */

.page {
    flex: 1;
    width: 100%;
    max-width: 1640px;
    margin: 0 auto;
    padding: 26px 30px 36px;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted-2); margin-bottom: 7px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumb-sep { color: var(--muted-2); opacity: .6; }
.page-title { font-size: 25px; line-height: 1.2; font-weight: 700; letter-spacing: -.022em; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 5px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.app-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 34px;
    padding-top: 18px;
    border-top: 1px solid var(--line-soft);
    color: var(--muted-2);
    font-size: 11.5px;
}
.app-foot-sep { opacity: .5; }
.app-foot-brand { color: var(--muted); font-weight: 600; letter-spacing: .03em; text-decoration: none; }
.app-foot-brand:hover { color: var(--accent); }

/* -------------------------------- Botões --------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 38px;
    padding: 0 15px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s, transform .05s;
    text-decoration: none;
}
.btn:hover { background: var(--panel-3); color: var(--text); border-color: var(--line); }
.btn:active { transform: translateY(1px); }
.btn svg { flex: none; }
.btn-primary {
    background: linear-gradient(180deg, #5b95ff, #3f7cf0);
    border-color: rgba(79, 140, 255, .55);
    color: #fff;
    box-shadow: 0 8px 20px rgba(79, 140, 255, .25);
}
.btn-primary:hover { background: linear-gradient(180deg, #6ba0ff, #4a86f5); color: #fff; border-color: rgba(79, 140, 255, .75); }
html[data-theme="light"] .btn-primary { background: linear-gradient(180deg, #3b82f6, #2563eb); }
.btn-danger { background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .3); color: #f87171; }
.btn-danger:hover { background: rgba(239, 68, 68, .17); color: #fca5a5; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--panel-3); color: var(--text); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12px; border-radius: 8px; }
.btn-icon { width: 34px; height: 34px; padding: 0; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn.is-loading { pointer-events: none; opacity: .75; }
.btn.is-loading svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.link-btn {
    background: none;
    border: 0;
    padding: 0;
    color: var(--accent);
    font-size: inherit;
    cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }

/* --------------------------------- Cards --------------------------------- */

.card {
    background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 97%, #fff 3%), var(--panel));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    min-width: 0;
}
html[data-theme="light"] .card { background: var(--panel); }
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line-soft);
    flex-wrap: wrap;
}
.card-title { font-size: 14px; font-weight: 650; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.card-title svg { color: var(--muted); }
.card-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }
.card-body.tight { padding: 12px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line-soft); display: flex; justify-content: space-between; align-items: center; gap: 10px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-16 { margin-bottom: 16px; }

/* --------------------------------- Stats --------------------------------- */

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
    position: relative;
    overflow: hidden;
    padding: 16px 17px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow-sm);
}
.stat::after {
    content: "";
    position: absolute;
    inset: auto -30% -70% auto;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, var(--stat-color, var(--accent)) 0%, transparent 68%);
    opacity: .12;
    pointer-events: none;
}
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-label { color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: var(--stat-color, var(--accent));
    background: color-mix(in srgb, var(--stat-color, var(--accent)) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--stat-color, var(--accent)) 22%, transparent);
}
.stat-value [data-count] { display: inline-block; animation: stat-pop .45s cubic-bezier(.2, .8, .2, 1); }
.stat-value { font-size: 30px; font-weight: 720; letter-spacing: -.03em; line-height: 1.15; margin-top: 10px; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.stat-foot { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 11.5px; color: var(--muted); }
.stat-foot .up { color: var(--green); }
.stat-foot .down { color: var(--red); }
.stat-foot .warn { color: var(--amber); }

/* -------------------------------- Badges --------------------------------- */

.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
}
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.status-online { color: #4ade80; background: rgba(34, 197, 94, .1); border-color: rgba(34, 197, 94, .22); }
.status-warning { color: #fbbf24; background: rgba(245, 165, 36, .1); border-color: rgba(245, 165, 36, .24); }
.status-offline { color: #f87171; background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .24); }
.status-unknown { color: #94a3b8; background: rgba(148, 163, 184, .1); border-color: rgba(148, 163, 184, .2); }
html[data-theme="light"] .status-online { color: #15803d; background: #dcfce7; border-color: #bbf7d0; }
html[data-theme="light"] .status-warning { color: #b45309; background: #fef3c7; border-color: #fde68a; }
html[data-theme="light"] .status-offline { color: #b91c1c; background: #fee2e2; border-color: #fecaca; }
html[data-theme="light"] .status-unknown { color: #475569; background: #f1f5f9; border-color: #e2e8f0; }

.type-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--chip-color, var(--muted));
    background: color-mix(in srgb, var(--chip-color, var(--muted)) 11%, transparent);
    border: 1px solid color-mix(in srgb, var(--chip-color, var(--muted)) 22%, transparent);
    white-space: nowrap;
}
.sev {
    display: inline-flex;
    align-items: center;
    height: 21px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.sev-critical { color: #f87171; background: rgba(239, 68, 68, .12); border: 1px solid rgba(239, 68, 68, .28); }
.sev-warning { color: #fbbf24; background: rgba(245, 165, 36, .12); border: 1px solid rgba(245, 165, 36, .28); }
.sev-info { color: #60a5fa; background: rgba(96, 165, 250, .12); border: 1px solid rgba(96, 165, 250, .26); }
.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 23px;
    padding: 0 9px;
    border-radius: 999px;
    background: var(--panel-3);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 500;
    white-space: nowrap;
}
.pill strong { color: var(--text-soft); font-weight: 650; }

/* --------------------------------- Tabelas -------------------------------- */

.table-wrap { width: 100%; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
    text-align: left;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--muted-2);
    font-weight: 650;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--panel-2) 55%, transparent);
    white-space: nowrap;
}
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: color-mix(in srgb, var(--panel-3) 55%, transparent); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .row-actions { display: flex; justify-content: flex-end; gap: 4px; opacity: .92; transition: opacity .15s; }
table.data tr:hover .row-actions { opacity: 1; }
table.data .row-actions .btn { gap: 5px; color: var(--muted); }
table.data .row-actions .btn:hover { color: var(--text); }
.table-action {
    background: none;
    border: 0;
    padding: 2px 3px;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.6;
    cursor: pointer;
    white-space: nowrap;
    border-radius: 4px;
}
.table-action:hover { color: var(--accent); background: var(--accent-soft); }
.table-action.is-loading { opacity: .55; pointer-events: none; }

.cell-device { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.table-art {
    position: relative;
    width: 44px;
    height: 44px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--status-color, var(--dev-color, var(--accent))) 34%, transparent);
    background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--dev-color, var(--accent)) 13%, transparent), transparent 72%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}
.table-art .device-art { width: 40px; height: 40px; }
.table-art.is-online { --status-color: var(--green); }
.table-art.is-warning { --status-color: var(--amber); }
.table-art.is-offline { --status-color: var(--red); }
.table-art.is-unknown { --status-color: #94a3b8; }
.table-art::after {
    content: "";
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--status-color);
    border: 2px solid var(--panel);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--status-color) 18%, transparent);
}
.table-art:hover { transform: translateY(-1px); }
.table-art .model-photo { border-radius: 8px; }

.dev-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    flex: none;
    color: var(--dev-color, var(--accent));
    background: color-mix(in srgb, var(--dev-color, var(--accent)) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--dev-color, var(--accent)) 20%, transparent);
}
.cell-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.cell-title>a, .cell-title>strong { color: var(--text); font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-title>a:hover { color: var(--accent); }
.cell-title small { color: var(--muted-2); font-size: 11.5px; font-family: var(--mono); }
.cell-sub { color: var(--muted); font-size: 11.5px; }
.cell-client { display: block; max-width: 165px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-strong { color: var(--text-soft); font-weight: 600; }
.text-muted { color: var(--muted); }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }

.bar-cell { display: flex; align-items: center; gap: 8px; min-width: 96px; }
.bar-cell .progress { flex: 1; }
.bar-cell span { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ------------------------------- Progresso -------------------------------- */

.progress {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text) 8%, transparent);
    overflow: hidden;
}
.progress>span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--progress-color, var(--green)), color-mix(in srgb, var(--progress-color, var(--green)) 75%, #fff));
    transition: width .3s ease;
}
.progress.is-warn { --progress-color: var(--amber); }
.progress.is-danger { --progress-color: var(--red); }
.progress.is-info { --progress-color: var(--accent); }

/* --------------------------------- Forms --------------------------------- */

.filters {
    display: grid;
    grid-template-columns: minmax(220px, 1.6fr) repeat(3, minmax(150px, 1fr)) auto;
    gap: 10px;
    align-items: end;
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field>label, .field-label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: .02em;
}
.field .hint { font-size: 11px; color: var(--muted-2); line-height: 1.45; }
.input, .select, .textarea {
    width: 100%;
    min-height: 38px;
    padding: 8px 11px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--text);
    font-size: 13px;
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:focus, .select:focus, .textarea:focus {
    border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: var(--panel);
}
.textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238492a8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}
.input-group { position: relative; display: flex; align-items: center; }
.input-group svg { position: absolute; left: 11px; color: var(--muted-2); pointer-events: none; }
.input-group .input { padding-left: 34px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-section { padding: 18px; border-bottom: 1px solid var(--line-soft); }
.form-section:last-child { border-bottom: 0; }
.form-section-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 15px; }
.form-section-head .sec-icon {
    width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
    background: var(--accent-soft); color: var(--accent); flex: none;
}
.form-section-head h3 { font-size: 13.5px; font-weight: 650; }
.form-section-head p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 16px 18px; border-top: 1px solid var(--line-soft); }
.form-note { font-size: 11.5px; color: var(--muted); background: var(--panel-2); border: 1px dashed var(--line); border-radius: 9px; padding: 10px 12px; line-height: 1.5; }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 12.5px; color: var(--text-soft); }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
    width: 38px; height: 22px; border-radius: 999px; background: var(--panel-3);
    border: 1px solid var(--line); position: relative; transition: background .15s, border-color .15s; flex: none;
}
.switch-track::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
    border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s;
}
.switch input:checked+.switch-track { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.switch input:checked+.switch-track::after { transform: translateX(16px); background: var(--accent); }
.switch input:focus-visible+.switch-track { box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------------------------------- Tabs --------------------------------- */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
    position: relative;
    padding: 10px 13px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    border: 0;
    background: none;
    cursor: pointer;
    white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); }
.tab.active::after {
    content: ""; position: absolute; left: 9px; right: 9px; bottom: -1px; height: 2px;
    background: var(--accent); border-radius: 2px;
}
.tab .count {
    display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
    margin-left: 5px; border-radius: 999px; background: var(--panel-3); color: var(--muted);
    font-size: 10px; font-weight: 700;
}
.tab.active .count { background: var(--accent-soft); color: var(--accent); }

/* -------------------------------- Listas --------------------------------- */

.list { display: flex; flex-direction: column; }
.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line-soft);
}
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: color-mix(in srgb, var(--panel-3) 45%, transparent); }
.list-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.list-main strong { font-size: 12.5px; font-weight: 600; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-main small { font-size: 11.5px; color: var(--muted); }
.list-time { font-size: 11px; color: var(--muted-2); white-space: nowrap; }

.role-card { display: flex; align-items: flex-start; gap: 10px; }
.role-card .icon-tile { flex: none; }
.role-card p { margin-top: 2px; }

.icon-tile {
    width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
    background: var(--tile-bg, var(--panel-3)); color: var(--tile-color, var(--muted)); flex: none;
}

/* --------------------------------- Charts -------------------------------- */

.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--line-soft); stroke-width: 1; }
.chart .axis-label { fill: var(--muted-2); font-size: 9px; font-family: var(--font); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: url(#chartArea); opacity: .9; }
.chart .dot { fill: var(--panel); stroke: var(--accent); stroke-width: 2; }
.chart-empty { display: grid; place-items: center; min-height: 180px; color: var(--muted-2); font-size: 12px; text-align: center; padding: 20px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 11.5px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 8px; height: 8px; border-radius: 2px; background: var(--swatch, var(--accent)); }
.chart-tooltip {
    position: absolute; pointer-events: none; opacity: 0; transform: translate(-50%, -120%);
    background: var(--panel-3); border: 1px solid var(--line); color: var(--text);
    border-radius: 8px; padding: 6px 9px; font-size: 11px; white-space: nowrap; z-index: 5;
    box-shadow: var(--shadow-sm); transition: opacity .1s;
}
.chart-tooltip.show { opacity: 1; }

.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { position: relative; flex: none; width: 132px; height: 132px; }
.donut svg { width: 132px; height: 132px; transform: rotate(-90deg); }
.donut-circle { fill: none; stroke-width: 12; stroke-linecap: round; }
.donut-center {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    pointer-events: none;
}
.donut-center strong { font-size: 24px; font-weight: 720; letter-spacing: -.03em; line-height: 1; }
.donut-center small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 130px; }
.donut-legend .row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.donut-legend .row strong { margin-left: auto; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.donut-legend .legend-swatch { width: 8px; height: 8px; border-radius: 50%; }

.dist { display: flex; flex-direction: column; gap: 13px; }
.dist-row { display: grid; grid-template-columns: 120px 1fr 38px; align-items: center; gap: 11px; font-size: 12px; }
.dist-label { display: flex; align-items: center; gap: 7px; color: var(--text-soft); min-width: 0; }
.dist-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dist-label svg { color: var(--muted); flex: none; }
.dist-bar { height: 7px; border-radius: 999px; background: color-mix(in srgb, var(--text) 7%, transparent); overflow: hidden; }
.dist-bar>span { display: block; height: 100%; border-radius: inherit; background: var(--dist-color, var(--accent)); }
.dist-value { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11.5px; }

/* -------------------------------- Detalhes -------------------------------- */

.detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    padding: 20px;
    margin-bottom: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background:
        radial-gradient(700px 180px at 0% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%),
        var(--panel);
    box-shadow: var(--shadow-sm);
}
.detail-id { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.detail-id .dev-icon { width: 48px; height: 48px; border-radius: 12px; }
.detail-title { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.detail-title h1 { font-size: 23px; font-weight: 720; letter-spacing: -.02em; line-height: 1.15; }
.detail-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.detail-meta code { color: var(--text-soft); background: var(--panel-3); border: 1px solid var(--line); padding: 2px 7px; border-radius: 6px; }
.detail-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 0; font-size: 12.5px; }
.kv>dt { color: var(--muted); padding: 8px 0; border-bottom: 1px dashed var(--line-soft); }
.kv>dd { margin: 0; padding: 8px 0; border-bottom: 1px dashed var(--line-soft); color: var(--text-soft); word-break: break-word; }
.kv>dt:last-of-type, .kv>dd:last-of-type { border-bottom: 0; }
.kv dd .mono { color: var(--text); }

.mini-stat { display: flex; flex-direction: column; gap: 3px; padding: 11px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line-soft); }
.mini-stat > span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); font-weight: 600; }
.mini-stat strong { font-size: 16px; font-weight: 680; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mini-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }

.supply { display: flex; flex-direction: column; gap: 7px; padding: 12px 0; border-bottom: 1px dashed var(--line-soft); }
.supply:last-child { border-bottom: 0; padding-bottom: 0; }
.supply:first-child { padding-top: 0; }
.supply-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; }
.supply-head strong { font-weight: 600; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.supply-head span { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11.5px; flex: none; }
.supply-sub { font-size: 10.5px; color: var(--muted-2); }

.snmpline {
    display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line-soft);
    font-size: 12px; font-family: var(--mono);
}
.snmpline:last-child { border-bottom: 0; }
.snmpline .oid { color: var(--muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snmpline .val { color: var(--text-soft); text-align: right; word-break: break-all; }
.copy-oid { flex: none; }

.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line-soft); }
.timeline-item:last-child { border-bottom: 0; }
.timeline-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--muted); }
.timeline-dot.critical { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.timeline-dot.warning { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.timeline-dot.info { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.timeline-body { flex: 1; min-width: 0; }
.timeline-body p { font-size: 12.5px; color: var(--text-soft); }
.timeline-body small { font-size: 11px; color: var(--muted-2); }
.timeline-meta { font-size: 11px; color: var(--muted-2); white-space: nowrap; }

/* -------------------------------- Clientes -------------------------------- */

.client-card { display: flex; flex-direction: column; gap: 14px; padding: 17px; transition: border-color .15s, transform .15s; }
.client-card:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); transform: translateY(-1px); }
.client-head { display: flex; align-items: flex-start; gap: 11px; }
.client-logo {
    width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
    font-size: 13px; font-weight: 800; color: #fff; flex: none;
    background: linear-gradient(135deg, var(--client-color, var(--accent)), color-mix(in srgb, var(--client-color, var(--accent)) 55%, #0b1020));
    box-shadow: 0 6px 16px color-mix(in srgb, var(--client-color, var(--accent)) 28%, transparent);
}
.client-info { min-width: 0; flex: 1; }
.client-info h3 { font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
.client-info p { font-size: 11.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.client-stat { background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 8px; padding: 7px 8px; text-align: center; }
.client-stat strong { display: block; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.client-stat span { font-size: 9.5px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .05em; }
.client-stat.online strong { color: var(--green); }
.client-stat.warning strong { color: var(--amber); }
.client-stat.offline strong { color: var(--red); }
.client-types { display: flex; flex-wrap: wrap; gap: 5px; }
.client-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 2px; }

.client-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.client-hero .client-logo { width: 58px; height: 58px; border-radius: 15px; font-size: 17px; }

/* --------------------------------- Alertas -------------------------------- */

.alert-item { display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.alert-item:last-child { border-bottom: 0; }
.alert-item:hover { background: color-mix(in srgb, var(--panel-3) 40%, transparent); }
.alert-sev { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.alert-sev.critical { background: var(--red-soft); color: #f87171; }
.alert-sev.warning { background: var(--amber-soft); color: var(--amber); }
.alert-sev.info { background: var(--accent-soft); color: var(--accent); }
.alert-body { flex: 1; min-width: 0; }
.alert-body strong { font-size: 12.5px; font-weight: 600; color: var(--text-soft); display: block; }
.alert-body p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.alert-body .alert-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 11px; color: var(--muted-2); }
.alert-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.alert-resolved { opacity: .62; }

/* --------------------------------- Estados -------------------------------- */

.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 48px 24px; }
.empty-icon {
    width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center;
    background: var(--panel-3); border: 1px solid var(--line); color: var(--muted);
    margin-bottom: 13px;
}
.empty-state h3 { font-size: 14px; font-weight: 650; margin-bottom: 4px; }
.empty-state p { font-size: 12.5px; color: var(--muted); max-width: 380px; line-height: 1.55; }
.empty-state .btn { margin-top: 14px; }

.flash-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.flash {
    display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-radius: 10px;
    font-size: 12.5px; border: 1px solid; animation: flash-in .25s ease;
}
.flash-success { background: var(--green-soft); border-color: rgba(34, 197, 94, .28); color: #86efac; }
.flash-error { background: var(--red-soft); border-color: rgba(239, 68, 68, .3); color: #fca5a5; }
.flash-warning { background: var(--amber-soft); border-color: rgba(245, 165, 36, .3); color: #fcd34d; }
.flash-info { background: var(--accent-soft); border-color: rgba(79, 140, 255, .3); color: #93c5fd; }
html[data-theme="light"] .flash-success { color: #15803d; }
html[data-theme="light"] .flash-error { color: #b91c1c; }
html[data-theme="light"] .flash-warning { color: #b45309; }
html[data-theme="light"] .flash-info { color: #1d4ed8; }
.flash span { flex: 1; }
.flash-close { background: none; border: 0; color: inherit; opacity: .65; cursor: pointer; padding: 2px; }
.flash-close:hover { opacity: 1; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.banner {
    display: flex; align-items: center; gap: 10px; padding: 12px 15px; border-radius: 10px;
    background: var(--amber-soft); border: 1px solid rgba(245, 165, 36, .3); color: #fcd34d;
    font-size: 12.5px; margin-bottom: 18px;
}
.banner a { color: inherit; text-decoration: underline; font-weight: 600; }
html[data-theme="light"] .banner { color: #92400e; }

/* --------------------------------- Utils --------------------------------- */

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.mono { font-family: var(--mono); }
.divider { height: 1px; background: var(--line-soft); margin: 14px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.grid-span-full { grid-column: 1 / -1; }

.pagination { display: flex; align-items: center; gap: 5px; }
.pagination a, .pagination span {
    min-width: 30px; height: 30px; padding: 0 8px; display: grid; place-items: center;
    border-radius: 7px; border: 1px solid var(--line); color: var(--muted); font-size: 12px;
}
.pagination a:hover { background: var(--panel-3); color: var(--text); }
.pagination .current { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); color: var(--accent); font-weight: 700; }
.pagination .disabled { opacity: .4; pointer-events: none; }

details.accordion { border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
details.accordion summary {
    list-style: none; cursor: pointer; padding: 11px 13px; font-size: 12.5px; font-weight: 600;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
details.accordion summary::-webkit-details-marker { display: none; }
details.accordion summary .chev { transition: transform .15s; color: var(--muted); }
details.accordion[open] summary .chev { transform: rotate(90deg); }
details.accordion .accordion-body { padding: 0 13px 13px; border-top: 1px solid var(--line-soft); }

/* ------------------------------- Responsivo ------------------------------- */

@media (max-width: 1320px) {
    .stats { grid-template-columns: repeat(4, 1fr); }
    .filters { grid-template-columns: minmax(200px, 1.5fr) repeat(3, minmax(130px, 1fr)) auto; }
}

@media (max-width: 1180px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filters .filters-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
}

@media (max-width: 1024px) {
    :root { --sidebar-w: 262px; }
    .sidebar { transform: translateX(-102%); transition: transform .22s ease; box-shadow: 0 0 60px rgba(0,0,0,.5); }
    body.sidebar-open .sidebar { transform: none; }
    .main { margin-left: 0; }
    .icon-btn.menu-btn { display: grid; }
    .sidebar-overlay {
        display: block; position: fixed; inset: 0; z-index: 45; background: rgba(3, 7, 15, .62);
        opacity: 0; pointer-events: none; transition: opacity .2s;
    }
    body.sidebar-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
    .page { padding: 22px 22px 32px; }
    .topbar { padding: 0 20px; }
    .detail-actions { width: 100%; }
}

@media (max-width: 760px) {
    .topbar { gap: 10px; padding: 0 14px; }
    .topbar-search { display: none; }
    .page { padding: 18px 14px 28px; }
    .page-title { font-size: 22px; }
    .page-head { align-items: flex-start; gap: 12px; }
    .page-actions { width: 100%; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat { padding: 13px; }
    .stat-value { font-size: 25px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
    .span-2 { grid-column: auto; }
    .form-grid, .form-grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
    .form-grid .span-2 { grid-column: auto; }
    .filters { grid-template-columns: 1fr; }
    .user-meta { display: none; }
    .user-menu .chev { display: none; }
    .user-menu summary { padding: 3px; }
    .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .donut-wrap { justify-content: center; }
    .dist-row { grid-template-columns: 100px 1fr 34px; }
    .detail-head { padding: 16px; }
    .detail-title h1 { font-size: 20px; }
    .kv { grid-template-columns: 115px minmax(0, 1fr); }
    .client-stats { grid-template-columns: repeat(4, 1fr); }
    .app-foot { flex-wrap: wrap; }
    .alert-actions { width: 100%; justify-content: flex-start; }
}

@media (max-width: 460px) {
    .page-actions .btn { padding: 0 12px; }
    .client-stats { grid-template-columns: repeat(2, 1fr); }
    .stat-value { font-size: 27px; }
}

@media print {
    .sidebar, .topbar, .page-actions, .app-foot, .flash-list { display: none !important; }
    .main { margin-left: 0; }
    .card { break-inside: avoid; box-shadow: none; }
}

/* ------------------------------ Toasts / loader --------------------------- */

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    vertical-align: -2px;
}
.toast-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 120;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: min(370px, calc(100vw - 32px));
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text-soft);
    font-size: 12.5px;
    box-shadow: var(--shadow);
    animation: toast-in .2s ease;
    transition: opacity .22s, transform .22s;
}
.toast span { flex: 1; }
.toast button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }
.toast-success { border-color: rgba(34, 197, 94, .35); }
.toast-error { border-color: rgba(239, 68, 68, .4); }
.toast-warning { border-color: rgba(245, 165, 36, .4); }
.toast-out { opacity: 0; transform: translateY(6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ------------------------------ Teste SNMP ------------------------------- */

.test-panel {
    margin-top: 14px;
    padding: 13px 15px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--panel-2);
    font-size: 12px;
    color: var(--text-soft);
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.test-panel strong { font-size: 12.5px; }
.test-panel .test-kv { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.test-panel .test-kv span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.test-panel code { color: var(--text); word-break: break-word; font-size: 11px; }
.test-panel.test-ok { border-color: rgba(34, 197, 94, .35); background: var(--green-soft); }
.test-panel.test-error { border-color: rgba(239, 68, 68, .35); background: var(--red-soft); color: #fca5a5; }
html[data-theme="light"] .test-panel.test-error { color: #b91c1c; }

/* ------------------------------- SNMP walk ------------------------------- */

.walk-loading, .walk-empty, .walk-error {
    padding: 22px;
    text-align: center;
    color: var(--muted);
    font-size: 12.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}
.walk-error { color: #f87171; }
.walk-meta { padding: 10px 14px; font-size: 11px; color: var(--muted); border-bottom: 1px solid var(--line); }
.walk-table td { font-size: 11.5px; }
.walk-table td:first-child { white-space: nowrap; }
.walk-table td:last-child { word-break: break-all; }

/* -------------------------------- Login ---------------------------------- */

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    align-items: stretch;
    background:
        radial-gradient(1000px 600px at 5% 0%, rgba(79, 140, 255, .16), transparent 60%),
        radial-gradient(800px 500px at 100% 100%, rgba(124, 92, 255, .14), transparent 60%),
        var(--bg);
}
.auth-visual {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 42px 48px;
    border-right: 1px solid var(--line-soft);
    position: relative;
    overflow: hidden;
}
.auth-visual::after {
    content: "";
    position: absolute;
    width: 560px;
    height: 560px;
    right: -180px;
    bottom: -220px;
    border-radius: 50%;
    border: 1px solid rgba(79, 140, 255, .18);
    box-shadow: 0 0 0 80px rgba(79, 140, 255, .04), 0 0 0 160px rgba(79, 140, 255, .025);
    pointer-events: none;
}
.auth-brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.auth-brand strong { font-size: 17px; letter-spacing: -.01em; }
.auth-brand small { display: block; color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; margin-top: 2px; }
.auth-copy { max-width: 460px; position: relative; z-index: 1; }
.auth-copy h1 { font-size: 38px; line-height: 1.12; letter-spacing: -.035em; font-weight: 720; margin-bottom: 16px; }
.auth-copy h1 span { background: linear-gradient(90deg, #7cabff, #a78bfa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-copy p { color: var(--muted); font-size: 14px; line-height: 1.65; max-width: 420px; }
.auth-features { display: flex; flex-direction: column; gap: 12px; margin-top: 28px; }
.auth-feature { display: flex; gap: 11px; align-items: flex-start; font-size: 12.5px; color: var(--text-soft); }
.auth-feature .icon-tile { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: #7cabff; }
.auth-feature small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.auth-foot { color: var(--muted-2); font-size: 11px; display: flex; gap: 8px; align-items: center; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 34px 24px; }
.auth-card { width: 100%; max-width: 390px; }
.auth-card h2 { font-size: 23px; font-weight: 700; letter-spacing: -.02em; }
.auth-card .auth-sub { color: var(--muted); font-size: 13px; margin: 6px 0 24px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-card .btn { height: 42px; }
.auth-branding { margin-top: 22px; text-align: center; }
.auth-branding a {
    color: var(--muted-2);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .16em;
    text-decoration: none;
    transition: color .15s ease;
}
.auth-branding a:hover { color: var(--accent); }
.auth-note { margin-top: 20px; font-size: 11.5px; color: var(--muted-2); line-height: 1.6; }
.auth-alert {
    display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 9px;
    background: var(--red-soft); border: 1px solid rgba(239, 68, 68, .3); color: #fca5a5;
    font-size: 12px; margin-bottom: 16px;
}
html[data-theme="light"] .auth-alert { color: #b91c1c; }
.auth-success {
    display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 9px;
    background: var(--green-soft); border: 1px solid rgba(34, 197, 94, .3); color: #86efac;
    font-size: 12px; margin-bottom: 16px;
}
html[data-theme="light"] .auth-success { color: #15803d; }

@media (max-width: 900px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-visual { display: none; }
}

/* ==========================================================================
   Dashboard — centro de operações
   ========================================================================== */

.dash-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 228px;
    padding: 26px 30px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background:
        radial-gradient(680px 300px at 84% 30%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
        radial-gradient(460px 240px at 55% 120%, color-mix(in srgb, var(--accent-2) 12%, transparent), transparent 70%),
        linear-gradient(120deg, color-mix(in srgb, var(--panel) 94%, #fff 6%), var(--panel));
    box-shadow: var(--shadow-sm);
}
.dash-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(color-mix(in srgb, var(--text) 6%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--text) 6%, transparent) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: radial-gradient(600px 300px at 80% 40%, #000 0%, transparent 72%);
    opacity: .35;
    pointer-events: none;
}
.hero-copy { position: relative; z-index: 2; max-width: 640px; }
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 9px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
    color: #8ab3ff;
    font-size: 10.5px;
    font-weight: 650;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 16%, transparent);
    animation: pulse-dot 2.2s ease-in-out infinite;
}
.hero-copy h2 {
    margin: 12px 0 7px;
    font-size: 30px;
    font-weight: 730;
    letter-spacing: -.035em;
    line-height: 1.12;
}
.hero-sub { color: var(--muted); font-size: 13.5px; line-height: 1.65; max-width: 560px; }
.hero-sub strong { color: var(--text-soft); }
.hero-warn { color: var(--amber) !important; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.hero-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; color: var(--muted-2); font-size: 11px; }
.hero-meta svg { display: inline-block; vertical-align: -2px; }
.hero-meta-sep { opacity: .4; }

.live-btn .live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--muted-2);
    transition: background .2s, box-shadow .2s;
}
.live-btn.is-live {
    border-color: color-mix(in srgb, var(--green) 38%, var(--line));
    background: var(--green-soft);
    color: #86efac;
}
.live-btn.is-live .live-dot {
    background: var(--green);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 16%, transparent);
    animation: pulse-dot 1.8s ease-in-out infinite;
}
html[data-theme="light"] .live-btn.is-live { color: #15803d; }

.hero-visual {
    position: relative;
    flex: none;
    width: 340px;
    height: 190px;
    z-index: 1;
}
.hero-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
    transform: translate(-50%, -50%);
}
.hero-ring.r1 { width: 150px; height: 150px; opacity: .8; }
.hero-ring.r2 { width: 240px; height: 240px; opacity: .45; }
.hero-ring.r3 { width: 330px; height: 330px; opacity: .22; }
.hero-core {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 14%, transparent), 0 0 30px color-mix(in srgb, var(--accent) 45%, transparent);
    transform: translate(-50%, -50%);
}
.hero-device {
    position: absolute;
    display: grid;
    place-items: center;
    filter: drop-shadow(0 16px 24px rgba(0, 0, 0, .35));
}
.hero-device.d1 { left: 118px; top: 8px; animation: float 7s ease-in-out infinite; }
.hero-device.d2 { left: 4px; bottom: 4px; animation: float 8s ease-in-out .7s infinite; }
.hero-device.d3 { right: 2px; bottom: 16px; animation: float 6.4s ease-in-out 1.2s infinite; }

.dash-stats .stat-link { color: inherit; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.dash-stats .stat-link:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--stat-color, var(--accent)) 30%, var(--line));
    box-shadow: 0 12px 30px rgba(0, 0, 0, .18);
}
html[data-theme="light"] .dash-stats .stat-link:hover { box-shadow: 0 12px 26px rgba(15, 23, 42, .09); }

/* ------------------------------- Frota ---------------------------------- */

.fleet-panel .card-body { padding-top: 13px; }
.fleet-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 11px 18px;
    border-bottom: 1px solid var(--line-soft);
}
.fleet-tabs { display: flex; gap: 3px; flex-wrap: wrap; }
.fleet-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border-radius: 7px;
    border: 1px solid transparent;
    background: none;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 550;
    cursor: pointer;
    transition: background .13s, color .13s, border-color .13s;
}
.fleet-tab span {
    min-width: 17px;
    padding: 1px 5px;
    border-radius: 999px;
    background: var(--panel-3);
    color: var(--muted-2);
    font-size: 9.5px;
    font-variant-numeric: tabular-nums;
    text-align: center;
}
.fleet-tab:hover { background: var(--panel-2); color: var(--text-soft); }
.fleet-tab.active {
    background: var(--accent-soft);
    border-color: color-mix(in srgb, var(--accent) 26%, transparent);
    color: var(--accent);
}
.fleet-tab.active span { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.fleet-search { position: relative; display: flex; align-items: center; }
.fleet-search svg { position: absolute; left: 9px; color: var(--muted-2); pointer-events: none; }
.fleet-search input {
    width: 178px;
    height: 31px;
    padding: 0 10px 0 29px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--text);
    font-size: 11.5px;
    outline: none;
}
.fleet-search input:focus { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 3px var(--accent-soft); }

.fleet-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.fleet-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 19px 9px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-2);
    color: inherit;
    text-align: center;
    overflow: hidden;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.fleet-item::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(110px 80px at 50% 18%, color-mix(in srgb, var(--art-color, var(--accent)) 16%, transparent), transparent 72%);
    opacity: .85;
    pointer-events: none;
}
.fleet-item:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--art-color, var(--accent)) 42%, var(--line));
    background: var(--panel-3);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .2);
}
.fleet-item[hidden] { display: none; }
.fleet-status { position: absolute; top: 8px; left: 8px; height: 18px; padding: 0 6px; font-size: 9.5px; z-index: 2; }
.fleet-art {
    position: relative;
    z-index: 1;
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    filter: drop-shadow(0 8px 16px color-mix(in srgb, var(--art-color, var(--accent)) 25%, transparent));
    transition: transform .18s ease;
}
.fleet-art .device-art { width: 100%; height: 100%; }
.fleet-item:hover .fleet-art { transform: translateY(-2px) scale(1.04); }
.fleet-name {
    position: relative;
    z-index: 1;
    max-width: 100%;
    margin-top: 5px;
    font-size: 12px;
    font-weight: 620;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fleet-model {
    position: relative;
    z-index: 1;
    max-width: 100%;
    color: var(--muted-2);
    font-size: 9px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fleet-client {
    position: relative;
    z-index: 1;
    max-width: 100%;
    color: var(--muted-2);
    font-size: 9.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fleet-foot { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 5px; width: 100%; margin-top: 5px; }
.fleet-foot .type-chip { height: 17px; padding: 0 5px; font-size: 9px; gap: 3px; }
.fleet-foot .type-chip svg { display: none; }
.fleet-latency { color: var(--muted-2); font-size: 9.5px; font-variant-numeric: tabular-nums; }
.fleet-add {
    justify-content: center;
    gap: 5px;
    border-style: dashed;
    background: transparent;
    min-height: 178px;
}
.fleet-add::before { display: none; }
.fleet-add:hover { background: var(--panel-2); border-style: dashed; }
.fleet-add-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--muted);
    margin-bottom: 2px;
}
.fleet-add-title { font-size: 11.5px; font-weight: 600; color: var(--text-soft); }
.fleet-add-sub { font-size: 9.5px; color: var(--muted-2); }
.fleet-empty { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 30px 16px; color: var(--muted); font-size: 12px; }
.fleet-more { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 11px; }

/* ------------------------------- Saúde ---------------------------------- */

.health-panel .card-body { display: flex; flex-direction: column; gap: 15px; }
.live-indicator { font-size: 10px; color: var(--muted-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 7px; }
.health-donut { gap: 16px; }
.health-donut .donut, .health-donut .donut svg { width: 118px; height: 118px; }
.health-donut .donut-center strong { font-size: 22px; }
.health-donut .donut-legend { gap: 7px; }
.health-donut .donut-legend .row { color: var(--muted); }
.health-donut .donut-legend a.row:hover { color: var(--text); }
.health-block { padding-top: 3px; }
.health-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 11px; color: var(--muted); }
.health-row strong { color: var(--text-soft); font-variant-numeric: tabular-nums; }
.health-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.health-kpis .mini-stat { padding: 9px 10px; }
.health-kpis .mini-stat strong { font-size: 15px; }
.health-link {
    display: flex;
    align-items: center;
    gap: 7px;
    padding-top: 12px;
    border-top: 1px solid var(--line-soft);
    color: var(--accent);
    font-size: 11.5px;
    font-weight: 600;
}
.health-link svg:last-child { margin-left: auto; }

/* ------------------------------ Latência -------------------------------- */

.range-tabs { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.range-tab { border: 0; background: none; padding: 4px 9px; border-radius: 6px; color: var(--muted); font-size: 10.5px; font-weight: 600; cursor: pointer; }
.range-tab:hover { color: var(--text); }
.range-tab.active { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.latency-body { position: relative; }
.chart-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: color-mix(in srgb, var(--panel) 70%, transparent);
    backdrop-filter: blur(2px);
    border-radius: 0 0 var(--radius) var(--radius);
    color: var(--muted);
    font-size: 11.5px;
    z-index: 3;
}
.latency-summary { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); color: var(--muted-2); font-size: 11px; }
.latency-summary strong { color: var(--text-soft); font-variant-numeric: tabular-nums; }

/* ------------------------------- Clientes -------------------------------- */

.client-mini-list { display: flex; flex-direction: column; }
.client-mini { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); color: inherit; }
.client-mini:last-child { border-bottom: 0; }
.client-mini:hover { background: color-mix(in srgb, var(--panel-3) 48%, transparent); }
.client-mini-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.client-mini-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; }
.client-mini-top strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-mini-top span { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 10.5px; }
.client-bar { display: flex; gap: 1px; height: 5px; border-radius: 999px; overflow: hidden; background: color-mix(in srgb, var(--text) 7%, transparent); }
.client-bar i { display: block; height: 100%; }
.client-mini-sub { color: var(--muted-2); font-size: 9.5px; }
.client-chev { color: var(--muted-2); flex: none; }

/* -------------------------------- Tipos ---------------------------------- */

.type-showcase { display: flex; flex-wrap: wrap; gap: 10px; }
.type-tile {
    position: relative;
    flex: 1 1 190px;
    max-width: 280px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-2);
    color: inherit;
    overflow: hidden;
    transition: transform .15s, border-color .15s, background .15s;
}
.type-tile::after {
    content: "";
    position: absolute;
    right: -18px;
    bottom: -32px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--type-color) 20%, transparent), transparent 68%);
    pointer-events: none;
}
.type-tile:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--type-color) 45%, var(--line));
    background: var(--panel-3);
}
.type-tile-art { width: 52px; height: 52px; flex: none; display: grid; place-items: center; filter: drop-shadow(0 7px 12px color-mix(in srgb, var(--type-color) 25%, transparent)); }
.type-tile-art svg { width: 52px; height: 52px; }
.type-tile-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.type-tile-body strong { font-size: 12px; font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.type-tile-body small { font-size: 9.5px; color: var(--muted); }
.type-tile-count { margin-left: auto; font-size: 16px; font-weight: 720; color: var(--type-color); font-variant-numeric: tabular-nums; z-index: 1; }

/* ------------------------------ Atividade -------------------------------- */

.activity-list { display: flex; flex-direction: column; }
.activity-item { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--line-soft); color: inherit; }
.activity-item:last-child { border-bottom: 0; }
.activity-item:hover { background: color-mix(in srgb, var(--panel-3) 45%, transparent); }
.activity-flag { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--muted); }
.activity-flag.online { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.activity-flag.warning { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.activity-flag.offline { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.activity-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.activity-body strong { font-size: 11.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-body small { font-size: 10px; color: var(--muted); }

/* --------------------------- Arte dos aparelhos --------------------------- */

.device-art { display: block; overflow: visible; }
.art-glow {
    display: inline-grid;
    place-items: center;
    border-radius: 18px;
    background: radial-gradient(circle, color-mix(in srgb, var(--art-color, var(--accent)) 22%, transparent), transparent 70%);
    padding: 6px;
}
.detail-art {
    width: 88px;
    height: 88px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 16px;
    border: 1px solid color-mix(in srgb, var(--art-color, var(--accent)) 28%, var(--line));
    background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--art-color, var(--accent)) 18%, transparent), var(--panel-2) 72%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.detail-art .device-art { filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .32)); }

/* -------------------------- Deteção de equipamentos ---------------------- */

.detect-layout { display: grid; grid-template-columns: minmax(0, 430px) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.detect-form-card .card-body { padding: 20px; }
.detect-form { display: flex; flex-direction: column; gap: 14px; }
.detect-snmp-grid { grid-template-columns: 1.15fr .85fr; gap: 12px; }
.detect-form-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 2px; }
.detect-intro {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 22px 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        radial-gradient(520px 260px at 65% 20%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%),
        linear-gradient(160deg, var(--panel), color-mix(in srgb, var(--panel-2) 65%, transparent));
    min-height: 380px;
}
.detect-intro h2 { font-size: 25px; font-weight: 720; letter-spacing: -.03em; line-height: 1.15; max-width: 420px; margin-bottom: 10px; }
.detect-intro p { color: var(--muted); font-size: 12.5px; line-height: 1.7; max-width: 480px; }
.detect-points { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 11.5px; color: var(--text-soft); }
.detect-points li { display: flex; align-items: flex-start; gap: 8px; }
.detect-points svg { color: var(--green); margin-top: 1px; flex: none; }

.detect-stage { position: relative; height: 188px; margin-bottom: 10px; }
.radar-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
    transform: translate(-50%, -50%);
    animation: radar-ping 5s ease-out infinite;
}
.radar-ring.r1 { width: 112px; height: 112px; }
.radar-ring.r2 { width: 200px; height: 200px; animation-delay: 1.1s; }
.radar-ring.r3 { width: 288px; height: 288px; animation-delay: 2.2s; }
.radar-core {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 14%, transparent), 0 0 24px color-mix(in srgb, var(--accent) 50%, transparent);
}
.stage-art { position: absolute; filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .3)); }
.stage-art.a1 { left: 12px; top: 38px; animation: float 7s ease-in-out infinite; }
.stage-art.a2 { left: 39%; top: 2px; animation: float 8s ease-in-out .6s infinite; }
.stage-art.a3 { right: 22px; top: 39px; animation: float 6.5s ease-in-out 1s infinite; }
.stage-art.a4 { right: 74px; bottom: 0; opacity: .85; animation: float 9s ease-in-out .2s infinite; }

.detect-result-target { margin-top: 18px; }
.detect-result {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--type-color, var(--accent)) 30%, var(--line));
    border-radius: 18px;
    background:
        radial-gradient(480px 260px at 0% 0%, color-mix(in srgb, var(--type-color, var(--accent)) 14%, transparent), transparent 70%),
        var(--panel);
    box-shadow: var(--shadow-sm);
    animation: result-in .3s ease;
}
.detect-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 22px;
    border-right: 1px solid var(--line-soft);
    background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--type-color, var(--accent)) 17%, transparent), transparent 68%);
    min-height: 320px;
}
.detect-art { width: 190px; height: 190px; display: grid; place-items: center; filter: drop-shadow(0 20px 30px rgba(0, 0, 0, .35)); animation: float 7s ease-in-out infinite; }
.detect-art svg { width: 100%; height: 100%; }
.confidence {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 9.5px;
    font-weight: 650;
    letter-spacing: .03em;
    border: 1px solid;
}
.confidence-high { color: #4ade80; background: var(--green-soft); border-color: rgba(34, 197, 94, .28); }
.confidence-medium { color: #fbbf24; background: var(--amber-soft); border-color: rgba(245, 165, 36, .3); }
.confidence-low { color: #94a3b8; background: rgba(148, 163, 184, .1); border-color: rgba(148, 163, 184, .22); }
html[data-theme="light"] .confidence-high { color: #15803d; }
html[data-theme="light"] .confidence-medium { color: #b45309; }
html[data-theme="light"] .confidence-low { color: #475569; }
.detect-info { display: flex; flex-direction: column; gap: 13px; padding: 22px 24px; min-width: 0; }
.detect-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.detect-head h2 { font-size: 21px; font-weight: 700; letter-spacing: -.025em; line-height: 1.2; overflow-wrap: anywhere; }
.detect-head p { margin-top: 4px; color: var(--muted); font-size: 11.5px; }
.detect-head code { color: var(--text-soft); }
.detect-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.detect-fact { padding: 8px 9px; border-radius: 8px; border: 1px solid var(--line-soft); background: var(--panel-2); min-width: 0; }
.detect-fact span { display: block; color: var(--muted-2); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.detect-fact strong { display: block; margin-top: 2px; color: var(--text-soft); font-size: 11px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detect-sysdescr {
    padding: 9px 11px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: var(--panel-2);
    color: var(--muted);
    font-size: 10.5px;
    line-height: 1.6;
    max-height: 67px;
    overflow: auto;
}
.evidence-list { display: flex; flex-wrap: wrap; gap: 5px; }
.evidence-chip {
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--type-color, var(--accent)) 24%, transparent);
    background: color-mix(in srgb, var(--type-color, var(--accent)) 9%, transparent);
    color: var(--text-soft);
    font-size: 10px;
}
.detect-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.detect-details summary { font-size: 11px; }
.detect-result.compact { grid-template-columns: 190px minmax(0, 1fr); }
.detect-result.compact .detect-visual { min-height: 270px; padding: 16px; }
.detect-result.compact .detect-art { width: 145px; height: 145px; }
.detect-result.compact .detect-info { padding: 18px; }
.detect-result.compact .detect-head h2 { font-size: 18px; }
.detect-result.compact .detect-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detect-result.compact .detect-facts .detect-fact:nth-child(n+5) { display: none; }

.detect-error {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 17px 19px;
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, .35);
    background: var(--red-soft);
    color: #fca5a5;
}
.detect-error strong { font-size: 12.5px; }
.detect-error p { margin-top: 3px; font-size: 11.5px; color: #fca5a5; opacity: .85; line-height: 1.5; }
html[data-theme="light"] .detect-error, html[data-theme="light"] .detect-error p { color: #b91c1c; }

.scan-state { display: flex; align-items: center; gap: 18px; padding: 22px 24px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.scan-radar { position: relative; flex: none; width: 78px; height: 78px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); background: radial-gradient(circle, color-mix(in srgb, var(--accent) 14%, transparent), transparent 68%); overflow: hidden; }
.scan-radar::before, .scan-radar::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent); }
.scan-radar::before { inset: 13px; }
.scan-radar::after { inset: 27px; }
.scan-sweep { position: absolute; inset: -1px; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0deg 295deg, color-mix(in srgb, var(--accent) 38%, transparent) 360deg); animation: radar-spin 1.5s linear infinite; }
.scan-blip { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); top: 20px; left: 50px; box-shadow: 0 0 8px var(--accent); animation: blip 1.7s ease-in-out infinite; }
.scan-blip.b2 { top: 47px; left: 24px; animation-delay: .6s; }
.scan-copy strong { display: block; font-size: 13px; }
.scan-copy p { margin-top: 3px; color: var(--muted); font-size: 11.5px; }

.detect-inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }

.detect-prefill {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 17px;
    margin-bottom: 16px;
    border: 1px solid color-mix(in srgb, var(--type-color, var(--accent)) 32%, var(--line));
    border-radius: 14px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--type-color, var(--accent)) 10%, transparent), transparent 70%), var(--panel);
}
.detect-prefill-art { flex: none; width: 62px; height: 62px; display: grid; place-items: center; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .25)); }
.detect-prefill-body { flex: 1; min-width: 0; }
.detect-prefill-body h3 { margin-top: 4px; font-size: 14px; font-weight: 650; }
.detect-prefill-body p { margin-top: 3px; color: var(--muted); font-size: 11.5px; line-height: 1.5; }

/* ------------------------------- Animações -------------------------------- */

@keyframes float {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -7px; }
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .55; transform: scale(.82); }
}
@keyframes radar-ping {
    0% { opacity: .55; scale: .82; }
    70% { opacity: 0; scale: 1.08; }
    100% { opacity: 0; scale: 1.08; }
}
@keyframes radar-spin { to { transform: rotate(360deg); } }
@keyframes blip { 0%, 100% { opacity: .25; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes result-in { from { opacity: .8; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }
@keyframes stat-pop { from { opacity: .35; translate: 0 4px; } to { opacity: 1; translate: 0 0; } }

@media (prefers-reduced-motion: reduce) {
    .hero-device, .stage-art, .detect-art, .pulse-dot, .live-btn.is-live .live-dot,
    .radar-ring, .scan-sweep, .scan-blip { animation: none !important; }
    .fleet-item, .stat-link, .type-tile { transition: none !important; }
}

/* ------------------------------ Responsivo -------------------------------- */

@media (max-width: 1320px) {
    .fleet-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .detect-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1180px) {
    .dash-hero { padding: 22px; }
    .hero-visual { width: 260px; transform: scale(.88); transform-origin: right center; }
    .detect-layout { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); }
    .detect-intro { padding: 20px; }
    .detect-result { grid-template-columns: 210px minmax(0, 1fr); }
    .detect-art { width: 160px; height: 160px; }
    .detect-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
    .dash-hero { min-height: 210px; }
    .hero-visual { width: 230px; transform: scale(.78); }
    .detect-layout { grid-template-columns: minmax(0, 1fr); }
    .detect-intro { min-height: 300px; }
    .detect-stage { height: 150px; margin-bottom: 0; }
    .stage-art.a4 { display: none; }
    .detect-result { grid-template-columns: 210px minmax(0, 1fr); }
    .detect-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .fleet-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .detect-result, .detect-result.compact { grid-template-columns: minmax(0, 1fr); }
    .detect-visual, .detect-result.compact .detect-visual { border-right: 0; border-bottom: 1px solid var(--line-soft); min-height: 250px; }
    .detect-result.compact .detect-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .fleet-panel .card-head > .btn { display: none; }
    .detect-form-card .card-head .pill { display: none; }
    .dash-hero { padding: 20px 18px; }
    .hero-copy h2 { font-size: 25px; }
    .hero-visual { display: none; }
    .hero-actions .btn { font-size: 12px; padding: 0 12px; }
    .fleet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fleet-toolbar { align-items: flex-start; }
    .fleet-search input { width: 100%; }
    .fleet-search { width: 100%; }
    .fleet-tabs { width: 100%; }
    .detect-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detect-info { padding: 16px; }
    .detect-head { flex-direction: column; }
    .detect-result { grid-template-columns: minmax(0, 1fr); }
    .detect-stage { transform: scale(.9); transform-origin: left center; }
    .detect-prefill { flex-wrap: wrap; }
    .detect-prefill .btn { margin-left: 76px; }
    .type-showcase { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .type-tile { flex-basis: 160px; padding: 10px; }
    .type-tile-art { width: 44px; height: 44px; }
    .type-tile-art svg { width: 44px; height: 44px; }
    .latency-summary { gap: 10px; }
}

@media (max-width: 460px) {
    .hero-actions .btn { flex: 1 1 auto; }
    .detect-snmp-grid { grid-template-columns: 1fr 1fr; }
    .detect-prefill .btn { margin-left: 0; }
    .scan-state { flex-direction: column; text-align: center; }
}


/* ---------------------------- Fotografias de modelos ---------------------- */

.model-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 5%;
    border-radius: 10px;
    background: linear-gradient(180deg, #fbfdff, #e7edf7);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08), 0 6px 14px rgba(0, 0, 0, .14);
    overflow: hidden;
}
.model-photo img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}
.fleet-art .model-photo { border-radius: 8px; }
.table-art .model-photo { padding: 3px; border-radius: 7px; }
.detail-art .model-photo { padding: 4px; border-radius: 12px; }
.detect-art .model-photo { border-radius: 14px; padding: 5%; }
.tv-art .model-photo { border-radius: 12px; padding: 4%; }

/* ------------------------- Ícones de dispositivo (sem foto) --------------- */

.device-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--icon-color, var(--accent));
}
.device-icon svg {
    width: 52%;
    height: 52%;
    stroke-width: 1.7;
    filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--icon-color, var(--accent)) 28%, transparent));
}
html[data-theme="light"] .device-icon {
    color: color-mix(in srgb, var(--icon-color, var(--accent)) 45%, #0f172a);
}
.fleet-art {
    background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--art-color, var(--accent)) 15%, transparent), transparent 72%);
    border: 1px solid color-mix(in srgb, var(--art-color, var(--accent)) 22%, transparent);
    border-radius: 10px;
}
.type-tile-art {
    border-radius: 10px;
    background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--type-color, var(--accent)) 16%, transparent), transparent 72%);
    border: 1px solid color-mix(in srgb, var(--type-color, var(--accent)) 22%, transparent);
}
.detect-art {
    border-radius: 16px;
    background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--type-color, var(--accent)) 15%, transparent), transparent 70%);
    border: 1px solid color-mix(in srgb, var(--type-color, var(--accent)) 24%, transparent);
}
.detect-art .device-icon svg { width: 50%; height: 50%; }

/* Ícones nas composições */
.hero-device .device-icon {
    width: 108px;
    height: 108px;
    border-radius: 20px;
    background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--icon-color, var(--accent)) 22%, transparent), transparent 70%);
    border: 1px solid color-mix(in srgb, var(--icon-color, var(--accent)) 30%, transparent);
}
.hero-device.d2 .device-icon {
    width: 126px;
    height: 126px;
}
.hero-device.d3 .device-icon {
    width: 94px;
    height: 94px;
}
.stage-art .device-icon {
    border-radius: 16px;
    background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--icon-color, var(--accent)) 20%, transparent), transparent 70%);
    border: 1px solid color-mix(in srgb, var(--icon-color, var(--accent)) 28%, transparent);
}
.stage-art.a1 .device-icon { width: 82px; height: 82px; }
.stage-art.a2 .device-icon { width: 100px; height: 100px; }
.stage-art.a3 .device-icon { width: 80px; height: 80px; }
.stage-art.a4 .device-icon { width: 62px; height: 62px; }
.type-tile-art .device-icon svg { width: 52%; height: 52%; }

/* Ícones de dispositivo em tiles coloridos (sem fundo branco) */
.device-icon { color: #fff; }
.device-icon svg { filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .28)); }

html[data-theme="light"] .device-icon { color: #fff; }

.fleet-art,
.detail-art,
.tv-art,
.table-art,
.type-tile-art,
.detect-art,
.hero-device .device-icon,
.stage-art .device-icon {
    background: linear-gradient(145deg,
        color-mix(in srgb, var(--tile-color, var(--accent)) 58%, #0b1220),
        color-mix(in srgb, var(--tile-color, var(--accent)) 34%, #0b1220));
    border: 1px solid color-mix(in srgb, var(--tile-color, var(--accent)) 58%, transparent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 6px 14px rgba(0, 0, 0, .16);
}

.fleet-art, .detail-art, .tv-art { --tile-color: var(--art-color, var(--accent)); }
.table-art { --tile-color: var(--dev-color, var(--accent)); }
.type-tile-art { --tile-color: var(--type-color, var(--accent)); }
.detect-art { --tile-color: var(--type-color, var(--accent)); }
.hero-device .device-icon, .stage-art .device-icon { --tile-color: var(--icon-color, var(--accent)); }

.tv-group-logo.type-logo {
    background: linear-gradient(145deg,
        color-mix(in srgb, var(--art-color, var(--accent)) 55%, #0b1220),
        color-mix(in srgb, var(--art-color, var(--accent)) 32%, #0b1220));
    border: 1px solid color-mix(in srgb, var(--art-color, var(--accent)) 55%, transparent);
}
.tv-group-logo.type-logo .device-icon { color: #fff; }


.detect-prefill-art .device-icon {
    border-radius: 12px;
    background: linear-gradient(145deg,
        color-mix(in srgb, var(--type-color, var(--accent)) 55%, #0b1220),
        color-mix(in srgb, var(--type-color, var(--accent)) 32%, #0b1220));
    border: 1px solid color-mix(in srgb, var(--type-color, var(--accent)) 55%, transparent);
    color: #fff;
}

/* ------------------------------- 2FA / TOTP ------------------------------- */

.totp-input {
    text-align: center;
    font-family: var(--mono);
    font-size: 22px;
    letter-spacing: .28em;
    height: 50px;
    padding-left: .28em;
}
.recovery-codes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
}
.recovery-code {
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--text);
    border-radius: 8px;
    padding: 9px 10px;
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: .08em;
    cursor: pointer;
    text-align: center;
}
.recovery-code:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); color: var(--accent); }
.totp-setup {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.totp-qr {
    flex: none;
    width: 218px;
    min-height: 218px;
    display: grid;
    place-items: center;
    padding: 12px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .18);
}
.totp-qr img, .totp-qr canvas { display: block; max-width: 100%; height: auto; }
.totp-setup-copy { flex: 1; min-width: 250px; }
.totp-setup-copy h3 { font-size: 13px; font-weight: 650; margin-bottom: 4px; }
.totp-setup-copy .form-note { margin-top: 10px; }
html[data-theme="light"] .totp-qr { box-shadow: 0 8px 20px rgba(15, 23, 42, .08); }
@media (max-width: 560px) {
    .totp-qr { width: 100%; min-height: 0; }
    .totp-input { font-size: 20px; }
}
