:root {
    --sidebar-w: 260px;
    --sidebar-bg: #e8f0f7;
    --sidebar-hover: #d4e5f7;
    --sidebar-active: #c2dff0;
    --accent: #3b82f6;
    --topbar-bg: #d4e5f7;
    --topbar-border: #b8d4f0;
    --surface-bg: #f1f5f9;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    background: var(--surface-bg);
    color: var(--text-main);
}

.dashboard-shell {
    min-height: 100vh;
    display: flex;
}

.dashboard-sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid #d9e7f0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-logo-block {
    padding: 18px 16px 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.sidebar-logo-full {
    width: 190px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.sidebar-nav {
    padding: 18px 14px 14px;
    flex: 1;
    overflow-y: auto;
}

.sidebar-group-title {
    color: #2c5aa0;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #0a1929;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 0.86rem;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar-link i {
    width: 18px;
    text-align: center;
    color: #1e3a5f;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: var(--sidebar-hover);
    color: #0a1929;
}

.sidebar-link.active {
    background: var(--sidebar-active);
    border-left: 3px solid var(--accent);
}

.sidebar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 0;
    background: #64748b;
    flex-shrink: 0;
}

.dashboard-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.dashboard-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    height: 60px;
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--topbar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    color: var(--text-main);
}

.dashboard-topbar-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.dashboard-topbar-brand {
    display: none;
}

.dashboard-main {
    max-width: 1440px;
    padding-bottom: 24px;
}

.company-hero {
    padding: 4px 2px 2px;
}

.monitor-section {
    align-items: stretch;
}

.dashboard-welcome {
    margin: 0;
    font-family: 'Oswald', sans-serif;
    font-size: clamp(1.8rem, 2.2vw, 2.3rem);
    font-weight: 600;
    color: #263544;
}

.dashboard-breadcrumb {
    color: #7d8aa0;
    font-size: 0.85rem;
    margin-top: 4px;
}

.dashboard-breadcrumb span {
    padding: 0 5px;
}

.hero-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-actions .btn {
    border-radius: 6px;
    font-weight: 600;
}

