@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ===========================
   VARIÁVEIS
   =========================== */
:root {
    --bg-body:        #eef2f7;
    --sidebar-bg:     #040c1c;
    --sidebar-border: #0f1b36;
    --card-bg:        #ffffff;
    --text-primary:   #0f172a;
    --text-secondary: #64748b;
    --primary:        #2563eb;
    --primary-hover:  #1d4ed8;
    --success:        #22c55e;
    --danger:         #ef4444;
    --warning:        #f59e0b;
    --muted:          #94a3b8;
    --border:         #e2e8f0;
    --border-focus:   #93c5fd;
    --radius-sm:      8px;
    --radius-md:      12px;
    --radius-lg:      18px;
    --shadow-card:    0 1px 3px rgba(15,23,42,.05), 0 6px 20px rgba(15,23,42,.07);
    --shadow-hover:   0 6px 28px rgba(37,99,235,.13);
    --transition:     0.15s ease;
}

/* ===========================
   RESET
   =========================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 0.95rem;
    line-height: 1.55;
    background-color: var(--bg-body);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    text-decoration: underline;
}

/* Scrollbar personalizada */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===========================
   LAYOUT
   =========================== */
.layout {
    min-height: 100vh;
    display: flex;
}

.layout-public { overflow-x: hidden; }

/* ===========================
   SIDEBAR
   =========================== */
.sidebar {
    width: 248px;
    min-width: 248px;
    background: var(--sidebar-bg);
    color: #fff;
    padding: 18px 12px 14px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--sidebar-border);
    gap: 2px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

/* Logo */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.1rem;
    color: #fff;
    padding: 4px 8px 18px;
    letter-spacing: 0.01em;
    text-decoration: none;
}

.sidebar-logo-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, #2563eb 0%, #22c55e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(37,99,235,.45);
}

/* Nav */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Separadores */
.sidebar-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 4px 7px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #ea580c;
    text-shadow: 0 0 10px rgba(234,88,12,.35);
}

.sidebar-divider::before {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(234,88,12,.28);
}

.sidebar-divider-admin {
    color: #f59e0b;
    opacity: 0.85;
}

.sidebar-divider-admin::before {
    background: rgba(245,158,11,.22);
}

/* Links */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 11px;
    border-radius: 9px;
    color: rgba(255,255,255,.78);
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    position: relative;
    cursor: pointer;
}

.sidebar-link:hover {
    background: rgba(234,88,12,.18);
    color: #fff;
    text-decoration: none;
    border-left-color: #ea580c;
}

.sidebar-link.active {
    background: rgba(37,99,235,.22);
    color: #fff;
    font-weight: 600;
    border-left-color: #3b82f6;
}

.sidebar-link-admin:hover {
    background: rgba(245,158,11,.1);
    border-left-color: rgba(245,158,11,.5);
}

.sidebar-link-admin.active {
    background: rgba(245,158,11,.14);
    border-left-color: #f59e0b;
}

.sidebar-link-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.72;
    transition: opacity var(--transition);
}

.sidebar-link:hover .sidebar-link-icon,
.sidebar-link.active .sidebar-link-icon {
    opacity: 1;
}

.sidebar-link-label { flex: 1; }

/* Badge offline */
.sidebar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    animation: badge-pulse 1.6s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.5); }
    50%       { box-shadow: 0 0 0 5px rgba(239,68,68,0); }
}

/* Logout */
.logout-link {
    margin-top: 6px;
    border: 1px solid rgba(255,255,255,.1);
    color: rgba(255,255,255,.55);
}

.logout-link:hover {
    background: rgba(239,68,68,.14);
    border-color: rgba(239,68,68,.38);
    color: #fca5a5;
    border-left-color: #ef4444;
}

/* Footer sidebar */
.sidebar-footer {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,.07);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    margin-bottom: 4px;
    border-radius: 9px;
    background: rgba(255,255,255,.04);
}

.sidebar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: hidden;
}

.sidebar-user-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.68rem;
    color: rgba(255,255,255,.4);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ===========================
   MAIN / TOPBAR
   =========================== */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-body);
    overflow-x: hidden;
    min-width: 0;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 28px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.topbar-public {
    background: transparent;
    border-bottom: none;
    flex-wrap: wrap;
    padding: 14px 16px;
}

