/* ─────────────────────────────────────────────────────────────────
   Webasr v3.3 — Mobile-first design system
   Breakpoints: ≤680 mobile · 681-1024 tablet · >1024 desktop
   ───────────────────────────────────────────────────────────────── */

:root[data-theme="light"] {
    --bg:           #fafaf9;
    --bg-elev:      #ffffff;
    --bg-soft:      #f4f4f2;
    --bg-hover:     #f0f0ed;
    --fg:           #18181b;
    --fg-muted:     #525252;
    --fg-faint:     #a3a3a3;
    --border:       #e7e5e4;
    --border-soft:  #efeeec;
    --border-strong:#d6d3d1;
    --accent:       #dc2626;
    --accent-hover: #b91c1c;
    --accent-soft:  #fef2f2;
    --link:         #2547d0;
    --link-soft:    #eef1ff;
    --success:      #16a34a;
    --success-soft: #ecfdf5;
    --warn:         #d97706;
    --warn-soft:    #fffbeb;
    --warn-border:  #f59e0b;
    --danger:       #b91c1c;
    --danger-soft:  #fef2f2;
    --shadow-sm:    0 1px 2px rgba(0,0,0,0.04);
    --shadow:       0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-lg:    0 4px 12px rgba(0,0,0,0.06);
    --logo-w-color: #18181b;
    color-scheme: light;
}

:root[data-theme="dark"] {
    --bg:           #0a0a0b;
    --bg-elev:      #131418;
    --bg-soft:      #1a1b1f;
    --bg-hover:     #22232a;
    --fg:           #ededed;
    --fg-muted:     #a1a1aa;
    --fg-faint:     #6b7280;
    --border:       #292c33;
    --border-soft:  #1f2229;
    --border-strong:#3a3f48;
    --accent:       #ef4444;
    --accent-hover: #f87171;
    --accent-soft:  rgba(239,68,68,0.10);
    --link:         #6488ff;
    --link-soft:    rgba(100,136,255,0.12);
    --success:      #4ade80;
    --success-soft: rgba(74,222,128,0.10);
    --warn:         #fbbf24;
    --warn-soft:    rgba(251,191,36,0.10);
    --warn-border:  #fbbf24;
    --danger:       #f87171;
    --danger-soft:  rgba(248,113,113,0.10);
    --shadow-sm:    0 1px 2px rgba(0,0,0,0.4);
    --shadow:       0 1px 3px rgba(0,0,0,0.5);
    --shadow-lg:    0 4px 12px rgba(0,0,0,0.5);
    --logo-w-color: #ffffff;
    color-scheme: dark;
}

:root {
    --f-ui:    'Inter', system-ui, -apple-system, sans-serif;
    --f-mono:  'JetBrains Mono', ui-monospace, monospace;
    --radius:  6px;
    --radius-lg: 10px;
    --tap: 44px;  /* tamanho mínimo de toque */
}

/* ───── reset ───── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--f-ui);
    background: var(--bg);
    color: var(--fg);
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; border: 0; background: none; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: var(--link); text-decoration: none; -webkit-tap-highlight-color: transparent; }
a:hover { text-decoration: underline; }
input, select, textarea { font-size: 16px; }  /* evita zoom no iOS */

/* ───── helpers globais ───── */
.desktop-only { display: inline-flex; }
.mobile-only  { display: none; }
.cell-mono    { font-family: var(--f-mono); }
.muted        { color: var(--fg-muted); }
.ta-r         { text-align: right; }


/* ═══════════════════════════════════════════════════════════════════
   LOGO
   ═══════════════════════════════════════════════════════════════════ */
.wl { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px; line-height: 1; }
.wl-text {
    font-family: var(--f-ui);
    font-weight: 900;
    font-size: 22px;
    letter-spacing: -1.2px;
    line-height: 1;
    display: flex;
    align-items: baseline;
}
.wl-w { color: var(--logo-w-color); }
.wl-a { color: var(--accent); position: relative; text-transform: lowercase; }
.wl-a::after {
    content: '';
    position: absolute;
    bottom: -3px; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), transparent);
    border-radius: 2px;
}
.wl-sub {
    font-family: var(--f-ui);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 3px;
    color: var(--fg-faint);
    text-transform: uppercase;
    margin-top: 5px;
}
.wl.wl-sm .wl-text { font-size: 18px; letter-spacing: -1px; }
.wl.wl-sm .wl-sub  { font-size: 8px; letter-spacing: 2px; }
.wl.wl-lg .wl-text { font-size: 36px; letter-spacing: -1.6px; }
.wl.wl-lg .wl-sub  { font-size: 10px; letter-spacing: 4px; margin-top: 8px; }


/* ═══════════════════════════════════════════════════════════════════
   LIVE INDICATOR
   ═══════════════════════════════════════════════════════════════════ */
