/*
 * ===================================
 * VARUNA System Stylesheet
 * Font: Poppins
 * ===================================
 */
@font-face {
    font-family: 'Poppins';
    src: url('../libs/fonts/Poppins-Light.woff2') format('woff2'),
        url('../libs/fonts/Poppins-Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Poppins';
    src: url('../libs/fonts/Poppins-Regular.woff2') format('woff2'),
        url('../libs/fonts/Poppins-Regular.woff') format('woff');
    font-weight: normal;
    /* Corresponds to 400 */
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Poppins';
    src: url('../libs/fonts/Poppins-Medium.woff2') format('woff2'),
        url('../libs/fonts/Poppins-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Poppins';
    src: url('../libs/fonts/Poppins-Bold.woff2') format('woff2'),
        url('../libs/fonts/Poppins-Bold.woff') format('woff');
    font-weight: bold;
    /* Corresponds to 700 */
    font-style: normal;
    font-display: swap;
}

/* ------------------------------ */
/* 1. Root Variables & Basic Setup
/* ------------------------------ */
:root {
    --primary-color: rgb(244, 91, 105);
    --primary-color-darker: rgb(209, 59, 73);
    /* For gradients */
    --secondary-color: rgb(245, 237, 238);
    --text-color: #333333;
    /* Slightly softer than pure black */
    --white-color: #FFFFFF;
    --gray-color: #b0b0b0;
    /* For input borders and labels */
    --font-family: 'Poppins', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--secondary-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* Ensures body takes full viewport height */
}

/* ------------------------------ */
/* 2. Header
/* ------------------------------ */
.main-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-darker));
    color: var(--white-color);
    padding: 10px 40px;
    /* Adjusted padding slightly */
    display: flex;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.logo {
    height: 70px;
    /* Keeping the larger size */
    margin-right: 20px;
    /* Add margin back for spacing */
    /* This is the new line for the glow effect */
    filter: drop-shadow(0px 1px 4px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-container {
    /* This ensures the logo is vertically centered */
    display: flex;
    align-items: center;
}

.system-name-container {
    text-align: center;
    flex-grow: 1;
    /* The negative margin has been removed */
}

.system-name {
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
    animation: fadeInDown 0.6s ease-out;
}

.system-subtitle {
    font-size: 0.9rem;
    font-weight: 300;
    animation: fadeInDown 0.7s ease-out;
}


/* ------------------------------ */
/* 4. Login Page & Form
/* ------------------------------ */
.login-container {
    flex-grow: 1;
    /* Takes up remaining vertical space */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.login-box {
    width: 100%;
    max-width: 400px;
    background: var(--white-color);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    /* Ensures header gradient doesn't leak out */
    animation: fadeInUp 0.5s ease-out;
}

.login-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-darker));
    color: var(--white-color);
    padding: 20px;
    text-align: center;
}

.login-header h2 {
    font-weight: 500;
    font-size: 1.5rem;
}

.login-form {
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    /* Increased gap for better spacing */
}

