* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    line-height: 1.6;
    background-color: #f8f9fa;
    color: #343a40;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3 {
    margin-bottom: 0.75em;
    color: #0056b3;
}

main.content-area h2 { /* Main page title */
    font-size: 1.4em;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.3em;
    margin-bottom: 1.5rem; /* Increase space below main title */
}

main.content-area h3 { /* Sub-section titles (like Existing Files) */
    font-size: 1.2em;
    color: #495057; /* Slightly less prominent color */
    border-bottom: 1px solid #eee;
    padding-bottom: 0.2em;
    margin-top: 1.5rem; /* Add space above sub-titles */
    margin-bottom: 1rem;
}


a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.main-header {
    background-color: #e9ecef;
    padding: 0.5rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 45px;
}

.main-footer {
    background-color: #e9ecef;
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
    margin-top: auto;
    text-align: center;
    font-size: 0.9em;
    color: #6c757d;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
}

.header-actions span {
    font-weight: 500;
    color: #495057;
}

main.content-area {
    padding: 1.5rem;
    flex-grow: 1;
}

nav.main-nav {
    background-color: #ffffff;
    padding: 0.5rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* --- UPDATED/GENERALIZED Desktop Navigation Level Styling --- */
div[class^="nav-level-"] {
    display: flex;
    flex-wrap: wrap;
    gap: 5px; /* This provides the spacing between buttons */
    padding: 5px 0;
    /* Add border between levels, except for the first one */
    border-top: 1px dashed #e0e0e0;
    margin-top: 5px;
    padding-top: 10px;
}

/* Remove top border/margin for the very first level (level 0) */
.nav-level-0 {
    border-top: none;
    margin-top: 0;
    padding-top: 5px; /* Keep original padding */
}
/* --- End of Updated Desktop Navigation Level Styling --- */


form.nav-form {
    display: inline-block;
    margin: 0;
}

.button,
button {
    display: inline-block;
    padding: 8px 15px;
    font-size: 0.95em;
    font-weight: 500;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 4px;
    background-color: #6c757d;
    color: #ffffff;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    white-space: nowrap;
}

button:hover {
    opacity: 0.9;
}

.button-primary,
button[type="submit"] {
    background-color: #007bff;
    border-color: #007bff;
}

.button-primary:hover,
button[type="submit"]:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.nav-button {
    background-color: #007bff;
    color: #ffffff;
    border-color: #007bff;
    padding: 6px 12px;
    font-size: 0.9em;
}

.nav-button:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    color: #ffffff;
    opacity: 1;
}

.nav-button.nav-button-active {
    background-color: #0056b3;
    border-color: #0056b3;
    color: #ffffff;
    font-weight: bold;
    cursor: default;
}

.nav-button.nav-button-active:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.logout-button {
    background-color: #dc3545;
    border-color: #dc3545;
    padding: 5px 10px;
    font-size: 0.9em;
}

.logout-button:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.login-container {
    max-width: 400px;
    margin: 3rem auto;
    padding: 2rem;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-form h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #0056b3;
    font-size: 1.25em;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* --- Updated Input Styling (Including input[list]) --- */
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[list], /* <<< ADDED input[list] HERE */
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    background-color: #fff;
    color: #495057;
    line-height: inherit; /* Ensure line height matches text */
    /* Required for number spinner hiding */
    -moz-appearance: textfield; /* Firefox - Note: This might affect time input appearance too */
}

/* Hide number input spinners */
.form-group input[type="number"]::-webkit-outer-spin-button,
.form-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0; /* Optional: Adjust if needed */
}
/* --- End of Updated Input Styling --- */

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 5px;
    vertical-align: middle;
    padding: initial; /* Reset padding for checkbox */
    border: initial; /* Reset border */
    border-radius: initial;
    /* Reset appearance for checkbox */
    -moz-appearance: checkbox;
    -webkit-appearance: checkbox;
    appearance: checkbox;
}


.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.login-error {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    text-align: center;
}

