/* CSS Variables - Modern & Professional Theme */
:root {
    --primary-color: #b71c1c;
    --primary-light: #e53935;
    --primary-dark: #7f0000;
    --primary-gradient: linear-gradient(135deg, #c62828 0%, #b71c1c 50%, #7f0000 100%);
    --secondary-color: #1a237e;
    --secondary-light: #3949ab;
    --secondary-dark: #0d1442;
    --secondary-gradient: linear-gradient(180deg, #283593 0%, #1a237e 50%, #0d1442 100%);
    --accent-color: #ff6f00;
    --success-color: #2e7d32;
    --success-light: #4caf50;
    --warning-color: #f57c00;
    --warning-light: #ff9800;
    --danger-color: #c62828;
    --info-color: #0277bd;
    --info-light: #03a9f4;
    --light-gray: #f5f7fa;
    --medium-gray: #cfd8dc;
    --dark-gray: #607d8b;
    --text-color: #263238;
    --text-light: #546e7a;
    --white: #ffffff;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.15);
    --border-radius: 10px;
    --border-radius-lg: 16px;
    --transition-fast: 0.15s ease;
    --transition: 0.25s ease;
    --transition-slow: 0.4s ease;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #eef2f7;
    color: var(--text-color);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar - Modern Professional */
.sidebar {
    width: 260px;
    background: var(--secondary-gradient);
    color: var(--white);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 100;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar-header {
    padding: 28px 24px;
    background: var(--primary-gradient);
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.sidebar-header small {
    display: block;
    font-size: 0.75rem;
    opacity: 0.85;
    margin-top: 6px;
    font-weight: 400;
}

/* Sidebar Logo */
.sidebar-logo {
    max-width: 180px;
    max-height: 100px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Global Search */
.global-search-container {
    padding: 12px 16px;
    position: relative;
}

.global-search-input {
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 0.9rem;
    outline: none;
    transition: all var(--transition);
}

.global-search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.global-search-input:focus {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.global-search-results {
    position: fixed;
    top: auto;
    left: 16px;
    width: 228px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-height: 400px;
    overflow-y: auto;
    z-index: 10000;
    display: none;
}

.global-search-results.active {
    display: block;
}

.search-result-group {
    border-bottom: 1px solid #eee;
}

.search-result-group:last-child {
    border-bottom: none;
}

.search-result-group-title {
    padding: 10px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #666;
    background: #f8f9fa;
    letter-spacing: 0.5px;
}

.search-result-item {
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background var(--transition);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #f8f9fa;
}

.search-result-title {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 2px;
}

.search-result-subtitle {
    font-size: 0.8rem;
    color: var(--text-light);
}

.search-no-results {
    padding: 20px 14px;
    text-align: center;
    color: var(--text-light);
}

.nav-menu {
    list-style: none;
    padding: 12px 0;
}

.nav-item {
    padding: 14px 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all var(--transition);
    border-left: 4px solid transparent;
    margin: 2px 0;
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: rgba(255, 255, 255, 0.4);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    border-left-color: var(--white);
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.05);
}

.nav-icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
    opacity: 0.9;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    background: linear-gradient(180deg, #eef2f7 0%, #e8eef5 100%);
    min-height: 100vh;
}

/* Pages */
.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--medium-gray);
}

.page-header h2 {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--secondary-color);
    letter-spacing: -0.5px;
}

.department-subtitle {
    width: 100%;
    margin: 0;
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 500;
}

/* Header buttons group */
.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.header-buttons .btn {
    white-space: nowrap;
}

@media (max-width: 600px) {
    .header-buttons {
        width: 100%;
        justify-content: stretch;
    }
    .header-buttons .btn {
        flex: 1;
        font-size: 0.85rem;
        padding: 8px 12px;
    }
}

/* Dashboard Stats - Modern Cards */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    padding: 28px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    text-align: center;
    transition: all var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.stat-number {
    font-size: 2.75rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.stat-label {
    color: var(--text-light);
    margin-top: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dashboard-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 24px;
}

.dashboard-section {
    background: var(--white);
    padding: 24px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.dashboard-section h3 {
    margin-bottom: 18px;
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 1.1rem;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--light-gray);
    display: flex;
    align-items: center;
    gap: 10px;
}

.list-container {
    max-height: 320px;
    overflow-y: auto;
}

.list-container::-webkit-scrollbar {
    width: 6px;
}

.list-container::-webkit-scrollbar-track {
    background: var(--light-gray);
    border-radius: 3px;
}

.list-container::-webkit-scrollbar-thumb {
    background: var(--medium-gray);
    border-radius: 3px;
}

.list-item {
    padding: 14px 12px;
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background var(--transition-fast);
    border-radius: 6px;
    margin: 2px 0;
}

.list-item:hover {
    background: var(--light-gray);
}

.list-item:last-child {
    border-bottom: none;
}

/* Buttons - Modern Style */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.4s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(183, 28, 28, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(183, 28, 28, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: linear-gradient(135deg, #607d8b, #546e7a);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(96, 125, 139, 0.3);
}

.btn-secondary:hover {
    box-shadow: 0 6px 20px rgba(96, 125, 139, 0.4);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #e53935, #c62828);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(198, 40, 40, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(198, 40, 40, 0.4);
    transform: translateY(-2px);
}

.btn-info {
    background: linear-gradient(135deg, #0288d1, #0277bd);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(2, 119, 189, 0.3);
}

.btn-info:hover {
    box-shadow: 0 6px 20px rgba(2, 119, 189, 0.4);
    transform: translateY(-2px);
}

.btn-small {
    padding: 8px 14px;
    font-size: 0.85rem;
}

.btn-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Tables - Professional Style */
.table-container {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    overflow: auto;
    border: 1px solid rgba(0, 0, 0, 0.04);
    max-height: 70vh;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 16px 18px;
    text-align: left;
    border-bottom: 1px solid var(--light-gray);
}

th {
    background: var(--secondary-gradient);
    color: var(--white);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

th:first-child {
    border-radius: var(--border-radius-lg) 0 0 0;
}

th:last-child {
    border-radius: 0 var(--border-radius-lg) 0 0;
}

tr {
    transition: background var(--transition-fast);
}

tr:hover {
    background: linear-gradient(90deg, var(--light-gray), transparent);
}

tr:last-child td {
    border-bottom: none;
}

td {
    font-size: 0.95rem;
}

/* Filters - Clean Style */
.filters {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
    background: var(--white);
    padding: 20px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
}

.filters input,
.filters select {
    padding: 12px 16px;
    border: 2px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    transition: all var(--transition);
    background: var(--white);
}

.filters input:focus,
.filters select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(183, 28, 28, 0.1);
}

.filters label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

/* Modals - Modern Design */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 20, 66, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
    animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-large {
    max-width: 920px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 2px solid var(--light-gray);
    background: linear-gradient(180deg, var(--light-gray), var(--white));
}

.modal-header h3 {
    color: var(--secondary-color);
    font-weight: 700;
    font-size: 1.25rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    color: var(--dark-gray);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.close-btn:hover {
    color: var(--danger-color);
    background: rgba(198, 40, 40, 0.1);
}

/* Modal header with action buttons */
.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header-actions .btn {
    white-space: nowrap;
}

.modal-header-actions .close-btn {
    margin-left: 8px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 2px solid var(--light-gray);
    background: var(--light-gray);
    position: sticky;
    bottom: 0;
    z-index: 10;
}

/* Forms - Clean Professional */
form {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: all var(--transition);
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(183, 28, 28, 0.1);
}

/* Required field validation states */
.form-group input.field-invalid,
.form-group select.field-invalid,
.form-group textarea.field-invalid {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.15);
}

.form-group input.field-valid,
.form-group select.field-valid,
.form-group textarea.field-valid {
    border-color: var(--success-color);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--medium-gray);
}

/* Google Places Autocomplete Element Styling */
.form-group gmp-place-autocomplete {
    display: block;
    width: 100%;
}

.form-group gmp-place-autocomplete::part(input) {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: all var(--transition);
    background: var(--white);
    font-family: inherit;
}

.form-group gmp-place-autocomplete::part(input):focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(183, 28, 28, 0.1);
}

.form-group gmp-place-autocomplete::part(input)::placeholder {
    color: var(--medium-gray);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    max-height: 220px;
    overflow-y: auto;
    padding: 14px;
    border: 2px solid var(--light-gray);
    border-radius: var(--border-radius);
    background: var(--light-gray);
}

.checkbox-group::-webkit-scrollbar {
    width: 6px;
}

.checkbox-group::-webkit-scrollbar-track {
    background: var(--white);
    border-radius: 3px;
}

.checkbox-group::-webkit-scrollbar-thumb {
    background: var(--medium-gray);
    border-radius: 3px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    background: var(--white);
    border-radius: 6px;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.checkbox-group label:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.checkbox-group label.inactive-item {
    color: var(--dark-gray);
    font-style: italic;
    opacity: 0.7;
}

.stipend-checkbox-group {
    max-height: 160px;
}

.form-hint {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 12px;
    font-style: italic;
}

/* NERIS Module Sections */
.neris-module {
    border: 2px solid var(--light-gray);
    border-radius: var(--border-radius-lg);
    margin: 20px 0;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.neris-module .module-header {
    margin: 0;
    padding: 16px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    font-weight: 600;
    transition: all var(--transition);
}

.neris-module .module-header:hover {
    opacity: 0.95;
}

.neris-module .toggle-icon {
    font-weight: bold;
    font-size: 1.3rem;
    transition: transform var(--transition);
}

.neris-module .module-content {
    padding: 20px;
    border-top: 1px solid var(--light-gray);
    background: var(--white);
}

.neris-module .module-content h5 {
    margin: 18px 0 12px 0;
    padding-top: 12px;
    border-top: 1px solid var(--light-gray);
    color: var(--secondary-color);
    font-weight: 600;
}

.neris-module .module-content h5:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* Fire Module - Red theme */
.fire-module {
    border-color: #e53935;
}

.fire-module .module-header {
    background: linear-gradient(135deg, #e53935, #c62828);
    color: white;
}

/* EMS Module - Blue theme */
.ems-module {
    border-color: #1976d2;
}

.ems-module .module-header {
    background: linear-gradient(135deg, #1e88e5, #1565c0);
    color: white;
}

/* HazMat Module - Orange theme */
.hazmat-module {
    border-color: #f57c00;
}

.hazmat-module .module-header {
    background: linear-gradient(135deg, #ff9800, #ef6c00);
    color: white;
}

/* Casualties Module - Purple theme */
.casualties-module {
    border-color: #7b1fa2;
}

.casualties-module .module-header {
    background: linear-gradient(135deg, #9c27b0, #6a1b9a);
    color: white;
}

/* Settings */
.settings-section {
    background: var(--white);
    padding: 28px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.settings-section h3 {
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--light-gray);
    color: var(--secondary-color);
    font-weight: 700;
}

/* Reports - Enhanced Cards */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.report-card {
    background: var(--white);
    padding: 28px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.report-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--secondary-gradient);
    transform: scaleX(0);
    transition: transform var(--transition);
}

.report-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.report-card:hover::before {
    transform: scaleX(1);
}

.report-card h3 {
    margin-bottom: 12px;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.15rem;
}

.report-card p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.5;
}

.report-content {
    padding: 24px;
}

.report-output {
    background: var(--white);
    padding: 28px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    display: none;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.report-output.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Tax Info Card */
.tax-info-card {
    background: var(--secondary-gradient);
    color: var(--white);
    padding: 32px;
    border-radius: var(--border-radius-lg);
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
}

.tax-info-card h3 {
    margin-bottom: 18px;
    font-weight: 700;
    font-size: 1.3rem;
}

.tax-info-card ul {
    margin: 18px 0;
    padding-left: 24px;
}

.tax-info-card li {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* Status Badges - Modern */
.badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: linear-gradient(135deg, #c8e6c9, #a5d6a7);
    color: #1b5e20;
}

.badge-warning {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    color: #e65100;
}

.badge-danger {
    background: linear-gradient(135deg, #ffcdd2, #ef9a9a);
    color: #b71c1c;
}

.badge-info {
    background: linear-gradient(135deg, #b3e5fc, #81d4fa);
    color: #01579b;
}

.badge-dark {
    background: linear-gradient(135deg, #455a64, #37474f);
    color: #ffffff;
}

.badge-secondary {
    background: linear-gradient(135deg, #90a4ae, #78909c);
    color: #ffffff;
}

/* Action Buttons in Tables */
.action-buttons {
    display: flex;
    gap: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
        overflow: visible;
    }

    .sidebar-header {
        padding: 20px 10px;
    }

    .sidebar-header h1 {
        display: none;
    }

    /* Hide elements in narrow sidebar */
    .user-info,
    .logout-btn,
    .department-switcher,
    .current-department-name,
    #sync-status {
        display: none;
    }

    /* Global search on tablet - make it smaller */
    .global-search-container {
        padding: 8px;
    }

    .global-search-input {
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .global-search-results {
        max-height: 300px;
    }

    .nav-item {
        padding: 16px;
        justify-content: center;
    }

    .nav-item span:not(.nav-icon) {
        display: none;
    }

    .main-content {
        margin-left: 70px;
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .dashboard-sections {
        grid-template-columns: 1fr;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    /* Chart container responsive */
    .chart-container {
        height: 200px;
    }

    /* Action buttons responsive */
    .action-buttons {
        flex-direction: column;
        gap: 4px;
    }

    .action-buttons .btn {
        width: 100%;
        font-size: 0.75rem;
        padding: 6px 8px;
    }
}

/* Apparatus Grid */
.apparatus-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.apparatus-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    padding: 28px;
    text-align: center;
    transition: all var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.apparatus-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.apparatus-icon {
    font-size: 3.5rem;
    margin-bottom: 14px;
}

.apparatus-card h3 {
    color: var(--primary-color);
    margin-bottom: 8px;
    font-weight: 700;
}

.apparatus-type {
    color: var(--text-light);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.apparatus-stats {
    font-weight: 700;
    color: var(--secondary-color);
    margin-top: 14px;
    font-size: 1.1rem;
}

.apparatus-notes {
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
    margin-top: 8px;
}

/* Stipend Section */
.stipend-section {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border: 2px solid #66bb6a;
    border-radius: var(--border-radius-lg);
    padding: 20px;
    margin: 20px 0;
    box-shadow: var(--shadow-sm);
}

.stipend-section h4 {
    color: #2e7d32;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #a5d6a7;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Stipend Module (collapsible) */
.stipend-module {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border: 2px solid #66bb6a;
    border-radius: var(--border-radius-lg);
    margin: 15px 0;
}

.stipend-module .module-header {
    background: linear-gradient(135deg, #66bb6a, #4caf50);
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.stipend-module .module-header:hover {
    background: linear-gradient(135deg, #4caf50, #43a047);
}

.stipend-module .module-content {
    padding: 15px;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
}

/* Print Styles */
@media print {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }

    .btn, .modal-footer, .filters {
        display: none;
    }

    .page {
        display: block !important;
    }

    .report-content {
        padding: 0;
    }

    body {
        background: white;
    }
}

/* Address Autocomplete Suggestions */
.address-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 2px solid var(--primary-color);
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    max-height: 220px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: var(--shadow-lg);
}

.address-suggestions.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

.address-suggestion-item {
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--light-gray);
    font-size: 0.95rem;
    transition: background var(--transition-fast);
}

.address-suggestion-item:last-child {
    border-bottom: none;
}

.address-suggestion-item:hover,
.address-suggestion-item.selected {
    background: var(--light-gray);
}

.address-suggestion-item strong {
    color: var(--primary-color);
}

/* Time Input Styling */
.time-input {
    font-family: 'SF Mono', 'Consolas', monospace;
    letter-spacing: 1px;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Focus Visible for Accessibility */
:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

/* Selection Color */
::selection {
    background: var(--primary-light);
    color: var(--white);
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
    /* Modal improvements */
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 10px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-content.modal-large {
        width: 98%;
        max-width: 98%;
        margin: 5px;
    }

    .modal-header {
        padding: 15px;
        position: sticky;
        top: 0;
        background: var(--white);
        z-index: 10;
    }

    .modal-footer {
        padding: 15px;
        position: sticky;
        bottom: 0;
        background: var(--white);
        flex-wrap: wrap;
        gap: 10px;
    }

    .modal-footer .btn {
        flex: 1;
        min-width: 120px;
    }

    /* Table responsive */
    .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table th,
    .data-table td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }

    /* Stats grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    /* Page header */
    .page-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .page-header h2 {
        font-size: 1.5rem;
    }

    .page-header .btn {
        width: 100%;
    }

    /* Form improvements */
    .form-group label {
        font-size: 0.85rem;
    }

    input, select, textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }

    /* Checkbox groups */
    .checkbox-group {
        max-height: 200px;
    }

    .checkbox-group label {
        padding: 10px;
    }

    /* Module headers */
    .module-header {
        padding: 12px 15px;
        font-size: 0.95rem;
    }

    /* Apparatus grid */
    .apparatus-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .apparatus-card {
        padding: 20px;
    }

    /* Gear cards */
    .gear-cards {
        grid-template-columns: 1fr;
    }

    /* Report sections */
    .report-section {
        padding: 15px;
        margin-bottom: 15px;
    }

    /* Charts */
    canvas {
        max-height: 250px;
    }

    /* Buttons */
    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .btn-sm {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    /* Action buttons in tables */
    .btn-icon {
        padding: 8px;
        font-size: 1rem;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .sidebar {
        width: 60px;
    }

    .main-content {
        margin-left: 60px;
        padding: 15px;
    }

    .nav-item {
        padding: 14px;
    }

    /* Hide global search on very small screens - use page-level search */
    .global-search-container {
        display: none;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* Dashboard stats smaller on mobile */
    .dashboard-stats {
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .page-header h2 {
        font-size: 1.3rem;
    }

    .header-buttons {
        width: 100%;
    }

    .header-buttons .btn {
        flex: 1;
    }

    /* Apparatus card buttons - fit 3 on mobile */
    .apparatus-card .action-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
        justify-content: center;
    }

    .apparatus-card .action-buttons .btn {
        flex: 1 1 auto;
        min-width: 55px;
        font-size: 11px;
        padding: 6px 8px;
    }

    /* Modal header actions on mobile */
    .modal-header-actions {
        gap: 4px;
    }

    .modal-header-actions .btn {
        font-size: 11px;
        padding: 5px 8px;
    }

    .modal-header-actions .close-btn {
        margin-left: 4px;
        width: 32px;
        height: 32px;
        font-size: 1.4rem;
    }

    /* Time inputs on small screens */
    .time-input {
        min-width: 100px;
    }

    /* Cert alerts on mobile */
    .cert-alert-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .cert-alert-status {
        align-items: flex-start;
        flex-direction: row;
        gap: 8px;
    }

    /* Table cards on mobile */
    table#calls-table tbody tr,
    table#members-table tbody tr,
    table#training-table tbody tr,
    table#tax-events-table tbody tr,
    table#gear-table tbody tr,
    table#billing-table tbody tr {
        display: block;
        margin-bottom: 12px;
        background: white;
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        padding: 12px;
    }

    table#calls-table tbody td,
    table#members-table tbody td,
    table#training-table tbody td,
    table#tax-events-table tbody td,
    table#gear-table tbody td,
    table#billing-table tbody td {
        display: block;
        padding: 4px 0;
        border: none;
    }

    table#calls-table tbody td:before,
    table#members-table tbody td:before,
    table#training-table tbody td:before,
    table#tax-events-table tbody td:before,
    table#gear-table tbody td:before,
    table#billing-table tbody td:before {
        content: attr(data-label);
        font-weight: 600;
        margin-right: 8px;
        color: var(--text-light);
    }

    table#calls-table thead,
    table#members-table thead,
    table#training-table thead,
    table#tax-events-table thead,
    table#gear-table thead,
    table#billing-table thead {
        display: none;
    }

    /* Tax info card mobile */
    .tax-info-card {
        padding: 16px;
        font-size: 0.9rem;
    }

    /* Gear page filters and stats mobile */
    .filters-row {
        display: flex !important;
        flex-direction: column;
        gap: 12px;
    }

    .filters-row .form-group {
        display: block !important;
        margin-right: 0 !important;
    }

    .stats-row {
        display: flex !important;
        flex-wrap: wrap;
        gap: 8px;
    }

    .stats-row .stat-card {
        display: block !important;
        flex: 1 1 45%;
        margin-right: 0 !important;
        text-align: center;
    }

    /* Header buttons stack on mobile */
    .header-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .header-buttons .btn {
        flex: 1 1 45%;
        font-size: 0.85rem;
        padding: 10px 12px;
    }
}

/* ==========================================
   LOGIN PAGE STYLES
   ========================================== */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a237e 0%, #0d1442 50%, #000 100%);
    padding: 20px;
}

.login-container {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 15px;
}

.login-header h1 {
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.login-header p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--medium-gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color var(--transition);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.login-error {
    background: #ffebee;
    color: var(--danger-color);
    padding: 12px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary-gradient);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
}

.login-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
}

.login-footer a:hover {
    text-decoration: underline;
}

.footer-separator {
    color: var(--text-light);
    margin: 0 10px;
}

.toggle-auth-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
}

.toggle-auth-btn:hover {
    text-decoration: underline;
}

.reset-password-form {
    text-align: center;
}

.reset-password-form p {
    margin-bottom: 15px;
    color: var(--text-light);
}

.reset-message {
    padding: 12px;
    border-radius: var(--border-radius);
    margin-top: 15px;
    font-size: 0.9rem;
}

.reset-message.success {
    background: #e8f5e9;
    color: var(--success-color);
}

.reset-message.error {
    background: #ffebee;
    color: var(--danger-color);
}

/* ==========================================
   MULTI-TENANCY UI STYLES
   ========================================== */

.department-switcher {
    margin: 10px 0;
}

.department-select {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    color: var(--white);
    font-size: 0.85rem;
    cursor: pointer;
}

.department-select option {
    background: var(--secondary-dark);
    color: var(--white);
}

.current-department-name {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin: 10px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
}

.user-email {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    word-break: break-all;
}

.user-role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.role-admin {
    background: var(--primary-color);
    color: var(--white);
}

.role-officer {
    background: var(--accent-color);
    color: var(--white);
}

.role-firefighter {
    background: var(--info-color);
    color: var(--white);
}

.logout-btn {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    color: var(--white);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background var(--transition);
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==========================================
   USER MANAGEMENT PAGE STYLES
   ========================================== */

.users-section {
    padding: 20px;
    margin-bottom: 30px;
}

.users-section h3 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--medium-gray);
    color: var(--text-color);
}

.users-list .data-table {
    width: 100%;
}

.users-list select {
    padding: 6px 10px;
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    font-size: 0.85rem;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background: #e8f5e9;
    color: var(--success-color);
}

.status-pending {
    background: #fff3e0;
    color: var(--warning-color);
}

.status-removed {
    background: #ffebee;
    color: var(--danger-color);
}

/* Billing status badges */
.status-trial {
    background: #e3f2fd;
    color: #1565c0;
}

.status-pastdue {
    background: #fff3e0;
    color: var(--warning-color);
}

.status-suspended {
    background: #ffebee;
    color: var(--danger-color);
}

.status-cancelled {
    background: #eceff1;
    color: #546e7a;
}

/* Billing section */
.billing-section {
    background: var(--white);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-top: 24px;
}

/* Billing warning banner */
.billing-warning-banner {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border: 1px solid var(--warning-color);
    border-left: 4px solid var(--warning-color);
    color: #e65100;
    padding: 12px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.billing-warning-banner.suspended {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border-color: var(--danger-color);
    color: #c62828;
}

.billing-warning-icon {
    font-size: 1.5rem;
}

/* Hide admin-only nav items by default */
.nav-item.admin-only {
    display: none;
}

/* Mobile responsive for login */
@media (max-width: 480px) {
    .login-container {
        padding: 30px 20px;
    }

    .login-header h1 {
        font-size: 1.5rem;
    }

    .user-info {
        padding: 8px;
    }

    .user-email {
        font-size: 0.75rem;
    }
}

/* ==========================================
   QUICK ACTIONS (Dashboard)
   ========================================== */

.quick-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--white);
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    color: var(--primary-color);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.quick-action-btn:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.quick-action-icon {
    font-size: 1.2rem;
}

@media (max-width: 600px) {
    .quick-actions {
        flex-direction: column;
    }

    .quick-action-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================
   FILE ATTACHMENTS
   ========================================== */

.attachment-preview {
    background: var(--light-gray);
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    padding: 12px;
    margin-top: 10px;
}

.attachment-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.attachment-info span {
    font-size: 14px;
    color: var(--text-color);
    word-break: break-all;
}

.existing-attachments {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--medium-gray);
}

.existing-attachments h5 {
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--text-light);
}

.attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--white);
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    margin-bottom: 8px;
    transition: var(--transition-fast);
}

.attachment-item:hover {
    border-color: var(--primary-color);
}

.attachment-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
}

.attachment-link:hover {
    text-decoration: underline;
}

.attachment-icon {
    font-size: 18px;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* Attachment indicator in calls table */
.attachment-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--info-color);
    font-size: 12px;
    margin-left: 8px;
}

.attachment-indicator::before {
    content: '📎';
}

/* ==========================================
   DEPARTMENT MANAGEMENT
   ========================================== */

.departments-section {
    padding: 20px 0;
}

.section-description {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 14px;
}

.departments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.department-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    padding: 20px;
    transition: var(--transition);
}

.department-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.department-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--light-gray);
}

.department-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-color);
}

.status-inactive {
    background: rgba(158, 158, 158, 0.1);
    color: var(--dark-gray);
}

.department-info {
    margin-bottom: 15px;
}

.department-info p {
    margin: 6px 0;
    font-size: 13px;
    color: var(--text-light);
}

.department-info strong {
    color: var(--text-color);
}

.department-actions {
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid var(--light-gray);
}

.department-actions .btn {
    flex: 1;
}

/* Super admin role badge */
.role-superadmin {
    background: linear-gradient(135deg, #7b1fa2 0%, #4a148c 100%);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .departments-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   PENDING INVITATIONS
   ========================================== */

.invitations-list {
    margin-bottom: 20px;
}

.invitations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.invitation-card {
    background: var(--white);
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    transition: var(--transition-fast);
}

.invitation-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.invitation-info {
    flex: 1;
    min-width: 0;
}

.invitation-email {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 5px;
    word-break: break-all;
}

.invitation-details {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.invitation-role {
    background: var(--light-gray);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.invitation-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.empty-message {
    color: var(--text-light);
    font-style: italic;
    padding: 10px 0;
}

.section-hint {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 15px;
}

/* Pending Users Styles */
.pending-users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.pending-user-card {
    background: var(--white);
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.pending-user-card:hover {
    border-color: var(--warning-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.pending-user-info {
    flex: 1;
}

.pending-user-name {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.pending-user-email {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 4px;
}

.pending-user-role {
    display: inline-block;
    background: var(--warning-color);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.pending-user-actions {
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .invitation-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .invitation-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .invitations-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   CAD PDF IMPORT STYLES
   ========================================== */

.cad-import-section {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #dee2e6;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.cad-import-section:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
}

.cad-import-btn {
    cursor: pointer;
    margin: 0;
}

.cad-import-btn .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-weight: 500;
}

.cad-import-btn .btn::before {
    content: "\1F4C4";
    font-size: 1.1em;
}

.cad-import-status {
    font-size: 0.9rem;
    color: var(--text-light);
}

.cad-import-status.success {
    color: var(--success-color);
    font-weight: 500;
}

.cad-import-status.error {
    color: var(--danger-color);
    font-weight: 500;
}

.cad-import-status.loading {
    color: var(--primary-color);
    font-style: italic;
}

.cad-import-status.loading::after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================
   LOADING OVERLAY
   ========================================== */

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    background: white;
    padding: 30px 50px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.loading-text {
    font-size: 1.1rem;
    color: var(--text-color);
    font-weight: 500;
}

/* ==========================================
   DASHBOARD CHART STYLES
   ========================================== */

.chart-section {
    min-height: 300px;
}

.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
}

/* Expiring Certifications Alert Styles */
.cert-alert-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: var(--border-radius);
    margin-bottom: 8px;
    background: #fff8e1;
    border-left: 4px solid var(--warning-color);
}

.cert-alert-item.expired {
    background: #ffebee;
    border-left-color: var(--danger-color);
}

.cert-alert-item.expiring-soon {
    background: #fff3e0;
    border-left-color: #ff9800;
}

.cert-alert-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cert-alert-name {
    font-weight: 600;
    color: var(--text-color);
}

.cert-alert-type {
    font-size: 0.85rem;
    color: var(--text-light);
}

.cert-alert-date {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(0,0,0,0.1);
}

.cert-alert-item.expired .cert-alert-date {
    color: var(--danger-color);
}

/* Cert alert status classes */
.cert-alert-expired {
    background: #ffebee;
    border-left-color: var(--danger-color);
}

.cert-alert-urgent {
    background: #fff3e0;
    border-left-color: #ff9800;
}

.cert-alert-warning {
    background: #fff8e1;
    border-left-color: var(--warning-color);
}

.cert-alert-info strong {
    font-size: 0.9rem;
}

.cert-alert-info span {
    font-size: 0.8rem;
    color: var(--text-light);
}

.cert-alert-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.cert-alert-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(0,0,0,0.1);
}

.cert-alert-expired .cert-alert-badge {
    background: var(--danger-color);
    color: white;
}

.cert-alert-urgent .cert-alert-badge {
    background: #ff9800;
    color: white;
}

.no-alerts-message {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-style: italic;
}

/* ==========================================
   PAGINATION STYLES
   ========================================== */

.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--light-gray);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    border-top: 1px solid var(--medium-gray);
    flex-wrap: wrap;
    gap: 12px;
}

.pagination-info {
    color: var(--text-light);
    font-size: 14px;
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-nav .btn {
    min-width: 36px;
    padding: 6px 10px;
    font-size: 14px;
}

.pagination-nav .btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-page {
    padding: 0 12px;
    font-size: 14px;
    color: var(--text-color);
    white-space: nowrap;
}

.pagination-size {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-size label {
    font-size: 14px;
    color: var(--text-light);
}

.pagination-size select {
    padding: 6px 10px;
    border: 1px solid var(--medium-gray);
    border-radius: 6px;
    background: var(--white);
    font-size: 14px;
    cursor: pointer;
}

.pagination-size select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Container for table + pagination */
.table-with-pagination {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-with-pagination .table-container {
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .pagination-controls {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .pagination-nav {
        justify-content: center;
    }

    .pagination-size {
        justify-content: center;
    }
}

/* ==========================================
   CALL LOCATION MAP
   ========================================== */

#call-map {
    width: 100%;
    background: #e8e8e8;
}

.call-map-marker {
    background: transparent !important;
    border: none !important;
}

/* Leaflet popup styling to match app theme */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 3px 14px rgba(0,0,0,0.2);
}

.leaflet-popup-content {
    margin: 12px;
    line-height: 1.5;
}

.leaflet-popup-content hr {
    border: none;
    border-top: 1px solid #ddd;
}

.leaflet-popup-content .btn {
    margin-top: 5px;
}

/* Map legend (optional future enhancement) */
.map-legend {
    background: white;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.2);
}

.map-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 5px 0;
}

.map-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Drop pin map */
.drop-pin-marker, .dept-marker {
    background: transparent !important;
    border: none !important;
}

#drop-pin-map {
    cursor: crosshair;
    background: #e0e0e0;
    position: relative;
}

/* Ensure modal content flexes properly for map */
#drop-pin-modal .modal-content {
    overflow: hidden;
}

#drop-pin-modal .modal-content,
#call-map-modal .modal-content {
    overflow: visible;
}

/* Fix Leaflet z-index issues in modals */
.modal .leaflet-pane {
    z-index: 1 !important;
}
.modal .leaflet-top,
.modal .leaflet-bottom {
    z-index: 2 !important;
}

/* ==========================================
   FEATURE TOGGLE SWITCHES
   ========================================== */

.feature-toggles {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e0e0e0;
}

.feature-toggles h4 {
    margin-bottom: 15px;
    color: #333;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.feature-toggle-row {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e8e8e8;
}

.feature-toggle-row:last-child {
    border-bottom: none;
}

.feature-info {
    margin-left: 15px;
    flex: 1;
}

.feature-info strong {
    display: block;
    font-size: 14px;
    color: #333;
}

.feature-info span {
    font-size: 12px;
    color: #666;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary-color, #c41e3a);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* Super admin only sections */
.superadmin-only {
    border: 2px solid #c41e3a;
    position: relative;
}

.superadmin-only::before {
    content: "SUPER ADMIN";
    position: absolute;
    top: -10px;
    left: 15px;
    background: #c41e3a;
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* ==========================================
   NERIS READINESS CHECKER
   ========================================== */

/* NERIS Score Badge */
.neris-score-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.neris-score-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.neris-score-high {
    background: #4caf50;
    color: white;
}

.neris-score-medium {
    background: #8bc34a;
    color: white;
}

.neris-score-partial {
    background: #ff9800;
    color: white;
}

.neris-score-low {
    background: #f44336;
    color: white;
}

.neris-score-submitted {
    background: #1565c0;
    color: white;
}

.neris-score-pending {
    background: #9e9e9e;
    color: white;
    animation: pulse 1.5s ease-in-out infinite;
}

.neris-score-failed {
    background: #ff5722;
    color: white;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.neris-submitted-badge,
.neris-pending-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    border-radius: 4px;
    font-weight: 500;
}

.neris-submitted-badge {
    background: #e3f2fd;
    color: #1565c0;
}

.neris-pending-badge {
    background: #f5f5f5;
    color: #666;
}

/* NERIS Sync Status Indicators */
.neris-sync-indicator {
    display: inline-block;
    margin-left: 4px;
    font-size: 10px;
    font-weight: bold;
    width: 14px;
    height: 14px;
    line-height: 14px;
    text-align: center;
    border-radius: 50%;
    vertical-align: middle;
}

.neris-sync-done {
    background: #22c55e;
    color: white;
}

.neris-sync-resync {
    background: #f59e0b;
    color: white;
}

/* NERIS Details Modal */
.neris-details {
    padding: 10px 0;
}

.neris-score-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.neris-score-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.neris-score-circle.complete {
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    color: white;
}

.neris-score-circle.good {
    background: linear-gradient(135deg, #8bc34a, #558b2f);
    color: white;
}

.neris-score-circle.needs-work {
    background: linear-gradient(135deg, #ff9800, #ef6c00);
    color: white;
}

.neris-score-circle .score-number {
    font-size: 22px;
    font-weight: bold;
    line-height: 1;
}

.neris-score-circle .score-label {
    font-size: 9px;
    text-transform: uppercase;
    opacity: 0.9;
}

.neris-score-summary h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
}

.neris-score-summary p {
    margin: 0;
    color: #666;
    font-size: 13px;
}

.neris-score-summary .score-detail {
    margin-top: 8px;
    font-weight: 500;
    color: #333;
}

/* NERIS Warning */
.neris-warning {
    background: #fff3e0;
    border: 1px solid #ffb74d;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 15px;
}

.neris-warning strong {
    display: block;
    color: #e65100;
    margin-bottom: 5px;
}

.neris-warning p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

/* NERIS Missing Fields */
.neris-missing-section {
    margin-bottom: 15px;
}

.neris-missing-section h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #d32f2f;
}

.neris-missing-list {
    background: #fafafa;
    border-radius: 8px;
    padding: 15px;
}

.neris-category {
    margin-bottom: 15px;
}

.neris-category:last-child {
    margin-bottom: 0;
}

.neris-category h5 {
    margin: 0 0 8px 0;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.neris-category ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.neris-category li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}

.neris-category li:last-child {
    border-bottom: none;
}

.neris-category .field-name {
    font-size: 13px;
    color: #333;
}

.neris-category .btn-link {
    background: none;
    border: none;
    color: var(--primary-color, #c41e3a);
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
}

.neris-category .btn-link:hover {
    text-decoration: underline;
}

/* NERIS Complete */
.neris-complete {
    text-align: center;
    padding: 20px;
    background: #e8f5e9;
    border-radius: 8px;
    margin-bottom: 15px;
}

.neris-complete .checkmark {
    display: block;
    font-size: 40px;
    color: #4caf50;
    margin-bottom: 10px;
}

.neris-complete p {
    margin: 0;
    color: #2e7d32;
    font-weight: 500;
}

/* NERIS Present Fields */
.neris-present-section {
    margin-top: 15px;
}

.neris-present-section summary {
    cursor: pointer;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: 13px;
    color: #666;
}

.neris-present-section summary:hover {
    background: #eeeeee;
}

.neris-present-list {
    list-style: none;
    margin: 10px 0 0 0;
    padding: 10px 15px;
    background: #fafafa;
    border-radius: 6px;
    columns: 2;
}

.neris-present-list li {
    font-size: 12px;
    color: #4caf50;
    padding: 3px 0;
}

/* Field highlight animation */
.highlight-field {
    animation: highlightPulse 2s ease-out;
}

@keyframes highlightPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(196, 30, 58, 0); }
    25%, 75% { box-shadow: 0 0 0 4px rgba(196, 30, 58, 0.3); }
    50% { box-shadow: 0 0 0 6px rgba(196, 30, 58, 0.2); }
}

/* NERIS Tools Tabs */
.neris-tools-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    background: #f5f5f5;
}

.neris-tab {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.neris-tab:hover {
    background: #eeeeee;
    color: #333;
}

.neris-tab.active {
    background: white;
    color: var(--primary-color, #c41e3a);
    border-bottom: 2px solid var(--primary-color, #c41e3a);
}

.neris-tab-content {
    max-height: 60vh;
    overflow-y: auto;
}

/* NERIS Data Audit Report */
.neris-audit-report {
    padding: 10px 0;
}

.neris-audit-report h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
}

.neris-audit-report .audit-subtitle {
    color: #666;
    font-size: 13px;
    margin-bottom: 20px;
}

.audit-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.audit-stat {
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    background: #f5f5f5;
}

.audit-stat .stat-number {
    display: block;
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
}

.audit-stat .stat-label {
    display: block;
    font-size: 11px;
    color: #666;
    margin-top: 5px;
}

.audit-stat.complete { background: #e8f5e9; }
.audit-stat.complete .stat-number { color: #2e7d32; }

.audit-stat.good { background: #f1f8e9; }
.audit-stat.good .stat-number { color: #558b2f; }

.audit-stat.partial { background: #fff3e0; }
.audit-stat.partial .stat-number { color: #ef6c00; }

.audit-stat.low { background: #ffebee; }
.audit-stat.low .stat-number { color: #c62828; }

.audit-warning {
    background: #fff3e0;
    border: 1px solid #ffb74d;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 15px;
}

.audit-warning strong {
    display: block;
    color: #e65100;
    margin-bottom: 5px;
}

.audit-warning p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.audit-success {
    background: #e8f5e9;
    border: 1px solid #81c784;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 15px;
}

.audit-success strong {
    display: block;
    color: #2e7d32;
    margin-bottom: 5px;
}

.audit-success p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.audit-section {
    margin-bottom: 20px;
}

.audit-section h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #333;
}

.audit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.audit-table th,
.audit-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.audit-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #666;
}

.audit-errors {
    background: #fafafa;
    border-radius: 8px;
    padding: 15px;
}

.audit-error-item {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.audit-error-item:last-child {
    border-bottom: none;
}

.audit-error-item strong {
    color: #c62828;
}

.audit-error-item ul {
    margin: 5px 0 0 20px;
    padding: 0;
    font-size: 12px;
    color: #666;
}

.more-errors, .more-calls {
    color: #999;
    font-style: italic;
    font-size: 12px;
    margin-top: 10px;
}

.audit-calls-list {
    background: #fafafa;
    border-radius: 8px;
    padding: 10px;
}

.audit-call-item {
    display: grid;
    grid-template-columns: 80px 100px 1fr 60px;
    gap: 10px;
    padding: 8px 10px;
    background: white;
    border-radius: 4px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 13px;
}

.audit-call-item:hover {
    background: #e3f2fd;
}

.audit-call-item .call-number {
    font-weight: 600;
}

.audit-call-item .call-date {
    color: #666;
}

.audit-call-item .call-type {
    color: #333;
}

.audit-call-item .call-score {
    text-align: right;
    color: #c62828;
    font-weight: 600;
}

.audit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* ==========================================
   MOBILE BOTTOM NAVIGATION
   ========================================== */

/* Hidden by default - shown only on mobile portrait */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--secondary-gradient);
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 4px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 2px;
}

.bottom-nav-item:active {
    transform: scale(0.95);
}

.bottom-nav-item.active {
    color: white;
}

.bottom-nav-item.active .bottom-nav-icon {
    transform: scale(1.1);
}

.bottom-nav-icon {
    font-size: 1.4rem;
    transition: transform 0.2s ease;
}

.bottom-nav-label {
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* More Menu Overlay */
.more-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.more-menu-overlay.active {
    display: block;
    opacity: 1;
}

/* More Menu Panel */
.more-menu {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    z-index: 1002;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    max-height: 70vh;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom);
}

.more-menu.active {
    display: block;
    transform: translateY(0);
}

.more-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    font-size: 1.1rem;
    position: sticky;
    top: 0;
    background: white;
}

.more-menu-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.more-menu-items {
    padding: 8px 0;
}

.more-menu-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 1rem;
}

.more-menu-item:hover {
    background: #f5f5f5;
}

.more-menu-item:active {
    background: #eee;
}

.more-menu-icon {
    font-size: 1.3rem;
    width: 28px;
    text-align: center;
}

/* More Menu User Info */
.more-menu-user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.more-menu-email {
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
}

.more-menu-role {
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.more-menu-department {
    font-size: 0.8rem;
    color: #888;
}

.more-menu-dept-switcher {
    margin-top: 8px;
    width: 100%;
}

.more-menu-dept-select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    color: var(--text-color);
    cursor: pointer;
}

.more-menu-dept-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* More Menu Footer with Logout */
.more-menu-footer {
    padding: 16px 20px;
    border-top: 1px solid #eee;
    position: sticky;
    bottom: 0;
    background: white;
}

.more-menu-logout-btn {
    width: 100%;
    padding: 14px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.more-menu-logout-btn:hover {
    background: #c82333;
}

.more-menu-logout-btn:active {
    background: #bd2130;
}

/* Mobile Portrait: Show bottom nav, hide sidebar */
@media (max-width: 768px) and (orientation: portrait) {
    .sidebar {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding-bottom: 80px; /* Space for bottom nav */
    }

    .bottom-nav {
        display: flex;
    }

    /* Adjust modals to not be hidden by bottom nav */
    .modal-content {
        margin-bottom: 70px;
    }
}

/* Tablet portrait - slightly larger bottom nav */
@media (min-width: 481px) and (max-width: 768px) and (orientation: portrait) {
    .bottom-nav-icon {
        font-size: 1.5rem;
    }

    .bottom-nav-label {
        font-size: 0.7rem;
    }

    .bottom-nav-item {
        padding: 8px 4px;
    }
}

/* Very small phones */
@media (max-width: 350px) and (orientation: portrait) {
    .bottom-nav-label {
        font-size: 0.55rem;
    }

    .bottom-nav-icon {
        font-size: 1.2rem;
    }
}

/* Google Places Autocomplete dropdown - ensure it shows above modals */
.pac-container {
    z-index: 100000 !important;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 1px solid #ddd;
    font-family: inherit;
}

.pac-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.pac-item:hover {
    background-color: #f5f5f5;
}

.pac-item-query {
    font-weight: 600;
    color: #333;
}

.pac-matched {
    font-weight: 700;
}

/* ==========================================
   APPARATUS CHECK SYSTEM STYLES
   ========================================== */

/* Check items container */
.check-items-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    background: #fafafa;
}

/* Check category */
.check-category {
    margin-bottom: 15px;
}

.check-category:last-child {
    margin-bottom: 0;
}

.check-category-title {
    font-size: 13px;
    font-weight: 600;
    color: #1565c0;
    margin: 0 0 8px 0;
    padding-bottom: 4px;
    border-bottom: 1px solid #e0e0e0;
}

/* Individual check item */
.check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #fff;
    border-radius: 6px;
    margin-bottom: 6px;
    border: 1px solid #eee;
}

.check-item:hover {
    background: #f5f9ff;
}

.check-item-label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    cursor: pointer;
}

.check-item-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.check-item-name {
    font-size: 14px;
}

.check-target {
    font-size: 12px;
    color: #666;
    font-weight: normal;
}

.check-item-notes {
    width: 180px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.check-item-notes:focus {
    border-color: #1565c0;
    outline: none;
}

/* Checklist config items */
.checklist-config-items {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    background: #fafafa;
    min-height: 100px;
}

/* Apparatus check status on cards */
.apparatus-check-status {
    font-size: 11px;
    margin: 4px 0;
}

.apparatus-check-status.overdue {
    animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Mobile adjustments for check modals */
@media (max-width: 768px) {
    .check-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .check-item-label {
        width: 100%;
    }

    .check-item-notes {
        width: 100%;
        margin-top: 6px;
    }

    .check-items-container {
        max-height: 300px;
    }

    .checklist-config-items {
        max-height: 250px;
    }
}
