/* ══════════════════════════════════════════════════════════════════════
   BOREAL — Design System Premium & Alta Acessibilidade (Dark Navy & Cyan)
   ══════════════════════════════════════════════════════════════════════ */

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

/* ══════════════════════════════════════════════════════════════════════
   DIRETRIZ MANDATÓRIA DE ALTO CONTRASTE E TIPOGRAFIA (LEI DE CONTRASTE)
   É terminantemente PROIBIDO o uso de tons cinzas escuros/médios
   (#6c757d, #8d99ae, #475569, #64748b) sobre o tema escuro Navy.
   Toda tipografia secundária DEVE ter luminância mínima de #cbd5e1 ou #e2e8f0.
   ══════════════════════════════════════════════════════════════════════ */

/* Sobrescritas globais invioláveis para legibilidade perfeita */
.text-muted, 
small.text-muted, 
.form-text, 
.text-secondary,
.text-dim,
.text-silver,
.sidebar-section-title,
p.text-muted,
span.text-muted,
div.text-muted,
small,
.small,
.table td.text-muted,
.table th.text-muted,
.card-subtitle,
.dropdown-header,
.text-muted *,
.text-secondary * {
    color: #cbd5e1 !important; /* Prata claro luminoso com altíssimo contraste contra o fundo escuro */
}

/* Ícones secundários e mutados */
i.text-muted, 
i.text-secondary,
.bi.text-muted,
.bi.text-secondary {
    color: #94a3b8 !important;
}

/* Títulos de seção na barra lateral */
.sidebar-section-title {
    color: #e2e8f0 !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
}

/* Textos principais e dados de tabelas */
body, #content, .table, .table td, .table th, p, span, label, input, select, textarea {
    color: #f8fafc !important;
}

/* Badges secundários e tags */
.badge.bg-secondary, .badge.bg-dark {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.badge.bg-secondary.text-dark {
    color: #ffffff !important;
    background-color: #334155 !important;
}

/* Cores Ciano BOREAL de Alto Contraste */
.bg-cyan, 
.badge.bg-cyan,
.badge-cyan {
    background-color: #00b4d8 !important;
    color: #09131f !important;
    font-weight: 700 !important;
    border: none !important;
}

.bg-cyan *,
.badge.bg-cyan *,
.badge-cyan * {
    color: #09131f !important;
}

.text-cyan {
    color: #38bdf8 !important;
}

.text-cyan-light {
    color: #7dd3fc !important;
}

/* Placeholders de inputs */
::placeholder, .form-control::placeholder {
    color: #94a3b8 !important;
    opacity: 0.9 !important;
}

/* Links e navegação */
a.text-muted, a.text-secondary {
    color: #38bdf8 !important;
    text-decoration: none !important;
}
a.text-muted:hover, a.text-secondary:hover {
    color: #7dd3fc !important;
    text-decoration: underline !important;
}

/* Elementos vazios / informativos */
.text-center.text-muted {
    color: #e2e8f0 !important;
}

:root {
    --bg-navy: #09131f;
    --sidebar-bg: #101e30;
    --accent-cyan: #00b4d8;
    --accent-cyan-light: #38bdf8;
    --success-green: #10b981;
    --danger-red: #f43f5e;
    --warning-yellow: #fbbf24;
    
    /* Tipografia de Alto Contraste */
    --text-pure-white: #ffffff;
    --text-light: #f8fafc;
    --text-silver: #cbd5e1;
    --text-muted: #cbd5e1;
    --text-dim: #cbd5e1;
    
    --border-color: rgba(255, 255, 255, 0.15);
    --border-cyan: rgba(0, 180, 216, 0.4);
    --glass-bg: rgba(16, 30, 48, 0.90);
    --glass-border: rgba(255, 255, 255, 0.12);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-navy);
    color: var(--text-light);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.text-light {
    color: #f8fafc !important;
}

.text-cyan {
    color: var(--accent-cyan-light) !important;
}

p, span, td, th, label, li, a {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--text-pure-white);
    letter-spacing: -0.01em;
}

/* Layout */
#wrapper {
    display: flex;
    width: 100%;
    height: 100vh;
}

/* Sidebar */
#sidebar {
    min-width: 260px;
    max-width: 260px;
    height: 100vh;
    position: sticky;
    top: 0;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
}