.live-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px 3px 8px;
    background: var(--success-soft);
    border: 1px solid var(--success);
    border-radius: 999px;
    font-size: 11px; font-weight: 500;
    color: var(--success);
    line-height: 1;
}
.live-dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.live-dot::before {
    content: ''; position: absolute; inset: -3px;
    border-radius: 50%;
    background: var(--success); opacity: 0.6;
    animation: live-ping 1.6s cubic-bezier(0,0,0.2,1) infinite;
}
.live-dot::after {
    content: ''; position: absolute; inset: 0;
    border-radius: 50%;
    background: var(--success);
    animation: live-pulse 1.6s ease-in-out infinite;
}
@keyframes live-ping { 0% { transform: scale(0.8); opacity: 0.6; } 80%, 100% { transform: scale(2.4); opacity: 0; } }
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
.live-text { font-variant-numeric: tabular-nums; }


/* ═══════════════════════════════════════════════════════════════════
   LOGIN
   ═══════════════════════════════════════════════════════════════════ */
.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(220,38,38,0.04) 0%, transparent 50%),
        var(--bg);
}
.login-shell { width: min(380px, 100%); }
.login-mark { display: flex; justify-content: center; margin-bottom: 32px; }
.login-card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow);
}
.login-head { text-align: center; margin-bottom: 24px; }
.login-head h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 4px; }
.login-head p  { font-size: 13px; color: var(--fg-muted); }

.field { display: block; margin-bottom: 14px; }
.field span {
    display: block; font-size: 12px; font-weight: 500;
    color: var(--fg-muted); margin-bottom: 6px;
}
.field input,
.ff input,
.ff select {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 11px 12px;
    font-size: 16px;
    color: var(--fg);
    transition: border-color .15s, box-shadow .15s;
    min-height: var(--tap);
}
.field input:focus, .ff input:focus, .ff select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.alert {
    margin: 8px 0 0;
    padding: 9px 12px;
    background: var(--danger-soft);
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--danger);
}

.btn-primary {
    background: var(--accent);
    color: white;
    border-radius: var(--radius);
    padding: 11px 18px;
    font-weight: 500;
    font-size: 14px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: background .15s, transform .08s, box-shadow .2s;
    box-shadow: 0 0 0 0 var(--accent-soft);
    min-height: var(--tap);
}
.login-card .btn-primary { margin-top: 16px; width: 100%; }
.btn-primary:hover  { background: var(--accent-hover); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled, .btn-primary.is-loading { opacity: 0.7; cursor: progress; pointer-events: none; }
.btn-primary.is-loading svg { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-foot { margin-top: 20px; text-align: center; font-family: var(--f-mono); font-size: 11px; color: var(--fg-faint); }


/* ═══════════════════════════════════════════════════════════════════
   DASHBOARD shell (mobile-first)
   ═══════════════════════════════════════════════════════════════════ */
.dash-body { min-height: 100vh; display: flex; flex-direction: column; }

/* topbar mobile primeiro */
.topbar {
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 10;
    padding: env(safe-area-inset-top) 0 0 0;
}
.topbar-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.menu-btn {
    width: var(--tap); height: var(--tap);
    display: grid; place-items: center;
    color: var(--fg-muted);
    border-radius: var(--radius);
    margin-left: -8px;
    transition: background .15s;
}
.menu-btn:hover { background: var(--bg-soft); color: var(--fg); }

.topbar-sep   { width: 1px; height: 18px; background: var(--border); }
.topbar-host  { font-family: var(--f-mono); font-size: 12px; color: var(--fg-muted); }
.topbar-user  { font-size: 13px; color: var(--fg-muted); }
.topbar-link {
    font-size: 13px;
    color: var(--fg-muted);
    padding: 8px 10px;
    border-radius: var(--radius);
    display: inline-flex; align-items: center; gap: 5px;
    min-height: var(--tap);
    transition: color .15s, background .15s;
}
.topbar-link:hover { color: var(--fg); background: var(--bg-soft); text-decoration: none; }

.theme-btn {
    width: var(--tap); height: var(--tap);
    display: grid; place-items: center;
    color: var(--fg-muted);
    border-radius: var(--radius);
    transition: color .15s, background .15s;
}
.theme-btn:hover { color: var(--fg); background: var(--bg-soft); }
.theme-btn .i-sun  { display: none; }
.theme-btn .i-moon { display: block; }
[data-theme="dark"] .theme-btn .i-sun  { display: block; }
[data-theme="dark"] .theme-btn .i-moon { display: none; }


/* ═══════════════════════════════════════════════════════════════════
   DRAWER (gaveta lateral mobile)
   ═══════════════════════════════════════════════════════════════════ */
.drawer-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100;
    opacity: 0;
    transition: opacity .2s;
}
.drawer-overlay.is-open { opacity: 1; }

.drawer {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(280px, 80vw);
    background: var(--bg-elev);
    border-right: 1px solid var(--border);
    z-index: 101;
    transform: translateX(-100%);
    transition: transform .22s cubic-bezier(.2,.8,.2,1);
    display: flex; flex-direction: column;
    box-shadow: var(--shadow-lg);
    padding-top: env(safe-area-inset-top);
}
.drawer.is-open { transform: translateX(0); }

.drawer-head {
    padding: 14px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.drawer-info {
    padding: 14px;
    border-bottom: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 12px;
}
.drawer-info-row { display: flex; flex-direction: column; gap: 2px; }
.drawer-info-row small {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg-faint);
    font-weight: 500;
}
.drawer-info-row span { font-size: 13px; color: var(--fg); }

.drawer-nav {
    padding: 8px;
    display: flex; flex-direction: column; gap: 2px;
    flex: 1;
}
.drawer-link {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius);
    color: var(--fg);
    font-size: 14px;
    text-align: left;
    width: 100%;
    transition: background .15s;
    min-height: var(--tap);
}
.drawer-link:hover { background: var(--bg-soft); text-decoration: none; }
.drawer-link.is-active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 500;
}
.drawer-link-danger { color: var(--danger); margin-top: auto; }
.drawer-link-danger:hover { background: var(--danger-soft); }


