:root {
    --sim-bg: #f8fafc;
    --sim-border: #cbd5e1;
    --sim-red-dark: #b91c1c;
    --sim-red-main: #dc2626;
    --sim-text-main: #1e293b;
    --sim-text-muted: #64748b;
}

body.sim-body {
    background-color: var(--sim-bg);
    color: var(--sim-text-main);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.sim-header {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

/* HEADER BRANDING UTAMA */
.sim-header-top {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);

    height: 80px;
    min-height: 80px;

    padding-top: 3px !important;
    padding-bottom: 3px !important;

    background-image:
        linear-gradient(
            90deg,
            rgba(185, 28, 28, 0.82) 0%,
            rgba(220, 38, 38, 0.88) 45%,
            rgba(255, 241, 241, 0.95) 85%,
            #ffffff 100%
        ),
        url('../images/mangodod.png');

    background-repeat: no-repeat, no-repeat;
    background-position: center, left 0 center;
    background-size: cover, auto 100%;

    box-sizing: border-box;
}

/* TEKS JUDUL & BRANDING ARTISTIK OFFLINE */
.sim-title-artistic {
    font-family: 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.2px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.6);
}

.sim-brand-highlight {
    font-family: 'Arial Rounded MT Bold', 'Trebuchet MS', sans-serif;
    font-size: 1.15rem;
    color: #fef08a;
    font-weight: 800;
    display: block;
    margin-top: 3px;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
}

/* LOGO MANGODOD SISI KANAN */
.sim-logo-main { 
    height: 70px !important; 
    width: auto !important; 
    max-width: 260px !important; 
    object-fit: contain; 
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.15)); 
}

/* SUB-NAVBAR MENU */
.sim-nav {
    background-color: rgba(255, 255, 255, 0.97);
    border-bottom: 3px solid var(--sim-red-dark) !important;
    padding-top: 0.15rem !important;
    padding-bottom: 0.15rem !important;
}

/* STATUS DATABASE */
.sim-nav .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.6rem !important;
    line-height: 1.1;
}

/* AVATAR USER */
.avatar-circle {
    width: 30px;
    height: 30px;
    background-color: var(--sim-red-main);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* INFORMASI USER */
.sim-nav .fw-bold {
    font-size: 0.78rem;
    line-height: 1.1;
}

.sim-nav .fs-8 {
    font-size: 0.68rem !important;
    line-height: 1.1;
}


/* =========================================================
   SWEETALERT2
   ========================================================= */

.swal2-icon.swal2-question {
    border-color: #dc3545 !important;
    color: #dc3545 !important;
}

.swal2-confirm {
    background-color: #dc3545 !important;
    color: #fff !important;
}

.swal2-cancel {
    background-color: #6c757d !important;
    color: #fff !important;
}


/* =========================================================
   SIM MANG ODOD - NAVBAR NAVIGATION
   ========================================================= */

.nav-link-sim {
    display: flex;
    align-items: center;
    gap: 4px;

    white-space: nowrap;

    font-size: 0.82rem !important;
    font-weight: 600;
    color: #334155;

    padding: 4px 8px !important;
    margin: 0 !important;
    border-radius: 5px;
    line-height: 1.2;

    transition:
        color 0.15s ease,
        background-color 0.15s ease;
}

.nav-link-sim:hover {
    color: var(--sim-red-main);
    background-color: #fef2f2;
}

.nav-link-sim.active {
    color: var(--sim-red-main) !important;
    background-color: #fef2f2;
    font-weight: 700;
}

.sim-back-link,
.sim-home-link {
    display: flex;
    align-items: center;
}

.sim-back-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.sim-back-link:hover .sim-back-icon {
    transform: translateX(-3px);
}

.sim-home-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.sim-home-link:hover .sim-home-icon {
    transform: scale(1.1);
}

.sim-main-menu-dropdown {
    position: relative;
}

.sim-main-menu-dropdown > .nav-link {
    display: flex;
    align-items: center;
    white-space: nowrap;
}


/* =========================================================
   NAVBAR KANAN DESKTOP
   ========================================================= */

.sim-nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sim-db-clock-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sim-clock-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    border-left: 1px solid #cbd5e1;
    padding-left: 10px;
}