#sidebar .sidebar-header {
    flex-shrink: 0 !important;
    min-height: 84px;
    padding: 14px 12px 10px 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(16, 30, 48, 0.98) 0%, rgba(9, 19, 31, 0.90) 100%);
    overflow: hidden;
}

#sidebar .sidebar-header a,
#sidebar .sidebar-header a:hover,
#sidebar .sidebar-header a:focus,
.sidebar-logo-link,
.sidebar-logo-link * {
    text-decoration: none !important;
}

.sidebar-logo-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    transition: opacity 0.2s ease;
}

.sidebar-logo-link:hover {
    opacity: 0.92;
}

.sidebar-brand-logo-wrap {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 215px !important;
    background: #ffffff !important;
    padding: 6px 10px !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-logo-link:hover .sidebar-brand-logo-wrap {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 180, 216, 0.35) !important;
}

/* Selo branco para logos oficiais de fabricantes (Cisco, Huawei, MikroTik etc.) — a maioria das
   marcas oficiais usa wordmarks escuros/pretos ou dependem de `currentColor`, ilegíveis contra o
   tema escuro do BOREAL sem um fundo claro próprio. Mesmo padrão visual do .sidebar-brand-logo-wrap. */
.manufacturer-logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 6px;
    padding: 3px 6px;
    box-sizing: border-box;
    line-height: 0;
}

.sidebar-brand-logo {
    width: 100% !important;
    max-width: 195px !important;
    height: auto !important;
    max-height: 38px !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
}

.sidebar-brand-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 6px;
    text-decoration: none !important;
}

.sidebar-app-name {
    font-size: 0.60rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.16em !important;
    color: var(--accent-cyan-light) !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
}

.sidebar-app-dot {
    color: #64748b;
    font-size: 0.55rem;
    text-decoration: none !important;
}

.sidebar-app-version {
    font-size: 0.58rem !important;
    font-weight: 600 !important;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace !important;
    color: #cbd5e1 !important;
    background: rgba(255, 255, 255, 0.06) !important;
    padding: 1px 5px !important;
    border-radius: 4px !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    text-decoration: none !important;
}

.sidebar-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: #cbd5e1 !important;
    text-decoration: none !important;
    padding: 3px 8px;
    background: rgba(16, 185, 129, 0.10);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.sidebar-status-pill:hover {
    background: rgba(16, 185, 129, 0.20);
    border-color: rgba(16, 185, 129, 0.6);
    color: #ffffff !important;
}

.sidebar-status-dot {
    width: 6px;
    height: 6px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.8);
}

#sidebar ul.components {
    padding: 15px 0 25px 0;
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Scrollbar fina e elegante para o sidebar */
#sidebar ul.components::-webkit-scrollbar {
    width: 5px;
}
#sidebar ul.components::-webkit-scrollbar-track {
    background: rgba(11, 24, 41, 0.5);
}
#sidebar ul.components::-webkit-scrollbar-thumb {
    background: rgba(0, 180, 216, 0.3);
    border-radius: 4px;
}
#sidebar ul.components::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 180, 216, 0.6);
}

#sidebar ul li a {
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #e2e8f0;
    text-decoration: none;
    transition: all 0.2s ease;
}

#sidebar ul li a:hover {
    color: #ffffff;
    background: rgba(0, 180, 216, 0.15);
    border-left: 4px solid var(--accent-cyan);
}

#sidebar ul li.active > a {
    color: #ffffff;
    background: rgba(0, 180, 216, 0.22);
    border-left: 4px solid var(--accent-cyan);
    font-weight: 600;
}

#sidebar ul li a i {
    font-size: 1.15rem;
    width: 24px;
    text-align: center;
}

.sidebar-section-title {
    font-size: 0.74rem !important;
    letter-spacing: 0.06em !important;
    color: #e2e8f0 !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
}

/* Sidebar Group Headers & Collapsible Navigation */
.sidebar-group-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 8px 14px !important;
    color: #cbd5e1 !important;
    text-decoration: none !important;
    cursor: pointer;
    border-radius: 6px;
    margin: 2px 10px;
    transition: all 0.2s ease;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
}