/* ═══════════════════════════════════════════════════════════════════
   MAIN
   ═══════════════════════════════════════════════════════════════════ */
.dash-main {
    flex: 1; width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px 14px;
}

.hero { margin-bottom: 16px; }
.hero h1 {
    font-size: clamp(22px, 5vw, 28px);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}
.hero p {
    color: var(--fg-muted);
    font-size: 13px;
}


/* ───── control panel (mobile primeiro) ───── */
.control-panel {
    display: flex; flex-direction: column;
    gap: 14px;
    margin-bottom: 16px;
    padding: 14px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.control-buttons {
    display: flex; gap: 8px;
    flex-wrap: wrap;
}
.control-buttons .btn-primary,
.control-buttons .btn-secondary { flex: 1; min-width: 130px; }

.btn-secondary {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 10px 16px;
    font-weight: 500;
    font-size: 14px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: background .15s, color .15s, transform .08s;
    min-height: var(--tap);
}
.btn-secondary:hover  { background: var(--accent-soft); }
.btn-secondary:active { transform: translateY(1px); }
.btn-secondary.is-loading svg { animation: spin .9s linear infinite; }

/* stats — scroll horizontal mobile */
.stats {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0;
    scrollbar-width: none;
}
.stats::-webkit-scrollbar { display: none; }
.stat {
    display: flex; flex-direction: column; gap: 2px;
    min-width: 80px;
    flex-shrink: 0;
    padding: 8px 12px;
    background: var(--bg-soft);
    border-radius: var(--radius);
}
.stat-label {
    font-size: 10px;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}
.stat-value {
    font-family: var(--f-mono);
    font-size: 20px;
    font-weight: 600;
    color: var(--fg);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}


/* ───── empty ───── */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    background: var(--bg-elev);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    color: var(--fg-muted);
}
.empty-state svg { color: var(--fg-faint); margin-bottom: 10px; }
.empty-state p { font-size: 14px; margin-bottom: 4px; }
.empty-state small { font-size: 12px; color: var(--fg-faint); }
.empty-state em { font-style: normal; color: var(--accent); font-weight: 500; }

.empty-state-inline {
    text-align: center;
    padding: 32px 16px;
    color: var(--fg-muted);
}
.empty-state-inline p { font-size: 13px; margin-bottom: 4px; }
.empty-state-inline small { font-size: 12px; color: var(--fg-faint); }
.empty-state-inline em { font-style: normal; color: var(--accent); font-weight: 500; }


/* ═══════════════════════════════════════════════════════════════════
   TABS (com scroll horizontal em mobile)
   ═══════════════════════════════════════════════════════════════════ */
.tabs-wrap { animation: rise 0.3s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.tabs-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-bottom: 1px solid var(--border);
    margin: 0 -14px;
    padding: 0 14px;
}
.tabs-scroll::-webkit-scrollbar { display: none; }
.tabs {
    display: flex;
    gap: 2px;
    min-width: max-content;
}
.tab {
    color: var(--fg-muted);
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color .15s, border-color .15s, background .15s;
    border-radius: var(--radius) var(--radius) 0 0;
    white-space: nowrap;
    flex-shrink: 0;
    min-height: var(--tap);
}
.tab:hover { color: var(--fg); background: var(--bg-soft); }
.tab.is-active { color: var(--fg); border-bottom-color: var(--accent); }
.tab[disabled] { opacity: 0.5; cursor: not-allowed; }
.tab[disabled]:hover { background: transparent; color: var(--fg-muted); }

.tab-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.tab-dot-on   { background: var(--success); }
.tab-dot-warn { background: var(--warn); }
.tab-dot-info { background: var(--link); }