.topbar-info p {
    font-weight: 600;
    font-size: 0.92rem;
}

.topbar-info small { color: var(--text-secondary); font-size: 0.8rem; }

.role-tag {
    text-transform: uppercase;
    font-size: 0.7rem;
    color: var(--muted);
    margin-left: 8px;
    background: #f1f5f9;
    padding: 2px 7px;
    border-radius: 999px;
}

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

/* ===========================
   BOTÕES
   =========================== */
.ghost-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #dbeafe;
    padding: 7px 14px;
    border-radius: var(--radius-md);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.88rem;
    background: #f4f8ff;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
    text-decoration: none;
}

.ghost-button:hover {
    background: #e8f0ff;
    border-color: #93c5fd;
    box-shadow: 0 2px 8px rgba(37,99,235,.1);
    text-decoration: none;
}

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.88rem;
    border: none;
    cursor: pointer;
    transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
    text-decoration: none;
}

.primary-button:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 14px rgba(37,99,235,.3);
    transform: translateY(-1px);
    text-decoration: none;
    color: #fff;
}

button {
    padding: 9px 16px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background var(--transition), box-shadow var(--transition);
    font-family: inherit;
}

button:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 14px rgba(37,99,235,.25);
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ===========================
   CHIPS
   =========================== */
.chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.73rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.chip-plan { background: #e0ecff; color: var(--primary); }
.chip-live  { background: #dcfce7; color: var(--success); }

/* ===========================
   CONTAINER
   =========================== */
.container {
    flex: 1;
    padding: 28px 32px;
}

.container-public {
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
    padding: 16px 12px 32px;
}

/* ===========================
   CARDS
   =========================== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(226,232,240,.8);
}

.card h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 2px;
    color: var(--text-primary);
}

.card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 2px;
    color: var(--text-primary);
}

.card-head h2 { margin: 0; }

.card-head p,
.card p {
    margin: 5px 0 0;
    color: var(--text-secondary);
    font-size: 0.87rem;
}

/* Card grid */
.card-grid { display: grid; gap: 18px; }

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.stats-card {
    padding: 18px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #eef4ff 0%, #e8f2ff 100%);
    border: 1px solid #d1e0ff;
}

.stats-card strong {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    margin: 8px 0;
    color: var(--primary);
}

.stats-card small {
    display: block;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.06em;
    font-size: 0.72rem;
}

/* ===========================
   CHART CARD
   =========================== */
.chart-card canvas {
    width: 100%;
    max-height: 320px;
}

/* ===========================
   IP CARDS (lista)
   =========================== */
.ip-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.ip-card {
    border-radius: var(--radius-lg);
    background: var(--card-bg);
    padding: 18px 20px;
    border: 1.5px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.ip-card[data-href] { cursor: pointer; }

.ip-card[data-href]:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: #93c5fd;
}

.ip-card.online {
    border-color: #86efac;
    box-shadow: 0 0 0 3px rgba(34,197,94,.1);
}

.ip-card.offline {
    border-color: #fca5a5;
    box-shadow: 0 0 0 3px rgba(239,68,68,.08);
}

.ip-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ip-card-stats {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.ip-card-stats div {
    flex: 1;
    min-width: 80px;
}

.ip-card-stats small {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 2px;
}

.ip-card-stats strong {
    font-size: 1.3rem;
    font-weight: 700;
}

.ip-card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.88rem;
}

/* ===========================
   BADGE
   =========================== */
.badge {
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.73rem;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    background: #f1f5f9;
    font-weight: 600;
}

.status-online { color: var(--success); font-weight: 600; }
.status-offline { color: var(--danger); font-weight: 600; }

/* ===========================
   ALERTAS PREVIEW
   =========================== */
.alert-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.alert-preview-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    background: #fafcff;
    transition: box-shadow var(--transition);
}

.alert-preview-card:hover {
    box-shadow: 0 3px 12px rgba(15,23,42,.08);
}

.alert-preview-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    text-transform: uppercase;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 700;
}