.stats-row .stat-card,
.panel-card,
.mini-card,
.monitor-card-dashboard {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

.stat-card {
    min-height: 100px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.stat-value {
    font-size: 1.95rem;
    line-height: 1;
    font-weight: 700;
    color: #24303f;
}

.stat-label {
    color: #667487;
    font-size: 0.92rem;
    margin-top: 4px;
}

.stat-pill {
    display: inline-block;
    margin-top: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #eef3fb;
    color: #5d77a0;
}

.stat-blue .stat-icon { background: #dbe8ff; color: #3c79ff; }
.stat-green .stat-icon { background: #ddf6e4; color: #2eae58; }
.stat-orange .stat-icon { background: #ffe9d8; color: #ff8a2b; }
.stat-purple .stat-icon { background: #e9e0ff; color: #8a63ff; }

.stat-blue .stat-pill { color: #4e79ff; }
.stat-green .stat-pill { color: #2eae58; }
.stat-orange .stat-pill { color: #ff8a2b; }
.stat-purple .stat-pill { color: #8a63ff; }

.panel-card {
    overflow: hidden;
}

.panel-card-header {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(42, 58, 79, 0.08);
    color: #314150;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.panel-card-body {
    padding: 16px;
}

.progress-item + .progress-item {
    margin-top: 14px;
}

.progress-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #314150;
    margin-bottom: 6px;
    font-weight: 600;
}

.progress-bar-line {
    height: 6px;
    border-radius: 999px;
    background: #edf2f7;
    overflow: hidden;
}

.progress-bar-line .fill {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.fill.blue { background: #1c79ff; }
.fill.green { background: #2e9b66; }
.fill.yellow { background: #ffbf20; }
.fill.red { background: #e34a5a; }

.mini-card {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mini-card-title {
    color: #97a3b4;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-size: 0.74rem;
    font-weight: 700;
}

.mini-card-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin: 8px 0 6px;
}

.mini-card-value.blue { color: #1c79ff; }
.mini-card-value.green { color: #2e9b66; }

.mini-card-subtitle {
    color: #788496;
    font-size: 0.86rem;
}

.activity-card {
    overflow: hidden;
}

.activity-list {
    padding: 10px 16px 16px;
}

.activity-item {
    position: relative;
    display: flex;
    gap: 12px;
    padding: 10px 0 10px 10px;
    border-left: 2px solid #e6ebf2;
}

.activity-item + .activity-item {
    margin-top: 4px;
}

.activity-item strong {
    color: #233040;
    font-size: 0.92rem;
}

.activity-item div div {
    color: #8a95a6;
    font-size: 0.78rem;
    margin-top: 2px;
}

.dot {
    position: absolute;
    left: -7px;
    top: 16px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
}

.dot.blue { background: #4f8df7; }
.dot.green { background: #2ec27e; }
.dot.orange { background: #ffae42; }
.dot.purple { background: #8a63ff; }

.monitor-card-dashboard {
    overflow: hidden;
}

.monitor-card-header {
    padding: 16px 18px 12px;
}

.monitor-card-header--split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid rgba(42, 58, 79, 0.08);
}

.monitor-card-title {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.monitor-card-subtitle {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 2px;
}

.monitor-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--accent);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
}

.dashboard-table-wrap {
    padding: 10px 12px 12px;
}

.monitor-card-loading-host {
    position: relative;
}

.monitor-card-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(1px);
    z-index: 30;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.monitor-card-loader-content {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #d5e3f5;
    border-radius: 999px;
    padding: 8px 14px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.monitor-card-loader.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.monitor-card-loader-spinner {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 4px solid #d5e3f5;
    border-top-color: #3b82f6;
    animation: cardLoaderSpin 0.8s linear infinite;
}

.monitor-card-loader-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
}

@keyframes cardLoaderSpin {
    to {
        transform: rotate(360deg);
    }
}

table.dataTable {
    border-collapse: collapse !important;
    width: 100% !important;
    margin: 0 !important;
}

table.dataTable thead th {
    background: #e2e8f0 !important;
    border: 1px solid #d1dbe8 !important;
    color: #334155;
    font-weight: 700;
    font-size: 0.74rem;
    padding: 12px 10px !important;
    vertical-align: middle;
}

table.dataTable tbody td {
    border: 1px solid #e2e8f0 !important;
    padding: 10px !important;
    color: #334155;
    font-size: 0.88rem;
    vertical-align: top;
    word-break: break-word;
}

table.dataTable tbody tr:nth-child(odd) {
    background: #ffffff;
}

table.dataTable tbody tr:nth-child(even) {
    background: #fafcff;
}

.dataTables_wrapper .row {
    margin-left: 0;
    margin-right: 0;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    font-size: 0.9rem;
    color: #5a6471;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    padding: 10px 0 12px;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid #d6dbe6;
    border-radius: 4px;
    padding: 4px 8px;
    box-shadow: none;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border: 1px solid #d9dee7 !important;
    border-radius: 4px !important;
    background: #ffffff !important;
    color: #6b7482 !important;
    margin: 0 2px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #ffffff !important;
}

.dataTables_wrapper .dataTables_info {
    padding-top: 14px !important;
}

.dataTables_wrapper .dataTables_paginate {
    padding-top: 10px !important;
}

.acciones-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.monitor-action-btn {
    width: 30px;
    height: 30px;
    border: 1px solid transparent;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease, border-color 0.16s ease;
}

.monitor-action-btn i {
    font-size: 14px;
    line-height: 1;
}

.monitor-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.14);
    filter: saturate(1.05);
}

.monitor-action-btn:active {
    transform: translateY(0);
}

.monitor-action-btn:focus-visible {
    outline: 2px solid #94a3b8;
    outline-offset: 1px;
}

.monitor-action-edit {
    background: #fff7db;
    border-color: #f5dd84;
    color: #9a6500;
}

.monitor-action-delete {
    background: #ffe7e7;
    border-color: #f5bcbc;
    color: #b4232f;
}

.monitor-action-release {
    background: #e5f7ef;
    border-color: #abdcc2;
    color: #117a4b;
}

.dato-alerta-rojo {
    color: #c62828;
    font-weight: 700;
}

.dato-alerta-verde {
    color: #1b8f3a;
    font-weight: 700;
}

.dashboard-footer {
    position: static;
    border-top: 1px solid var(--topbar-border);
    background: var(--topbar-bg);
    padding: 14px 16px;
    margin-top: auto;
    box-shadow: 0 -2px 10px rgba(25, 38, 61, 0.05);
}

.dashboard-footer-inner {
    text-align: center;
    color: #314150;
    font-size: 0.92rem;
    line-height: 1.5;
    font-weight: 600;
}

.dashboard-footer-inner div + div {
    margin-top: 2px;
}

.company-grid {
    margin-bottom: 8px;
}

.company-card-link {
    display: block;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.company-card-link:hover,
.company-card-link:focus {
    text-decoration: none;
    color: inherit;
}

.company-card {
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid rgba(42, 58, 79, 0.08);
    box-shadow: 0 12px 24px rgba(25, 38, 61, 0.08);
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    min-height: 180px;
}

.company-card-top {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 127px;
}

.company-card h2 {
    margin: 0;
    font-family: 'Oswald', sans-serif;
    font-size: 1.5rem;
    color: #24303f;
}

.company-card p {
    margin: 2px 0 0;
    color: #6d7a8a;
    font-size: 0.9rem;
}

.company-logo-box {
    width: 92px;
    height: 92px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #eff4fb;
    overflow: hidden;
}

.company-logo-box--light {
    background: #ffffff;
    border: 1px solid rgba(42, 58, 79, 0.08);
}

.company-logo-box--warm { background: #fff1df; }

.company-logo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 5px;
}

.company-logo-image--dkt {
    padding: 6px;
    transform: scale(1.08);
}

.company-logo-icon {
    font-size: 1.7rem;
    color: inherit;
}

.company-logo-fallback {
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: #2f5fb5;
}

.company-card-blue { border-top: 4px solid #4f8df7; }
.company-card-dark { border-top: 4px solid #24303f; }
.company-card-orange { border-top: 4px solid #ff8a2b; }
.company-card-green { border-top: 4px solid #2e9b66; }
.company-card-purple { border-top: 4px solid #8a63ff; }

.error-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 220px);
    padding: 12px 0 24px;
}

.error-card {
    position: relative;
    width: min(920px, 100%);
    overflow: hidden;
    border-radius: 28px;
    border: 1px solid rgba(42, 58, 79, 0.08);
    background: linear-gradient(135deg, #ffffff 0%, #f2f7ff 55%, #e3edff 100%);
    box-shadow: 0 24px 60px rgba(25, 38, 61, 0.12);
    padding: 42px 32px;
}

.error-orbit {
    position: absolute;
    border-radius: 999px;
    filter: blur(2px);
    opacity: 0.8;
    pointer-events: none;
}

.error-orbit-one {
    top: -36px;
    right: 48px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(79, 141, 247, 0.28) 0%, rgba(79, 141, 247, 0) 72%);
    animation: floatOrbit 7s ease-in-out infinite;
}

.error-orbit-two {
    bottom: -54px;
    left: -12px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(138, 99, 255, 0.18) 0%, rgba(138, 99, 255, 0) 70%);
    animation: floatOrbit 9s ease-in-out infinite reverse;
}

.error-code {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.error-code span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(88px, 10vw, 112px);
    height: clamp(88px, 10vw, 112px);
    border-radius: 24px;
    font-family: 'Oswald', sans-serif;
    font-size: clamp(3rem, 6vw, 4.8rem);
    line-height: 1;
    color: #20436f;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(79, 141, 247, 0.14);
    box-shadow: 0 16px 34px rgba(79, 141, 247, 0.16);
    animation: floatDigit 3.4s ease-in-out infinite;
}

.error-code span:nth-child(2) {
    animation-delay: 0.25s;
}

.error-code span:nth-child(3) {
    animation-delay: 0.5s;
}

.error-content {
    position: relative;
    z-index: 1;
    max-width: 620px;
    margin: 0 auto;
    text-align: center;
}

.error-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(32, 67, 111, 0.08);
    color: #20436f;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.error-title {
    margin: 18px 0 10px;
    font-family: 'Oswald', sans-serif;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.05;
    color: #24303f;
}

.error-text {
    margin: 0;
    font-size: 1rem;
    color: #617186;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.error-actions .btn {
    min-width: 180px;
    border-radius: 10px;
    font-weight: 700;
    padding: 11px 18px;
}

@keyframes floatDigit {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

@keyframes floatOrbit {
    0%,
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    50% {
        transform: translate3d(0, 12px, 0) scale(1.05);
    }
}

.dashboard-footer-inner,
.dashboard-topbar-title {
    letter-spacing: 0.2px;
}

@media (max-width: 575.98px) {
    .company-card {
        min-height: 0;
    }

    .company-card-top {
        min-height: 0;
    }

    .error-card {
        padding: 32px 18px;
        border-radius: 22px;
    }

    .error-code {
        gap: 8px;
    }

    .error-code span {
        border-radius: 18px;
    }
}

@media (max-width: 991.98px) {
    .dashboard-shell {
        flex-direction: column;
    }

    .dashboard-sidebar {
        width: 100%;
        min-height: auto;
        position: static;
        height: auto;
    }

    .dashboard-topbar {
        height: auto;
        padding: 12px 14px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .dashboard-topbar-title {
        position: static;
        transform: none;
        width: 100%;
        order: -1;
    }

    .dashboard-topbar-actions {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .dashboard-topbar-brand {
        width: 100%;
        justify-content: center;
        min-width: 0;
    }

    .dashboard-welcome {
        font-size: 1.8rem;
    }
}

@media (max-width: 767.98px) {
    .dashboard-main {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .hero-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .stat-card {
        padding: 16px 14px;
    }

    .panel-card-body,
    .activity-list,
    .dashboard-table-wrap {
        padding-left: 12px;
        padding-right: 12px;
    }
}