p.error {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.mobile-nav-toggle {
    display: none;
    padding: 0.5rem 1.5rem;
    text-align: right;
    background-color: #e9ecef;
    border-bottom: 1px solid #dee2e6;
}

.mobile-nav-toggle button.mobile-menu-button {
    background-color: #007bff;
    border-color: #007bff;
    padding: 5px 10px;
}

form.mobile-action-form {
    display: inline-block;
    margin: 0;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    z-index: 1000;
    overflow-y: auto;
    padding: 1rem;
    flex-direction: column;
}

.mobile-menu.mobile-menu-visible {
    display: flex;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 1rem;
}

.mobile-menu-header span {
    font-size: 1.2em;
    font-weight: bold;
    color: #0056b3;
}

.mobile-menu-close-button {
    background-color: #6c757d;
    border-color: #6c757d;
    padding: 5px 10px;
}

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    gap: 10px; /* Spacing for mobile buttons */
}

.mobile-menu-content form.nav-form,
.mobile-menu-content form.mobile-action-form {
    display: block;
    margin: 0;
}

.mobile-menu-content .nav-button,
.mobile-menu-content form.mobile-action-form button {
    width: 100%;
    text-align: left;
    padding: 12px 15px;
    font-size: 1em;
}

/* Style mobile buttons consistently */
.mobile-menu-content .nav-button,
.mobile-menu-content form.mobile-action-form button {
    background-color: #007bff;
    color: #ffffff;
    border-color: #007bff;
}
.mobile-menu-content .nav-button:hover,
.mobile-menu-content form.mobile-action-form button:hover {
     background-color: #0056b3;
     border-color: #0056b3;
}

/* Active state highlighting for mobile */
.mobile-menu-content .nav-button.nav-button-active,
.mobile-menu-content form.mobile-action-form button.nav-button-active {
    background-color: #0056b3;
    border-color: #0056b3;
    font-weight: bold;
    cursor: default;
}
.mobile-menu-content .nav-button.nav-button-active:hover,
.mobile-menu-content form.mobile-action-form button.nav-button-active:hover {
     background-color: #0056b3; /* Keep active color on hover */
}

/* --- General Page Actions --- */
.page-actions {
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.page-actions form {
    display: inline-block;
    margin: 0;
}
/* --- Style for search input within page actions --- */
.page-actions form input[type="text"] {
    padding: 6px 10px;
    font-size: 0.9em;
    border: 1px solid #ccc;
    border-radius: 4px;
    vertical-align: middle;
    min-width: 200px;
}
.page-actions .button {
    padding: 7px 12px;
    vertical-align: middle;
}
/* --- Make Add button align right by default --- */
.page-actions .add-new-button-form {
    margin-left: auto;
}


/* --- Data Table Styling --- */
.desktop-table-container {
    display: none;
    overflow-x: auto;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    background-color: #fff;
    border: 1px solid #dee2e6;
}
.data-table th,
.data-table td {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    text-align: left;
    vertical-align: top;
}
.data-table thead th {
    background-color: #e9ecef;
    font-weight: 600;
    white-space: nowrap;
    position: relative;
}
.data-table tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}
.data-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.data-table.compact th,
.data-table.compact td {
    padding: 0.4rem 0.5rem;
    font-size: 0.9em;
}

.data-table .col-comment {
    white-space: normal;
    word-wrap: break-word;
    max-width: 300px;
    min-width: 150px;
}
.data-table .col-actions {
    width: 150px;
    text-align: center;
    white-space: nowrap;
}