.tab-count {
    font-family: var(--f-mono);
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--fg-muted);
    font-variant-numeric: tabular-nums;
    border: 1px solid var(--border);
}
.tab.is-active .tab-count { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.tab-count-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }

.tab-panel { display: none; padding-top: 12px; }
.tab-panel.is-active { display: block; }


/* ═══════════════════════════════════════════════════════════════════
   SUB-TABS (histórico)
   ═══════════════════════════════════════════════════════════════════ */
.subtabs-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-bottom: 1px solid var(--border);
    margin: 0 -14px;
    padding: 0 14px;
}
.subtabs-scroll::-webkit-scrollbar { display: none; }
.subtabs {
    display: flex; gap: 2px;
    min-width: max-content;
}
.subtab {
    color: var(--fg-muted);
    padding: 9px 14px;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex; align-items: center; gap: 8px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color .15s, border-color .15s, background .15s;
    border-radius: var(--radius) var(--radius) 0 0;
    white-space: nowrap;
    min-height: 40px;
}
.subtab:hover { color: var(--fg); background: var(--bg-soft); }
.subtab.is-active { color: var(--fg); border-bottom-color: var(--accent); }

.subtab-badge {
    font-family: var(--f-mono);
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--fg-muted);
    border: 1px solid var(--border);
    font-variant-numeric: tabular-nums;
}
.subtab.is-active .subtab-badge { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.subtab-badge-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }

.subtab-panel { display: none; padding-top: 12px; }
.subtab-panel.is-active { display: block; }


/* ═══════════════════════════════════════════════════════════════════
   DATA: search + tabela OU cards
   ═══════════════════════════════════════════════════════════════════ */
.data-wrap {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.data-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
}
.search-wrap {
    flex: 1;
    position: relative;
    display: flex; align-items: center;
}
.search-wrap svg {
    position: absolute;
    left: 10px;
    color: var(--fg-faint);
    pointer-events: none;
}
.search-wrap input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 9px 12px 9px 32px;
    font-size: 14px;
    color: var(--fg);
    min-height: var(--tap);
    transition: border-color .15s, box-shadow .15s;
}
.search-wrap input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.data-info {
    font-family: var(--f-mono);
    font-size: 11px;
    color: var(--fg-muted);
    flex-shrink: 0;
    white-space: nowrap;
}

.data-scroll { max-height: 70vh; overflow: auto; -webkit-overflow-scrolling: touch; }


/* ═══════════════════════════════════════════════════════════════════
   TABELAS (desktop/tablet)
   ═══════════════════════════════════════════════════════════════════ */
.ppp-table, .users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.ppp-table thead th,
.users-table thead th {
    background: var(--bg-soft);
    text-align: left;
    padding: 9px 14px;
    font-weight: 500;
    font-size: 12px;
    color: var(--fg-muted);
    border-bottom: 1px solid var(--border);
}
.ppp-table tbody tr,
.users-table tbody tr {
    border-bottom: 1px solid var(--border-soft);
    transition: background .12s;
}
.ppp-table tbody tr:last-child,
.users-table tbody tr:last-child { border-bottom: 0; }
.ppp-table tbody tr:hover,
.users-table tbody tr:hover { background: var(--bg-hover); }
.ppp-table td, .users-table td {
    padding: 10px 14px;
    color: var(--fg);
    font-variant-numeric: tabular-nums;
    vertical-align: middle;
    position: relative;
}
.row-unauth td { background: rgba(251, 191, 36, 0.02); }
.row-critical td { background: rgba(239, 68, 68, 0.04); }
.row-critical strong { color: var(--danger); }

.cell-iface { font-family: var(--f-mono); font-weight: 500; }
.cell-peer  { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }

.active-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--success);
    flex-shrink: 0;
    animation: live-pulse 2s ease-in-out infinite;
}
.warn-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--warn);
    flex-shrink: 0;
    animation: live-pulse 2.4s ease-in-out infinite;
}
.loop-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--warn);
    flex-shrink: 0;
    animation: live-pulse 2s ease-in-out infinite;
}
.loop-dot-crit { background: var(--danger); }

/* IP cell — texto + botão de copiar SEMPRE visível */
.ip-cell {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--f-mono);
    color: var(--link);
    padding: 4px 0;
    border-radius: 4px;
    position: relative;
}
.ip-text { user-select: text; }

.ip-copy-btn {
    width: 24px; height: 24px;
    display: inline-grid;
    place-items: center;
    color: var(--fg-muted);
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    transition: color .12s, background .12s, border-color .12s;
    flex-shrink: 0;
    padding: 0;
    vertical-align: middle;
}
.ip-copy-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
}
.ip-copy-btn:active {
    transform: scale(0.92);
}

.ip-muted { font-family: var(--f-mono); color: var(--fg-faint); }

