/* ==========================================================
   MHI INDONESIA - MASTER STYLING (CLEAN & UNIFIED)
   ========================================================== */

:root {
    --mhi-cyan: #1DB1E9;
    --mhi-orange: #F18E19;
}

/* --- SIDEBAR STYLING --- */
.sidebar-link {
    transition: all 0.2s ease-in-out;
    color: #374151;
}

.sidebar-link:hover {
    background-color: #1DB1E9;
    color: #ffffff;
}

.sidebar-link.active {
    background-color: #F18E19;
    color: #ffffff;
    font-weight: 600;
}

/* --- BUTTON GRADIENT --- */
.btn-primary-gradient {
    background: linear-gradient(135deg, #1DB1E9 0%, #F18E19 100%);
    color: #ffffff;
    transition: opacity 0.2s ease;
}

.btn-primary-gradient:hover {
    opacity: 0.9;
}

/* --- MASTER LAYOUT & CONTAINER --- */
.main-content {
    flex: 1 1 0%;
    width: 100%;
    overflow-y: auto;
    padding: 1rem;
    background-color: rgba(249, 250, 251, 0.5);
}

@media (min-width: 768px) {
    .main-content {
        padding: 0.5rem;
    }
}

.content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem; /* Standar jarak antar kontainer / card */
}

.card-box {
    background-color: #ffffff;
    border-radius: 1rem;
    border: 1px solid #f3f4f6;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    padding: 1rem;
}

@media (min-width: 768px) {
    .card-box {
        padding: 0.75rem;
    }
}

/* --- FLOATING LABEL STYLE --- */
.floating-group {
    position: relative;
}

.floating-input {
    width: 100%;
    padding: 0.95rem 0.875rem 0.95rem 0.875rem !important; 
    font-size: 0.95rem;
    line-height: 1.25rem;
    background-color: transparent;
    border: 1.5px solid #d1d5db;
    border-radius: 0.75rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.floating-input:focus {
    border-color: #1DB1E9;
    box-shadow: 0 0 0 2px rgba(29, 177, 233, 0.15);
}

.floating-label {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    background-color: #ffffff;
    padding: 0 0.25rem;
    color: #6b7280;
    font-size: 0.95rem;
    pointer-events: none;
    transition: 0.2s ease all;
}

.floating-input:focus ~ .floating-label,
.floating-input:not(:placeholder-shown) ~ .floating-label {
    top: 0;
    transform: translateY(-50%) scale(0.85);
    color: #F18E19 !important;
    font-weight: 600;
}

/* --- CUSTOM SELECT DROPDOWN --- */
select.floating-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1.1rem center;
    background-size: 1.1rem;
    padding-right: 2.75rem !important;
    cursor: pointer;
}

/* --- CUSTOM SCROLLBAR --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==========================================================
   SIDEBAR COLLAPSE & FLYOUT SUBMENU STYLING
   ========================================================== */
#sidebar {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Kondisi saat Sidebar Ditutup (Collapsed) di Desktop */
.sidebar-collapsed .sidebar-text,
.sidebar-collapsed .dropdown-arrow {
    display: none !important;
}

.sidebar-collapsed {
    width: 5rem !important; /* Lebar ringkas w-20 */
    overflow: visible !important;
}

.sidebar-collapsed nav {
    overflow: visible !important;
}

.sidebar-collapsed .sidebar-item-container {
    justify-content: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Pengaturan Header Sidebar saat Collapsed (Logo & Tombol Toggle) */
.sidebar-collapsed .sidebar-logo-container {
    flex-direction: column !important;
    height: auto !important;
    padding: 0.75rem 0.5rem !important;
    gap: 0.5rem;
}
.sidebar-collapsed .sidebar-logo-img {
    max-height: 24px !important;
    width: auto;
}
.sidebar-collapsed .sidebar-toggle-btn {
    width: 2rem !important;
    height: 2rem !important;
}

/* PERBAIKAN FLYOUT MENU (Tanpa Gap agar kursor tidak keburu hilang) */
@media (min-width: 768px) {
    .sidebar-collapsed .menu-group-wrapper {
        position: relative;
    }
    
    /* Sembunyikan submenu secara default saat collapsed */
    .sidebar-collapsed .menu-group-wrapper .sidebar-submenu {
        display: none !important;
    }

    /* Saat wrapper di-hover, tampilkan submenu menempel tanpa gap (margin-left: 0) */
    .sidebar-collapsed .menu-group-wrapper:hover > .sidebar-submenu {
        display: block !important;
        position: absolute !important;
        left: 100% !important;
        top: 0 !important;
        width: 15rem !important;
        background-color: #ffffff !important;
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
        border: 1px solid #f3f4f6 !important;
        border-radius: 0.75rem !important;
        padding: 0.75rem !important;
        z-index: 99999 !important;
        margin-left: 0px !important; /* Menempel persis di pinggir sidebar */
    }

    /* Tambahkan jembatan tak terlihat di sebelah kiri submenu agar kursor tidak "jatuh" */
    .sidebar-collapsed .menu-group-wrapper:hover > .sidebar-submenu::before {
        content: '';
        position: absolute;
        left: -15px;
        top: 0;
        width: 15px;
        height: 100%;
    }
}