/* --- Truncation utility classes --- */
.filename-truncate {
    display: inline-block;
    max-width: 150px; /* Adjust as needed */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.title-truncate {
    display: inline-block;
    max-width: 180px; /* Adjust as needed, consistent with inline style */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.comment-truncate { /* Multi-line truncation example, if needed elsewhere */
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Number of lines to show */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 4.2em; /* line-height * number of lines (e.g., 1.4em * 3) */
    line-height: 1.4em;
    /* Note: .comment-truncate in PHP inline style is different (block, max-width, word-wrap)
       This global one is for multi-line ellipsis. Choose based on desired global behavior.
       The inline style in PHP will override this for that specific page's table.
       If the PHP's comment-truncate is preferred globally, use that definition here.
    */
}


/* --- Table Header Sorting Styles --- */
th.sortable-header {
    cursor: pointer;
}
th.sortable-header form.sort-form {
    display: inline;
    margin: 0;
    padding: 0;
}
/* Style removed for .header-sort-button as it wasn't used */
/* --- END Table Header Sorting Styles --- */


.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: stretch;
}
.action-buttons form {
    display: block;
}
.action-buttons .button {
    width: 100%;
    text-align: center;
    padding: 4px 8px;
    font-size: 0.85em;
}
.button-small {
     padding: 4px 8px;
     font-size: 0.85em;
}

.button-danger {
     background-color: #dc3545;
     border-color: #dc3545;
}
.button-danger:hover {
     background-color: #c82333;
     border-color: #bd2130;
}


/* --- Mobile Card Styling --- */
.mobile-card-container {
    display: none;
}
.card {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.card-header {
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-size: 1.1em;
    font-weight: 500;
    word-break: break-word;
}
.card-content {
    padding: 1rem;
}
.card-field {
    margin-bottom: 0.5rem;
    font-size: 0.95em;
    word-wrap: break-word;
}
.card-field strong {
    color: #495057;
    display: block;
    margin-bottom: 2px;
    font-weight: 600;
}
.card-actions {
    padding: 0.75rem 1rem;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
}
.card-actions .action-buttons {
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}
.card-actions .action-buttons .button {
    width: auto;
}


/* --- Responsive Display --- */
@media (max-width: 768px) {
    .desktop-table-container {
        display: none;
    }
    .mobile-card-container {
        display: block;
    }
    .page-actions {
        /* Keep space-between, let flex-wrap handle stacking */
    }
     /* --- Adjust page actions for mobile --- */
    .page-actions form {
        flex-grow: 1;
    }
    .page-actions form input[type="text"] {
        width: 100%;
        margin-bottom: 5px;
    }
    .page-actions .button {
         flex-grow: 1;
         text-align: center;
    }
    .page-actions .add-new-button-form {
         margin-left: 0;
         width: 100%;
         order: 1;
    }
    .page-actions form:not(.add-new-button-form) {
         width: 100%;
         margin-bottom: 5px;
    }

    nav.main-nav {
         display: none;
    }
    .mobile-nav-toggle {
        display: block;
    }
    .header-actions span {
        display: none;
    }
    .login-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    main.content-area {
        padding: 1rem;
    }
    .page-actions {
         margin-bottom: 1rem;
    }
}

@media (min-width: 769px) {
    .desktop-table-container {
        display: block;
    }
    .mobile-card-container {
        display: none;
    }
    .mobile-nav-toggle {
        display: none;
    }
}

/* --- Form Styling --- */
.form-container {
    background-color: #fff;
    padding: 1.5rem;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    margin-bottom: 1.5rem;
    max-width: 800px;
}
.form-container h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
    font-size: 1.2em;
}

.form-group-checkbox label {
    display: inline-block;
    margin-bottom: 0;
    margin-left: 5px;
    font-weight: normal;
    vertical-align: middle;
}
.form-group-checkbox input[type="checkbox"] {
     width: auto;
     vertical-align: middle;
}

/* --- Feedback Messages --- */
.feedback-message {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 4px;
}
.feedback-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}
.feedback-error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}
.feedback-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}


/* --- Required Field Indicator --- */
.required {
    color: #dc3545;
    margin-left: 2px;
    font-weight: bold;
}

