/* General Body and Container Styles (from admin.html, potentially reusable) */
body {
    padding-top: 20px;
    padding-bottom: 20px;
    font-family: sans-serif; /* Adding a basic font */
}

.user-info-bubble {
    background: #f8f9fa;
    border-radius: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    font-size: 1rem;
    color: #333;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem 2rem;
    pointer-events: none;
    position: static;
    display: inline-block;
    min-width: 200px;
    text-align: center;
}



/* Unified admin/superadmin header navigation bar styles */
.admin-navbar {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 2rem 2.5rem 2rem 2.5rem;
    margin: 2rem auto 2.5rem auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    min-height: 80px;
    border-radius: 1rem;
    max-width: 900px;
}


.admin-navbar .nav-btns {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    width: 100%;
}


/* General container styling, might conflict with Bootstrap's .container if not careful.
   Bootstrap's .container sets max-width at different breakpoints.
   This .container style from admin.html is more restrictive.
   Consider if this should be specific to the admin page, e.g., .admin-container */
.container {
    max-width: 960px; /* Default from admin, can be overridden by Bootstrap if Bootstrap's .container class is also used */
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}


/* Flashed Messages Styling (from form.html) */
.flashes {
    padding: 1em 0;
}

/* Admin Page Table Styles (from admin.html) */
.admin-page .table th, /* Scoping to admin page */
.admin-page .table td {
    vertical-align: top;
}

.admin-page .table td {
    min-width: 200px;
    max-width: 300px;
    word-break: break-word;
    padding: 0.25rem;
}

.admin-page .cell-content-wrapper { /* Scoping to admin page */
    max-height: 50px;
    overflow-y: auto;
    text-align: left;
}

/* Form Specific Styles (can be expanded) */
.form-group {
    margin-bottom: 1rem; /* Consistent spacing for form groups */
}

.error-message {
    color: #dc3545; /* Bootstrap danger color */
    font-size: 0.875em;
    margin-top: 0.25rem;
}

.form-text {
    font-size: 0.875em;
}

.info-icon-container {
    background-color: transparent;
    border: none;
}

.info-icon {
    cursor: pointer;
    color: var(--bs-secondary-color);
}

.info-icon:hover {
    color: var(--bs-primary);
}

/* Button styling (can be adjusted or rely on Bootstrap) */
.button, .btn { /* Targeting .button class from signature.html and .btn from Bootstrap */
    display: inline-block;
    padding: 0.5em 1em;
    text-decoration: none;
    border-radius: 0.25rem;
    cursor: pointer;
}
/* If not using Bootstrap buttons everywhere, define primary/secondary styles */
/*
.button-primary, .btn-primary {
    background-color: #007bff;
    color: white;
    border: 1px solid #007bff;
}
.button-secondary, .btn-secondary {
    background-color: #6c757d;
    color: white;
    border: 1px solid #6c757d;
}
*/

/* Add some general styling for cards if used outside Bootstrap context explicitly */
.card {
    border: 1px solid rgba(0,0,0,.125);
    border-radius: .25rem;
    margin-bottom: 1rem; /* Consistent spacing */
}
.card-body {
    padding: 1.25rem;
}
.card h2 { /* Example: styling for h2 within cards if needed */
    margin-bottom: 0.75rem;
}

/* Ensure form elements in general have some basic styling if Bootstrap isn't fully applied or is overridden */
input[type="text"],
input[type="email"],
input[type="date"],
input[type="time"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: .375rem .75rem;
    font-size: 1rem;
    line-height: 1.5;
    border: 1px solid #ced4da;
    border-radius: .25rem;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
        padding-left: 10px;
        padding-right: 10px;
    }
    .admin-navbar {
        padding: 1rem;
    }
    .admin-navbar .nav-btns {
        gap: 1rem;
    }
    input[type="text"],
    input[type="email"],
    input[type="date"],
    input[type="time"],
    input[type="number"],
    textarea,
    select {
        font-size: 0.9rem;
    }
}

.help-info-text {
  color: #666;
}

.pdf-preview {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pdf-preview img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
}

.btn-logout {
    background-color: #FF8C00 !important;
    border-color: #FF8C00 !important;
    color: #fff !important;
}

.btn-logout:hover {
    background-color: #E67E00 !important;
    border-color: #CC7000 !important;
}

.btn-download {
    background-color: #6f42c1 !important;
    border-color: #6f42c1 !important;
    color: #fff !important;
}

.btn-download:hover {
    background-color: #6239aa !important;
    border-color: #5b369d !important;
}

.btn-clear {
    background-color: #800000 !important;
    border-color: #800000 !important;
    color: #fff !important;
}