.stage-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    font-family: var(--f-mono);
    white-space: nowrap;
}
.stage-pill.localt   { background: var(--success-soft); color: var(--success); }
.stage-pill.unauthna { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-border); }
.stage-pill.authsent { background: var(--warn-soft); color: var(--warn); }
.stage-pill.fail     { background: var(--danger-soft); color: var(--danger); }

.flags-list { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.flag {
    font-family: var(--f-mono);
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 500;
    border: 1px solid;
}
.flag.open     { color: var(--success); border-color: var(--success); background: var(--success-soft); }
.flag.nego     { color: var(--warn);    border-color: var(--warn);    background: var(--warn-soft); }
.flag.fail     { color: var(--danger);  border-color: var(--danger);  background: var(--danger-soft); }
.flag.progress { color: var(--link);    border-color: var(--link);    background: var(--link-soft); }

.interval-ok   { color: var(--fg-muted); }
.interval-crit { color: var(--danger); font-weight: 700; }


/* ═══════════════════════════════════════════════════════════════════
   CARDS (mobile) - PPPoE
   ═══════════════════════════════════════════════════════════════════ */
.data-cards {
    padding: 8px;
    display: flex; flex-direction: column;
    gap: 8px;
    max-height: 70vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.ppp-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    display: flex; flex-direction: column;
    gap: 8px;
    transition: border-color .12s, transform .08s;
}
.ppp-card:active { transform: scale(0.99); }
.ppp-card-on { border-left: 3px solid var(--success); }
.ppp-card-warn { border-left: 3px solid var(--warn); }
.ppp-card-crit { border-left: 3px solid var(--danger); background: rgba(239, 68, 68, 0.03); }

.ppp-card-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px;
}
.ppp-card-name {
    display: flex; align-items: center; gap: 8px;
    min-width: 0;
    flex: 1;
}
.ppp-card-name strong {
    font-weight: 600;
    font-size: 15px;
    color: var(--fg);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.ppp-card-ip-row {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 10px;
    background: var(--bg-soft);
    border-radius: var(--radius);
}
.ppp-card-ip {
    flex: 1;
    font-family: var(--f-mono);
    font-size: 15px;
    font-weight: 500;
    color: var(--link);
    padding: 4px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.ppp-card-ip:hover { color: var(--accent); }
.ppp-card-ip-muted { color: var(--fg-faint); cursor: default; }

.btn-icon {
    width: 36px; height: 36px;
    display: grid; place-items: center;
    color: var(--fg-muted);
    border-radius: var(--radius);
    transition: background .15s, color .15s;
    flex-shrink: 0;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--fg); }
.btn-icon:active { transform: scale(0.92); }

.ppp-card-foot {
    display: flex; flex-wrap: wrap;
    align-items: center; gap: 6px;
}

.ppp-card-meta { font-size: 12px; }

.ppp-card-compact { padding: 10px 12px; gap: 4px; }
.ppp-card-compact .ppp-card-head { align-items: baseline; }

.loop-count {
    font-size: 12px;
    color: var(--fg-muted);
    font-variant-numeric: tabular-nums;
}
.loop-count strong { color: var(--fg); font-family: var(--f-mono); font-size: 14px; }


/* ═══════════════════════════════════════════════════════════════════
   USERS - cards mobile
   ═══════════════════════════════════════════════════════════════════ */
.users-cards {
    padding: 12px;
    display: flex; flex-direction: column;
    gap: 10px;
}
.user-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    display: flex; flex-direction: column;
    gap: 10px;
}
.user-card-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px;
}
.user-card-name { display: flex; align-items: center; gap: 8px; }
.user-card-name strong { font-size: 15px; color: var(--fg); }
.user-card-info { font-size: 13px; color: var(--fg-muted); }
.user-card-meta {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px;
    font-size: 12px;
}
.user-card-actions {
    display: flex; gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}
.btn-card {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--fg);
    background: var(--bg-soft);
    min-height: 38px;
    transition: background .15s;
}
.btn-card:hover { background: var(--bg-hover); }
.btn-card-danger { color: var(--danger); border-color: var(--danger); }
.btn-card-danger:hover { background: var(--danger-soft); }


/* ═══════════════════════════════════════════════════════════════════
   BANNERS / INFO / WARN
   ═══════════════════════════════════════════════════════════════════ */
.warn-banner {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    margin: 12px 0;
    background: var(--warn-soft);
    border: 1px solid var(--warn-border);
    border-left: 3px solid var(--warn-border);
    border-radius: var(--radius);
    color: var(--warn);
}
.warn-banner svg { flex-shrink: 0; margin-top: 1px; }
.warn-banner strong { font-weight: 600; display: block; margin-bottom: 2px; font-size: 13px; }
.warn-banner small { color: var(--fg-muted); font-size: 12px; line-height: 1.5; display: block; }
.warn-banner code {
    font-family: var(--f-mono);
    font-size: 11px;
    background: var(--bg);
    padding: 1px 5px;
    border-radius: 3px;
    color: var(--warn);
}