.sidebar-group-header:hover {
    background: rgba(255, 255, 255, 0.07) !important;
    color: #38bdf8 !important;
    border-color: rgba(56, 189, 248, 0.2);
}

.sidebar-group-header.active-group {
    color: #38bdf8 !important;
    background: rgba(56, 189, 248, 0.08) !important;
    border-color: rgba(56, 189, 248, 0.25);
}

/* Subgroup Header (ex: Backups dentro de Rede) */
.sidebar-subgroup-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 7px 14px 7px 28px !important;
    color: #cbd5e1 !important;
    text-decoration: none !important;
    cursor: pointer;
    border-radius: 6px;
    margin: 1px 10px;
    transition: all 0.2s ease;
    font-size: 0.86rem !important;
    font-weight: 500 !important;
    background: transparent;
    border: 1px solid transparent;
}

.sidebar-subgroup-header:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #38bdf8 !important;
}

.sidebar-subgroup-header.active-subgroup {
    color: #38bdf8 !important;
    font-weight: 600 !important;
}

/* Indicador Clean + / - (sem setas tradicionais) */
.toggle-indicator {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace, sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    transition: all 0.2s ease;
    user-select: none;
}

.sidebar-group-header:hover .toggle-indicator,
.sidebar-subgroup-header:hover .toggle-indicator {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
}

/* Quando expandido (sem .collapsed): exibe '-' */
.toggle-indicator::before {
    content: '−';
    font-size: 0.95rem;
}

/* Quando colapsado (.collapsed): exibe '+' */
.collapsed .toggle-indicator::before {
    content: '+';
    font-size: 0.95rem;
}

.group-chevron, .toggle-chevron {
    display: none !important;
}

.sidebar-sublist {
    padding: 2px 0 4px 0 !important;
    margin-bottom: 2px;
}

/* Subitens nível 1 (afastados do canto) */
.sidebar-sublist li a {
    padding: 8px 16px 8px 28px !important;
    font-size: 0.88rem !important;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #cbd5e1 !important;
    text-decoration: none !important;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    margin: 1px 0;
}

.sidebar-sublist li a:hover {
    color: #ffffff !important;
    background: rgba(0, 180, 216, 0.15) !important;
    border-left: 3px solid var(--accent-cyan) !important;
    padding-left: 32px !important;
}

.sidebar-sublist li.active > a {
    color: #ffffff !important;
    background: rgba(0, 180, 216, 0.22) !important;
    border-left: 3px solid var(--accent-cyan) !important;
    font-weight: 600 !important;
}

/* Sub-subitens nível 2 (Fila de Backups, Rotina Global) ainda mais afastados */
.sidebar-subsublist {
    padding: 1px 0 3px 0 !important;
    margin-bottom: 1px;
}

.sidebar-subsublist li a {
    padding: 7px 16px 7px 42px !important;
    font-size: 0.84rem !important;
    color: #94a3b8 !important;
    border-left: 3px solid transparent;
}

.sidebar-subsublist li a:hover {
    color: #ffffff !important;
    background: rgba(0, 180, 216, 0.12) !important;
    border-left: 3px solid var(--accent-cyan) !important;
    padding-left: 46px !important;
}

.sidebar-subsublist li.active > a {
    color: #ffffff !important;
    background: rgba(0, 180, 216, 0.20) !important;
    border-left: 3px solid var(--accent-cyan) !important;
    font-weight: 600 !important;
}

.sidebar-sublist li a i,
.sidebar-subsublist li a i {
    font-size: 1.0rem !important;
    width: 18px !important;
    text-align: center;
}

.sidebar-divider {
    border-color: rgba(255, 255, 255, 0.08) !important;
    margin: 6px 12px !important;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    background: rgba(9, 19, 31, 0.5);
}

.active-client-badge {
    background: rgba(0, 180, 216, 0.15);
    border: 1px solid var(--accent-cyan);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 15px;
    font-size: 0.85rem;
}

.active-client-badge .badge-title {
    color: var(--text-silver);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
    display: block;
    font-weight: 600;
}

.active-client-badge .client-name {
    color: #ffffff;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.active-client-badge a {
    color: var(--text-silver);
    transition: color 0.2s;
}

.active-client-badge a:hover {
    color: var(--danger-red);
}

