/* ===== NETWORK MONITORING SYSTEM - CUSTOM STYLES ===== */

/* ===== CSS VARIABLES ===== */
:root {
    --navbar-height: 100px; /* Increased from 50px to match header.php */
    --sidebar-width: 250px;
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-color: #dee2e6;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --transition: all 0.2s ease-in-out;
}

/* ===== BASE STYLES ===== */
body {
    padding-top: var(--navbar-height); /* Now will use 100px */
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* ===== NAVBAR & HEADER ===== */
.navbar-custom {
    min-height: 70px !important; /* Adjusted for actual navbar height */
    padding: 0.5rem 1rem !important;
    box-shadow: var(--shadow-sm);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
}

.navbar-brand {
    height: auto !important; /* Remove fixed height constraint */
    display: flex !important;
    align-items: center !important;
    padding: 0.5rem 0 !important; /* Add some padding */
    font-weight: 600;
    font-size: 1rem !important;
    color: white !important;
}

.navbar-brand.has-logo .app-name {
    margin-left: 8px;
    font-size: 0.95rem;
}

.navbar-brand.no-logo .app-name {
    font-size: 1rem;
}

.header-logo {
    height: 55px !important;
    width: auto !important;
    max-width: 140px;
    object-fit: contain;
    transition: var(--transition);
}

/* ===== MOBILE RESPONSIVE LOGO ===== */
@media (max-width: 768px) {
    .header-logo {
        height: 55px !important; /* Increased from 45px */
        max-width: 180px !important; /* Increased from 140px */
    }
    
    .navbar-brand {
        padding: 0.7rem 0 !important; /* More padding for larger logo */
    }
    
    .navbar-custom {
        min-height: 80px !important; /* Adjust navbar height for larger logo */
    }
}

@media (max-width: 480px) {
    .header-logo {
        height: 50px !important; /* Slightly smaller for very small screens */
        max-width: 220px !important;
    }
}

/* ===== NAVIGATION MENU ===== */
.navbar-nav.main-menu {
    flex-direction: row;
    margin-left: auto;
    margin-right: 20px;
}

.navbar-nav.main-menu .nav-item {
    margin: 0 5px;
}

.navbar-nav.main-menu .nav-link {
    color: rgba(255,255,255,0.9) !important;
    padding: 8px 12px;
    border-radius: 4px;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.9rem;
}

.navbar-nav.main-menu .nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    color: white !important;
}

.navbar-nav.main-menu .nav-link.active {
    background-color: var(--primary-color);
    color: white !important;
}

/* ===== SIDEBAR (Hidden by default) ===== */
.sidebar {
    display: none;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: 0 !important;
    padding: 20px;
    width: 100%;
    min-height: calc(100vh - var(--navbar-height));
}

/* ===== BUTTONS & CONTROLS ===== */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: var(--transition);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.dropdown-toggle {
    padding: 0.4rem 0.8rem;
    border-radius: 0.375rem;
    transition: var(--transition);
    font-size: 0.9rem;
}

.dropdown-toggle:hover {
    background-color: rgba(255,255,255,0.1);
}

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.3);
}

/* ===== CARDS & COMPONENTS ===== */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.table-responsive {
    border-radius: 0.375rem;
}

/* ===== DASHBOARD STATS ===== */
.dashboard-stats {
    margin-bottom: 30px;
}

.dashboard-stats .card {
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.dashboard-stats .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.dashboard-stats .card-body {
    padding: 1.5rem;
    text-align: center;
}

.dashboard-stats .card-body h5 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
    opacity: 0.9;
}

.dashboard-stats .card-body h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1;
}

