/* ==========================================================
   Monitoreo UPS — Tema "NOC Control Center"
   Paleta Electric Blue + sidebar oscuro + toggle de tema
   ========================================================== */

:root {
    --noc-accent:       #0ea5e9;   /* electric blue */
    --noc-accent-rgb:   14,165,233;
    --noc-accent-2:     #06b6d4;   /* cyan */
    --noc-sidebar-bg:   #0b1020;
    --noc-sidebar-bg-2: #121a2f;
    --noc-sidebar-text: #cbd5e1;
    --noc-sidebar-muted:rgba(255,255,255,.5);

    /* Override Tabler primary */
    --tblr-primary:     #0ea5e9;
    --tblr-primary-rgb: 14,165,233;
    --tblr-primary-fg:  #ffffff;
    --tblr-link-color:  #0ea5e9;
    --tblr-link-color-rgb: 14,165,233;
}

[data-bs-theme="dark"] {
    --tblr-body-bg: #0b1220;
    --tblr-body-color: #e2e8f0;
    --tblr-border-color: rgba(255,255,255,.08);
}

body { background: #f4f6fb !important; }
[data-bs-theme="dark"] body { background: #0b1220 !important; }
[data-bs-theme="dark"] .card { background: #111c31; border-color: rgba(255,255,255,.06); }

/* ============ SIDEBAR ============ */
.noc-sidebar {
    background: linear-gradient(180deg, var(--noc-sidebar-bg) 0%, var(--noc-sidebar-bg-2) 100%);
    border-right: 1px solid rgba(255,255,255,.04);
    box-shadow: 0 0 20px rgba(0,0,0,.15);
}
.noc-sidebar .container-fluid {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-left: 0;
    padding-right: 0;
}
.noc-sidebar .navbar-brand {
    padding: 1.1rem 1.25rem .9rem;
    margin: 0;
    border-bottom: 1px solid rgba(255,255,255,.04);
}
.noc-sidebar .navbar-collapse {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    padding: 0;
}

/* Brand */
.noc-brand {
    display: flex !important;
    align-items: center;
    gap: .7rem;
    text-decoration: none !important;
    width: 100%;
}
.noc-brand-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--noc-accent) 0%, var(--noc-accent-2) 100%);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    box-shadow: 0 4px 14px rgba(var(--noc-accent-rgb), .45),
                inset 0 1px 0 rgba(255,255,255,.25);
    flex-shrink: 0;
    position: relative;
}
.noc-brand-icon::after {
    content: '';
    position: absolute; inset: 0;
    border-radius: 10px;
    background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.25), transparent 60%);
    pointer-events: none;
}
.noc-brand-icon i { font-size: 1.3rem; }
.noc-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.noc-brand-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: .01em;
}
.noc-brand-subtitle {
    font-size: .62rem;
    color: var(--noc-sidebar-muted);
    letter-spacing: .14em;
    text-transform: uppercase;
    margin-top: 2px;
}

/* Secciones del menú */
.noc-nav-section {
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: rgba(255,255,255,.32);
    padding: 1.1rem 1.25rem .35rem;
}
.noc-nav-section:first-child { padding-top: 1rem; }