/* Main Content */
#content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    background-color: var(--bg-navy);
}

.top-navbar {
    background: rgba(16, 30, 48, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 30px;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
}

@keyframes borealSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.spin-fast {
    animation: borealSpin 0.8s linear infinite;
    display: inline-block;
}

.main-container {
    padding: 25px 30px;
    flex-grow: 1;
    animation: fadeIn 0.3s ease;
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    margin-bottom: 25px;
}

.glass-card:hover {
    border-color: rgba(0, 180, 216, 0.35);
}

.glass-card .card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 15px;
    background: transparent;
}

/* ── Formulários e Selects de Alto Contraste ── */
.form-control, .form-select {
    background-color: #111f33 !important;
    border: 1px solid rgba(0, 180, 216, 0.35) !important;
    color: #ffffff !important;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    background-color: #15263d !important;
    border-color: var(--accent-cyan-light) !important;
    box-shadow: 0 0 0 0.25rem rgba(0, 180, 216, 0.3) !important;
    color: #ffffff !important;
}

.form-control::placeholder {
    color: #94a3b8 !important;
    opacity: 0.9 !important;
}

.form-select option, select option {
    background-color: #0f1c2e !important;
    color: #ffffff !important;
    padding: 10px;
    font-size: 0.95rem;
}

.form-label {
    font-weight: 600;
    margin-bottom: 6px;
    color: #f8fafc;
    font-size: 0.9rem;
}

.input-group-text {
    background-color: #111f33;
    border: 1px solid rgba(0, 180, 216, 0.35);
    color: #cbd5e1;
}

/* ── Botões Visíveis e Selecionáveis de Alto Contraste ── */
.btn-boreal {
    background-color: var(--accent-cyan);
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 9px 18px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 180, 216, 0.3);
}

.btn-boreal:hover {
    background-color: #0096b4;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 180, 216, 0.5);
}

.btn-boreal-outline, .btn-outline-cyan {
    background-color: rgba(0, 180, 216, 0.14) !important;
    color: #38bdf8 !important;
    border: 1px solid #00b4d8 !important;
    border-radius: 8px;
    padding: 9px 18px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-boreal-outline:hover, .btn-outline-cyan:hover {
    background-color: #00b4d8 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 180, 216, 0.4);
}

.btn-cyan {
    background-color: #00b4d8 !important;
    color: #09131f !important;
    border: 1px solid #00b4d8 !important;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-cyan:hover {
    background-color: #38bdf8 !important;
    color: #09131f !important;
}

.btn-outline-secondary {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: #f8fafc !important;
    font-weight: 500;
}

.btn-outline-secondary:hover {
    background-color: rgba(255, 255, 255, 0.18) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
}

.btn-outline-info {
    background-color: rgba(56, 189, 248, 0.12) !important;
    border: 1px solid #38bdf8 !important;
    color: #38bdf8 !important;
    font-weight: 600;
}

.btn-outline-info:hover {
    background-color: #38bdf8 !important;
    color: #09131f !important;
    font-weight: 700;
}

.btn-outline-danger {
    background-color: rgba(244, 63, 94, 0.12) !important;
    border: 1px solid #f43f5e !important;
    color: #fb7185 !important;
}

/* Estado "Selecionado" (Item 90) para grupos de botões via Bootstrap .btn-check (rádio/checkbox
   escondido + label estilizada como botão — usado em seletores de ferramenta como Ping/Tracert/
   Portas no Diagnóstico de Rede). As variantes acima sobrescrevem a cor base com `!important`,
   o que anula silenciosamente a regra nativa `.btn-check:checked + .btn` do Bootstrap — sem esta
   regra, a opção marcada fica visualmente idêntica às não marcadas. Reaproveita a mesma cor sólida
   já usada no :hover para dar destaque óbvio e persistente ao item atualmente selecionado. */
.btn-check:checked + .btn-boreal-outline,
.btn-check:active + .btn-boreal-outline,
.btn-check:checked + .btn-outline-cyan,
.btn-check:active + .btn-outline-cyan {
    background-color: #00b4d8 !important;
    color: #ffffff !important;
    border-color: #00b4d8 !important;
    box-shadow: 0 0 0 2px rgba(0, 180, 216, 0.35), 0 4px 12px rgba(0, 180, 216, 0.4) !important;
}

.btn-check:checked + .btn-outline-secondary,
.btn-check:active + .btn-outline-secondary {
    background-color: rgba(255, 255, 255, 0.22) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18) !important;
}