/* ===== MONITORING COMPONENTS ===== */
.status-indicator {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.badge {
    font-size: 0.75em;
    padding: 0.35em 0.65em;
}

.device-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.device-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.device-status .status-dot.online {
    background-color: var(--success-color);
    animation: pulse 2s infinite;
}

.device-status .status-dot.offline {
    background-color: var(--danger-color);
}

.device-status .status-dot.unknown {
    background-color: var(--secondary-color);
}

.monitoring-card {
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
}

.monitoring-card:hover {
    transform: translateY(-2px);
}

.monitoring-card.success {
    border-left-color: var(--success-color);
}

.monitoring-card.warning {
    border-left-color: var(--warning-color);
}

.monitoring-card.danger {
    border-left-color: var(--danger-color);
}

/* ===== FORMS & MODALS ===== */
.modal-content {
    border-radius: 0.5rem;
    border: none;
    box-shadow: var(--shadow-md);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

.form-control, .form-select {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* ===== TABLES ===== */
.table {
    margin-bottom: 0;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: #495057;
    background-color: var(--light-color);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* ===== ALERTS ===== */
.alert {
    border-radius: 0.5rem;
    border: none;
    padding: 1rem 1.25rem;
}

.alert-dismissible .btn-close {
    padding: 1.25rem 1rem;
}

/* ===== LOADING STATES ===== */
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== LOGIN PAGE ===== */
.login-page {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 0 !important;
}

.login-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 0 30px rgba(0,0,0,0.15);
    max-width: 400px;
    width: 100%;
}

.login-logo {
    width: 200px !important;
    height: 200px !important;
    max-width: 200px !important;
    max-height: 200px !important;
    object-fit: contain;
    margin-bottom: 20px;
    border-radius: 8px;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 992px) {
 
    
    .navbar-nav.main-menu .nav-item {
        margin: 0;
    }
    
    .navbar-nav.main-menu .nav-link {
        padding: 10px 20px;
        border-radius: 0;
    }
}

@media (max-width: 768px) {
    .navbar-custom {
        padding: 0.3rem 0.8rem !important;
    }
    
    .navbar-brand {
        font-size: 0.95rem !important;
    }
    
    .header-logo {
        height: 28px !important;
        max-width: 120px;
    }
    
    .navbar-brand.has-logo .app-name {
        font-size: 0.85rem;
        margin-left: 6px;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .avatar {
        width: 24px;
        height: 24px;
    }
    
    .dashboard-stats .card-body h2 {
        font-size: 2rem;
    }
    
    .login-logo {
        width: 180px !important;
        height: 180px !important;
        max-width: 180px !important;
        max-height: 180px !important;
    }
    
    .login-container {
        padding: 30px 20px;
        margin: 20px;
    }
}

@media (max-width: 576px) {
    .header-logo {
        height: 26px !important;
        max-width: 100px;
    }
    
    .navbar-brand.has-logo .app-name {
        font-size: 0.8rem;
    }
    
    .main-content {
        padding: 10px;
    }
    
    .dashboard-stats .card-body h2 {
        font-size: 1.8rem;
    }
}

@media (min-width: 1200px) {
    .header-logo {
        height: 36px !important;
        max-width: 160px;
    }
    
    .dashboard-stats .card-body h2 {
        font-size: 3rem;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .navbar, .sidebar, .btn, .modal {
        display: none !important;
    }
    
    body {
        padding-top: 0 !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
}

/* ===== UTILITY CLASSES ===== */
.btn, .card, .nav-link, .dropdown-item {
    transition: var(--transition);
}

.btn:focus, .form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* ===== ENHANCED MOBILE CARD RESPONSIVENESS ===== */
@media (max-width: 576px) {
    /* Stack cards vertically on very small screens */
    .dashboard-stats .col-lg-3,
    .dashboard-stats .col-md-6,
    .dashboard-stats .col-sm-6 {
        margin-bottom: 15px;
    }
    
    /* Adjust card body padding for mobile */
    .dashboard-stats .card-body {
        padding: 1.25rem 1rem;
    }
    
    /* Smaller font sizes for mobile */
    .dashboard-stats .card-body h4 {
        font-size: 2rem;
    }
    
    .dashboard-stats .card-body small {
        font-size: 0.8rem;
    }
    
    .dashboard-stats .card-body i {
        font-size: 2rem !important;
    }
}

@media (max-width: 768px) {
    /* Two cards per row on medium mobile screens */
    .dashboard-stats .col-sm-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Enhanced card hover effects for touch devices */
@media (hover: none) and (pointer: coarse) {
    .dashboard-stats .card:hover {
        transform: none;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
}

/* ===== MOBILE DROPDOWN EXPANSION FIXES ===== */
@media (max-width: 991.98px) {
    .navbar-nav .dropdown {
        position: relative;
    }
    
    .navbar-nav .dropdown-menu {
        position: static;
        float: none;
        width: 100%;
        margin-top: 0;
        background-color: rgba(255,255,255,0.1);
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        display: none;
        overflow: hidden;
        max-height: 0;
        transition: max-height 0.3s ease, opacity 0.3s ease;
        opacity: 0;
    }
    
    .navbar-nav .dropdown-menu.show {
        display: block !important;
        max-height: 300px;
        opacity: 1;
        animation: expandDown 0.3s ease-out;
    }
    
    .navbar-nav .dropdown-item {
        padding: 0.75rem 2rem;
        color: rgba(255,255,255,0.8) !important;
        background-color: transparent;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        transition: background-color 0.2s ease;
        display: block;
        width: 100%;
        text-align: left;
    }
    
    .navbar-nav .dropdown-item:hover {
        background-color: rgba(255,255,255,0.15);
        color: #fff !important;
    }
    
    .navbar-nav .dropdown-item.active {
        background-color: rgba(0,123,255,0.4);
        color: #fff !important;
    }
    
    .navbar-nav .dropdown-item:last-child {
        border-bottom: none;
    }
    
    .navbar-nav .dropdown-toggle {
        position: relative;
    }
    
    .navbar-nav .dropdown-toggle::after {
        margin-left: auto;
        transition: transform 0.3s ease;
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .navbar-nav .dropdown-toggle[aria-expanded="true"]::after {
        transform: translateY(-50%) rotate(180deg);
    }
    
    /* Pastikan navbar collapse tidak tertutup saat dropdown dibuka */
    .navbar-collapse.show {
        display: block !important;
    }
    
    .navbar-nav.main-menu.show {
        display: flex !important;
        flex-direction: column;
    }
}

@keyframes expandDown {
    from {
        max-height: 0;
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        max-height: 300px;
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== DESKTOP DROPDOWN IMPROVEMENTS ===== */
@media (min-width: 992px) {
    .navbar-nav .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 1000;
        min-width: 200px;
        padding: 0.5rem 0;
        margin: 0.125rem 0 0;
        background-color: #fff;
        border: 1px solid rgba(0,0,0,.15);
        border-radius: 0.375rem;
        box-shadow: 0 0.5rem 1rem rgba(0,0,0,.175);
        display: none;
    }
    
    .navbar-nav .dropdown-menu.show {
        display: block !important;
        animation: fadeInDown 0.2s ease;
    }
    
    .navbar-nav .dropdown-item {
        padding: 0.5rem 1rem;
        color: #212529;
        transition: background-color 0.2s ease;
    }
    
    .navbar-nav .dropdown-item:hover {
        background-color: #f8f9fa;
        color: #1e2125;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== PREVENT HORIZONTAL SCROLL ===== */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

.container-fluid {
    padding-left: 15px;
    padding-right: 15px;
    max-width: 100%;
}

/* ===== RESPONSIVE NAVBAR IMPROVEMENTS ===== */
@media (max-width: 991.98px) {
    .navbar-collapse {
        max-width: calc(100vw - 30px);
        overflow-x: hidden;
    }
    
    .navbar-nav.main-menu {
        width: 100%;
        padding: 0;
    }
    
    .navbar-nav.main-menu .nav-item {
        width: 100%;
    }
    
    .navbar-nav.main-menu .nav-link {
        width: 100%;
        text-align: left;
    }
}

/* Mini Dashboard Cards */
.dashboard-stats .card-mini {
    min-height: 80px;
}

.dashboard-stats .card-mini .card-body {
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dashboard-stats .card-mini h6 {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.dashboard-stats .card-mini h4 {
    font-size: 1.5rem;
    margin-bottom: 0;
    font-weight: bold;
}

.dashboard-stats .card-mini .icon {
    font-size: 2rem;
    opacity: 0.7;
}

/* Auto-refresh controls styling */
.auto-refresh-controls {
    border-left: 4px solid #0d6efd;
    background-color: #f8f9fa;
}

.auto-refresh-controls .card-body {
    padding: 0.75rem 1rem;
}

.auto-refresh-controls .form-select-sm {
    font-size: 0.875rem;
}

.auto-refresh-controls .input-group-sm .form-control {
    font-size: 0.875rem;
}

.auto-refresh-controls .badge {
    font-size: 0.75rem;
}

.auto-refresh-controls .small {
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    .auto-refresh-controls .row > div {
        margin-bottom: 0.5rem;
    }
    
    .auto-refresh-controls .row > div:last-child {
        margin-bottom: 0;
    }
}

/* ===== STICKY BOTTOM MENU ===== */
/* Pastikan sticky bottom menu tetap di posisi yang benar */
.sticky-bottom-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1020; /* Tetap di bawah mobile menu overlay */
    background: linear-gradient(135deg, var(--header-color, #2c3e50) 0%, #1a252f 100%);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
}

.bottom-menu-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 10px;
}

.bottom-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
    padding: 8px 4px;
    border-radius: 8px;
    min-width: 50px;
    position: relative;
}

.bottom-menu-item i {
    font-size: 1.2rem;
    margin-bottom: 2px;
    transition: all 0.3s ease;
}

.bottom-menu-item span {
    font-size: 0.7rem;
    font-weight: 500;
    text-align: center;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60px;
}

.bottom-menu-item:hover,
.bottom-menu-item.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.bottom-menu-item.active {
    background: var(--primary-color, #007bff);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.bottom-menu-item.active i {
    transform: scale(1.1);
}

/* Adjust body padding for bottom menu */
@media (max-width: 991.98px) {
    body {
        padding-bottom: 70px; /* Space for bottom menu */
    }
    
    .main-content {
        margin-bottom: 20px;
    }
}

/* Hide bottom menu on desktop */
@media (min-width: 992px) {
    .sticky-bottom-menu {
        display: none !important;
    }
}

/* Responsive adjustments for very small screens */
@media (max-width: 480px) {
    .bottom-menu-item span {
        font-size: 0.65rem;
        max-width: 50px;
    }
    
    .bottom-menu-item i {
        font-size: 1.1rem;
    }
    
    .bottom-menu-container {
        padding: 0 5px;
    }
}

/* ===== MOBILE MENU IMPROVEMENTS ===== */
@media (max-width: 991.98px) {
    /* Improve mobile navbar */
    .navbar-custom {
        background: linear-gradient(135deg, var(--header-color, #2c3e50) 0%, #1a252f 100%) !important;
        backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    /* Mobile menu overlay improvements */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100vw; /* Ubah dari 320px ke 100vw untuk lebar penuh */
        max-width: 100vw; /* Ubah dari 90vw ke 100vw */
        height: 100vh;
        background: linear-gradient(135deg, #07082B 0%, #124A82 100%);
        z-index: 10000; /* Tingkatkan z-index agar di atas sticky menu */
        transition: right 0.3s ease;
        overflow-y: auto;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
        padding-bottom: 80px; /* Tambahkan padding bottom untuk sticky menu */
    }
    
    .mobile-menu-overlay.show {
        right: 0;
    }
    
    .mobile-menu-header {
        padding: 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        text-align: center;
        width: 100%; /* Pastikan header menggunakan lebar penuh */
    }
    
    .mobile-menu-header .close-btn {
        position: absolute;
        top: 15px;
        right: 20px;
        background: none;
        border: none;
        color: #fff;
        font-size: 1.5rem;
        cursor: pointer;
    }
    
    .mobile-menu-profile {
        display: flex;
        flex-direction: column;
        align-items: center;
        color: #fff;
        margin-top: 10px;
    }
    
    .mobile-menu-profile .avatar {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        margin-bottom: 10px;
        border: 3px solid rgba(255, 255, 255, 0.3);
    }
    
    .mobile-menu-profile .user-info h5 {
        margin: 0;
        font-size: 1.1rem;
    }
    
    .mobile-menu-profile .user-info small {
        color: rgba(255, 255, 255, 0.7);
    }
    
    .mobile-menu-content {
        padding: 0 20px 100px 20px; /* Tambahkan padding bottom ekstra */
        min-height: calc(100vh - 140px); /* Pastikan konten memiliki tinggi minimum */
        width: 100%; /* Pastikan konten menggunakan lebar penuh */
    }
    
    .mobile-menu-section {
        margin-bottom: 30px;
    }
    
    .mobile-menu-section h6 {
        color: rgba(255, 255, 255, 0.7);
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 1px;
        margin-bottom: 15px;
        padding: 0 20px;
    }
    
    .mobile-menu-item {
        display: flex;
        align-items: center;
        padding: 15px 20px;
        color: #fff;
        text-decoration: none;
        transition: all 0.3s ease;
        border-left: 3px solid transparent;
    }
    
    .mobile-menu-item:hover,
    .mobile-menu-item.active {
        background: rgba(255, 255, 255, 0.1);
        border-left-color: var(--primary-color, #007bff);
        color: #fff;
    }
    
    .mobile-menu-item i {
        font-size: 1.2rem;
        margin-right: 15px;
        width: 20px;
        text-align: center;
    }
    
    .mobile-menu-item span {
        font-size: 1rem;
        font-weight: 500;
    }
    
    .mobile-menu-item .badge {
        margin-left: auto;
        background: var(--primary-color, #007bff);
    }
    
    /* Pastikan backdrop juga memiliki z-index yang tepat */
    .mobile-menu-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9999; /* Satu level di bawah overlay */
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-backdrop.show {
        opacity: 1;
        visibility: visible;
    }
    
    /* Hide on desktop */
    @media (min-width: 992px) {
        .mobile-menu-overlay,
        .mobile-menu-backdrop {
            display: none !important;
        }
    }
}

/* Mobile Quick Actions */
.mobile-quick-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.quick-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-2px);
}

/* Mobile Dropdown Styles */
.mobile-dropdown {
    margin-bottom: 10px;
}

.mobile-dropdown-toggle {
    width: 100%;
    background: none;
    border: none;
    color: white;
    padding: 15px 20px;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    font-weight: 500;
}

.mobile-dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-dropdown-toggle.active {
    background: rgba(255, 255, 255, 0.15);
}

.mobile-dropdown-toggle.active .dropdown-arrow {
    transform: rotate(180deg);
}

.mobile-dropdown-toggle i:first-child {
    margin-right: 15px;
    font-size: 18px;
}

.dropdown-arrow {
    transition: transform 0.3s ease;
}

.mobile-dropdown-toggle.active .dropdown-arrow {
    transform: rotate(180deg);
}

.mobile-dropdown-content {
    position: relative !important;
    display: block !important;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin-top: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.mobile-dropdown-content.show {
    max-height: 500px !important;
    overflow-y: auto;
}

.mobile-dropdown-content .dropdown-header {
    color: #666;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 10px 20px 5px;
    margin: 0;
}

.mobile-dropdown-content .dropdown-divider {
    border-color: rgba(0, 0, 0, 0.1);
    margin: 10px 20px;
}

.mobile-dropdown-content .mobile-menu-item {
    padding: 12px 20px;
    margin: 0;
    border-radius: 0;
    color: #333;
}

.mobile-dropdown-content .mobile-menu-item:hover {
    background: rgba(0, 123, 255, 0.1);
    color: #0056b3;
}

.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
    background-color: #fff;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger.is-active .hamburger-inner {
    background-color: transparent;
}

.hamburger.is-active .hamburger-inner::before {
    transform: rotate(45deg) translate(5px, 5px);
    background-color: #fff;
}

.hamburger.is-active .hamburger-inner::after {
    transform: rotate(-45deg) translate(7px, -6px);
    background-color: #fff;
}

/* ===== MOBILE CARD SPACING ===== */
/* Card spacing untuk mobile */
@media (max-width: 991.98px) {
    /* Spacing untuk dashboard cards */
    .dashboard-stats .col-lg-3,
    .dashboard-stats .col-md-6,
    .dashboard-stats .col-sm-6 {
        margin-bottom: 15px;
    }
    
    /* Spacing khusus untuk risk dan incident dashboard */
    .risk-dashboard .row .col-lg-3,
    .risk-dashboard .row .col-md-6,
    .risk-dashboard .row .col-sm-6,
    .incident-dashboard .row .col-lg-3,
    .incident-dashboard .row .col-md-6,
    .incident-dashboard .row .col-sm-6 {
        padding-left: 8px;
        padding-right: 8px;
        margin-bottom: 15px;
    }
    
    /* Card styling untuk mobile */
    .card {
        margin-bottom: 15px;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    /* Spacing untuk row container */
    .row {
        margin-left: -8px;
        margin-right: -8px;
    }
}

/* Spacing untuk tablet */
@media (max-width: 768px) {
    .dashboard-stats .col-lg-3,
    .dashboard-stats .col-md-6,
    .dashboard-stats .col-sm-6 {
        margin-bottom: 20px;
    }
    
    .risk-dashboard .row .col-lg-3,
    .risk-dashboard .row .col-md-6,
    .risk-dashboard .row .col-sm-6,
    .incident-dashboard .row .col-lg-3,
    .incident-dashboard .row .col-md-6,
    .incident-dashboard .row .col-sm-6 {
        padding-left: 10px;
        padding-right: 10px;
        margin-bottom: 20px;
    }
    
    .row {
        margin-left: -10px;
        margin-right: -10px;
    }
}

/* Spacing untuk mobile kecil */
@media (max-width: 480px) {
    .dashboard-stats .col-lg-3,
    .dashboard-stats .col-md-6,
    .dashboard-stats .col-sm-6 {
        margin-bottom: 15px;
        padding-left: 5px;
        padding-right: 5px;
    }
    
    .risk-dashboard .row .col-lg-3,
    .risk-dashboard .row .col-md-6,
    .risk-dashboard .row .col-sm-6,
    .incident-dashboard .row .col-lg-3,
    .incident-dashboard .row .col-md-6,
    .incident-dashboard .row .col-sm-6 {
        padding-left: 5px;
        padding-right: 5px;
        margin-bottom: 15px;
    }
    
    .row {
        margin-left: -5px;
        margin-right: -5px;
    }
    
    /* Card lebih compact untuk layar kecil */
    .card {
        margin-bottom: 12px;
    }
    
    .card-body {
        padding: 1rem 0.75rem;
    }
}

/* Spacing khusus untuk container utama pada mobile */
@media (max-width: 991.98px) {
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .main-content {
        padding: 15px;
    }
}

/* Report Logo Styling */
.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    border-bottom: 2px solid #dee2e6;
}

.report-header h2 {
    margin: 0;
    color: #495057;
}

.report-logo {
    max-height: 60px;
    max-width: 200px;
    height: auto;
}

@media (max-width: 768px) {
    .report-header {
        flex-direction: column;
        text-align: center;
    }
    
    .report-header h2 {
        margin-bottom: 10px;
    }
    
    .report-logo {
        max-height: 40px;
        max-width: 150px;
    }
}

/* Pastikan z-index tidak konflik */
.mobile-menu-overlay {
    z-index: 10000 !important;
}

.mobile-dropdown-content {
    z-index: 10001 !important;
}

/* Perbaikan untuk dropdown toggle */
.mobile-dropdown-toggle.active .dropdown-arrow {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

/* Dashboard Quick Actions */
.dashboard-quick-actions {
    position: fixed;
    bottom: 80px; /* Di atas sticky bottom menu */
    right: 20px;
    z-index: 1015;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 8px;
}

.quick-actions-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quick-action-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    text-decoration: none;
    color: #333;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-width: 80px;
}

.quick-action-item:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(-2px);
}

.quick-action-item i {
    font-size: 1rem;
    margin-right: 8px;
}

.quick-action-item span {
    font-size: 0.8rem;
    font-weight: 500;
}

/* ===== DROP-UP SUBMENU (MOBILE) ===== */
.dropup-submenu {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 70px; /* muncul di atas sticky bottom menu */
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    transform: translateY(10px);
    opacity: 0;
    pointer-events: none;
    transition: all .18s ease-out;
    z-index: 10010; /* di atas sticky-bottom-menu (yang z-index 10000) */
    overflow: hidden;
}
.dropup-submenu.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.dropup-submenu .submenu-items {
    display: flex;
    flex-direction: column;
}
.dropup-submenu .submenu-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #212529;
    text-decoration: none;
    border-bottom: 1px solid rgba(0,0,0,.06);
}
.dropup-submenu .submenu-item:last-child {
    border-bottom: 0;
}
.dropup-submenu .submenu-item:hover {
    background: #f8f9fa;
}

/* Backdrop untuk fokus */
.submenu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s ease-out;
    z-index: 10005; /* di bawah panel tapi di atas konten */
}
.submenu-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

/* Responsiveness kecil */
@media (min-width: 576px) {
    .dropup-submenu {
        left: 25%;
        right: 25%;
    }
}