/* ------------------------------ */
/* 5. Custom Form Components & Animations
/* ------------------------------ */

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.form-section {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.form-section-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-weight: 500;
    color: #555;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.input-group input[type="text"],
.input-group input[type="number"],
.input-group input[type="password"],
.input-group input[type="date"],
.input-group select {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: #fdfdfd;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.input-group input[type="file"] {
    width: 100%;
    padding: 10px;
    background-color: #fdfdfd;
    border: 1px dashed #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.input-group input[type="file"]:hover {
    border-color: var(--primary-color);
    background-color: #fff;
}

.document-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.document-upload-item {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #eee;
}

.document-upload-item label {
    color: #444;
    font-weight: 500;
    margin-bottom: 12px;
    display: block;
}

.form-actions {
    text-align: center;
    margin-top: 30px;
    padding: 20px 0;
}

.form-actions button {
    min-width: 200px;
}

@media (max-width: 768px) {
    .details-grid {
        grid-template-columns: 1fr;
    }

    .document-upload-grid {
        grid-template-columns: 1fr;
    }

    .form-section {
        padding: 20px 15px;
    }
}

/* Custom Animated Input Box */
.input-group {
    /* This is now just a simple container for a label and its input */
    margin-bottom: 15px;
    /* Adds space between form rows */
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(244, 91, 105, 0.2);
}

/* Special styling for file inputs to look consistent */
.input-group input[type="file"] {
    padding: 9px 15px;
    cursor: pointer;
}

.date-input-wrapper {
    position: relative;
}

/* Style the date input to match other fields */
.input-group input[type="date"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    display: block;
    width: 100%;
    padding: 12px 40px 12px 15px;
    /* Extra right padding for our icon */
    font-size: 1rem;
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: #fdfdfd;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Remove the default ugly calendar icon in WebKit browsers (Chrome, Safari) */
.input-group input[type="date"]::-webkit-calendar-picker-indicator {
    display: none;
    -webkit-appearance: none;
}

/* Create our own beautiful calendar icon */
.date-input-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    /* An embedded SVG for a sharp, scalable calendar icon */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23555555'%3E%3Cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    /* Allows clicks to go "through" to the input */
}








.input-group select {
    position: relative;
    -webkit-appearance: none;
    /* Removes default chrome and safari style */
    -moz-appearance: none;
    /* Removes default firefox style */
    appearance: none;
    /* Removes default style */

    /* Apply the same styles as our text inputs for consistency */
    display: block;
    width: 100%;
    padding: 12px 40px 12px 15px;
    /* Extra right padding for our custom arrow */
    font-size: 1rem;
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: #fdfdfd;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Add the focus style */
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(244, 91, 105, 0.2);
}

/* * The magic part: We use the ::after pseudo-element on the PARENT 
 * to create the custom arrow. But first, let's make the parent a positioning context.
*/
.input-group {
    position: relative;
}

/* Create the custom arrow */
.input-group select+ ::after {
    content: '';
    position: absolute;
    top: 55%;
    /* Vertically center relative to the input height */
    right: 15px;
    width: 10px;
    height: 10px;
    /* An embedded SVG for a sharp, scalable arrow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23555555'%3E%3Cpath d='M8 11.293l-4.646-4.647a.5.5 0 0 1 .708-.708L8 9.879l4.94-4.94a.5.5 0 0 1 .707.707L8 11.293z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    /* Allows clicks to go "through" to the select element */
    transition: transform 0.3s ease;
}

/* Optional: Rotate the arrow when the dropdown is open (works in some browsers) */
.input-group select:focus+ ::after {
    transform: rotate(180deg);
}

/* Custom Animated Button */
.btn-login {
    background-image: linear-gradient(135deg, var(--primary-color), var(--primary-color-darker));
    color: var(--white-color);
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-family: var(--font-family);
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(244, 91, 105, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-login:hover {
    transform: translateY(-4px);
    /* A more noticeable lift */
    box-shadow: 0 8px 20px rgba(244, 91, 105, 0.4);
}

.btn-login:active {
    transform: translateY(-1px);
    /* A subtle press down effect */
    box-shadow: 0 2px 5px rgba(244, 91, 105, 0.3);
}

/* A utility class to make an element span the full width of the grid */
.grid-full-width {
    grid-column: 1 / -1;
    /* Span from the first grid line to the last one */
}

/* Minor adjustment for consistency */
.validation-warning {
    color: #D8000C;
    font-size: 0.85rem;
    padding-top: 5px;
}

/* ------------------------------ */
/* 6. Footer
/* ------------------------------ */
.main-footer {
    background-color: #333;
    color: var(--white-color);
    text-align: center;
    padding: 15px;
    font-size: 0.9rem;
    margin-top: auto;
    /* Pushes footer to the bottom of the page */
}

/* ----------------------------- */
/* Error Text Styles */
/* ----------------------------- */
/* Style for the custom error message text */
.error-text {
    color: #D8000C;
    /* A strong red for errors */
    font-size: 0.85rem;
    padding-top: 5px;
    display: none;
    /* Hidden by default */
}

/* Style for an input field when it has an error */
/* Style for an input field when it has an error */
.input-group input.is-invalid,
.input-group select.is-invalid {
    border-color: #D8000C !important;
    background-color: #fff6f6 !important;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.details-card {
    background-color: #fff;
    border: 1px solid #eee;
    border-left: 5px solid var(--primary-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/*
 * ===================================
 * NEW: Modal and Utility Styling
 * ===================================
 */

/* The hidden utility class */
.hidden {
    display: none !important;
}

/* The semi-transparent background overlay for the modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
}

/* Specific styles for staff edit modal */
#staff_edit_modal {
    padding: 10px;
}

#edit_modal_body {
    padding: 10px;
}

#edit_modal_body .details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

#edit_modal_body .input-group {
    margin-bottom: 10px;
}

#edit_modal_body h4 {
    margin-top: 20px;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

#edit_modal_body .current-doc-link {
    font-size: 0.85rem;
    margin-bottom: 5px;
    color: #555;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid #ddd;
    width: 90%;
    max-width: 950px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.4s ease-out;
    max-height: 85vh;
    overflow-y: auto;
}

/* The close button (X) */
.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #888;
    cursor: pointer;
    line-height: 1;
}

.modal-close-btn:hover {
    color: #000;
}

.modal-section-title {
    margin-top: 30px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 500;
}


.modal-main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    /* Text details take 2/3, images take 1/3 */
    gap: 20px;
    align-items: flex-start;
}

.modal-text-details p {
    margin: 0 0 10px 0;
}

.modal-text-details strong {
    color: #333;
}

.modal-profile-images {
    text-align: center;
}

.modal-profile-images label {
    font-weight: 500;
    font-size: 0.9rem;
    color: #555;
    display: block;
    margin-bottom: 5px;
}

.modal-text-details p {
    margin: 0 0 10px 0;
}

.modal-text-details strong {
    color: #333;
}


.modal-docs-grid {
    display: grid;
    /* Creates a responsive grid with 2 or 3 columns depending on space */
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.modal-top-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 15px;
    margin-bottom: 20px;
}

.modal-profile-img {
    display: block;
    width: 150px !important;
    height: 200px !important;
    object-fit: cover;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin: 0 auto;
}