.btn-check:checked + .btn-outline-info,
.btn-check:active + .btn-outline-info {
    background-color: #38bdf8 !important;
    color: #09131f !important;
    font-weight: 700;
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35) !important;
}

.btn-check:checked + .btn-outline-danger,
.btn-check:active + .btn-outline-danger {
    background-color: #f43f5e !important;
    color: #ffffff !important;
    border-color: #f43f5e !important;
    box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.35) !important;
}

.btn-outline-danger:hover {
    background-color: #f43f5e !important;
    color: #ffffff !important;
}

/* Badges */
.badge-active {
    background-color: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 6px 14px;
    border-radius: 50rem;
    font-weight: 600;
}

.badge-inactive {
    background-color: rgba(244, 63, 94, 0.2);
    color: #fb7185;
    border: 1px solid rgba(244, 63, 94, 0.4);
    padding: 6px 14px;
    border-radius: 50rem;
    font-weight: 600;
}

/* ── Tabelas de Alta Visibilidade e Densidade ── */
.table, .table td, .table th, .table-borderless td, .table-borderless th {
    background-color: transparent !important;
    color: inherit;
    --bs-table-bg: transparent !important;
    --bs-table-accent-bg: transparent !important;
    --bs-table-striped-bg: transparent !important;
    --bs-table-active-bg: rgba(0, 180, 216, 0.12) !important;
    --bs-table-hover-bg: rgba(0, 180, 216, 0.08) !important;
}

.table-dark {
    background-color: transparent !important;
    color: #f8fafc;
}

.table-dark th {
    border-bottom: 2px solid rgba(0, 180, 216, 0.35);
    border-top: none;
    color: #38bdf8;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    padding: 10px 14px;
    background: rgba(16, 30, 48, 0.75) !important;
}

.table-dark td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 14px;
    vertical-align: middle;
    color: #f8fafc;
}

/* Tabela Compacta para Alta Densidade de Equipamentos (Ver mais por tela) */
.table-compact th {
    padding: 8px 12px !important;
    font-size: 0.76rem !important;
}

.table-compact td {
    padding: 7px 12px !important;
    font-size: 0.84rem !important;
}

.table-hover tbody tr {
    transition: background-color 0.12s ease;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 180, 216, 0.12) !important;
}

.table-actions a {
    color: #38bdf8;
    margin: 0 6px;
    transition: color 0.2s, transform 0.2s;
    display: inline-block;
}

.table-actions a:hover {
    color: #ffffff;
    transform: scale(1.15);
}

/* Login Page */
.login-page {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, #101e30 0%, #09131f 100%);
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 40px;
    text-align: center;
}

.login-logo {
    font-size: 2.4rem;
    color: var(--accent-cyan);
    font-weight: 800;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
    #sidebar {
        margin-left: -260px;
        position: fixed;
        height: 100vh;
        z-index: 1040;
    }
    #sidebar.active {
        margin-left: 0;
    }
    .main-container {
        padding: 15px;
    }
}