.btn-clear:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.btn-admin-panel {
    background-color: #000080 !important;
    border-color: #000080 !important;
    color: #fff !important;
}

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

.btn-edit {
    background-color: #3399ff;
    border-color: #3399ff;
    color: white;
}

.btn-edit:hover {
    background-color: #2980e6;
    border-color: #2980e6;
    color: white;
}

.btn-maroon {
    background-color: #800000;
    border-color: #800000;
    color: white !important;
}

.btn-maroon:hover {
    background-color: #660000;
    border-color: #660000;
    color: white !important;
}

.actions-column .btn {
    width: 100%;
    margin-bottom: 0.5rem;
    box-sizing: border-box;
}

.actions-column .btn:last-child {
    margin-bottom: 0;
}

/* Ensure button text is white in both themes */
.btn-download, .btn-clear, .btn-logout, .btn-admin-panel, .btn-edit {
    color: white !important;
}

.btn-full-width {
    width: 100%;
    box-sizing: border-box; /* Ensures padding and border are included in the width */
}

/* Filter Toggle Styles (consolidated from admin_styles.css) */
.filter-toggle-label {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
    margin-bottom: 5px; /* Added for spacing if they wrap */
    background-color: #f8f9fa; /* Default light background */
    color: #495057;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
    user-select: none; /* Prevent text selection */
}

.filter-toggle-label:hover {
    background-color: #e9ecef;
    border-color: #bbb;
}

.filter-toggle-input {
    display: none; /* Hide the actual checkbox */
}

.filter-toggle-input:checked + .filter-toggle-label {
    background-color: #007bff; /* Bootstrap primary blue for selected */
    color: white;
    border-color: #0056b3;
}

.filter-toggle-input:checked + .filter-toggle-label::before {
    content: '\2713\00A0'; /* Checkmark character with a non-breaking space */
    font-weight: bold;
}

.filter-toggle-label::before {
    content: '\2610\00A0'; /* Empty box character with a non-breaking space */
    font-weight: bold;
}

/* Styling for Filters inside Table Headers */
th .header-filter {
    margin-top: 5px; /* Add some space below the column title */
    margin-bottom: 2px; /* Reduce bottom margin */
    display: block; /* Make inputs/selects take full width of available space */
    max-width: 150px; /* Prevent filters from becoming too wide */
    font-size: 0.8rem; /* Slightly smaller font for filters */
}

/* Specific adjustments for different filter types */
th input.header-filter,
th select.header-filter {
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
    height: auto; /* Adjust height based on padding */
}

/* Ensure toggle labels don't get too wide */
th label.header-filter {
     max-width: none; /* Allow label to take needed space */
     margin-top: 5px;
     display: inline-block; /* Align with checkbox */
     font-weight: normal; /* Normal weight for filter labels */
}

/* Style the wrapper for signature radio buttons */
th .signature-filter-group {
    margin-top: 5px;
    text-align: left; /* Align radios left */
}

th .signature-filter-group .form-check {
    padding-left: 0; /* Remove default padding */
    margin-right: 5px !important; /* Space between radios */
}

th .signature-filter-group .form-check-inline {
    margin-right: 0.5rem; /* Consistent spacing */
     display: block; /* Stack radios vertically */
     margin-bottom: 2px; /* Space between stacked radios */
}

th .signature-filter-group .form-check-label {
    font-size: 0.8rem; /* Match other filter font size */
    font-weight: normal;
    padding-left: 3px; /* Space after radio button */
    display: inline; /* Keep label inline with radio */
    margin-bottom: 0;
}

/* Adjust toggle button styling within header */
th .filter-toggle-label.header-filter {
    padding: 0.2rem 0.4rem; /* Smaller padding */
}

/* --- Dark Theme Styles --- */
[data-bs-theme="dark"] {
  --bs-body-bg: #181a1b;
  --bs-body-color: #f1f1f1;
  --bs-emphasis-color: #f1f1f1;
  --bs-secondary-color: #f8f9fa !important;
  --bs-tertiary-bg: #222426;
  --bs-border-color: #444;
  --bs-border-color-translucent: rgba(255, 255, 255, 0.15);
  --bs-heading-color: #f8f9fa;
  --bs-light-bg-subtle: #333;
}