.info-banner {
    display: flex; flex-wrap: wrap;
    align-items: center; justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    margin: 12px 0;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
}
.info-banner-tip {
    background: var(--link-soft);
    border-color: var(--link);
    color: var(--link);
    padding: 10px 12px;
    gap: 10px;
    align-items: flex-start;
}
.info-banner-tip svg { flex-shrink: 0; margin-top: 2px; }
.info-banner-tip small { color: var(--fg-muted); font-size: 12px; line-height: 1.5; }

.hist-summary { display: flex; flex-direction: column; gap: 2px; }
.hist-summary .muted { font-family: var(--f-mono); font-size: 11px; color: var(--fg-muted); }

.hist-reasons { display: flex; flex-wrap: wrap; gap: 6px; }
.reason-pill {
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    color: var(--fg-muted);
}
.reason-pill strong { color: var(--fg); margin-right: 4px; font-family: var(--f-mono); }

.error-box {
    padding: 14px 18px;
    background: var(--danger-soft);
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--danger);
}


/* ═══════════════════════════════════════════════════════════════════
   INCIDENT CARDS
   ═══════════════════════════════════════════════════════════════════ */
.incident-card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-left: 3px solid var(--warn-border);
    border-radius: var(--radius-lg);
    padding: 14px;
    margin-bottom: 10px;
    transition: border-color .15s;
}
.incident-card:hover { border-left-color: var(--warn); }
.incident-head {
    display: flex; flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}
.incident-title {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--fg);
    font-size: 14px;
}
.incident-meta { font-size: 11px; }
.user-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.user-chip {
    font-family: var(--f-mono);
    font-size: 11px;
    padding: 2px 8px;
    background: var(--warn-soft);
    color: var(--warn);
    border: 1px solid var(--warn-border);
    border-radius: 3px;
}


/* ═══════════════════════════════════════════════════════════════════
   FORM USUÁRIOS (mobile vira coluna única)
   ═══════════════════════════════════════════════════════════════════ */
.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 13px;
    border: 1px solid;
    animation: rise 0.3s ease-out;
}
.flash-ok  { background: var(--success-soft); color: var(--success); border-color: var(--success); }
.flash-err { background: var(--danger-soft);  color: var(--danger);  border-color: var(--danger); }

.card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    overflow: hidden;
}
.card-head {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.card-head h2 { font-size: 14px; font-weight: 600; }
.card-head .muted { font-family: var(--f-mono); font-size: 12px; }

.form-row {
    padding: 14px;
    display: flex; flex-direction: column;
    gap: 12px;
}
.ff { display: flex; flex-direction: column; gap: 6px; }
.ff > span {
    font-size: 11px; font-weight: 500; color: var(--fg-muted);
    text-transform: uppercase; letter-spacing: 0.04em;
}

.badge-self {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    background: var(--accent-soft); color: var(--accent);
    border-radius: 3px;
    font-size: 10px; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.04em;
}

.role-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px; font-weight: 500;
    font-family: var(--f-mono);
}
.role-admin  { background: var(--accent-soft); color: var(--accent); }
.role-viewer { background: var(--bg-soft);    color: var(--fg-muted); }

.select-mini {
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 4px 8px;
    font-family: var(--f-mono);
    font-size: 11px;
    cursor: pointer;
    min-height: 32px;
}
.select-mini:focus { outline: none; border-color: var(--accent); }

.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-dot.on  { background: var(--success); animation: live-pulse 2s ease-in-out infinite; }
.status-dot.off { background: var(--fg-faint); }
.status-on  { color: var(--success); }
.status-off { color: var(--fg-faint); }

.actions {
    display: flex; gap: 4px;
    justify-content: flex-end; align-items: center;
    flex-wrap: wrap;
}
.inline-form { display: inline; }

.btn-ghost {
    width: 32px; height: 32px;
    display: grid; place-items: center;
    background: transparent;
    color: var(--fg-muted);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    transition: all .15s;
}
.btn-ghost:hover {
    color: var(--fg);
    background: var(--bg-soft);
    border-color: var(--fg-muted);
}
.btn-ghost.btn-danger:hover {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: var(--danger);
}

.dropdown { display: inline-block; position: relative; }
.dropdown summary { list-style: none; }
.dropdown summary::-webkit-details-marker { display: none; }
.dropdown-panel {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--bg-elev);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 8px;
    box-shadow: var(--shadow-lg);
    display: flex;
    gap: 6px;
    z-index: 5;
    min-width: 220px;
}
.dropdown-panel input {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 6px 8px;
    font-size: 12px;
    color: var(--fg);
}
.dropdown-panel input:focus { outline: none; border-color: var(--accent); }
.btn-mini {
    background: var(--accent);
    color: white;
    border-radius: var(--radius);
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    transition: background .15s;
}
.btn-mini:hover { background: var(--accent-hover); }