/* ── Mensagens de Erro e Falha de Backup com Alto Contraste ── */
.boreal-error-box {
    background: rgba(220, 38, 38, 0.22) !important;
    border: 1px solid rgba(248, 113, 113, 0.6) !important;
    border-left: 4px solid #ef4444 !important;
    color: #ffffff !important;
    border-radius: 8px;
    padding: 0.85rem 1.1rem;
    font-size: 0.86rem;
    line-height: 1.5;
    word-break: break-word;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.boreal-error-box strong {
    color: #fca5a5 !important;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.boreal-error-msg {
    color: #fee2e2 !important;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.84rem;
    margin-top: 0.35rem;
    display: block;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    border: 1px solid rgba(248, 113, 113, 0.25);
}
.boreal-error-badge {
    background: rgba(239, 68, 68, 0.25) !important;
    border: 1px solid rgba(248, 113, 113, 0.6) !important;
    color: #fecaca !important;
    font-weight: 600;
}

/* ── Alertas Universais BOREAL de Alto Contraste (Regra 8) ── */
.alert, .boreal-alert {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.88rem;
    border-width: 1px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.alert-danger, .alert-error, .boreal-alert-danger, .boreal-alert-error {
    background-color: rgba(220, 38, 38, 0.22) !important;
    border: 1px solid rgba(248, 113, 113, 0.6) !important;
    border-left: 4px solid #ef4444 !important;
    color: #ffffff !important;
}
.alert-danger *, .alert-error *, .boreal-alert-danger *, .boreal-alert-error * {
    color: #ffffff !important;
}

.alert-success, .boreal-alert-success {
    background-color: rgba(16, 185, 129, 0.20) !important;
    border: 1px solid rgba(52, 211, 153, 0.6) !important;
    border-left: 4px solid #10b981 !important;
    color: #ffffff !important;
}
.alert-success *, .boreal-alert-success * {
    color: #ffffff !important;
}

.alert-warning, .boreal-alert-warning {
    background-color: rgba(245, 158, 11, 0.20) !important;
    border: 1px solid rgba(251, 191, 36, 0.6) !important;
    border-left: 4px solid #f59e0b !important;
    color: #ffffff !important;
}
.alert-warning *, .boreal-alert-warning * {
    color: #ffffff !important;
}

.alert-info, .boreal-alert-info {
    background-color: rgba(0, 180, 216, 0.20) !important;
    border: 1px solid rgba(56, 189, 248, 0.6) !important;
    border-left: 4px solid #00b4d8 !important;
    color: #ffffff !important;
}
.alert-info *, .boreal-alert-info * {
    color: #ffffff !important;
}

/* ── Modal Bootstrap Stacking Context Fix ── */
.modal {
    z-index: 1060 !important;
}
.modal-backdrop {
    z-index: 1050 !important;
}
.modal-dialog {
    z-index: 1065 !important;
}

/* Item 72 - Alto Contraste Vermelho (BugReports Status) */
.boreal-status-red, .boreal-badge-danger, .badge-danger {
    background: rgba(239, 68, 68, 0.25) !important;
    border: 1px solid #ef4444 !important;
    color: #ffffff !important;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4) !important;
}

/* ══════════════════════════════════════════════════════════════════════
   MOTOR UNIVERSAL DE TABELAS INTERATIVAS (PREMISSA ETERNIZADA / REGRA 20)
   ══════════════════════════════════════════════════════════════════════ */
.boreal-sortable-th {
    cursor: pointer !important;
    user-select: none !important;
    transition: background-color 0.15s ease, color 0.15s ease;
    position: relative;
}

.boreal-sortable-th:hover {
    color: #38bdf8 !important;
    background-color: rgba(56, 189, 248, 0.08) !important;
}

.boreal-sort-icon {
    display: inline-block;
    font-size: 0.72rem;
    opacity: 0.45;
    transition: opacity 0.15s ease, color 0.15s ease, transform 0.15s ease;
    vertical-align: middle;
}

.boreal-sortable-th:hover .boreal-sort-icon {
    opacity: 0.95;
    color: #38bdf8 !important;
}

.boreal-th-sorted-asc,
.boreal-th-sorted-desc {
    background-color: rgba(56, 189, 248, 0.12) !important;
    color: #00f0ff !important;
    border-bottom: 2px solid #00f0ff !important;
}

.boreal-th-sorted-asc .boreal-sort-icon,
.boreal-th-sorted-desc .boreal-sort-icon {
    opacity: 1 !important;
    color: #00f0ff !important;
    font-weight: 700;
}

/* Alça de redimensionamento interativo de colunas */
.col-resizer {
    position: absolute;
    top: 2px;
    right: 0;
    width: 6px;
    cursor: col-resize;
    user-select: none;
    height: calc(100% - 4px);
    z-index: 10;
    border-right: 2px solid rgba(56, 189, 248, 0.4);
    background-color: rgba(56, 189, 248, 0.12);
    border-radius: 2px;
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.col-resizer:hover {
    background-color: rgba(0, 240, 255, 0.9) !important;
    border-color: #00f0ff !important;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.8) !important;
}

.boreal-table-resizing {
    user-select: none !important;
}