.modal-doc-item {
    background-color: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.modal-doc-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.modal-doc-item label {
    font-weight: 500;
    font-size: 0.9rem;
    color: #333;
    display: block;
    margin-bottom: 10px;
}

.modal-signature-img {
    height: 120px;
    /* Make signature shorter */
    background-color: #fdfdfd;
    object-fit: contain;
    /* Use contain for signatures so nothing is cut off */
    padding: 10px;
}

.modal-doc-img,
.modal-profile-img,
.modal-signature-img {
    width: 100%;
    height: 180px;
    /* Give documents a fixed height */
    border-radius: 6px;
    border: 1px solid #ccc;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    object-fit: cover;
    /* Important: prevents images from stretching */
}

.modal-doc-img:hover,
.modal-profile-img:hover,
.modal-signature-img:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Add this to style the action buttons at the bottom of the modal */
.modal-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    /* Aligns buttons to the right */
    gap: 10px;
}

/* Styling for the status tags in the staff table */
.status-pending {
    color: #f0ad4e;
    font-weight: bold;
}

.status-approved {
    color: #5cb85c;
    font-weight: bold;
}

.status-rejected {
    color: #d9534f;
    font-weight: bold;
}

/*
 * ===================================
 * NEW: Staff Approval Page Styling
 * ===================================
 */

/* Tab container styling */
.tab-container {
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
}

.tab-link {
    padding: 10px 20px;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    color: #555;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    margin-bottom: -2px;
    /* Aligns the bottom border with the container's border */
}

.tab-link:hover {
    background-color: #f7f7f7;
}

.tab-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Tab content styling */
.tab-content {
    display: none;
    /* Hide tabs by default */
}

.tab-content.active {
    display: block;
    /* Show the active tab */
    animation: fadeInUp 0.5s ease-out;
    /* Add a nice fade-in effect */
}

/* Icon button styling */
.btn-action {
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 5px;
    margin: 0 3px;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    line-height: 1;
    transition: all 0.2s ease;
}

.btn-action.approve {
    background-color: #5cb85c;
    /* Green */
}

.btn-action.approve:hover {
    background-color: #4cae4c;
    transform: scale(1.1);
}

.btn-action.reject {
    background-color: #d9534f;
    /* Red */
}

.btn-action.reject:hover {
    background-color: #c9302c;
    transform: scale(1.1);
}

.btn-action.view {
    background-color: #5bc0de;
    /* A nice info blue */
    color: white;
    padding: 6px 12px;
    font-size: 0.9rem;
    font-weight: normal;
}

.btn-action.view:hover {
    background-color: #31b0d5;
}

.btn-action.print {
    background-color: #6c757d;
    /* A gray color for print */
    color: white;
    padding: 6px 12px;
    font-size: 0.9rem;
    font-weight: normal;
}

.btn-action.print:hover {
    background-color: #5a6268;
}

.btn-action.edit {
    background-color: #f0ad4e;
    /* A standard warning/edit orange */
    color: white;
    padding: 6px 12px;
    font-size: 0.9rem;
    font-weight: normal;
}

.btn-action.edit:hover {
    background-color: #ec971f;
}

.btn-action.terminate {
    background-color: #777;
    /* A neutral grey color */
    font-weight: bold;
    color: white;
    font-size: 1rem;
    /* Ensure the icon has a size */
}

.btn-action.terminate:hover {
    background-color: #555;
    transform: scale(1.1);
}

.btn-action.link {
    background-color: #17a2b8;
    /* A teal/info color */
}

.btn-action.link:hover {
    background-color: #138496;
    transform: scale(1.1);
}

/*
 * ===================================
 * NEW: Admin Panel Accordion Styling
 * ===================================
 */
.admin-accordion .accordion-item {
    background-color: #fff;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.accordion-header {
    background-color: #f7f7f7;
    width: 100%;
    border: none;
    text-align: left;
    padding: 15px 20px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    position: relative;
    border-radius: 8px;
}

.accordion-header:hover {
    background-color: #e9e9e9;
}

.accordion-header.active {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.accordion-header::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--primary-color);
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
}

.accordion-header.active::after {
    content: '−';
    transform: translateY(-50%) rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: auto;
    transition: max-height 0.4s ease-out;
}

.accordion-body {
    padding: 20px;
    border-top: 1px solid #ddd;
}

/*
 * ===================================
 * FINAL Polished & Animated Navbar
 * ===================================
 */

/* Users Data Summary Styles */
.users-data-summary {
    padding: 15px;
    max-height: 70vh;
    overflow-y: auto;
}

.users-data-summary h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.users-data-summary h4 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #2c3e50;
    border-left: 3px solid #3498db;
    padding-left: 10px;
}

.users-data-summary ul {
    list-style-type: none;
    padding-left: 15px;
    margin-bottom: 15px;
}