/* ═══════════════════════════════════════════════════════════════════
   FOOTER + TOAST
   ═══════════════════════════════════════════════════════════════════ */
.dash-foot {
    border-top: 1px solid var(--border);
    padding: 14px;
    text-align: center;
    font-size: 12px;
    color: var(--fg-muted);
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
}
.dash-foot .sep { margin: 0 6px; color: var(--fg-faint); }

.toast {
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--fg);
    color: var(--bg);
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 200;
    opacity: 0;
    transition: opacity .2s, transform .2s;
    max-width: calc(100vw - 40px);
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }


/* ═══════════════════════════════════════════════════════════════════
   BREAKPOINT: Tablet (681-1024px)
   ═══════════════════════════════════════════════════════════════════ */
@media (min-width: 681px) {
    .desktop-only { display: inline-flex; }
    .mobile-only  { display: none !important; }
    .table-only   { display: block; }

    .dash-main { padding: 28px 20px 24px; }
    .topbar-inner { padding: 12px 20px; }
    .menu-btn { display: none; }

    .control-panel {
        flex-direction: row;
        align-items: center;
        gap: 20px;
        padding: 16px 20px;
    }
    .control-buttons { flex: 0 0 auto; }
    .control-buttons .btn-primary,
    .control-buttons .btn-secondary { flex: 0 0 auto; min-width: 0; }

    .stats {
        margin-left: auto;
        padding-left: 20px;
        border-left: 1px solid var(--border);
    }
    .stat { background: transparent; padding: 0; }

    .form-row {
        display: grid;
        grid-template-columns: 1fr 1fr 1.5fr 1fr auto;
        gap: 12px;
        align-items: end;
        padding: 18px;
    }

    .tabs-scroll, .subtabs-scroll {
        margin: 0;
        padding: 0;
        overflow: visible;
        border-bottom: 1px solid var(--border);
    }

    .incident-head { flex-direction: row; justify-content: space-between; align-items: center; }
}


/* ═══════════════════════════════════════════════════════════════════
   BREAKPOINT: Desktop (>1024px)
   ═══════════════════════════════════════════════════════════════════ */
@media (min-width: 1025px) {
    .dash-main { padding: 36px 24px 24px; }
    .topbar-inner { padding: 12px 24px; }

    .stats { gap: 32px; padding-left: 24px; }
    .stat-value { font-size: 22px; }

    .hero h1 { font-size: 28px; }
}


/* mobile only — remove tabela e mostra cards */
@media (max-width: 680px) {
    .table-only { display: none !important; }
    .mobile-only { display: block !important; }

    /* Tablets em retrato — esconde colunas menos críticas */
    .topbar-inner > .topbar-right { display: none; }
}


/* ═══════════════════════════════════════════════════════════════════
   v3.4 — Modal de interface (overlay + slide-up mobile)
   ═══════════════════════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 200;
    opacity: 0;
    transition: opacity .2s;
}
.modal-overlay.is-open { opacity: 1; }

.modal {
    position: fixed;
    z-index: 201;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column;
    overflow: hidden;

    /* Desktop: centro da tela */
    top: 50%; left: 50%;
    transform: translate(-50%, -45%);
    width: min(620px, 92vw);
    max-height: 86vh;
    opacity: 0;
    transition: opacity .2s, transform .22s cubic-bezier(.2,.8,.2,1);
}
.modal.is-open {
    opacity: 1;
    transform: translate(-50%, -50%);
}

.modal-head {
    padding: 14px 18px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}
