/* =========================================
   BASE SYSTEM STYLES
========================================= */
body { 
    font-family: Arial, sans-serif; 
    background: #f4f7f6; 
    margin: 0; 
    color: #333; 
}

.container { 
    max-width: 1000px; 
    margin: 30px auto; 
    background: #fff; 
    padding: 20px; 
    border-radius: 8px; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); 
}

/* =========================================
   TABLES & BUTTONS
========================================= */
table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-top: 15px; 
}

table th, table td { 
    padding: 10px; 
    text-align: left; 
    border-bottom: 1px solid #ddd; 
}

table th { 
    background: #f9f9f9; 
}

.btn { 
    display: inline-block; 
    padding: 8px 12px; 
    background: #0A1F44; 
    color: #fff; 
    text-decoration: none; 
    border: none; 
    border-radius: 4px; 
    cursor: pointer; 
}

.btn-small { padding: 5px 8px; font-size: 12px; }
.btn-edit { background: #CBA052; }
.btn-delete { background: #dc3545; }

/* =========================================
   FORMS & ALERTS
========================================= */
.form-group { margin-bottom: 15px; }

.form-group label { 
    display: block; 
    margin-bottom: 5px; 
    font-weight: bold; 
}

.form-group input, .form-group textarea, .form-group select { 
    width: 100%; 
    padding: 8px; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
    box-sizing: border-box; 
}

.msg { 
    padding: 10px; 
    margin-bottom: 15px; 
    border-radius: 4px; 
    background: #d4edda; 
    color: #155724; 
}
/* =========================================
   BEAUTIFIED NAVIGATION BAR (SPLIT LAYOUT)
========================================= */
.navbar { 
    background-color: #0A1F44; 
    color: white; 
    display: flex; 
    align-items: center; 
    padding: 15px 30px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.15); 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
}

.nav-brand { 
    font-size: 24px; 
    font-weight: 700; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    letter-spacing: 1px; 
    white-space: nowrap; 
}

/* 1. Main Container: Splits the left and right sections */ 
.nav-menu { 
    display: flex; 
    flex: 1; 
    justify-content: space-between; 
    align-items: center; 
    margin-left: 40px; 
}

/* 2. The Link Lists: Keeps links horizontal on desktop */
.nav-links { 
    list-style: none; 
    display: flex; 
    gap: 15px; 
    margin: 0; 
    padding: 0; 
    align-items: center; 
}

.nav-links li a, .dropbtn { 
    color: #ffffff !important; 
    text-decoration: none; 
    font-size: 14px; 
    font-weight: 500; 
    transition: all 0.3s ease; 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    padding: 8px 10px; 
    border-radius: 5px; 
    cursor: pointer;
}

.nav-links li a i, .dropbtn i { 
    color: #ffffff !important; 
}

.nav-links li a:hover, .dropdown:hover .dropbtn { 
    color: #ffffff !important; 
    background-color: rgba(255, 255, 255, 0.1); 
}

.logout-btn { 
    background: #dc3545 !important; 
    color: white !important; 
}

.logout-btn:hover { 
    background: #c82333 !important; 
}

.hamburger { 
    display: none; 
    background: none; 
    border: none; 
    color: white; 
    font-size: 24px; 
    cursor: pointer; 
    margin-left: auto; 
}

/* =========================================
   DROPDOWN MENU STYLES (HOVER FIX)
========================================= */ 
.dropdown { 
    position: relative; 
    display: inline-block; 
}

.dropdown-content { 
    display: none; 
    position: absolute; 
    top: 100%; /* Snaps perfectly below the button */
    left: 0;
    background-color: #0A1F44; 
    min-width: 180px; 
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.5); 
    z-index: 1001; 
    border-radius: 5px; 
    /* margin-top is REMOVED to close the hover gap */
    overflow: hidden; 
}

.dropdown-content a { 
    padding: 12px 16px !important; 
    display: flex !important; 
    border-radius: 0 !important; 
}

.dropdown:hover .dropdown-content { 
    display: block; 
}

/* =========================================
   ADAPTIVE RESPONSIVE DESIGN (MOBILE & TABLET)
========================================= */
@media (max-width: 1100px) {
    /* 1. Navbar Mobile Layout */ 
    .navbar { 
        padding: 15px 20px; 
    } 
    
    .hamburger { 
        display: block !important; 
    } 
    
    .nav-menu { 
        display: none; 
        flex-direction: column; 
        justify-content: flex-start; 
        position: absolute; 
        top: 60px; 
        left: 0; 
        width: 100%; 
        background-color: #0A1F44; 
        padding: 15px 0; 
        box-shadow: 0 4px 6px rgba(0,0,0,0.2); 
        margin-left: 0; 
    } 
    
    .nav-menu.active { 
        display: flex !important; 
    } 
    
    .nav-links { 
        flex-direction: column; 
        width: 100%; 
        gap: 0; 
    } 
    
    .nav-links li { 
        width: 100%; 
    } 
    
    .nav-links li a, .dropbtn { 
        padding: 12px 20px; 
        justify-content: flex-start; 
        border-radius: 0; 
        width: 100%;
        box-sizing: border-box;
    }

    /* 2. Fix Dropdowns for Mobile */
    .dropdown-content {
        position: static; 
        box-shadow: none;
        padding-left: 15px;
        display: none;
        width: 100%;
        background-color: rgba(0,0,0,0.1);
    }
    
    .dropdown:hover .dropdown-content,
    .dropdown:active .dropdown-content {
        display: block;
    }

    /* 3. Fix Tables on Mobile */ 
    table { 
        display: block; 
        width: 100%; 
        overflow-x: auto; 
        white-space: nowrap; 
        -webkit-overflow-scrolling: touch; 
    }

    /* 4. Stack Forms and Layouts */ 
    .container { 
        padding: 15px; 
        margin: 10px auto; 
        width: 95%; 
        box-sizing: border-box;
    }

    div[style*="display: flex"] { 
        flex-direction: column !important; 
        gap: 10px !important; 
    } 
    
    .form-group { 
        width: 100% !important; 
        flex: none !important; 
    } 
}