/* --- Confirmation Message --- */
.confirmation-message {
    margin-bottom: 1.5rem;
    font-weight: bold;
    color: #555;
    padding: 1rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

/* --- Active Filters Display --- */
.active-filters-display {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background-color: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.9em;
    color: #495057;
}
.active-filters-display strong {
    color: #343a40;
    margin-right: 5px;
}


/* --- Notification Messages --- */

.notification-container {
    position: fixed;
    top: 60px;
    right: 20px;
    max-width: 350px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    width: 300px;
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.16);
    background-color: white;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.notification-content {
    flex: 1;
    padding-right: 10px;
    word-wrap: break-word;
}

.notification form.notification-dismiss {
    margin: 0;
    padding: 0;
}
.notification form.notification-dismiss button {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 1.4em;
    font-weight: bold;
    line-height: 1;
    padding: 0 0 0 5px;
    cursor: pointer;
    opacity: 0.7;
}
.notification form.notification-dismiss button:hover {
    opacity: 1;
    color: #343a40;
}

.notification-error { border-left: 12px solid #dc3545; }
.notification-warning { border-left: 12px solid #ffc107; }
.notification-info { border-left: 12px solid #007bff; }


/* --- Pagination --- */
.pagination {
    margin-top: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}
.pagination button.button,
.pagination span {
    margin: 0 3px;
    padding: 6px 12px;
    font-size: 0.9em;
}
.pagination span {
    color: #6c757d;
    background-color: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    display: inline-block;
}
.pagination form {
    display: inline;
    margin: 0;
}


/* --- Company Assignment Form Styles --- */
.assignment-form-container .form-group {
    margin-bottom: 1.5rem;
}
.assignment-search-group {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}
.assignment-search-group label {
    flex-basis: 100%;
    margin-bottom: 0.3rem;
}
.assignment-search-group input[list] {
    flex-grow: 1;
    min-width: 200px;
}
ul.assignment-list {
    list-style: none;
    padding: 0;
    margin-top: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    min-height: 50px;
    max-height: 250px;
    overflow-y: auto;
    background-color: #f8f9fa;
}
ul.assignment-list li {
    padding: 8px 12px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
ul.assignment-list li:last-child {
    border-bottom: none;
}
ul.assignment-list li.no-assignments {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 15px;
}
button.remove-assignment-button {
    background: none;
    border: none;
    color: #adb5bd;
    font-size: 1.1em;
    font-weight: bold;
    line-height: 1;
    padding: 0 5px;
    margin-left: 10px;
    cursor: pointer;
    opacity: 0.6;
    transition: color 0.15s ease-in-out, opacity 0.15s ease-in-out;
}
button.remove-assignment-button:hover {
    opacity: 1;
    color: #dc3545;
}
.assignment-feedback-inline {
    font-size: 0.9em;
    margin-left: 10px;
    padding: 2px 5px;
    border-radius: 3px;
}
.assignment-feedback-inline.success {
    color: #155724;
    background-color: #d4edda;
}
.assignment-feedback-inline.error {
    color: #721c24;
    background-color: #f8d7da;
}

/* --- *** NEW: Drop Zone Styling *** --- */
/* Add this to your existing CSS */

.drop-zone {
    border: 3px dashed #007bff;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative; 
}

.drop-zone.active {
    background-color: #e3f2fd;
    border-color: #0056b3;
}

.drop-zone.uploading {
    background-color: #e8f5e9;
    border-color: #4caf50;
    cursor: not-allowed;
}

.drop-zone-text {
    font-size: 1.25rem;
    color: #495057;
    font-weight: 500;
}

.drop-zone-uploading {
    font-size: 1.25rem;
    color: #2e7d32;
    font-weight: 500;
}

.upload-form-container {
    width: 100%;
    margin-bottom: 2rem;
    position: relative;
    z-index: 10;
}
/* --- *** END: Drop Zone Styling *** --- */{
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    line-height: 1.6;
    background-color: #f8f9fa;
    color: #343a40;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3 {
    margin-bottom: 0.75em;
    color: #0056b3;
}

main.content-area h2 { /* Main page title */
    font-size: 1.4em;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.3em;
    margin-bottom: 1.5rem; /* Increase space below main title */
}

main.content-area h3 { /* Sub-section titles (like Existing Files) */
    font-size: 1.2em;
    color: #495057; /* Slightly less prominent color */
    border-bottom: 1px solid #eee;
    padding-bottom: 0.2em;
    margin-top: 1.5rem; /* Add space above sub-titles */
    margin-bottom: 1rem;
}


a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.main-header {
    background-color: #e9ecef;
    padding: 0.5rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 45px;
}

.main-footer {
    background-color: #e9ecef;
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
    margin-top: auto;
    text-align: center;
    font-size: 0.9em;
    color: #6c757d;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
}

.header-actions span {
    font-weight: 500;
    color: #495057;
}

main.content-area {
    padding: 1.5rem;
    flex-grow: 1;
}

nav.main-nav {
    background-color: #ffffff;
    padding: 0.5rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* --- UPDATED/GENERALIZED Desktop Navigation Level Styling --- */
div[class^="nav-level-"] {
    display: flex;
    flex-wrap: wrap;
    gap: 5px; /* This provides the spacing between buttons */
    padding: 5px 0;
    /* Add border between levels, except for the first one */
    border-top: 1px dashed #e0e0e0;
    margin-top: 5px;
    padding-top: 10px;
}

/* Remove top border/margin for the very first level (level 0) */
.nav-level-0 {
    border-top: none;
    margin-top: 0;
    padding-top: 5px; /* Keep original padding */
}
/* --- End of Updated Desktop Navigation Level Styling --- */


form.nav-form {
    display: inline-block;
    margin: 0;
}

.button,
button {
    display: inline-block;
    padding: 8px 15px;
    font-size: 0.95em;
    font-weight: 500;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 4px;
    background-color: #6c757d;
    color: #ffffff;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    white-space: nowrap;
}

button:hover {
    opacity: 0.9;
}

.button-primary,
button[type="submit"] {
    background-color: #007bff;
    border-color: #007bff;
}

.button-primary:hover,
button[type="submit"]:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.nav-button {
    background-color: #007bff;
    color: #ffffff;
    border-color: #007bff;
    padding: 6px 12px;
    font-size: 0.9em;
}

.nav-button:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    color: #ffffff;
    opacity: 1;
}

.nav-button.nav-button-active {
    background-color: #0056b3;
    border-color: #0056b3;
    color: #ffffff;
    font-weight: bold;
    cursor: default;
}

.nav-button.nav-button-active:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.logout-button {
    background-color: #dc3545;
    border-color: #dc3545;
    padding: 5px 10px;
    font-size: 0.9em;
}

.logout-button:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.login-container {
    max-width: 400px;
    margin: 3rem auto;
    padding: 2rem;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-form h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #0056b3;
    font-size: 1.25em;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* --- Updated Input Styling (Including input[list]) --- */
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[list], /* <<< ADDED input[list] HERE */
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    background-color: #fff;
    color: #495057;
    line-height: inherit; /* Ensure line height matches text */
    /* Required for number spinner hiding */
    -moz-appearance: textfield; /* Firefox - Note: This might affect time input appearance too */
}

/* Hide number input spinners */
.form-group input[type="number"]::-webkit-outer-spin-button,
.form-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0; /* Optional: Adjust if needed */
}
/* --- End of Updated Input Styling --- */

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 5px;
    vertical-align: middle;
    padding: initial; /* Reset padding for checkbox */
    border: initial; /* Reset border */
    border-radius: initial;
    /* Reset appearance for checkbox */
    -moz-appearance: checkbox;
    -webkit-appearance: checkbox;
    appearance: checkbox;
}


.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.login-error {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    text-align: center;
}

p.error {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.mobile-nav-toggle {
    display: none;
    padding: 0.5rem 1.5rem;
    text-align: right;
    background-color: #e9ecef;
    border-bottom: 1px solid #dee2e6;
}

.mobile-nav-toggle button.mobile-menu-button {
    background-color: #007bff;
    border-color: #007bff;
    padding: 5px 10px;
}

form.mobile-action-form {
    display: inline-block;
    margin: 0;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    z-index: 1000;
    overflow-y: auto;
    padding: 1rem;
    flex-direction: column;
}

.mobile-menu.mobile-menu-visible {
    display: flex;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 1rem;
}

.mobile-menu-header span {
    font-size: 1.2em;
    font-weight: bold;
    color: #0056b3;
}

.mobile-menu-close-button {
    background-color: #6c757d;
    border-color: #6c757d;
    padding: 5px 10px;
}

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    gap: 10px; /* Spacing for mobile buttons */
}

.mobile-menu-content form.nav-form,
.mobile-menu-content form.mobile-action-form {
    display: block;
    margin: 0;
}

.mobile-menu-content .nav-button,
.mobile-menu-content form.mobile-action-form button {
    width: 100%;
    text-align: left;
    padding: 12px 15px;
    font-size: 1em;
}

/* Style mobile buttons consistently */
.mobile-menu-content .nav-button,
.mobile-menu-content form.mobile-action-form button {
    background-color: #007bff;
    color: #ffffff;
    border-color: #007bff;
}
.mobile-menu-content .nav-button:hover,
.mobile-menu-content form.mobile-action-form button:hover {
     background-color: #0056b3;
     border-color: #0056b3;
}

/* Active state highlighting for mobile */
.mobile-menu-content .nav-button.nav-button-active,
.mobile-menu-content form.mobile-action-form button.nav-button-active {
    background-color: #0056b3;
    border-color: #0056b3;
    font-weight: bold;
    cursor: default;
}
.mobile-menu-content .nav-button.nav-button-active:hover,
.mobile-menu-content form.mobile-action-form button.nav-button-active:hover {
     background-color: #0056b3; /* Keep active color on hover */
}

/* --- General Page Actions --- */
.page-actions {
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.page-actions form {
    display: inline-block;
    margin: 0;
}
/* --- Style for search input within page actions --- */
.page-actions form input[type="text"] {
    padding: 6px 10px;
    font-size: 0.9em;
    border: 1px solid #ccc;
    border-radius: 4px;
    vertical-align: middle;
    min-width: 200px;
}
.page-actions .button {
    padding: 7px 12px;
    vertical-align: middle;
}
/* --- Make Add button align right by default --- */
.page-actions .add-new-button-form {
    margin-left: auto;
}


/* --- Data Table Styling --- */
.desktop-table-container {
    display: none;
    overflow-x: auto;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    background-color: #fff;
    border: 1px solid #dee2e6;
}
.data-table th,
.data-table td {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    text-align: left;
    vertical-align: top;
}
.data-table thead th {
    background-color: #e9ecef;
    font-weight: 600;
    white-space: nowrap;
    position: relative;
}
.data-table tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}
.data-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.data-table.compact th,
.data-table.compact td {
    padding: 0.4rem 0.5rem;
    font-size: 0.9em;
}

.data-table .col-comment {
    white-space: normal;
    word-wrap: break-word;
    max-width: 300px;
    min-width: 150px;
}
.data-table .col-actions {
    width: 150px;
    text-align: center;
    white-space: nowrap;
}

/* --- Table Header Sorting Styles --- */
th.sortable-header {
    cursor: pointer;
}
th.sortable-header form.sort-form {
    display: inline;
    margin: 0;
    padding: 0;
}
/* Style removed for .header-sort-button as it wasn't used */
/* --- END Table Header Sorting Styles --- */


.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: stretch;
}
.action-buttons form {
    display: block;
}
.action-buttons .button {
    width: 100%;
    text-align: center;
    padding: 4px 8px;
    font-size: 0.85em;
}
.button-small {
     padding: 4px 8px;
     font-size: 0.85em;
}

.button-danger {
     background-color: #dc3545;
     border-color: #dc3545;
}
.button-danger:hover {
     background-color: #c82333;
     border-color: #bd2130;
}


/* --- Mobile Card Styling --- */
.mobile-card-container {
    display: none;
}
.card {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.card-header {
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-size: 1.1em;
    font-weight: 500;
    word-break: break-word;
}
.card-content {
    padding: 1rem;
}
.card-field {
    margin-bottom: 0.5rem;
    font-size: 0.95em;
    word-wrap: break-word;
}
.card-field strong {
    color: #495057;
    display: block;
    margin-bottom: 2px;
    font-weight: 600;
}
.card-actions {
    padding: 0.75rem 1rem;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
}
.card-actions .action-buttons {
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}
.card-actions .action-buttons .button {
    width: auto;
}


/* --- Responsive Display --- */
@media (max-width: 768px) {
    .desktop-table-container {
        display: none;
    }
    .mobile-card-container {
        display: block;
    }
    .page-actions {
        /* Keep space-between, let flex-wrap handle stacking */
    }
     /* --- Adjust page actions for mobile --- */
    .page-actions form {
        flex-grow: 1;
    }
    .page-actions form input[type="text"] {
        width: 100%;
        margin-bottom: 5px;
    }
    .page-actions .button {
         flex-grow: 1;
         text-align: center;
    }
    .page-actions .add-new-button-form {
         margin-left: 0;
         width: 100%;
         order: 1;
    }
    .page-actions form:not(.add-new-button-form) {
         width: 100%;
         margin-bottom: 5px;
    }

    nav.main-nav {
         display: none;
    }
    .mobile-nav-toggle {
        display: block;
    }
    .header-actions span {
        display: none;
    }
    .login-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    main.content-area {
        padding: 1rem;
    }
    .page-actions {
         margin-bottom: 1rem;
    }
}

@media (min-width: 769px) {
    .desktop-table-container {
        display: block;
    }
    .mobile-card-container {
        display: none;
    }
    .mobile-nav-toggle {
        display: none;
    }
}

/* --- Form Styling --- */
.form-container {
    background-color: #fff;
    padding: 1.5rem;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    margin-bottom: 1.5rem;
    max-width: 800px;
}
.form-container h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
    font-size: 1.2em;
}

.form-group-checkbox label {
    display: inline-block;
    margin-bottom: 0;
    margin-left: 5px;
    font-weight: normal;
    vertical-align: middle;
}
.form-group-checkbox input[type="checkbox"] {
     width: auto;
     vertical-align: middle;
}

/* --- Feedback Messages --- */
.feedback-message {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 4px;
}
.feedback-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}
.feedback-error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}
.feedback-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}


