/* Barra superior CAS DMS, aislada del contenido y del sidebar. */
.cas-topbar.navbar {
    min-height: 66px;
    margin: 0;
    padding: 0 18px;
    background: linear-gradient(105deg, #103c70 0%, #16569b 55%, #246fbe 100%) !important;
    border: 0;
    border-radius: 0;
    box-shadow: 0 8px 24px rgba(16, 60, 112, 0.2);
}

.cas-topbar .cas-topbar-container {
    display: flex;
    width: 100% !important;
    min-height: 66px;
    padding: 0 !important;
    align-items: center;
}

.cas-topbar .navbar-header {
    display: flex;
    min-height: 66px;
    align-items: center;
}

.cas-topbar .cas-topbar-logo {
    display: flex;
    width: 104px;
    height: 48px;
    margin: 0 !important;
    padding: 5px 12px;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(4, 32, 61, 0.2);
}

.cas-topbar .cas-topbar-logo > a:last-child {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cas-topbar .cas-topbar-logo img {
    width: auto;
    max-width: 78px;
    height: 38px !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: contain;
}

.cas-topbar .cas-topbar-logo.cas-topbar-logo-saim {
    width: 126px;
    padding: 4px 10px;
    background: #123d70;
    border-color: rgba(255, 255, 255, 0.32);
}

.cas-topbar .cas-topbar-logo img.cas-topbar-brand-image-saim {
    max-width: 104px;
    height: 40px !important;
}

.cas-topbar .cas-topbar-collapse {
    flex: 1;
    padding: 0 !important;
}

.cas-topbar .cas-topbar-menu {
    display: flex;
    margin: 0 !important;
    gap: 5px;
    align-items: center;
}

.cas-topbar .cas-topbar-menu > li > a.cas-topbar-link {
    display: flex;
    min-height: 42px;
    padding: 11px 15px !important;
    align-items: center;
    gap: 7px;
    color: rgba(255, 255, 255, 0.92) !important;
    font-size: 13px;
    font-weight: 600;
    line-height: 20px;
    text-decoration: none;
    border-radius: 10px;
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.cas-topbar .cas-topbar-menu > li > a.cas-topbar-link:hover,
.cas-topbar .cas-topbar-menu > li > a.cas-topbar-link:focus,
.cas-topbar .cas-topbar-menu > li > a.cas-topbar-link.is-active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.14) !important;
    transform: translateY(-1px);
}

.cas-topbar .cas-topbar-menu > li > a.cas-topbar-logout {
    min-height: 38px;
    margin-left: 5px;
    padding: 8px 15px !important;
    border: 1px solid rgba(255, 255, 255, 0.52);
}

.cas-topbar .cas-topbar-menu > li > a.cas-topbar-logout:hover,
.cas-topbar .cas-topbar-menu > li > a.cas-topbar-logout:focus {
    color: #164f91 !important;
    background: #fff !important;
}

.cas-topbar .cas-notification-badge {
    min-width: 20px;
    height: 20px;
    padding: 2px 6px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    background: #dc3545 !important;
    border: 2px solid rgba(255, 255, 255, 0.85);
    border-radius: 999px;
    box-shadow: 0 3px 8px rgba(123, 20, 32, 0.28);
}

.cas-topbar .cas-notification-badge:empty {
    display: none;
}

.cas-topbar .navbar-toggle {
    margin: 14px 0 14px auto;
    padding: 9px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 9px;
}

.cas-topbar .navbar-toggle .icon-bar {
    background-color: #fff;
}

@media (max-width: 767px) {
    .cas-topbar.navbar { padding: 0 12px; }
    .cas-topbar .cas-topbar-container { display: block; }
    .cas-topbar .navbar-header { width: 100%; }
    .cas-topbar .cas-topbar-logo { width: 92px; height: 44px; }
    .cas-topbar .cas-topbar-logo img { height: 34px !important; }
    .cas-topbar .cas-topbar-logo.cas-topbar-logo-saim { width: 112px; }
    .cas-topbar .cas-topbar-logo img.cas-topbar-brand-image-saim { max-width: 92px; height: 36px !important; }
    .cas-topbar .cas-topbar-collapse {
        margin: 0 -12px;
        padding: 8px 12px 13px !important;
        background: #103c70;
        border: 0;
        box-shadow: 0 12px 20px rgba(4, 32, 61, 0.22);
    }
    .cas-topbar .cas-topbar-menu { display: block; width: 100%; }
    .cas-topbar .cas-topbar-menu > li > a.cas-topbar-link { width: 100%; margin: 2px 0; }
    .cas-topbar .cas-topbar-menu > li > a.cas-topbar-logout { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .cas-topbar .cas-topbar-link { transition: none !important; }
}
