html, body {
    margin: 0;
    padding: 0;
}

/* General Layout */
body {
    background: #f8fafc; /* Revert to a neutral background for other pages */
    font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
    color: #333; /* Revert to a neutral text color for other pages */
}

/* Specific styles for the login page body */
.login-page-body {
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460); /* Dark gradient background */
    color: #e0e0e0; /* Light text color */
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Prevent scrollbars from background effects */
}

/* Login Form Styling for Glassy 3D Effect */
.login-form {
    background: rgba(0, 0, 0, 0.3); /* Semi-transparent dark background */
    backdrop-filter: blur(10px); /* Glassy blur effect */
    border: 1px solid rgba(255, 255, 255, 0.18); /* Subtle light border */
    border-radius: 20px; /* More rounded corners */
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37); /* Stronger 3D shadow */
    padding: 40px;
    max-width: 450px;
    width: 100%;
    color: #ffffff; /* White text inside form */
    position: relative; /* For potential future 3D transforms */
    transform-style: preserve-3d; /* For 3D children */
    transition: all 0.3s ease-in-out;
}

.login-form h2, .login-form p {
    color: #ffffff; /* Ensure headings and paragraphs are white */
}

select.form-control option[value=""] {
    font-weight: normal;
    color: rgba(255, 255, 255, 0.6); /* Muted white */
}

/* Ensure labels in main content (e.g., in section/personnel_add_edit.php) are dark */
main label {
    color: #333; /* Dark color for labels on light background */
}

/* Form Controls for Glassy Dark Theme */
.form-control {
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.2); /* Subtle dark border */
    background-color: rgba(255, 255, 255, 0.8); /* Lighter, more opaque background for dark text */
    color: #00008B; /* Dark Blue text input */
    font-weight: bold; /* Bold text */
    transition: 0.2s;
    font-size: 1.2rem; /* Slightly bigger font size */
    padding: 0.75rem 1rem; /* Bigger padding for input fields */
}
.form-control:focus {
    border-color: #007bff; /* Blue focus border */
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.5); /* Blue glow on focus */
    background-color: rgba(255, 255, 255, 0.9); /* Even lighter on focus */
}
.form-control::placeholder {
    color: rgba(0, 0, 0, 0.6); /* Dark placeholder text */
}

/* Select Dropdown for Glassy Dark Theme */
select.form-control {
    background-color: rgba(255, 255, 255, 0.8); /* Match input background */
    color: #00008B; /* Dark Blue text input */
    font-weight: bold; /* Bold text */
    -webkit-appearance: none; /* Remove default arrow */
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2300008B%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13.2-5.4H18.6c-5%200-9.3%201.8-13.2%205.4A17.6%2017.6%200%200%200%200%2082.6c0%204.8%201.8%209.3%205.4%2013.2l128%20128c3.9%203.9%208.4%205.4%2013.2%205.4s9.3-1.8%2013.2-5.4l128-128c3.9-3.9%205.4-8.4%205.4-13.2%200-4.8-1.8-9.3-5.4-13.2z%22%2F%3E%3C%2Fsvg%3E'); /* Custom dark blue arrow */
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px; /* Bigger arrow */
    padding-right: 40px; /* More space for the bigger arrow */
    font-size: 1.2rem; /* Match input font size */
    padding: 0.75rem 1rem; /* Match input padding */
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); /* Enhanced shadow for 3D glassy effect */
    height: auto; /* Allow height to adjust based on content */
    line-height: 1.5; /* Ensure proper line height */
}
select.form-control:hover {
    background-color: rgba(255, 255, 255, 0.9); /* Match input focus background */
}