[data-bs-theme="dark"] body {
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .table,
[data-bs-theme="dark"] .alert {
  background-color: var(--bs-tertiary-bg) !important;
  color: var(--bs-body-color) !important;
  border-color: var(--bs-border-color) !important;
}

[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-accent-bg: #2c3034;
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .table-hover > tbody > tr:hover > * {
  --bs-table-hover-bg: #32383e;
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .admin-navbar,
[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer {
  background-color: transparent !important;
  border-color: var(--bs-border-color-translucent) !important;
}

[data-bs-theme="dark"] input,
[data-bs-theme="dark"] select,
[data-bs-theme="dark"] textarea,
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background-color: #181a1b !important;
  color: #f1f1f1 !important;
  border: 1px solid var(--bs-border-color) !important;
}

[data-bs-theme="dark"] .form-control::placeholder,
[data-bs-theme="dark"] .form-select {
  color: #b0b3b8 !important;
  opacity: 1;
}

[data-bs-theme="dark"] .help-info-text,
[data-bs-theme="dark"] .form-text,
[data-bs-theme="dark"] p.form-text {
  color: var(--bs-secondary-color) !important;
}

/* --- Login Page Specific Styles --- */
.login-page-body {
    height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
}

[data-bs-theme="dark"] .login-page-body {
    background-color: var(--bs-body-bg);
}

.login-container {
    background-color: #fff;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 400px;
}

[data-bs-theme="dark"] .login-container {
    background-color: var(--bs-tertiary-bg);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.5);
}

.login-container h2 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.forgot-password-link {
    color: #0dcaf0 !important;
}

.forgot-password-link:hover {
color: #0aa2c0 !important;
}

/* --- Admin Table Frozen Column Fix --- */
.table-frozen .frozen-right {
position: sticky;
right: 0;
z-index: 2;
background: #fff;
}

.table-frozen .frozen-right-2 {
position: sticky;
right: 60px; /* Width of the frozen-right (checkbox) column */
z-index: 2;
background: #fff;
}

[data-bs-theme="dark"] .table-frozen .frozen-left,
[data-bs-theme="dark"] .table-frozen .frozen-left-2,
[data-bs-theme="dark"] .table-frozen .frozen-right,
[data-bs-theme="dark"] .table-frozen .frozen-right-2 {
background: var(--bs-table-bg);
}

/* --- Dark Mode Disabled Form Field Fix --- */
[data-bs-theme="dark"] .form-control:disabled,
[data-bs-theme="dark"] .form-control[readonly] {
background-color: var(--bs-secondary-bg) !important;
opacity: 0.65 !important;
    opacity: 0.65 !important;
}

/* Ensure column title has spacing from filter below */
th .column-title {
    display: block; /* Ensure it takes its own line */
    margin-bottom: 5px; /* Space between title and filter */
}

/* --- Clearable Input Field --- */
.input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

/* Add padding to inputs to make room for the clear button */
.input-wrapper .form-control {
    padding-right: 30px; /* Default space for the X */
}

/* Add more padding for number inputs to accommodate spinners */
.input-wrapper .form-control[type="number"] {
    padding-right: 45px; /* Extra space for spinners + X */
}

.clear-btn {
    position: absolute;
    top: 50%;
    right: 10px; /* Default position */
    transform: translateY(-50%);
    cursor: pointer;
    color: #aaa;
    font-weight: bold;
    font-size: 1.2rem;
    line-height: 1;
    display: none; /* Hidden by default, shown by JS */
    z-index: 3; /* Ensure it's above other elements like autofill icons */
}

/* Move the clear button on number inputs to avoid the spinners */
.input-wrapper .form-control[type="number"] + .clear-btn {
    right: 25px;
}

.clear-btn:hover {
    color: #333;
}

[data-bs-theme="dark"] .clear-btn {
    color: #777;
}

[data-bs-theme="dark"] .clear-btn:hover {
    color: #ccc;
}

/* Frozen columns for admin table */
.table-frozen {
    position: relative;
    overflow-x: auto;
    width: 100%;
    display: block;
}
.table-frozen thead th,
.table-frozen tbody td {
    background-clip: padding-box;
    z-index: 1;
}

.table-frozen .frozen-left {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    box-shadow: 2px 0 5px -2px rgba(0,0,0,0.05);
}
.bulk-actions-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1050;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    gap: 10px;
    border: 1px solid #dee2e6;
}

[data-bs-theme="dark"] .bulk-actions-container {
    background-color: rgba(34, 36, 38, 0.95);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    border: 1px solid #444;
}

.table-frozen .frozen-left-2 {
    position: sticky;
    left: 200px; /* width of first frozen column */
    z-index: 2;
    background: #fff;
    box-shadow: 2px 0 5px -2px rgba(0,0,0,0.05);
}
.table-frozen .frozen-right {
    position: sticky;
    right: 0;
    z-index: 2;
    background: #fff;
    box-shadow: -2px 0 5px -2px rgba(0,0,0,0.05);
}

@media (max-width: 1200px) {
    .table-frozen .frozen-left,
    .table-frozen .frozen-left-2,
    .table-frozen .frozen-right {
        min-width: 120px;
        max-width: 200px;
    }
}