.users-data-summary ul li {
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

.users-data-summary .data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.users-data-summary .data-table th,
.users-data-summary .data-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.users-data-summary .data-table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.users-data-summary .data-table tr:hover {
    background-color: #f9f9f9;
}

.users-data-summary .filter-controls {
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.users-data-summary .export-controls {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
    width: 100%;
}

.users-data-summary .export-controls button {
    padding: 8px 15px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.users-data-summary .export-controls button:hover {
    background-color: #2ecc71;
}

.users-data-summary .search-box {
    flex: 1 1 100%;
    margin-bottom: 10px;
}

.users-data-summary .filter-selects {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.users-data-summary .filter-selects select {
    flex: 1;
    min-width: 150px;
}

.users-data-summary input[type="text"],
.users-data-summary select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.users-data-summary input[type="text"]:focus,
.users-data-summary select:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 3px rgba(52, 152, 219, 0.5);
}

.navbar {
    padding: 0;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

#nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.navbar-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    padding: 20px 25px;
    color: #333;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    /* Removes underlines */
    transition: color 0.3s ease;
    position: relative;
    z-index: 10;
    /* Put links on top */
}

.nav-item.active>.nav-link,
.nav-item:hover>.nav-link {
    color: var(--primary-color);
}

.hori-selector {
    display: inline-block;
    position: absolute;
    height: 100%;
    top: 0;
    left: 0;
    transition-duration: 0.5s;
    transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    background-color: var(--secondary-color);
    border-top: 3px solid var(--primary-color);
    z-index: 1;
    /* Keep selector behind links and dropdowns */
}

/* --- Dropdown Menu on Hover --- */
.dropdown-menu {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    /* Position it directly below the parent */
    left: 0;
    background-color: #fff;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    /* High z-index to appear above everything */
    min-width: 200px;
    list-style: none;
    /* This removes the bullet points */
    padding: 5px 0;
    /* Animation */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease-in-out;
}

.has-dropdown:hover>.dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    width: 100%;
    padding: 5px;
}

.dropdown-menu li a {
    width: 100%;
    padding: 10px 20px;
    white-space: nowrap;
    color: #333;
    text-decoration: none;
    /* Ensure no underline */
}

.dropdown-menu li a:hover {
    background-color: #f7f7f7;
    color: var(--primary-color);
}

/* --- User Section --- */
.navbar-user-section {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0 20px;
}

.nav-username {
    padding: 12px 16px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.nav-username:hover {
    color: var(--primary-color);
    background: linear-gradient(135deg, var(--secondary-color), #fff);
    border-color: var(--primary-color);
    box-shadow: 0 4px 8px rgba(244, 91, 105, 0.15);
    transform: translateY(-1px);
}

.nav-username i.fa-cog {
    transition: transform 0.3s ease;
}

.nav-username:hover i.fa-cog {
    transform: rotate(90deg);
}

.nav-link-logout {
    padding: 8px 18px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--white-color) !important;
    /* Ensure text is always white */
    background-color: var(--primary-color);
    border: none;
    border-radius: 6px;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
}

.nav-link-logout:hover {
    background-color: var(--primary-color-darker);
    transform: translateY(-2px);
    color: var(--white-color) !important;
}

/*
 * ===================================
 * 8. Responsive Design (Mobile First)
 * ===================================
 */

/* Apply these styles on screens with a max-width of 768px (tablets and phones) */
@media (max-width: 768px) {

    /* --- General Layout Adjustments --- */
    .main-header,
    .page-container,
    .form-container {
        padding-left: 20px;
        padding-right: 20px;
    }

    .main-header {
        flex-direction: column;
        gap: 10px;
        padding-top: 15px;
        padding-bottom: 15px;
    }

    .system-name {
        font-size: 2rem;
        /* Reduce header font size on mobile */
    }

    /* --- Form Responsiveness --- */
    .details-grid {
        /* This is the key change: switch from 3 columns to 1 column */
        grid-template-columns: 1fr;
        gap: 20px;
        /* Adjust gap for single column layout */
    }

    .login-form {
        padding: 30px 20px;
    }

    /* --- Navbar Adjustments for Mobile --- */
    /* This is a simple adjustment; a full "hamburger" menu would require more JavaScript */
    .navbar-nav {
        flex-direction: column;
        width: 100%;
    }

    .nav-item {
        text-align: center;
        border-bottom: 1px solid #f0f0f0;
    }

    .nav-item:last-child {
        border-bottom: none;
    }

    .hori-selector {
        /* Hide the sliding selector on mobile as it doesn't work well with a vertical layout */
        display: none !important;
    }

    .navbar-user-section {
        flex-direction: column;
        gap: 10px;
        padding: 10px 0;
        border-top: 1px solid #eee;
    }

    /* --- Modal Responsiveness --- */
    .modal-content {
        width: 95%;
        padding: 20px 15px;
        max-height: 80vh;
        overflow-y: auto;
    }

    #staff_edit_modal .modal-content {
        max-height: 85vh;
        overflow-y: auto;
    }

    #edit_modal_body {
        max-height: calc(85vh - 100px);
        overflow-y: auto;
    }

    /* --- Admin Panel on Mobile --- */
    .admin-container {
        gap: 40px;
    }
}

/*
 * ===================================
 * 9. Dashboard Specific Styles
 * ===================================
 */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.stat-card h2 {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 10px;
}

.stat-card p {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.dashboard-main-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
}

.dashboard-card {
    background: #fff;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.chart-container {
    position: relative;
    height: 300px;
}

#licensee_breakdown_table td,
#licensee-modal-table td,
#contract-modal-table td,
#staff-modal-table td {
    text-align: center;
    vertical-align: middle;
}