.noc-sidebar .navbar-nav { padding: 0 .5rem; gap: 2px; }
.noc-sidebar .nav-link {
    padding: .55rem .85rem !important;
    border-radius: 8px;
    color: var(--noc-sidebar-text) !important;
    font-size: .92rem;
    transition: background .2s ease, color .2s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: .65rem;
}
.noc-sidebar .nav-link:hover {
    background: rgba(255,255,255,.05);
    color: #fff !important;
}
.noc-sidebar .nav-link-icon {
    width: 22px;
    padding-right: 0 !important;
    margin-right: 0 !important;
    display: inline-flex !important;
    justify-content: center;
}
.noc-sidebar .nav-link-icon i {
    font-size: 1.18rem;
    color: rgba(255,255,255,.6);
    transition: color .2s ease;
}
.noc-sidebar .nav-link:hover .nav-link-icon i { color: #fff; }
.noc-sidebar .nav-link-title { flex: 1; }
.noc-sidebar .nav-link-badge {
    font-size: .65rem;
    padding: .22em .5em;
    border-radius: 6px;
    box-shadow: 0 0 8px rgba(214,57,57,.45);
}

/* Item activo */
.noc-sidebar .nav-item.active > .nav-link {
    background: linear-gradient(90deg,
                rgba(var(--noc-accent-rgb), .22) 0%,
                rgba(var(--noc-accent-rgb), .06) 60%,
                transparent 100%);
    color: #fff !important;
    font-weight: 600;
}
.noc-sidebar .nav-item.active > .nav-link::before {
    content: '';
    position: absolute;
    left: -.5rem;
    top: .45rem; bottom: .45rem;
    width: 3px;
    background: var(--noc-accent);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px rgba(var(--noc-accent-rgb), .75);
}
.noc-sidebar .nav-item.active > .nav-link .nav-link-icon i { color: var(--noc-accent); }

/* Footer sidebar */
.noc-sidebar-footer {
    margin-top: auto;
    padding: .85rem .75rem 1rem;
    border-top: 1px solid rgba(255,255,255,.05);
    background: rgba(0,0,0,.15);
}
.noc-poller-pill {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .7rem;
    border-radius: 8px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
    margin-bottom: .65rem;
}
.noc-led {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: #f59f00;
    box-shadow: 0 0 8px rgba(245,159,0,.7);
    animation: nocLedPulse 1.8s ease-out infinite;
    flex-shrink: 0;
}
.noc-poller-pill.ok   .noc-led { background: #2fb344; box-shadow: 0 0 8px rgba(47,179,68,.7); }
.noc-poller-pill.down .noc-led { background: #d63939; box-shadow: 0 0 8px rgba(214,57,57,.7); animation: none; }
@keyframes nocLedPulse {
    0%,100% { opacity: 1; }
    50%     { opacity: .4; }
}
.noc-pill-title    { font-weight: 600; color: #fff; line-height: 1; font-size: .78rem; }
.noc-pill-subtitle { font-size: .68rem; color: rgba(255,255,255,.55); margin-top: 3px; }

.noc-user-block {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .3rem;
}
.noc-user-avatar {
    width: 34px !important; height: 34px !important;
    background: linear-gradient(135deg, var(--noc-accent), var(--noc-accent-2)) !important;
    color: #fff !important;
    font-weight: 700;
    font-size: .78rem;
    box-shadow: 0 3px 10px rgba(var(--noc-accent-rgb), .45);
}
.noc-user-name { color: #fff; font-weight: 600; font-size: .85rem; line-height: 1.1; }
.noc-user-role {
    font-size: .66rem;
    color: rgba(255,255,255,.45);
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-top: 2px;
}

/* Toggle de tema */
.noc-theme-toggle {
    width: 34px; height: 34px;
    border-radius: 8px;
    color: rgba(255,255,255,.7) !important;
    background: rgba(255,255,255,.05) !important;
    border: 1px solid rgba(255,255,255,.08) !important;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.noc-theme-toggle:hover {
    color: #fff !important;
    background: rgba(var(--noc-accent-rgb), .2) !important;
    border-color: rgba(var(--noc-accent-rgb), .4) !important;
}
.noc-theme-toggle .theme-icon-dark  { display: none; }
[data-bs-theme="light"] .noc-theme-toggle .theme-icon-light { display: none; }
[data-bs-theme="light"] .noc-theme-toggle .theme-icon-dark  { display: inline-block; }

/* ============ PAGE HEADER ============ */
.page-header {
    background: transparent;
    border-bottom: 1px solid var(--tblr-border-color);
    padding-top: 1.75rem;
    padding-bottom: 1.5rem;
}
.page-pretitle {
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--noc-accent);
    font-size: .7rem;
    font-weight: 700;
    margin-bottom: .25rem;
}
.page-title {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -.01em;
    margin: 0;
}

/* Tabler primary overrides */
.btn-primary {
    background-color: var(--noc-accent);
    border-color: var(--noc-accent);
}
.btn-primary:hover,
.btn-primary:focus {
    background-color: #0284c7;
    border-color: #0284c7;
}
a { color: var(--noc-accent); }
a:hover { color: #0284c7; }