.modal-title-wrap { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.modal-title-wrap h2 {
    font-size: 17px;
    font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.modal-title-wrap small { font-size: 11px; }

.modal-body {
    padding: 16px 18px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

.modal-foot {
    padding: 10px 18px;
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
    text-align: center;
    font-size: 11px;
}
.modal-foot small { color: var(--fg-muted); }

.modal-loading {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 12px;
    padding: 48px 0;
    color: var(--fg-muted);
}
.modal-loading svg { animation: spin .9s linear infinite; }

/* Seções dentro do modal */
.iface-section { margin-bottom: 20px; }
.iface-section:last-child { margin-bottom: 0; }
.iface-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

/* Taxas - grid de 2 cards */
.rate-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.rate-card {
    padding: 14px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex; flex-direction: column; gap: 6px;
}
.rate-down { border-left: 3px solid var(--success); }
.rate-up   { border-left: 3px solid var(--link); }

.rate-label {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 10px;
    font-weight: 600;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.rate-down .rate-label { color: var(--success); }
.rate-up   .rate-label { color: var(--link); }

.rate-value {
    font-family: var(--f-mono);
    font-size: 24px;
    font-weight: 600;
    color: var(--fg);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}
.rate-meta {
    font-family: var(--f-mono);
    font-size: 11px;
    color: var(--fg-muted);
}

/* Acumulado */
.acc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.acc-cell {
    padding: 10px 14px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex; flex-direction: column; gap: 2px;
}
.acc-cell > small:first-child {
    font-size: 10px;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}
.acc-val {
    font-family: var(--f-mono);
    font-size: 18px;
    font-weight: 600;
    color: var(--fg);
}
.acc-cell .muted { font-size: 11px; }

/* Info DL (definition list) */
.iface-dl {
    display: grid;
    grid-template-columns: minmax(110px, auto) 1fr;
    gap: 6px 14px;
    font-size: 13px;
}
.iface-dl dt {
    color: var(--fg-muted);
    font-size: 12px;
}
.iface-dl dd {
    color: var(--fg);
    text-align: right;
}

.status-indicator {
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}
.status-indicator.on  { background: var(--success); animation: live-pulse 2s ease-in-out infinite; }
.status-indicator.off { background: var(--danger); }

.proto-chip {
    display: inline-block;
    font-family: var(--f-mono);
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    background: var(--success-soft);
    color: var(--success);
    border: 1px solid var(--success);
    margin-left: 3px;
}

/* Erros grid */
.err-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.err-cell {
    padding: 8px 10px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
}
.err-cell small {
    display: block;
    font-size: 10px;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}
.err-val {
    font-family: var(--f-mono);
    font-size: 16px;
    font-weight: 600;
    color: var(--success);
}
.err-val.err-bad { color: var(--danger); }

/* Nome do cliente clicável (abre modal) */
.peer-clickable {
    cursor: pointer;
    padding: 4px 0;
    border-radius: 4px;
    transition: color .12s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.peer-clickable:hover {
    color: var(--accent);
}
.peer-clickable:hover strong { color: var(--accent); }

/* Mobile: modal vira slide-up bottom sheet */
@media (max-width: 680px) {
    .modal {
        top: auto;
        bottom: 0;
        left: 0; right: 0;
        width: 100%;
        max-height: 92vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        border-left: 0; border-right: 0; border-bottom: 0;
        transform: translateY(100%);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .modal.is-open { transform: translateY(0); }
    .modal-head { padding: 14px 16px; }
    .modal-body { padding: 14px 16px; }
    .rate-value { font-size: 22px; }
    .err-grid { grid-template-columns: repeat(2, 1fr); }
    .iface-dl { font-size: 12px; }
}


/* v3.4.2 — IP link no modal + botão fechar grande */
.ip-link-modal {
    font-family: var(--f-mono);
    color: var(--link);
    border-bottom: 1px dashed var(--link-soft);
    transition: color .15s, border-color .15s;
    display: inline-flex;
    align-items: center;
}
.ip-link-modal:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
    text-decoration: none;
}

/* Footer do modal com botão grande */
.modal-foot {
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.modal-foot small { color: var(--fg-muted); font-size: 11px; flex: 1; min-width: 0; }
.modal-close-btn {
    min-height: 38px;
    padding: 8px 16px;
    font-size: 13px;
    flex-shrink: 0;
}

/* Mobile: botão fechar ocupa largura toda */
@media (max-width: 680px) {
    .modal-foot {
        flex-direction: column-reverse;
        align-items: stretch;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
    .modal-close-btn { width: 100%; }
    .modal-foot small { text-align: center; }
}


/* ═══════════════════════════════════════════════════════════════════
   ASR HEALTH — linha minimalista
   ═══════════════════════════════════════════════════════════════════ */
.asr-health-line {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    margin-bottom: 12px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 12px;
    font-family: var(--f-mono);
    color: var(--fg-muted);
    flex-wrap: wrap;
}
.asr-health-line .health-prefix {
    font-weight: 600;
    color: var(--fg);
    letter-spacing: 0.06em;
    font-size: 11px;
}
.asr-health-line .health-sep {
    color: var(--border);
}
.asr-health-line .health-item strong {
    color: var(--fg);
    font-weight: 500;
    margin-left: 4px;
}
.asr-health-line .health-item strong.health-warn { color: var(--warn); }
.asr-health-line .health-item strong.health-crit { color: var(--danger); }
.asr-health-line .health-time {
    margin-left: auto;
    font-size: 10px;
    color: var(--fg-faint);
}

.asr-health-line .health-refresh {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--fg-muted);
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: grid;
    place-items: center;
    cursor: pointer;
    padding: 0;
    transition: color .12s, background .12s, border-color .12s;
}
.asr-health-line .health-refresh:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
}
.asr-health-line .health-refresh:active { transform: scale(0.92); }
.asr-health-line .health-refresh.spinning svg {
    animation: hc-spin 0.8s linear infinite;
}
@keyframes hc-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@media (max-width: 680px) {
    .asr-health-line { font-size: 11px; padding: 6px 10px; }
    .asr-health-line .health-time { display: none; }
    .asr-health-line .health-refresh { margin-left: auto; }
}