.alert-type { letter-spacing: 0.08em; }

.alert-status {
    padding: 2px 9px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.75rem;
}

.alert-status.ok   { background: #dcfce7; color: var(--success); }
.alert-status.fail { background: #fee2e2; color: var(--danger);  }

.alert-target {
    margin: 0 0 4px;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary);
    word-break: break-all;
}

.alert-date  { color: var(--text-secondary); font-size: 0.8rem; }
.alert-error { margin: 8px 0 0; font-size: 0.82rem; color: var(--danger); }

/* ===========================
   TABELAS
   =========================== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 14px;
    font-size: 0.9rem;
}

th {
    padding: 10px 12px;
    text-align: left;
    background: #f4f7fb;
    border-bottom: 2px solid var(--border);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
    z-index: 1;
}

td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-primary);
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover td {
    background: #f8fafc;
}

/* ===========================
   FORMULÁRIOS
   =========================== */
input, select, textarea {
    width: 100%;
    padding: 10px 13px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #fafcff;
    font-family: inherit;
    font-size: 0.92rem;
    color: var(--text-primary);
    transition: border-color var(--transition), box-shadow var(--transition);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea {
    margin-bottom: 10px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

label {
    display: block;
    font-weight: 600;
    font-size: 0.87rem;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.hint {
    margin: 0 0 10px;
    font-size: 0.83rem;
    color: var(--muted);
}

/* ===========================
   SETTINGS
   =========================== */
.settings-wrapper   { display: flex; flex-direction: column; gap: 22px; }
.settings-hero      { display: flex; justify-content: space-between; gap: 22px; flex-wrap: wrap; }
.settings-hero-text h2 { margin-bottom: 4px; }

.settings-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    color: var(--muted);
    margin: 0 0 6px;
    font-weight: 700;
}

.settings-hero-status { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.settings-status {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 11px 16px;
    min-width: 150px;
    background: #f8fafc;
}

.settings-status span {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.settings-status strong { font-size: 1.05rem; }

.settings-status.ok   { border-color: rgba(34,197,94,.35); color: var(--success); }
.settings-status.warn { border-color: rgba(239,68,68,.35); color: var(--danger);  }

.settings-flash {
    border-radius: var(--radius-md);
    padding: 13px 16px;
    font-weight: 600;
    font-size: 0.9rem;
}

.settings-flash.success { background: #dcfce7; color: var(--success); }
.settings-flash.error   { background: #fee2e2; color: var(--danger);  }

.settings-grid  { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }

.form-card,
.test-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.form-card-head h4 { margin: 0; }

.form-card-head p {
    margin: 4px 0 10px;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px dashed #c7d9f5;
    border-radius: var(--radius-md);
    background: #f8fafc;
}

.muted-text { color: var(--text-secondary); font-size: 0.88rem; }

.settings-tests { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.test-form      { display: flex; flex-direction: column; gap: 10px; }

.inline-feedback {
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.inline-feedback.success { background: #dcfce7; color: var(--success); }
.inline-feedback.error   { background: #fee2e2; color: var(--danger);  }

.settings-tests button { align-self: flex-start; }

/* ===========================
   FOOTER
   =========================== */
.footer {
    padding: 14px 28px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.82rem;
    background: transparent;
}

/* ===========================
   AUTH
   =========================== */
.auth-page {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 440px;
    width: 100%;
    margin: 0 auto;
    padding: 4px 6px;
}

.auth-visual,
.auth-signal,
.auth-signal-dot,
.auth-signal-label,
.auth-visual-badges {
    display: none;
}

.auth-card {
    background: #fff;
    border-radius: 20px;
    padding: 26px 24px;
    border: 1px solid var(--border);
    box-shadow: 0 12px 32px rgba(15,23,42,.12), 0 4px 12px rgba(15,23,42,.07);
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
}

.auth-card h2 { margin: 0 0 10px; font-size: 1.3rem; }
.auth-card p  { margin: 0 0 12px; color: var(--text-secondary); font-size: 0.9rem; }

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-weight: 800;
    color: var(--primary);
}

.auth-brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 13px;
    background: linear-gradient(135deg, #2563eb 0%, #22c55e 100%);
    box-shadow: 0 5px 12px rgba(37,99,235,.22);
}

.auth-form label {
    display: block;
    margin: 10px 0 5px;
    font-weight: 600;
    color: var(--text-primary);
}

.auth-form input { width: 100%; margin-bottom: 8px; }

.auth-error {
    margin: 0 0 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: #fee2e2;
    color: #b91c1c;
    font-weight: 600;
    font-size: 0.88rem;
}

.auth-links {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
    font-size: 0.88rem;
}

.auth-links a { color: var(--primary); font-weight: 600; }

.auth-separator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.auth-separator::before,
.auth-separator::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-meta {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-meta a { font-weight: 700; }

/* ===========================
   DETAIL PAGE
   =========================== */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.detail-header h1 {
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0 0 3px;
}

.detail-header p, .detail-header small {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Status pill */
.status-pill {
    display: inline-block;
    padding: 9px 20px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.88rem;
    background: #f1f5f9;
    color: var(--text-secondary);
    min-width: 130px;
    text-align: center;
    border: 1.5px solid transparent;
}

.status-pill.online {
    background: #dcfce7;
    color: #15803d;
    border-color: #86efac;
    animation: status-pulse 2s ease-in-out infinite;
}

.status-pill.offline {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
}

@keyframes status-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(34,197,94,.4);  }
    70%  { box-shadow: 0 0 0 10px rgba(34,197,94,0); }
    100% { box-shadow: 0 0 0 0   rgba(34,197,94,0);  }
}

/* Métricas */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.metric-card {
    padding: 16px 18px;
    border-radius: var(--radius-md);
    background: #fafcff;
    border: 1px solid #dce8f8;
    border-top: 3px solid #bfdbfe;
    transition: box-shadow var(--transition), transform var(--transition);
}

.metric-card:hover {
    box-shadow: 0 4px 16px rgba(37,99,235,.08);
    transform: translateY(-1px);
}

.metric-card strong {
    display: block;
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 6px 0 4px;
    color: var(--text-primary);
}

.metric-card p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.metric-label {
    display: block;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.09em;
    font-weight: 700;
    color: var(--muted);
}

/* Heatmap */
.heatmap {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.heatmap-cell {
    border-radius: var(--radius-sm);
    padding: 9px;
    text-align: center;
    font-size: 0.78rem;
    border: 1px solid #e5e7eb;
    transition: transform var(--transition);
}

.heatmap-cell:hover { transform: scale(1.05); }

.heatmap-cell strong { display: block; font-size: 0.85rem; }
.heatmap-cell small  { color: var(--text-secondary); }

.heatmap-cell.good   { background: #dcfce7; color: #15803d; border-color: #86efac; }
.heatmap-cell.medium { background: #fef9c3; color: #a16207; border-color: #fde68a; }
.heatmap-cell.bad    { background: #fee2e2; color: var(--danger); border-color: #fca5a5; }

/* Detail actions */
.detail-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
    align-items: center;
}

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 14px;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition);
}

.back-link:hover {
    background: #f1f5f9;
    color: var(--primary);
    text-decoration: none;
}

/* Chart tabs (legacy - usamos links agora) */
.detail-chart-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.detail-chart-tabs button { background: #e2e8f0; color: var(--text-primary); }
.detail-chart-tabs button.active { background: var(--primary); color: #fff; }

/* ===========================
   IP CARD META
   =========================== */
.ip-card.latency-risk { box-shadow: inset 0 0 0 1px rgba(234,179,8,.35); }

.ip-card-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.meta-item {
    background: #f1f5f9;
    border-radius: 999px;
    padding: 4px 11px;
    font-size: 0.8rem;
}

.ip-row { cursor: pointer; transition: background var(--transition); }
.ip-row:hover td { background: #f0f7ff !important; }

/* ===========================
   RESPONSIVO
   =========================== */
@media (max-width: 900px) {
    .auth-page { max-width: 100%; padding: 6px; }

    .layout { flex-direction: column; }

    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        overflow-x: auto;
        padding: 12px;
        position: relative;
        flex-wrap: nowrap;
    }

    .sidebar-logo   { padding-bottom: 0; }
    .sidebar-footer { display: none; }
    .sidebar-divider { display: none; }

    .sidebar-nav {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 4px;
    }

    .sidebar-link {
        padding: 8px 10px;
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    .sidebar-link.active { border-bottom-color: #3b82f6; border-left-color: transparent; }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 16px;
        gap: 10px;
    }

    .topbar-actions { flex-wrap: wrap; }

    .container { padding: 16px; }

    .metric-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

    .heatmap { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); }
}

@media (max-width: 600px) {
    .metric-grid { grid-template-columns: 1fr 1fr; }
    .ip-cards    { grid-template-columns: 1fr; }
    .stats-grid  { grid-template-columns: 1fr 1fr; }
}

/* ===========================
   TOAST NOTIFICATIONS
   =========================== */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 18px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.88rem;
    color: #fff;
    box-shadow: 0 8px 28px rgba(0,0,0,.22);
    opacity: 0;
    transform: translateX(28px);
    transition: opacity .3s ease, transform .3s ease;
    pointer-events: auto;
    max-width: 340px;
    min-width: 200px;
}

.toast.show { opacity: 1; transform: translateX(0); }

.toast-icon {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: rgba(255,255,255,.25);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.78rem; font-weight: 800;
    flex-shrink: 0;
}

.toast-success { background: linear-gradient(135deg,#16a34a,#15803d); }
.toast-error   { background: linear-gradient(135deg,#dc2626,#b91c1c); }
.toast-info    { background: linear-gradient(135deg,#2563eb,#1d4ed8); }
.toast-warning { background: linear-gradient(135deg,#d97706,#b45309); }

/* ===========================
   SKELETON LOADING
   =========================== */
.skeleton-box {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.6s infinite;
    border-radius: 8px;
}

@keyframes skeleton-shimmer {
    0%   { background-position:  200% 0; }
    100% { background-position: -200% 0; }
}

.chart-skeleton {
    width: 100%;
    height: 220px;
    border-radius: 10px;
}

/* ===========================
   DARK MODE
   =========================== */
[data-theme="dark"] {
    --bg-body:      #0f172a;
    --card-bg:      #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary:#94a3b8;
    --border:       #334155;
    --shadow-card:  0 1px 3px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
}

[data-theme="dark"] .card {
    background: var(--card-bg);
    border-color: var(--border);
}

[data-theme="dark"] .topbar {
    background: #1e293b;
    border-bottom-color: #334155;
}

[data-theme="dark"] th {
    background: #0f172a;
    color: #64748b;
    border-bottom-color: #334155;
}

[data-theme="dark"] td {
    color: var(--text-primary);
    border-bottom-color: #1e293b;
}

[data-theme="dark"] tbody tr:hover td { background: #243046; }

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

[data-theme="dark"] .ip-card {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .ip-card.online  { border-color: #166534; }
[data-theme="dark"] .ip-card.offline { border-color: #7f1d1d; }

[data-theme="dark"] .stats-card {
    background: linear-gradient(135deg,#1e3a5f,#162d4a);
    border-color: #2a4a7a;
}

[data-theme="dark"] .stats-card strong { color: #93c5fd; }

[data-theme="dark"] .metric-card {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .heatmap-cell {
    border-color: #334155;
    background: #1e293b;
}

[data-theme="dark"] .alert-preview-card {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .sidebar-badge { background: #ef4444; }

[data-theme="dark"] .ghost-button {
    background: #1e293b;
    border-color: #334155;
    color: #93c5fd;
}

[data-theme="dark"] .ghost-button:hover {
    background: #243046;
    border-color: #3b82f6;
}

[data-theme="dark"] .meta-item { background: #0f172a; }

[data-theme="dark"] .skeleton-box {
    background: linear-gradient(90deg,#1e293b 25%,#243046 50%,#1e293b 75%);
    background-size: 200% 100%;
}

[data-theme="dark"] .back-link:hover { background: #1e293b; }

[data-theme="dark"] #darkToggle {
    border-color: #334155;
    color: #94a3b8;
}