/* Styles for the licensee exploration modal */
.licensee-details-modal {
    text-align: left;
    max-height: 400px;
    overflow-y: auto;
}

.contract-group {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.contract-group h4 {
    background-color: #f7f7f7;
    padding: 8px;
    border-radius: 4px;
}

.staff-list {
    list-style-type: none;
    padding-left: 15px;
}

.staff-list li {
    padding: 4px 0;
}

/* Add responsive rules for the new dashboard grid */
@media (max-width: 992px) {
    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-card {
        grid-column: auto !important;
    }
}

/* Dashboard Table Styles */
.table-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.table-link:hover {
    color: red;
    text-decoration: underline;
}

.staff-details-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.staff-details-link:hover {
    color: var(--primary-color-darker);
    text-decoration: underline;
}

.staff-id-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.staff-id-link:hover {
    color: var(--primary-color-darker);
    text-decoration: underline;
}

.modal-table-container {
    margin: 20px 0;
    max-height: 60vh;
    overflow: auto;
}

/* DataTables Custom Styling */
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-color) !important;
    color: white !important;
    border: 1px solid var(--primary-color) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--secondary-color) !important;
    color: white !important;
    border: 1px solid var(--secondary-color) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 4px;
}

/* Dashboard Section Styles */
.dashboard-section table.dataTable {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
}

.dashboard-section table.dataTable thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    padding: 12px;
    border-bottom: 2px solid #dee2e6;
    text-align: center !important;
}

.dashboard-section table.dataTable tbody td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
    text-align: center;
}

.dashboard-section table.dataTable tbody tr:hover {
    background-color: #f8f9fa;
}

/* Responsive Table Scrolling */
.dashboard-card .dataTables_wrapper {
    overflow-x: auto;
    margin: 0 -10px;
    padding: 0 10px;
}

/* Status Colors */
.status-approved {
    color: #28a745;
    font-weight: 500;
}

.status-pending {
    color: #ffc107;
    font-weight: 500;
}

.status-rejected {
    color: #dc3545;
    font-weight: 500;
}

.status-terminated {
    color: #6c757d;
    font-weight: 500;
}

.status-active {
    color: #28a745;
    font-weight: 500;
}

.status-inactive {
    color: #dc3545;
    font-weight: 500;
}

/* Modal Styles */
.modal-table-container table.dataTable thead th {
    text-align: center !important;
    background-color: #f8f9fa;
    font-weight: 600;
}

.modal-table-container table.dataTable tbody td {
    text-align: center;
}

/* Status Count Styles */
.status-counts {
    display: flex;
    gap: 20px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 15px;
}