.sim-user-logout-box {
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 1px solid #cbd5e1;
    padding-left: 10px;
}

.sim-user-info-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logout-container {
    display: flex;
    align-items: center;
    border-left: 1px solid #cbd5e1;
    padding-left: 10px;
}


/* DROPDOWN DESKTOP HOVER - TRANSPARANSI DIKEMBALIKAN (0.62) */
.sim-main-menu-dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    margin: 2px 0 0 0;
    padding: 5px 0;
    background: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(220, 53, 69, 0.15);
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    display: block;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition:
        opacity 0.20s ease,
        transform 0.20s ease,
        visibility 0.20s ease;
}

@media (min-width: 992px) {
    .sim-main-menu-dropdown:hover > .dropdown-menu {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }

    .sim-nav .navbar-nav {
        align-items: center;
    }

    .sim-nav .navbar-nav > .nav-item {
        margin-right: 2px;
    }
}

.sim-main-menu-dropdown .dropdown-item {
    display: block;
    width: 100%;
    padding: 8px 14px;
    font-size: 0.84rem;
    font-weight: 500;
    color: #343a40;
    white-space: nowrap;
    background: transparent;
    border-bottom: 1px solid rgba(108, 117, 125, 0.18);
    transition:
        background-color 0.15s ease,
        color 0.15s ease,
        padding-left 0.15s ease;
}

.sim-main-menu-dropdown .dropdown-item:last-child {
    border-bottom: none;
}

.sim-main-menu-dropdown .dropdown-item:hover {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.10);
    padding-left: 18px;
}


/* =========================================================
   TAMPILAN RESPONSIF HP & TABLET (< 992px)
   ========================================================= */

@media (max-width: 991.98px) {

    .sim-nav-right {
        width: 100%;
        justify-content: space-between;
        align-items: center;
        padding-top: 10px;
        margin-top: 8px;
        border-top: 1px solid #e2e8f0;
    }

    /* Kiri: Status Database (Atas) & Jam Server (Bawah) */
    .sim-db-clock-box {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .sim-clock-wrapper {
        border-left: none !important;
        padding-left: 0 !important;
    }

    /* Kanan: Status User (Atas) & Tombol Logout (Bawah) */
    .sim-user-logout-box {
        flex-direction: column;
        align-items: flex-end;
        gap: 6px;
        border-left: 1px solid #cbd5e1 !important;
        padding-left: 12px !important;
    }

    .sim-user-info-wrapper {
        justify-content: flex-end;
    }

    .logout-container {
        border-left: none !important;
        padding-left: 0 !important;
        width: auto;
    }

    /* Navigasi Menu Dropdown Mobile - TRANSPARANSI DIKEMBALIKAN (0.68) */
    .sim-main-menu-dropdown {
        width: 100%;
    }

    .sim-main-menu-dropdown > .nav-link {
        width: 100%;
        cursor: default;
        pointer-events: none;
    }

    .sim-main-menu-dropdown > .nav-link::after {
        display: none !important;
    }

    .sim-main-menu-dropdown > .dropdown-menu {
        position: static !important;
        display: block !important;
        width: 100%;
        min-width: 100%;
        margin: 2px 0 6px 0;
        padding: 4px 0;
        background: rgba(255, 255, 255, 0.68);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: 1px solid rgba(220, 53, 69, 0.12);
        border-radius: 8px;
        box-shadow: none;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto;
        transform: none !important;
        transition: none;
    }

    .sim-main-menu-dropdown .dropdown-item {
        display: block;
        width: 100%;
        padding: 8px 14px;
        font-size: 0.86rem;
        font-weight: 500;
        white-space: normal;
        color: #343a40;
        background: transparent;
        border-bottom: 1px solid rgba(108, 117, 125, 0.18);
    }

    .sim-main-menu-dropdown .dropdown-item:last-child {
        border-bottom: none;
    }

    .nav-link-sim {
        padding: 8px 10px !important;
    }
}