select.form-control option {
    font-weight: normal; /* Ensure all options are normal weight */
    color: #00008B; /* Dark blue for options */
    background-color: #f8fafc; /* Light background for options in dropdown list */
}
select.form-control:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Buttons for Glassy Dark Theme */
.btn {
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); /* Enhanced shadow */
    transition: all 0.3s ease;
    text-transform: uppercase;
}
.btn:hover {
    transform: translateY(-3px); /* More pronounced lift */
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.btn-primary {
    background: linear-gradient(45deg, #007bff, #00c6ff); /* Vibrant blue gradient */
    border: none;
    color: #ffffff;
}
.btn-primary:hover {
    background: linear-gradient(45deg, #0056b3, #0099cc); /* Darker blue on hover */
}

/* Other existing styles */
.consolidated-table-body td {
    color: #b0b0b0;
}

/* Page Header */
h1.h2 {
    font-weight: 700;
    color: #004c91;
    letter-spacing: 0.5px;
    text-align: center; /* Center the page header */
}

.text-3d-effect {
    color: #fff;
    text-shadow: 
        1px 1px 0 #000, 
        2px 2px 0 #000, 
        3px 3px 0 #000, 
        4px 4px 0 #000, 
        5px 5px 0 #000, 
        6px 6px 0 #000;
    /* You can adjust the color and offset for different 3D effects */
}

h4, h5 {
    color: #0a2e5c;
    font-weight: 600;
}

/* Form Controls */
/* These are now handled by the new .form-control and select.form-control rules above */

/* Table Styling */
.table {
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden;
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.table th {
    background-color: #004c91;
    color: #fff;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
}
.table td {
    vertical-align: middle;
    text-align: center;
    font-weight: normal; /* Changed to normal */
    font-size: 1em; /* Changed to 1em */
    color: #e0e0e0; /* Ensure table data is light and visible on dark background */
}

.table td:nth-child(2),
.table td:nth-child(5) {
    text-align: left;
}
.table-sm td, .table-sm th {
    padding: 0.6rem;
}

/* Input Fields inside table */
.styled-allocation-input {
    width: 60px; /* Reduced width */
    font-weight: bold; /* Already bold */
    color: #0000FF; /* Blue color */
    font-size: 1.3em; /* Even Bigger size */
    text-align: center; /* Center align text */
    line-height: 1.2em; /* Reduced line height */
    /* Hide spin buttons for number input, though we changed to type="text" */
    -moz-appearance: textfield; /* Firefox */
}
.styled-allocation-input:focus {
    background-color: #fff;
}

/* Totals Cells */
.styled-total-cell {
    font-weight: 700;
    background-color: #BCC2C8; /* Light-Dark Shade */
    border-left: 2px solid #dee2e6;
}
.column-total.total-background {
    background-color: #4A5568 !important; /* Dark Blue-Gray */
    color: white;
}

.required-total.total-background {
    background-color: #2D7A79 !important; /* Dark Teal */
    color: white;
}

/* Checkbox Column */
.hide-subdivision-checkbox {
    transform: scale(1.3);
    cursor: pointer;
}

/* Buttons */
/* These are now handled by the new .btn and .btn-primary rules above */

/* Alert Box */
.alert-info {
    background-color: #e9f4ff;
    border: 1px solid #bcdffb;
    color: #004c91;
    border-radius: 10px;
    font-weight: 500;
}

/* Hidden Subdivisions Box */
#hidden_subdivisions_container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    padding: 15px;
}

/* Row hover highlight */
.subdivision-row:hover {
    background-color: #f4faff;
}

/* Circulate / Save Button Layout */
.btn + .btn {
    margin-left: 10px;
}

/* Smooth transition for table updates */
tr, td, th {
    transition: background-color 0.25s ease;
}

.highlight {
    background-color: yellow;
    font-weight: bold;
}

.active-personnel {
    font-weight: bold;
    color: #007bff; /* A distinct blue color for active */
}

.dehighlighted-personnel {
    color: #6c757d; /* A muted gray color for de-highlighted */
}

/* === Modern Dark Sidebar Styling === */
.sidebar {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    min-height: 100vh;
    overflow-y: auto; /* Allow scrolling within the sidebar if its content is taller than the screen */
    background: linear-gradient(180deg, #1c1f26 0%, #0f1116 100%);
    color: #f1f1f1;
    box-shadow: 4px 0 10px rgba(0,0,0,0.4);
    border-right: 1px solid #2a2d34;
    font-size: 1.05rem; /* Slightly larger font */
    font-weight: 500;
    padding-top: 20px;
    transition: all 0.3s ease-in-out;
}

/* Sidebar links */
.sidebar a {
    color: #d8e4ff;
    display: block;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    margin: 6px 10px;
    transition: all 0.25s ease;
}

.sidebar a:hover {
    background: linear-gradient(90deg, #004c91, #007ad9);
    color: #fff;
    transform: translateX(4px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Active link style */
.sidebar a.active, 
.sidebar .nav-link.active {
    background: linear-gradient(90deg, #007ad9, #00a859);
    color: #fff !important;
    font-weight: 600;
    box-shadow: inset 0 0 6px rgba(255,255,255,0.15);
}

/* Sidebar section titles */
.sidebar .nav-heading {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffc107;
    margin: 15px 15px 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Hover highlight animation */
.sidebar a::before {
    content: "";
    position: absolute;
    left: 0;
    height: 100%;
    width: 4px;
    background: #00c16a;
    border-radius: 0 4px 4px 0;
    transform: scaleY(0);
    transition: transform 0.25s ease;
}
.sidebar a:hover::before {
    transform: scaleY(1);
}

/* Sidebar Scrollbar (for overflow menus) */
.sidebar::-webkit-scrollbar {
    width: 8px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: #3a3f47;
    border-radius: 10px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
    background: #555b65;
}

/* Sidebar Logo (optional if present) */
.sidebar .sidebar-logo {
    text-align: center;
    padding: 10px 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffd700;
    letter-spacing: 1px;
}
.sidebar .sidebar-logo img {
    width: 60px;
    height: auto;
    margin-bottom: 5px;
}

/* Compact padding for nav items */
.sidebar .nav-item {
    margin-bottom: 5px;
}

.remaining-total.total-background {
    background-color: #4C51BF !important; /* Dark Indigo */
    color: #fff;
}

/* Fixed Top Right Alert */
.fixed-top-right-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050; /* Ensure it's above modals */
    width: 300px; /* Adjust width as needed */
}

/* 3D Revolving Logo Effect */
.logo-revolve-3d {
    animation: revolve3d 15s infinite linear; /* Apply the revolving animation */
    transform-style: preserve-3d; /* Ensures 3D transforms work correctly */
}

@keyframes revolve3d {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

/* Custom Dark Blue Table Style */
.table-dark-blue.table {
    background-color: #00008B; /* Dark Blue */
    color: #ffffff; /* White text */
}

.table-dark-blue.table th {
    background-color: #00008B; /* Dark Blue for headers */
    color: #ffffff; /* White text for headers */
    border-color: #00008B; /* Dark Blue border for headers */
}

.table-dark-blue.table td {
    border-color: #00008B; /* Dark Blue border for cells */
}

.showPersonnelList {
    font-weight: bold; /* Make it bold for better visibility */
    font-size: 1.2em; /* Make it bigger */
}

.subdivision-count {
    color: darkblue !important;
}

.police-station-count {
    color: #24b9f0 !important;
}

#classificationTable tbody tr td:first-child {
    color: #000000 !important; /* Black color for better visibility */
    text-align: left !important; /* Left align the text */
}

.table-scroll-container {
    max-height: 70vh; /* Example height, adjust as needed */
    overflow: auto;
}



#personnelListModal .table thead th {
    font-weight: bold;
    color: #CCCCCC; /* Light Grey */
    font-size: 1.1em; /* Slightly bigger font size */
}

#personnelListModal .table tbody td {
    color: #00008B; /* Navy Blue */
}