.status-count {
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 4px;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.status-count span {
    font-weight: 600;
    color: var(--primary-color);
}

/* Staff ID Link Styles */
.staff-id-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.staff-id-link:hover {
    color: red;
    text-decoration: underline;
}

/* Staff Details Page Styles */
.staff-details-container {
    max-width: 1200px;
    margin: 0 auto;
}

.details-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.details-section h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-item label {
    font-weight: 500;
    color: #666;
}

.detail-item span {
    font-size: 1.1em;
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.document-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
}

.document-item h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.document-item img {
    max-width: 200px;
    height: auto;
    border-radius: 4px;
    margin: 10px 0;
}

.document-link {
    display: inline-block;
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    margin: 10px 0;
    transition: background-color 0.2s;
}

.document-link:hover {
    background: var(--secondary-color);
}

/* --- Feature Lock Overlay --- */
.feature-locked-container {
    position: relative;
    border: 1px dashed #ddd;
    padding: 15px;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.feature-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(230, 230, 230, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 20;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border-radius: 8px;
}

.feature-lock-overlay-content {
    text-align: center;
    color: #333;
}

.feature-lock-overlay-content .lock-icon {
    font-size: 40px;
    color: #dc3545;
    margin-bottom: 10px;
}

.feature-lock-overlay-content p {
    font-size: 1rem;

    .dashboard-section table.dataTable tbody td {
        padding: 12px;
        border-bottom: 1px solid #dee2e6;
        vertical-align: middle;
        text-align: center;
    }

    .dashboard-section table.dataTable tbody tr:hover {
        background-color: #f8f9fa;
    }

    /* Responsive Table Scrolling */
    .dashboard-card .dataTables_wrapper {
        overflow-x: auto;
        margin: 0 -10px;
        padding: 0 10px;
    }

    /* Status Colors */
    .status-approved {
        color: #28a745;
        font-weight: 500;
    }

    .status-pending {
        color: #ffc107;
        font-weight: 500;
    }

    .status-rejected {
        color: #dc3545;
        font-weight: 500;
    }

    .status-terminated {
        color: #6c757d;
        font-weight: 500;
    }

    .status-active {
        color: #28a745;
        font-weight: 500;
    }

    .status-inactive {
        color: #dc3545;
        font-weight: 500;
    }

    /* Modal Styles */
    .modal-table-container table.dataTable thead th {
        text-align: center !important;
        background-color: #f8f9fa;
        font-weight: 600;
    }

    .modal-table-container table.dataTable tbody td {
        text-align: center;
    }

    /* Status Count Styles */
    .status-counts {
        display: flex;
        gap: 20px;
        padding: 10px;
        background-color: #f8f9fa;
        border-radius: 4px;
        margin-bottom: 15px;
    }

    .status-count {
        font-weight: 500;
        padding: 5px 10px;
        border-radius: 4px;
        background-color: white;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .status-count span {
        font-weight: 600;
        color: var(--primary-color);
    }

    /* Staff ID Link Styles */
    .staff-id-link {
        color: var(--primary-color);
        text-decoration: none;
        font-weight: 500;
        transition: color 0.2s;
    }

    .staff-id-link:hover {
        color: red;
        text-decoration: underline;
    }

    /* Staff Details Page Styles */
    .staff-details-container {
        max-width: 1200px;
        margin: 0 auto;
    }

    .details-section {
        background: white;
        border-radius: 8px;
        padding: 20px;
        margin-bottom: 20px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .details-section h2 {
        color: var(--primary-color);
        margin-bottom: 15px;
        padding-bottom: 10px;
        border-bottom: 1px solid #eee;
    }

    .details-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }

    .detail-item {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    .detail-item label {
        font-weight: 500;
        color: #666;
    }

    .detail-item span {
        font-size: 1.1em;
    }

    .documents-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 20px;
    }

    .document-item {
        background: #f8f9fa;
        padding: 15px;
        border-radius: 6px;
        text-align: center;
    }

    .document-item h3 {
        margin-bottom: 10px;
        color: var(--primary-color);
    }

    .document-item img {
        max-width: 200px;
        height: auto;
        border-radius: 4px;
        margin: 10px 0;
    }

    .document-link {
        display: inline-block;
        padding: 8px 16px;
        background: var(--primary-color);
        color: white;
        text-decoration: none;
        border-radius: 4px;
        margin: 10px 0;
        transition: background-color 0.2s;
    }

    .document-link:hover {
        background: var(--secondary-color);
    }

    /* --- Feature Lock Overlay --- */
    .feature-locked-container {
        position: relative;
        border: 1px dashed #ddd;
        padding: 15px;
        border-radius: 8px;
        background-color: #f9f9f9;
    }

    .feature-lock-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(230, 230, 230, 0.5);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 20;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        border-radius: 8px;
    }

    .feature-lock-overlay-content {
        text-align: center;
        color: #333;
    }

    .feature-lock-overlay-content .lock-icon {
        font-size: 40px;
        color: #dc3545;
        margin-bottom: 10px;
    }

    .feature-lock-overlay-content p {
        font-size: 1rem;
        font-weight: 500;
        margin: 0;
    }

    /* Adjustments for buttons inside locked container */
}

.dashboard-section table.dataTable tbody tr:hover {
    background-color: #f8f9fa;
}

/* Responsive Table Scrolling */
.dashboard-card .dataTables_wrapper {
    overflow-x: auto;
    margin: 0 -10px;
    padding: 0 10px;
}

/* Status Colors */
.status-approved {
    color: #28a745;
    font-weight: 500;
}

.status-pending {
    color: #ffc107;
    font-weight: 500;
}

.status-rejected {
    color: #dc3545;
    font-weight: 500;
}

.status-terminated {
    color: #6c757d;
    font-weight: 500;
}

.status-active {
    color: #28a745;
    font-weight: 500;
}

.status-inactive {
    color: #dc3545;
    font-weight: 500;
}

/* Modal Styles */
.modal-table-container table.dataTable thead th {
    text-align: center !important;
    background-color: #f8f9fa;
    font-weight: 600;
}

.modal-table-container table.dataTable tbody td {
    text-align: center;
}

/* Status Count Styles */
.status-counts {
    display: flex;
    gap: 20px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 15px;
}

.status-count {
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 4px;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.status-count span {
    font-weight: 600;
    color: var(--primary-color);
}

/* Staff ID Link Styles */
.staff-id-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.staff-id-link:hover {
    color: red;
    text-decoration: underline;
}

/* Staff Details Page Styles */
.staff-details-container {
    max-width: 1200px;
    margin: 0 auto;
}

.details-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.details-section h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-item label {
    font-weight: 500;
    color: #666;
}

.detail-item span {
    font-size: 1.1em;
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.document-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
}

.document-item h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.document-item img {
    max-width: 200px;
    height: auto;
    border-radius: 4px;
    margin: 10px 0;
}

.document-link {
    display: inline-block;
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    margin: 10px 0;
    transition: background-color 0.2s;
}

.document-link:hover {
    background: var(--secondary-color);
}

/* --- Feature Lock Overlay --- */
.feature-locked-container {
    position: relative;
    border: 1px dashed #ddd;
    padding: 15px;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.feature-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(230, 230, 230, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 20;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border-radius: 8px;
}

.feature-lock-overlay-content {
    text-align: center;
    color: #333;
}

.feature-lock-overlay-content .lock-icon {
    font-size: 40px;
    color: #dc3545;
    margin-bottom: 10px;
}

.feature-lock-overlay-content p {
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
}

/* Adjustments for buttons inside locked container */
.status-rejected {
    color: #dc3545;
    font-weight: 500;
}

.status-terminated {
    color: #6c757d;
    font-weight: 500;
}

.status-active {
    color: #28a745;
    font-weight: 500;
}

.status-inactive {
    color: #dc3545;
    font-weight: 500;
}

/* Modal Styles */
.modal-table-container table.dataTable thead th {
    text-align: center !important;
    background-color: #f8f9fa;
    font-weight: 600;
}

.modal-table-container table.dataTable tbody td {
    text-align: center;
}

/* Status Count Styles */
.status-counts {
    display: flex;
    gap: 20px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 15px;
}

.status-count {
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 4px;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.status-count span {
    font-weight: 600;
    color: var(--primary-color);
}

/* Staff ID Link Styles */
.staff-id-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.staff-id-link:hover {
    color: red;
    text-decoration: underline;
}

/* Staff Details Page Styles */
.staff-details-container {
    max-width: 1200px;
    margin: 0 auto;
}

.details-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.details-section h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-item label {
    font-weight: 500;
    color: #666;
}

.detail-item span {
    font-size: 1.1em;
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.document-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
}

.document-item h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.document-item img {
    max-width: 200px;
    height: auto;
    border-radius: 4px;
    margin: 10px 0;
}

.document-link {
    display: inline-block;
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    margin: 10px 0;
    transition: background-color 0.2s;
}

.document-link:hover {
    background: var(--secondary-color);
}

/* --- Feature Lock Overlay --- */
.feature-locked-container {
    position: relative;
    border: 1px dashed #ddd;
    padding: 15px;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.feature-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(230, 230, 230, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 20;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border-radius: 8px;
}

.feature-lock-overlay-content {
    text-align: center;
    color: #333;
}

.feature-lock-overlay-content .lock-icon {
    font-size: 40px;
    color: #dc3545;
    margin-bottom: 10px;
}

.feature-lock-overlay-content p {
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
}

/* Adjustments for buttons inside locked container */
.feature-locked-container .btn-action {
    opacity: 0.5;
    pointer-events: none;
}

/*
 * ===================================
 * Select2 Customization
 * ===================================
 */

/* Match Select2 container to system inputs */
.select2-container--default .select2-selection--single {
    height: 50px !important;
    padding: 0 15px !important;
    /* Remove vertical padding, let flexbox center */
    font-size: 1rem;
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: #fdfdfd;
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    transition: all 0.3s ease;
    display: flex !important;
    align-items: center !important;
    box-sizing: border-box;
    position: relative;
}

/* Focus state */
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default .select2-selection--single:focus {
    outline: none;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(244, 91, 105, 0.2);
}

/* Arrow adjustment */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
    top: 0 !important;
    right: 15px !important;
    width: 20px !important;
    position: absolute !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hide the custom system arrow if it's appearing on the Select2 container */
.input-group select+.select2+ ::after,
.input-group select.select2-hidden-accessible+.select2+ ::after,
.input-group .select2-container+ ::after {
    display: none !important;
}

.input-group:has(.select2-container) ::after {
    display: none !important;
}

/* Rendered text adjustment */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-left: 0 !important;
    padding-right: 30px !important;
    color: var(--text-color) !important;
    line-height: normal !important;
    /* Reset line-height */
    margin: 0 !important;
    /* Remove margins */
    width: 100%;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Placeholder color */
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #999;
}

/* Clear button adjustment */
.select2-container--default .select2-selection--single .select2-selection__clear {
    margin-right: 10px !important;
    height: 100%;
    display: flex;
    align-items: center;
    color: #999;
    font-size: 1.2rem;
    position: relative;
    z-index: 2;
}

/* Dropdown styling */
.select2-dropdown {
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
}

.select2-results__option {
    padding: 10px 15px !important;
    font-family: var(--font-family);
    font-size: 0.95rem;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary-color) !important;
    color: white !important;
}

/* Fix for multiple select */
.select2-container--default .select2-selection--multiple {
    min-height: 50px !important;
    padding: 5px 15px !important;
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    background-color: #fdfdfd;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(244, 91, 105, 0.2);
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #eee !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    padding: 4px 10px !important;
    margin: 2px 5px 2px 0 !important;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    margin-right: 5px !important;
    color: #666 !important;
    font-weight: bold;
    border: none !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #333 !important;
    background: none !important;
}

/*
 * ===================================
 * Enhanced Contract Selector Styling
 * ===================================
 */

/* Enhanced container for contract selector */
.contract-selector-container .select2-selection--single {
    height: 60px !important;
    /* Larger search box */
    padding: 0 20px !important;
    font-size: 1.1rem !important;
    border: 2px solid #ddd !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, #ffffff, #f8f9fa) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced focus state */
.contract-selector-container.select2-container--open .select2-selection--single,
.contract-selector-container .select2-selection--single:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 4px rgba(244, 91, 105, 0.15), 0 4px 12px rgba(244, 91, 105, 0.2) !important;
    background: #ffffff !important;
    transform: translateY(-2px);
}

/* Enhanced rendered text */
.contract-selector-container .select2-selection__rendered {
    font-weight: 500 !important;
    font-size: 1.1rem !important;
    color: var(--text-color) !important;
}

/* Enhanced placeholder */
.contract-selector-container .select2-selection__placeholder {
    color: #999 !important;
    font-weight: 400 !important;
    font-style: italic;
}

/* Enhanced arrow */
.contract-selector-container .select2-selection__arrow b {
    border-color: var(--primary-color) transparent transparent transparent !important;
    border-width: 6px 6px 0 6px !important;
}

.contract-selector-container.select2-container--open .select2-selection__arrow b {
    border-color: transparent transparent var(--primary-color) transparent !important;
    border-width: 0 6px 6px 6px !important;
}

/* Enhanced clear button */
.contract-selector-container .select2-selection__clear {
    font-size: 1.4rem !important;
    color: var(--primary-color) !important;
    margin-right: 15px !important;
    transition: transform 0.2s ease;
}

.contract-selector-container .select2-selection__clear:hover {
    transform: scale(1.2);
    color: var(--primary-color-darker) !important;
}

/* Enhanced dropdown */
.contract-selector-dropdown {
    border: 2px solid var(--primary-color) !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 24px rgba(244, 91, 105, 0.2) !important;
    margin-top: 8px !important;
    min-width: 500px !important;
    /* Better dropdown width */
}

/* Enhanced search box in dropdown */
.contract-selector-dropdown .select2-search--dropdown {
    padding: 12px 15px !important;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-bottom: 2px solid var(--primary-color);
}

.contract-selector-dropdown .select2-search__field {
    height: 45px !important;
    /* Larger search input */
    padding: 10px 15px !important;
    font-size: 1rem !important;
    border: 2px solid #ddd !important;
    border-radius: 6px !important;
    font-family: var(--font-family) !important;
    transition: all 0.3s ease;
}

.contract-selector-dropdown .select2-search__field:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(244, 91, 105, 0.15) !important;
    outline: none !important;
}

/* Enhanced results container */
.contract-selector-dropdown .select2-results {
    max-height: 400px !important;
    padding: 8px 0 !important;
}

/* Enhanced result options */
.contract-selector-dropdown .select2-results__option {
    padding: 14px 20px !important;
    /* Larger option padding */
    font-size: 1rem !important;
    font-weight: 500 !important;
    color: var(--text-color) !important;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
    cursor: pointer;
}

/* Better highlighting - Maximum specificity for white text */
.select2-dropdown.contract-selector-dropdown .select2-results__option--highlighted,
.select2-dropdown.contract-selector-dropdown .select2-results__option--highlighted[aria-selected],
.select2-dropdown.contract-selector-dropdown .select2-results__option--highlighted[aria-selected="true"],
.select2-dropdown.contract-selector-dropdown .select2-results__option--highlighted[aria-selected="false"],
.select2-container--default .select2-dropdown.contract-selector-dropdown .select2-results__option--highlighted,
.select2-container--default .select2-results__option.select2-results__option--highlighted.select2-results__option,
body .select2-dropdown.contract-selector-dropdown .select2-results__option--highlighted {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-darker)) !important;
    color: #ffffff !important;
    transform: translateX(5px);
    border-left: 4px solid var(--primary-color-darker);
    box-shadow: 0 2px 8px rgba(244, 91, 105, 0.3);
}

/* Force white text on highlighted options - Ultimate override */
.select2-dropdown.contract-selector-dropdown .select2-results__option--highlighted,
.select2-dropdown.contract-selector-dropdown .select2-results__option--highlighted * {
    color: #ffffff !important;
}

/* Override any aria-selected state on highlighted items */
.select2-dropdown.contract-selector-dropdown .select2-results__option--highlighted[aria-selected] {
    color: #ffffff !important;
}

/* Selected option styling */
.contract-selector-dropdown .select2-results__option[aria-selected="true"] {
    background-color: var(--secondary-color) !important;
    color: var(--primary-color) !important;
    font-weight: 600 !important;
}

.contract-selector-dropdown .select2-results__option[aria-selected="true"]:not(.select2-results__option--highlighted) {
    position: relative;
}

.contract-selector-dropdown .select2-results__option[aria-selected="true"]:not(.select2-results__option--highlighted)::before {
    content: '\2713';
    /* Checkmark */
    position: absolute;
    right: 20px;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.2rem;
}

/* Loading state */
.contract-selector-dropdown .select2-results__option.loading-results {
    color: #999 !important;
    font-style: italic;
}

/* No results message */
.contract-selector-dropdown .select2-results__message {
    padding: 20px !important;
    text-align: center;
    color: #999 !important;
    font-style: italic;
}

/* Responsive adjustments for contract selector */
@media (max-width: 768px) {
    .contract-selector-container .select2-selection--single {
        height: 55px !important;
        font-size: 1rem !important;
    }

    .contract-selector-dropdown {
        min-width: 100% !important;
    }

    .contract-selector-dropdown .select2-results__option {
        padding: 12px 15px !important;
        font-size: 0.95rem !important;
    }
}