/* --- Required Field Indicator --- */
.required {
    color: #dc3545;
    margin-left: 2px;
    font-weight: bold;
}

/* --- Confirmation Message --- */
.confirmation-message {
    margin-bottom: 1.5rem;
    font-weight: bold;
    color: #555;
    padding: 1rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

/* --- Active Filters Display --- */
.active-filters-display {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background-color: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.9em;
    color: #495057;
}
.active-filters-display strong {
    color: #343a40;
    margin-right: 5px;
}


/* --- Notification Messages --- */

.notification-container {
    position: fixed;
    top: 60px;
    right: 20px;
    max-width: 350px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    width: 300px;
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.16);
    background-color: white;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.notification-content {
    flex: 1;
    padding-right: 10px;
    word-wrap: break-word;
}

.notification form.notification-dismiss {
    margin: 0;
    padding: 0;
}
.notification form.notification-dismiss button {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 1.4em;
    font-weight: bold;
    line-height: 1;
    padding: 0 0 0 5px;
    cursor: pointer;
    opacity: 0.7;
}
.notification form.notification-dismiss button:hover {
    opacity: 1;
    color: #343a40;
}

.notification-error { border-left: 12px solid #dc3545; }
.notification-warning { border-left: 12px solid #ffc107; }
.notification-info { border-left: 12px solid #007bff; }


/* --- Pagination --- */
.pagination {
    margin-top: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}
.pagination button.button,
.pagination span {
    margin: 0 3px;
    padding: 6px 12px;
    font-size: 0.9em;
}
.pagination span {
    color: #6c757d;
    background-color: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    display: inline-block;
}
.pagination form {
    display: inline;
    margin: 0;
}


/* --- Company Assignment Form Styles --- */
.assignment-form-container .form-group {
    margin-bottom: 1.5rem;
}
.assignment-search-group {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}
.assignment-search-group label {
    flex-basis: 100%;
    margin-bottom: 0.3rem;
}
.assignment-search-group input[list] {
    flex-grow: 1;
    min-width: 200px;
}
ul.assignment-list {
    list-style: none;
    padding: 0;
    margin-top: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    min-height: 50px;
    max-height: 250px;
    overflow-y: auto;
    background-color: #f8f9fa;
}
ul.assignment-list li {
    padding: 8px 12px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
ul.assignment-list li:last-child {
    border-bottom: none;
}
ul.assignment-list li.no-assignments {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 15px;
}
button.remove-assignment-button {
    background: none;
    border: none;
    color: #adb5bd;
    font-size: 1.1em;
    font-weight: bold;
    line-height: 1;
    padding: 0 5px;
    margin-left: 10px;
    cursor: pointer;
    opacity: 0.6;
    transition: color 0.15s ease-in-out, opacity 0.15s ease-in-out;
}
button.remove-assignment-button:hover {
    opacity: 1;
    color: #dc3545;
}
.assignment-feedback-inline {
    font-size: 0.9em;
    margin-left: 10px;
    padding: 2px 5px;
    border-radius: 3px;
}
.assignment-feedback-inline.success {
    color: #155724;
    background-color: #d4edda;
}
.assignment-feedback-inline.error {
    color: #721c24;
    background-color: #f8d7da;
}

/* --- *** NEW: Drop Zone Styling *** --- */
/* Add this to your existing CSS */

.drop-zone {
    border: 3px dashed #007bff;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative; 
}

.drop-zone.active {
    background-color: #e3f2fd;
    border-color: #0056b3;
}

.drop-zone.uploading {
    background-color: #e8f5e9;
    border-color: #4caf50;
    cursor: not-allowed;
}

.drop-zone-text {
    font-size: 1.25rem;
    color: #495057;
    font-weight: 500;
}

.drop-zone-uploading {
    font-size: 1.25rem;
    color: #2e7d32;
    font-weight: 500;
}

.upload-form-container {
    width: 100%;
    margin-bottom: 2rem;
    position: relative;
    z-index: 10;
}
/* --- *** END: Drop Zone Styling *** --- */