/* CareOps - Care Home Management System Styles */
/* Professional Care-focused Theme */

:root {
    /* CareOps Brand Colors - Professional Teal/Green Care Theme */
    --primary-color: #00838f;
    --primary-dark: #006064;
    --primary-light: #e0f7fa;
    --secondary-color: #546e7a;
    --success-color: #2e7d32;
    --warning-color: #f57c00;
    --danger-color: #c62828;
    --background-color: #f5f7f8;
    --card-background: #ffffff;
    --text-color: #263238;
    --text-muted: #607d8b;
    --border-color: #e0e0e0;
    --header-bg: #00363a;
    --header-height: 80px;
    --topnav-height: 60px;
    --topnav-bg: #ffffff;
    --accent-color: #26a69a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Utility Classes */
.hidden { display: none !important; }
.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background-color: var(--primary-color); color: white; }
.btn-primary:hover:not(:disabled) { background-color: var(--primary-dark); }
.btn-secondary { background-color: #f3f4f6; color: var(--text-color); border: 1px solid var(--border-color); }
.btn-secondary:hover:not(:disabled) { background-color: #e5e7eb; }
.btn-success { background-color: var(--success-color); color: white; }
.btn-success:hover:not(:disabled) { background-color: #388e3c; }
.btn-warning { background-color: #f59e0b; color: white; }
.btn-warning:hover:not(:disabled) { background-color: #d97706; }
.btn-danger { background-color: var(--danger-color); color: white; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-xs { padding: 4px 8px; font-size: 11px; }

/* Invalid field styling for required fields */
.invalid-field {
    border-color: var(--danger-color) !important;
    box-shadow: 0 0 0 2px rgba(198, 40, 40, 0.2) !important;
}

/* Collapsible section styling */
.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collapsible-header:hover {
    background-color: var(--background-color);
}
.btn-block { width: 100%; justify-content: center; }
.btn-outline { background-color: white; border: 1px solid var(--border-color); color: var(--text-color); }
.btn-outline:hover { background-color: var(--background-color); border-color: var(--primary-color); color: var(--primary-color); }

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

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

.badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}
.badge-admin { background-color: var(--primary-color); color: white; }
.badge-hr { background-color: #9c27b0; color: white; }
.badge-manager { background-color: #ff9800; color: white; }
.badge-finance { background-color: #4caf50; color: white; }
.badge-viewer { background-color: var(--secondary-color); color: white; }
.badge-success { background-color: #4caf50; color: white; }
.badge-danger { background-color: #f44336; color: white; }
.badge-warning { background-color: #ff9800; color: white; }
.badge-info { background-color: #2196f3; color: white; }
.badge-primary { background-color: var(--primary-color); color: white; }
.badge-secondary { background-color: var(--secondary-color); color: white; }

/* Background helpers */
.bg-warning-light { background-color: #fff3e0; }
.bg-success-light { background-color: #e8f5e9; }
.bg-danger-light { background-color: #ffebee; }

/* Page Management */
.page { display: none; }
.page.active { display: block; }
.content-page { display: none; }
.content-page.active { display: block; }

/* Hide main app when logged out - prevent scrolling */
body.logged-out {
    overflow: hidden;
}

body.logged-out #main-app {
    display: none !important;
    visibility: hidden;
    pointer-events: none;
}

body.logged-out #login-page {
    display: block !important;
}

body.logged-in #login-page {
    display: none !important;
}

body.logged-in #main-app {
    display: flex !important;
}

/* Role-based visibility - elements start hidden, JS removes hidden class based on role */
.hr-only.hidden, .manager-only.hidden, .finance-only.hidden, .super-only.hidden { display: none; }

/* Login Page - Full screen overlay */
#login-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: var(--header-bg);
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
}

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

.login-header .login-logo {
    width: 160px;
    height: auto;
    margin-bottom: 16px;
    background: transparent;
}

.login-header h1 {
    font-size: 28px;
    color: var(--header-bg);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-muted);
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: 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 3px rgba(0, 115, 207, 0.1);
}

.error-message {
    color: var(--danger-color);
    font-size: 13px;
    margin-top: 12px;
    text-align: center;
    padding: 10px;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    display: none;
}

.error-message:not(:empty) {
    display: block;
}

.login-footer {
    margin-top: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* Main Layout */
#main-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Header Bar (Logo + User) */
.top-header {
    height: var(--header-height);
    background-color: var(--header-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
}

.top-header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-header .logo-icon {
    height: 72px;
    width: auto;
    background: rgba(255, 255, 255, 0.95);
    padding: 0px 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
}

.top-header .logo-text {
    color: white;
    font-size: 22px;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-right .help-btn,
.header-right .user-menu-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
    font-size: 18px;
}

.header-right .help-btn:hover,
.header-right .user-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.header-right .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.header-right .user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.header-right .user-email {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
}

.header-right .location-selector {
    background: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #333;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}

/* Top Navigation Bar (Menu) */
.top-nav {
    height: var(--topnav-height);
    background-color: var(--topnav-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    z-index: 150;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    flex: 1;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    min-width: 80px;
    color: var(--text-muted);
}

.nav-item:hover {
    background-color: var(--background-color);
    color: var(--text-color);
}

.nav-item.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

svg.nav-icon {
    stroke: currentColor;
}

.nav-item span:last-child {
    font-size: 11px;
    font-weight: 500;
}

/* Hide old sidebar styles */
.sidebar {
    display: none !important;
}

.sidebar-header,
.sidebar-footer {
    display: none;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-top: calc(var(--header-height) + var(--topnav-height));
    display: flex;
    flex-direction: column;
    background-color: var(--background-color);
}

.content-header {
    height: 60px;
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: calc(var(--header-height) + var(--topnav-height));
    z-index: 50;
}

.content-header h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
}

.content-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

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

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
}

.stat-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    border-radius: 12px;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--primary-color);
}

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
}

.stat-info p {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
}

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

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: white;
}

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
}

.card-body {
    padding: 20px;
}

/* Activity List */
.activity-list {
    list-style: none;
}

.activity-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

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

/* Toolbar */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.search-box input {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: 280px;
    font-size: 14px;
    background: white;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 115, 207, 0.1);
}

.filter-box select {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    min-width: 160px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

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

.date-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-selector input[type="date"] {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

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

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: #fafafa;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.data-table th .sort-icon {
    opacity: 0.5;
    margin-left: 4px;
}

.data-table tbody tr {
    transition: background-color 0.15s;
}

.data-table tbody tr:hover {
    background-color: #f9fafb;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table .actions {
    display: flex;
    gap: 6px;
}

/* Employee name link style */
.data-table .employee-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}

.data-table .employee-link:hover {
    text-decoration: underline;
}

/* Employee name clickable link */
.employee-name-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
}

.employee-name-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Employee contact info in table */
.employee-contact {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
}

.employee-contact .contact-email {
    color: var(--text-color);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.employee-contact .contact-phone {
    color: var(--text-muted);
    font-size: 12px;
}

/* Action icon buttons */
.action-icons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-icon-action {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.btn-icon-action:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-icon-action.danger:hover {
    background: #ffebee;
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.btn-icon-action svg {
    width: 16px;
    height: 16px;
}

/* Contracted hours display in rota */
.contracted-hours-display {
    font-weight: 500;
    white-space: nowrap;
}

/* Rota controls */
.rota-controls {
    display: flex;
    gap: 16px;
    align-items: center;
}

.sort-controls,
.filter-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.sort-controls label,
.filter-controls label {
    font-size: 13px;
    color: var(--text-muted);
}

.sort-controls .btn svg {
    margin-left: 4px;
    vertical-align: middle;
}

#rota-role-filter {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    background: white;
}

/* E-Signature Container */
.esign-container {
    padding: 16px 0;
}

.contract-status-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.contract-status-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.contract-status-text {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Contract Timeline */
.contract-timeline {
    display: flex;
    gap: 8px;
    margin: 20px 0;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.timeline-item {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.timeline-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.timeline-icon.pending {
    background: #e9ecef;
    color: #6c757d;
}

.timeline-icon.complete {
    background: #d4edda;
    color: #28a745;
}

.timeline-icon.active {
    background: #fff3cd;
    color: #856404;
}

.timeline-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.timeline-content strong {
    font-size: 13px;
    color: var(--text-primary);
}

.timeline-content span {
    font-size: 12px;
    color: var(--text-secondary);
}

.esign-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

#signed-signature-display label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

/* Rota Table */
.rota-table input {
    width: 70px;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: center;
}

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

.rota-table textarea {
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.4;
}

.rota-table textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.rota-table .variance-positive {
    color: var(--success-color);
}

.rota-table .variance-negative {
    color: var(--danger-color);
}

/* Rota Budget Columns */
.budget-col {
    text-align: right;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9em;
}

.budget-col.over-budget {
    color: var(--danger-color);
    font-weight: 600;
}

.totals-row {
    background: #f8f9fa;
    font-weight: 600;
    border-top: 2px solid #dee2e6;
}

.totals-row td {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
}

/* Finance-only columns - hidden by default for non-finance users */
.finance-only {
    background: #fffbeb;
}

/* Show Cost Toggle Switch */
.show-cost-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.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%;
}

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

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

/* Shifts Cost Summary Header */
.shifts-cost-summary {
    display: flex;
    gap: 20px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.cost-summary-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cost-summary-item .cost-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cost-summary-item .cost-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.cost-summary-item .cost-amount {
    color: var(--primary-color);
}

/* Cost column in shifts table */
.shifts-table-cost-col {
    text-align: right;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 12px;
    color: var(--text-muted);
}

.shifts-table-cost-cell {
    text-align: center;
}

.shifts-table-cost-cell .cost-display {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.shifts-table-cost-cell .hours-display {
    font-weight: 600;
}

/* Daily totals row at bottom of shifts table */
.daily-totals-row {
    background: #f8f9fa;
    font-weight: 600;
    border-top: 2px solid #dee2e6;
}

.daily-totals-row td {
    padding: 10px 8px !important;
    text-align: center;
    vertical-align: top;
}

.daily-totals-row .total-hours {
    font-size: 13px;
    color: var(--text-color);
}

.daily-totals-row .total-cost {
    font-size: 11px;
    color: var(--primary-color);
    margin-top: 2px;
}

/* Payroll Summary */
.payroll-summary {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.summary-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    flex: 1;
    text-align: center;
}

.summary-card h4 {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.summary-card p {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

/* Reports Grid */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.report-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.report-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.report-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 15px;
    color: var(--text-color);
}

.report-icon svg {
    width: 100%;
    height: 100%;
}

.report-card h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

.report-card p {
    font-size: 13px;
    color: var(--text-muted);
}

.report-output {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-height: 200px;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.help-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 15px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: #fafafa;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    padding: 4px;
    border-radius: 4px;
}

.modal-close:hover {
    background: var(--background-color);
    color: var(--text-color);
}

.modal-body {
    padding: 24px;
}

.modal-body .form-group {
    margin-bottom: 16px;
}

.modal-body .form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--header-bg);
    color: white;
    padding: 14px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: var(--success-color);
}

.toast.error {
    background: var(--danger-color);
}

/* Status Badges */
.status-active { color: var(--success-color); }
.status-inactive { color: var(--danger-color); }
.status-pending { color: var(--warning-color); }
.status-approved { color: var(--success-color); }
.status-paid { color: var(--primary-color); }
/* All non-active statuses are now inactive with an inactive_reason */

/* Shift Grid Styles */
.shift-cell {
    min-width: 80px;
    text-align: center;
    padding: 4px !important;
    position: relative;
    vertical-align: top;
}

.shift-cell.empty {
    background: #f8fafc;
}

.shift-cell.has-shifts {
    background: #f0f9ff;
}

.shift-cell .add-shift-quick {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 22px;
    text-align: center;
    color: var(--secondary-color);
    cursor: pointer;
    border: 1px dashed var(--border-color);
    border-radius: 4px;
    font-size: 16px;
    margin-top: 2px;
}

.shift-cell .add-shift-quick:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.shift-item {
    position: relative;
    margin-bottom: 2px;
}

.shift-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.shift-badge.shift-early {
    background: #dbeafe;
    color: #1e40af;
}

.shift-badge.shift-late {
    background: #fef3c7;
    color: #92400e;
}

.shift-badge.shift-long_day {
    background: #dcfce7;
    color: #166534;
}

.shift-badge.shift-night {
    background: #e0e7ff;
    color: #3730a3;
}

.shift-badge.shift-twilight {
    background: #fce7f3;
    color: #9d174d;
}

.shift-badge.shift-custom,
.shift-badge.shift-other {
    background: #f1f5f9;
    color: #475569;
}

.shift-cell .delete-shift {
    position: absolute;
    top: 2px;
    right: 2px;
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 2px;
    opacity: 0;
    transition: opacity 0.2s;
}

.shift-cell:hover .delete-shift {
    opacity: 1;
}

.shift-cell .sick-shift {
    position: absolute;
    top: 2px;
    right: 18px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    padding: 2px;
    opacity: 0;
    transition: opacity 0.2s;
}

.shift-cell:hover .sick-shift {
    opacity: 1;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
}

/* Rota Period Selectors */
.rota-period-selector {
    background: var(--card-background);
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.period-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.period-selector label {
    font-weight: 600;
    color: var(--text-color);
}

.period-selector select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    min-width: 120px;
}

.week-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.week-dropdown {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    min-width: 250px;
    font-size: 14px;
}

#current-month-btn,
#current-week-btn {
    white-space: nowrap;
}

/* Report Filters */
.report-filters {
    background: var(--card-background);
}

.report-filter-toolbar {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.report-filter-toolbar .filter-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-filter-toolbar label {
    font-weight: 500;
    white-space: nowrap;
}

.report-filter-toolbar input[type="date"],
.report-filter-toolbar select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

/* Report Detail Tables */
.report-detail-section {
    margin-top: 20px;
}

.report-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.report-summary-card {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.report-summary-card h4 {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.report-summary-card p {
    font-size: 13px;
    color: var(--text-muted);
}

.expandable-row {
    cursor: pointer;
}

.expandable-row:hover {
    background-color: #e8f4ff !important;
}

.detail-row {
    background-color: #f8fafc;
}

.detail-row td {
    padding: 0 !important;
}

.detail-content {
    padding: 15px 20px;
    background: #f8fafc;
    border-left: 3px solid var(--primary-color);
}

.detail-content table {
    width: 100%;
    font-size: 13px;
}

.detail-content th,
.detail-content td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

/* Bank Details Form in Employee */
.bank-details-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.bank-details-section h4 {
    margin-bottom: 15px;
    color: var(--text-color);
}

/* Audit Page Styles */
.audit-item {
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
}

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

.audit-main {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.audit-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.audit-badge.create {
    background-color: #dcfce7;
    color: #166534;
}

.audit-badge.update {
    background-color: #fef3c7;
    color: #92400e;
}

.audit-badge.delete {
    background-color: #fee2e2;
    color: #991b1b;
}

.audit-time {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
}

.audit-details {
    margin-top: 6px;
    padding-left: 70px;
    font-size: 12px;
    color: var(--text-muted);
}

.audit-details .detail-item {
    display: inline-block;
    background: var(--background-color);
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 8px;
    margin-bottom: 4px;
}

/* Form actions for delete modal */
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Quick date buttons */
.quick-date-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-date-buttons .btn {
    flex: 0 0 auto;
}

/* Month navigator */
.month-navigator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.month-navigator span {
    font-weight: 600;
    min-width: 150px;
    text-align: center;
}

.payroll-toolbar {
    flex-wrap: wrap;
    gap: 15px;
}

/* Responsive */
@media (max-width: 1024px) {
    .top-nav {
        overflow-x: auto;
    }
    
    .nav-item {
        min-width: 70px;
        padding: 8px 12px;
    }
    
    .nav-item span:last-child {
        font-size: 10px;
    }
}

@media (max-width: 768px) {
    .top-header {
        padding: 0 16px;
    }
    
    .top-header .logo h1 {
        font-size: 18px;
    }
    
    .header-right .user-email {
        display: none;
    }
    
    .top-nav {
        padding: 0 12px;
        overflow-x: auto;
    }
    
    .nav-item {
        min-width: 60px;
        padding: 6px 10px;
    }
    
    .nav-icon {
        font-size: 18px;
    }
    
    .nav-item span:last-child {
        font-size: 9px;
    }
    
    .content-body {
        padding: 16px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-body .form-row {
        grid-template-columns: 1fr;
    }
    
    .period-selector,
    .week-selector,
    .report-filter-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .week-dropdown {
        min-width: 100%;
    }
    
    .search-box input {
        width: 100%;
    }
}

/* ============================================
   ROTA COLOR CODING STYLES
   Based on the rota system color keys
   ============================================ */

/* Shift type color codes (matching rota keys) */
.shift-type-a { background-color: #cce5ff; color: #004085; } /* Days - Blue */
.shift-type-b { background-color: #b8e0e0; color: #0c5460; } /* Maintenance/Activity - Teal */
.shift-type-c { background-color: #f8d7da; color: #721c24; } /* Senior Carer - Pink */
.shift-type-d { background-color: #d4c4e8; color: #4a235a; } /* Nights - Purple */
.shift-type-e { background-color: #ffe5d0; color: #856404; } /* Domestic - Orange */
.shift-type-f { background-color: #fff3cd; color: #856404; } /* Cook - Yellow */

/* Absence type colors */
.absence-al { background-color: #cce5ff; color: #004085; } /* Annual Leave - Blue */
.absence-cl { background-color: #d4edda; color: #155724; } /* Compassionate - Green */
.absence-cs { background-color: #b8e0e0; color: #0c5460; } /* Certified Sick - Teal */
.absence-mt { background-color: #f8d7da; color: #721c24; } /* Maternity - Pink */
.absence-pl { background-color: #e2d4f0; color: #4a235a; } /* Parental - Purple */
.absence-sk { background-color: #fff3cd; color: #856404; } /* Absent without Pay - Yellow */
.absence-tg { background-color: #d4edda; color: #155724; } /* Training - Green */
.absence-us { background-color: #ffe5d0; color: #856404; } /* Uncertified Sick - Orange */

/* Rota grouped tables by employee category */
.rota-category-section {
    margin-bottom: 30px;
}

.rota-category-header {
    background: var(--header-bg);
    color: white;
    padding: 12px 20px;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rota-category-header .category-icon {
    font-size: 20px;
}

.rota-category-header .employee-count {
    background: rgba(255,255,255,0.2);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Day/Night shift time badges */
.shift-time-day {
    background-color: #cce5ff;
    color: #004085;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 12px;
}

.shift-time-night {
    background-color: #d4c4e8;
    color: #4a235a;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 12px;
}

/* Day Off cell styling */
.day-off-cell {
    text-align: center;
    padding: 4px;
    border-radius: 4px;
}

.day-off-cell .day-off-label {
    font-size: 11px;
    font-weight: 600;
}

.day-off-cell .absence-code {
    font-size: 10px;
    font-weight: 500;
    margin-top: 2px;
}

/* Enhanced shift cell for rota display */
.rota-shift-cell {
    min-width: 90px;
    padding: 4px !important;
    vertical-align: middle;
    text-align: center;
}

.rota-shift-cell .shift-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.rota-shift-cell .shift-role {
    font-size: 10px;
    color: var(--text-muted);
}

/* Care Home filter bar */
.carehome-filter-bar {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.carehome-filter-bar label {
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
}

.carehome-filter-bar select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    min-width: 200px;
    font-size: 14px;
    background: white;
}

/* Care Home management page */
.carehome-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.carehome-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.carehome-card h4 {
    margin: 0 0 10px 0;
    color: var(--primary-color);
}

.carehome-card .carehome-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.carehome-card .carehome-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
}

/* Company hierarchy indicator */
.company-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

/* Table row category header */
tr.category-header {
    background: var(--header-bg) !important;
}

tr.category-header td {
    color: white !important;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 15px;
    border: none;
}

/* Shift type color coding (a-f from rota) */
.shift-item.shift-type-a {
    background-color: #cce5ff;
    border-radius: 4px;
    padding: 2px 4px;
    margin-bottom: 2px;
}

.shift-item.shift-type-a .shift-time {
    color: #004085;
    font-weight: 500;
}

.shift-item.shift-type-b {
    background-color: #b8e0e0;
    border-radius: 4px;
    padding: 2px 4px;
    margin-bottom: 2px;
}

.shift-item.shift-type-b .shift-time {
    color: #0c5460;
    font-weight: 500;
}

.shift-item.shift-type-c {
    background-color: #f8d7da;
    border-radius: 4px;
    padding: 2px 4px;
    margin-bottom: 2px;
}

.shift-item.shift-type-c .shift-time {
    color: #721c24;
    font-weight: 500;
}

.shift-item.shift-type-d {
    background-color: #d4c4e8;
    border-radius: 4px;
    padding: 2px 4px;
    margin-bottom: 2px;
}

.shift-item.shift-type-d .shift-time {
    color: #4a235a;
    font-weight: 500;
}

.shift-item.shift-type-e {
    background-color: #ffe5d0;
    border-radius: 4px;
    padding: 2px 4px;
    margin-bottom: 2px;
}

.shift-item.shift-type-e .shift-time {
    color: #856404;
    font-weight: 500;
}

.shift-item.shift-type-f {
    background-color: #fff3cd;
    border-radius: 4px;
    padding: 2px 4px;
    margin-bottom: 2px;
}

.shift-item.shift-type-f .shift-time {
    color: #856404;
    font-weight: 500;
}

/* Absence cell styles for rota */
.shift-cell.day-off {
    text-align: center;
    vertical-align: middle;
}

.shift-cell.day-off .absence-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
}

/* Specific absence type cell colors */
.shift-cell.absence-al { background-color: #cce5ff !important; }
.shift-cell.absence-cl { background-color: #d4edda !important; }
.shift-cell.absence-cs { background-color: #b8e0e0 !important; }
.shift-cell.absence-mt { background-color: #f8d7da !important; }
.shift-cell.absence-pl { background-color: #e2d4f0 !important; }
.shift-cell.absence-sk { background-color: #fff3cd !important; }
.shift-cell.absence-tg { background-color: #d4edda !important; }
.shift-cell.absence-us { background-color: #ffe5d0 !important; }

/* Employee View Tabs */
.employee-view-tabs {
    min-height: 400px;
}

.tab-buttons {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Settings Page Tabs */
.settings-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.settings-tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.settings-tab-btn:hover {
    color: var(--primary-color);
}

.settings-tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.settings-tab-content {
    display: none;
}

.settings-tab-content.active {
    display: block;
}

/* Detail Grid */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-item.full-width {
    grid-column: span 2;
}

.detail-item label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.detail-item span {
    font-size: 14px;
    color: var(--text-color);
}

/* Documents Section */
.documents-section {
    padding: 10px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h4 {
    margin: 0;
}

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

.documents-table th,
.documents-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.documents-table th {
    background: var(--background-color);
    font-weight: 600;
}

.doc-category {
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.no-data {
    color: var(--text-muted);
    text-align: center;
    padding: 30px;
}

/* Biometric Section */
.biometric-section {
    padding: 10px 0;
}

.biometric-section .info-text {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.biometric-enrolled {
    background: #d4edda;
    padding: 20px;
    border-radius: 8px;
}

.biometric-not-enrolled {
    background: #fff3cd;
    padding: 20px;
    border-radius: 8px;
}

.biometric-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.enrollment-info {
    font-size: 13px;
    color: var(--text-muted);
    margin: 10px 0;
}

/* ============================================
   BIZIMPLY-STYLE ENHANCEMENTS
   ============================================ */

/* Actions button in header */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-actions .btn {
    font-weight: 500;
}

/* Filter bar styling */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 16px;
}

.filter-bar .filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-bar .filter-group label {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}

.filter-bar select,
.filter-bar input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.filter-bar .btn-show-filters {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-color);
}

.filter-bar .btn-show-filters:hover {
    background: var(--background-color);
}

.filter-bar .btn-edit-columns {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-color);
}

/* Employee row with avatar */
.employee-row-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--primary-color);
}

.employee-name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-access-badge {
    font-size: 12px;
    margin-left: 4px;
    cursor: help;
}

/* Role/status badges */
.role-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    background: #f3f4f6;
    color: var(--text-color);
}

.role-badge.manager {
    background: #fef3c7;
    color: #92400e;
}

.role-badge.employee {
    background: #e0e7ff;
    color: #3730a3;
}

/* Dropdown menu for actions */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    padding: 6px 12px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dropdown-toggle:hover {
    background: var(--background-color);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    min-width: 160px;
    z-index: 100;
    display: none;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a,
.dropdown-menu button {
    display: block;
    width: 100%;
    padding: 10px 14px;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-color);
    text-decoration: none;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
    background: var(--background-color);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--text-color);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    max-width: 400px;
    margin: 0 auto;
}

/* Table enhancements */
.data-table th:hover {
    background: #f0f0f0;
}

.data-table th .th-content {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Checkbox styling */
.data-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: white;
}

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

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

.pagination-controls .btn {
    padding: 6px 12px;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background-color);
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* ============================================
   INLINE EDIT FORM STYLES
   ============================================ */

.page-header-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.page-header-bar h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.page-header-bar .btn svg {
    margin-right: 4px;
}

.edit-form-container {
    max-width: 900px;
}

.edit-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-section {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.form-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-grid .form-group.full-width {
    grid-column: span 2;
}

.form-grid .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-grid .form-group input,
.form-grid .form-group select,
.form-grid .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.form-grid .form-group input:focus,
.form-grid .form-group select:focus,
.form-grid .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 115, 207, 0.1);
}

.form-grid .form-group small {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-section .alert-info {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #1565c0;
}

.edit-form .form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid .form-group.full-width {
        grid-column: span 1;
    }
}

/* Staffing Requirements Grid */
.staffing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.staffing-grid .form-group label {
    font-size: 12px;
    margin-bottom: 4px;
}

.staffing-grid .form-group input {
    padding: 8px 10px;
}

.form-help-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

@media (max-width: 1024px) {
    .staffing-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .staffing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =====================================================
   BIZIMPLY-STYLE DASHBOARD
   ===================================================== */

.dashboard-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    height: calc(100vh - var(--header-height) - var(--topnav-height) - 100px);
}

/* Dashboard Sidebar */
.dashboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    padding-right: 8px;
}

.dashboard-panel {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
}

.panel-filter {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    background: white;
}

.panel-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

/* Attendance List */
.attendance-list {
    max-height: 200px;
    overflow-y: auto;
}

.attendance-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
}

.attendance-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--primary-color);
}

.attendance-info {
    flex: 1;
}

.attendance-name {
    font-weight: 500;
    font-size: 14px;
}

.attendance-location {
    font-size: 12px;
    color: var(--text-muted);
}

.attendance-times {
    text-align: right;
}

.attendance-times .time-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.attendance-times .time-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
}

.attendance-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #fff3e0;
    color: #e65100;
}

.attendance-summary {
    display: flex;
    border-top: 1px solid var(--border-color);
}

.summary-item {
    flex: 1;
    padding: 12px 16px;
    text-align: center;
    border-right: 1px solid var(--border-color);
}

.summary-item:last-child {
    border-right: none;
}

.summary-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.summary-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color);
}

.attendance-empty, .pending-empty, .training-empty, .coming-up-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* Pending Actions */
.pending-list {
    max-height: 200px;
    overflow-y: auto;
}

.pending-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
}

.pending-item:hover {
    background: var(--background-color);
}

.pending-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pending-content {
    flex: 1;
}

.pending-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--primary-color);
}

.pending-type {
    font-size: 12px;
    color: var(--text-muted);
}

.pending-action {
    color: var(--text-muted);
    cursor: pointer;
}

/* Training & Coming Up */
.training-list, .coming-up-list {
    max-height: 150px;
    overflow-y: auto;
}

.training-item, .coming-up-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
}

.training-badge {
    color: #f59e0b;
}

/* Dashboard Main Content */
.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    padding-right: 8px;
}

.dashboard-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

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

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-color);
}

.btn-icon:hover {
    background: var(--background-color);
}

.date-range {
    font-weight: 600;
    font-size: 16px;
    flex: 1;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-toggle {
    padding: 8px 16px;
}

/* Dashboard Cards */
.dashboard-card {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.dashboard-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-card .card-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.card-actions {
    display: flex;
    gap: 8px;
}

/* Chart Styles */
.chart-legend {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    gap: 20px;
    border-bottom: 1px solid var(--border-color);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.legend-dot.scheduled {
    background: var(--primary-color);
}

.legend-dot.actual {
    background: #ff9800;
}

.chart-toggle {
    margin-left: auto;
    display: flex;
    background: var(--background-color);
    border-radius: 6px;
    overflow: hidden;
}

.toggle-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn.active {
    background: var(--header-bg);
    color: white;
}

.chart-container {
    padding: 20px;
    min-height: 250px;
}

.chart-footer {
    padding: 16px 20px;
    text-align: right;
    border-top: 1px solid var(--border-color);
}

/* Collapsible Sections */
.collapsible-header {
    cursor: pointer;
}

.collapse-icon {
    margin-right: 8px;
    font-size: 12px;
    transition: transform 0.2s;
}

.collapsible.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.collapsible.collapsed .collapsible-content {
    display: none;
}

/* Issues Section */
.issues-section {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
}

.issue-category {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.category-toggle {
    font-size: 10px;
    color: var(--text-muted);
}

.category-name {
    font-weight: 500;
}

.issue-list {
    margin-top: 8px;
    display: none;
}

/* Time Off Section */
.timeoff-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px;
}

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

.timeoff-calendar {
    padding: 0 20px 20px;
}

.timeoff-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.badge-warning {
    background: #fff3e0;
    color: #e65100;
}

.badge-danger {
    background: #ffebee;
    color: #c62828;
}

.badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-info {
    background: var(--primary-light);
    color: var(--primary-color);
}

/* =====================================================
   DASHBOARD TILES LAYOUT (New Design)
   ===================================================== */

/* Dashboard toolbar */
.dashboard-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 0 8px 0;
}
.dashboard-toolbar-spacer { flex: 1; }
.dashboard-customize-wrapper {
    position: relative;
}
.dashboard-widget-panel {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 100;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    min-width: 260px;
    padding: 0;
    margin-top: 6px;
}
.widget-panel-header {
    padding: 12px 16px 8px;
    font-weight: 600;
    font-size: 0.85em;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}
.widget-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.15s;
    user-select: none;
}
.widget-toggle:hover {
    background: var(--bg-secondary);
}
.widget-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
    cursor: pointer;
    flex-shrink: 0;
}
.widget-panel-footer {
    padding: 8px 16px 12px;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

.dashboard-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 10px 0;
}

.dashboard-tile {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dashboard-tile.tile-wide {
    grid-column: span 2;
}

.dashboard-tile.tile-full {
    grid-column: span 3;
}

/* Stacked compliance tiles */
.compliance-summary-stacked {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.compliance-summary-stacked .compliance-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--background-color);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.compliance-summary-stacked .compliance-stat.expired {
    border-left-color: var(--danger-color);
    background: #ffebee;
}

.compliance-summary-stacked .compliance-stat.expiring {
    border-left-color: var(--warning-color);
    background: #fff8e1;
}

.compliance-summary-stacked .compliance-stat.valid {
    border-left-color: var(--success-color);
    background: #e8f5e9;
}

.compliance-summary-stacked .stat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color);
}

.compliance-summary-stacked .stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
}

.tile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(to right, #f8f9fa, #ffffff);
}

.tile-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.tile-header .badge {
    margin-left: auto;
}

.tile-body {
    padding: 16px 20px;
    flex: 1;
    overflow: visible;
}

/* Shift Status Grid */
.shift-status-grid {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.shift-stat {
    flex: 1;
    text-align: center;
    padding: 16px;
    background: var(--primary-light);
    border-radius: 8px;
}

.shift-stat.warning {
    background: #fff3e0;
}

.shift-stat .stat-number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-dark);
}

.shift-stat.warning .stat-number {
    color: #e65100;
}

.shift-stat .stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 4px;
}

/* Clock-in Chart */
.shift-clock-chart {
    height: 180px;
    position: relative;
}

.shift-clock-chart canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Attendance List in tile */
.tile-body .attendance-list {
    max-height: none;
    overflow-y: visible;
}

.tile-body .attendance-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.tile-body .attendance-item:last-child {
    border-bottom: none;
}

/* Pending List in tile */
.tile-body .pending-list {
    max-height: none;
}

.tile-body .pending-item {
    padding: 10px 0;
}

/* Coming Up List in tile */
.tile-body .coming-up-list {
    max-height: none;
}

.tile-body .coming-up-item {
    padding: 10px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.tile-body .coming-up-item:last-child {
    border-bottom: none;
}

.coming-up-date {
    min-width: 50px;
    text-align: center;
    padding: 6px 10px;
    background: var(--background-color);
    border-radius: 6px;
}

.coming-up-date .day {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.coming-up-date .month {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.coming-up-info {
    flex: 1;
}

.coming-up-title {
    font-weight: 500;
    font-size: 14px;
}

.coming-up-detail {
    font-size: 12px;
    color: var(--text-muted);
}

/* Labour Chart Tile */
.tile-header .week-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tile-header .date-range {
    font-weight: 600;
    font-size: 14px;
    margin: 0 8px;
}

/* Time Off Calendar Tile */
.tile-header .timeoff-month {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

/* Calendar Grid */
.calendar-grid {
    font-size: 13px;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 4px;
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    font-size: 11px;
    color: var(--text-muted);
    padding: 4px;
}

.calendar-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.calendar-day:hover:not(.empty) {
    background: var(--primary-light);
}

.calendar-day.empty {
    cursor: default;
}

.calendar-day.today {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.calendar-day.has-leave {
    background: #fff3e0;
    color: #e65100;
}

.calendar-day.today.has-leave {
    background: var(--primary-color);
    color: white;
    position: relative;
}

.calendar-day.today.has-leave::after {
    content: '';
    position: absolute;
    bottom: 2px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #ff9800;
}

/* Dashboard tile responsive */
@media (max-width: 1400px) {
    .dashboard-tiles {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-tile.tile-wide {
        grid-column: span 2;
    }
    .dashboard-tile.tile-full {
        grid-column: span 2;
    }
}

@media (max-width: 900px) {
    .dashboard-tiles {
        grid-template-columns: 1fr;
    }
    .dashboard-tile.tile-wide,
    .dashboard-tile.tile-full {
        grid-column: span 1;
    }
    .shift-status-grid {
        flex-direction: column;
    }
}

/* =====================================================
   INSIGHTS PAGE STYLES
   ===================================================== */

.insights-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Insights Filters */
.insights-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: white;
    min-width: 150px;
}

.filter-input {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: white;
    min-width: 120px;
}

/* Insights Stats Row */
.insights-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.insight-stat-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
}

.insight-stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-color);
}

.insight-stat-card .stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.insight-stat-card.small {
    padding: 16px;
}

.insight-stat-card.small .stat-value {
    font-size: 28px;
}

/* Insights Chart Cards */
.insights-chart-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 20px;
}

.insights-chart-card.wide {
    grid-column: span 1;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.chart-header h4 {
    font-size: 14px;
    font-weight: 600;
}

.chart-filter {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    background: white;
}

.pie-container {
    max-width: 250px;
    margin: 0 auto;
}

.chart-legend-bottom {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 16px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

/* Insights Rows */
.insights-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.insights-row.joiners-leavers {
    grid-template-columns: 120px 1fr 1fr 120px;
}

.insights-row.trackers {
    grid-template-columns: repeat(3, 1fr);
}

/* Insights Tables */
.insights-table-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.table-header h4 {
    font-size: 14px;
    font-weight: 600;
}

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

.insights-table th,
.insights-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.insights-table th {
    background: var(--background-color);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
}

.insights-table tbody tr:hover {
    background: var(--background-color);
}

.table-body {
    padding: 16px;
    min-height: 100px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    color: var(--text-muted);
}

/* Date Row */
.insights-date-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.date-range-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

/* Turnover Section */
.turnover-tabs {
    display: flex;
    background: var(--background-color);
    border-radius: 6px;
    overflow: hidden;
}

.turnover-tab {
    padding: 6px 16px;
    border: none;
    background: transparent;
    font-size: 12px;
    cursor: pointer;
}

.turnover-tab.active {
    background: var(--primary-color);
    color: white;
}

.turnover-stat {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.turnover-stat .stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

.turnover-stat .stat-big {
    font-size: 36px;
    font-weight: 700;
}

/* Full Width Table */
.insights-full-table {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 20px;
}

.table-filters {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.insights-table-scroll {
    max-height: 400px;
    overflow: auto;
}

.insights-data-table {
    font-size: 12px;
}

.insights-data-table th {
    position: sticky;
    top: 0;
    background: var(--background-color);
    z-index: 1;
}

/* Responsive */
@media (max-width: 1200px) {
    .dashboard-layout {
        grid-template-columns: 280px 1fr;
    }
    
    .insights-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .insights-row.joiners-leavers {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 992px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .dashboard-sidebar {
        order: 2;
    }
    
    .dashboard-main {
        order: 1;
    }
    
    .insights-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .insights-row {
        grid-template-columns: 1fr;
    }
    
    .insights-row.joiners-leavers {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .insights-stats-row {
        grid-template-columns: 1fr;
    }
    
    .insights-filters {
        flex-direction: column;
    }
    
    .filter-select, .filter-input {
        width: 100%;
    }
}

/* =====================================================
   EMPLOYEE PROFILE PAGE (Bizsimply Style)
   ===================================================== */

.employee-view-container {
    max-width: 1200px;
    margin: 0 auto;
}

.employee-profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: var(--card-background);
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.employee-profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 600;
    flex-shrink: 0;
}

.employee-profile-info {
    flex: 1;
}

.employee-profile-info h2 {
    font-size: 24px;
    margin-bottom: 4px;
}

.employee-profile-role {
    color: var(--text-muted);
    font-size: 14px;
}

.employee-profile-id {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
}

.employee-profile-actions {
    display: flex;
    gap: 10px;
}

.employee-profile-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
}

.profile-tab {
    padding: 12px 20px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.profile-tab:hover {
    color: var(--primary-color);
}

.profile-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.profile-tab-content {
    display: none;
}

.profile-tab-content.active {
    display: block;
}

.profile-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.profile-card {
    background: var(--card-background);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.profile-card.wide {
    grid-column: span 2;
}

.profile-card.full-width {
    grid-column: 1 / -1;
}

.profile-card.highlight {
    background: linear-gradient(135deg, var(--primary-light), #e8f5e9);
    border: 1px solid var(--accent-color);
}

.profile-card h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-detail-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-detail {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.profile-detail .label {
    color: var(--text-muted);
}

.profile-detail .value {
    font-weight: 500;
    text-align: right;
}

/* Holiday Balance Display */
.holiday-balance-display {
    text-align: center;
}

.holiday-main-stat {
    margin-bottom: 16px;
}

.holiday-number {
    font-size: 42px;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.holiday-label {
    font-size: 13px;
    color: var(--text-muted);
}

.holiday-breakdown {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    text-align: center;
    font-size: 13px;
}

.holiday-breakdown span {
    color: var(--text-muted);
}

/* Leave Balance Grid */
.leave-balance-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.leave-stat {
    text-align: center;
    padding: 16px;
    background: var(--background-color);
    border-radius: 8px;
}

.leave-stat.highlight {
    background: var(--primary-light);
    border: 1px solid var(--primary-color);
}

.leave-stat .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.leave-stat .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.leave-progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.leave-progress-bar .progress-used {
    height: 100%;
    background: var(--primary-color);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.leave-note {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

.card-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-header-actions h4 {
    margin-bottom: 0;
}

/* Employee Row Styling */
.employee-row.clickable:hover {
    background-color: var(--primary-light);
}

.employee-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.employee-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

/* Contracted/Allocated Hours Bar */
.hours-cell-with-bar {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hours-cell-with-bar span {
    font-weight: 500;
}

.hours-bar-container {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.hours-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.hours-bar-fill.bar-under {
    background: var(--warning-color);
}

.hours-bar-fill.bar-good {
    background: var(--success-color);
}

.hours-bar-fill.bar-over {
    background: var(--danger-color);
}

/* Hours Balance classes */
.balance-under {
    color: var(--warning-color);
    font-weight: 500;
}

.balance-over {
    color: var(--danger-color);
    font-weight: 500;
}

.balance-even {
    color: var(--success-color);
    font-weight: 500;
}

/* Leave Balance classes for reports */
.balance-good {
    color: var(--success-color);
    font-weight: 600;
}

.balance-low {
    color: var(--warning-color);
    font-weight: 600;
}

.balance-none {
    color: var(--danger-color);
    font-weight: 600;
}

/* Staffing Status Indicators */
.staffing-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
}

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

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

.staffing-status.overstaffed {
    background: #e3f2fd;
    color: #1976d2;
}

/* Occupancy Toggle Controls */
.occupancy-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.occ-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    padding: 0;
    line-height: 1;
}

.occ-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
}

.occ-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.occ-value {
    min-width: 36px;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    padding: 4px 8px;
    color: var(--text-primary);
    background: white;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

/* Staffing Indicator Colors */
.staffing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.staffing-indicator.staff-green {
    background: #e8f5e9;
    color: #2e7d32;
}

.staffing-indicator.staff-orange {
    background: #fff3e0;
    color: #e65100;
}

.staffing-indicator.staff-red {
    background: #ffebee;
    color: #c62828;
}

/* Leave Approval Dialog */
.leave-approval-dialog {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.leave-approval-details {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 8px;
}

.leave-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.leave-detail-row:last-child {
    border-bottom: none;
}

.leave-detail-row .label {
    color: var(--text-muted);
    font-weight: 500;
}

.leave-detail-row .value {
    font-weight: 600;
}

.leave-balance-info {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #c8e6c9;
}

.leave-balance-info h4 {
    margin: 0 0 12px 0;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.balance-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.balance-item {
    text-align: center;
    padding: 12px 8px;
    background: white;
    border-radius: 6px;
}

.balance-item.highlight {
    background: var(--primary-color);
    color: white;
}

.balance-item.highlight .balance-label {
    color: rgba(255,255,255,0.8);
}

.balance-item.highlight .balance-value {
    color: white;
}

.balance-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.balance-value {
    display: block;
    font-size: 16px;
    font-weight: 700;
}

.balance-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px;
    background: #fff3e0;
    border-radius: 6px;
    color: var(--warning-color);
    font-size: 13px;
    font-weight: 500;
}

.leave-approval-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.leave-approval-actions .btn {
    display: flex;
    align-items: center;
    gap: 6px;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

/* Resource Allocation Dashboard */
.resource-allocation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.resource-card {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 16px;
    border: 1px solid var(--border-color);
}

.resource-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.resource-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.resource-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.resource-metrics .metric {
    text-align: center;
    padding: 10px;
    background: white;
    border-radius: 8px;
}

.resource-metrics .metric.shortfall {
    grid-column: span 2;
    background: #ffebee;
}

.metric-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.metric-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.occupancy-display {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.occupancy-bar {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.occupancy-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.resource-empty,
.resource-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

/* Staffing Status Dashboard */
.staffing-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.staffing-card {
    background: white;
    border-radius: 10px;
    padding: 16px;
    border: 1px solid var(--border-color);
    transition: box-shadow 0.2s;
}

.staffing-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.staffing-card.understaffed {
    border-color: var(--danger-color);
    border-width: 2px;
}

.staffing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.staffing-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.shift-badge {
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

.staffing-summary {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.summary-item.understaffed .summary-value {
    color: var(--danger-color);
    font-weight: 700;
}

.summary-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.summary-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.staffing-breakdown {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 10px 12px;
}

.breakdown-header {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.role-row {
    display: flex;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
}

.role-row.understaffed {
    background: #ffebee;
    margin: 2px -8px;
    padding: 6px 8px;
    border-radius: 4px;
}

.role-name {
    flex: 1;
    color: var(--text-primary);
}

.role-actual {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 30px;
    text-align: right;
}

.role-actual.text-danger {
    color: var(--danger-color);
}

.role-divider {
    color: var(--text-muted);
    margin: 0 4px;
}

.role-required {
    color: var(--text-muted);
    min-width: 30px;
    text-align: left;
}

.no-requirements {
    padding: 12px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

/* Permissions Settings Grid */
.permissions-grid {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.permissions-header {
    display: grid;
    grid-template-columns: minmax(140px, 2fr) repeat(5, minmax(60px, 1fr));
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 13px;
}

.permissions-header > div {
    padding: 10px 8px;
    border-bottom: 2px solid var(--border-color);
}

.permissions-header .role-col {
    text-align: center;
}

.permissions-body {
    max-height: 500px;
    overflow-y: auto;
}

.permission-row {
    display: grid;
    grid-template-columns: minmax(140px, 2fr) repeat(5, minmax(60px, 1fr));
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s ease;
}

.permission-row:hover {
    background: var(--bg-hover);
}

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

.permission-row .permission-label {
    padding: 10px 8px;
    font-size: 13px;
    color: var(--text-primary);
}

.permission-row .role-col {
    padding: 10px 4px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.permission-row .role-col input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.permission-row .role-col input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Permission section header (e.g. "Section Visibility", "Feature Permissions") */
.permission-section-header {
    display: grid;
    grid-template-columns: minmax(140px, 2fr) repeat(5, minmax(60px, 1fr));
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    border-top: 2px solid var(--border-color);
}

.permission-section-header .permission-label {
    padding: 8px 8px;
}

/* Visibility rows have a subtle accent to distinguish them */
.permission-row.visibility-row {
    background: color-mix(in srgb, var(--primary-color) 4%, transparent);
}

.permission-row.visibility-row:hover {
    background: color-mix(in srgb, var(--primary-color) 8%, transparent);
}

/* Inspection Documents Dashboard */
.inspection-summary {
    margin-bottom: 16px;
}

.inspection-badges {
    display: flex;
    gap: 12px;
}

.inspection-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 20px;
    border-radius: 8px;
    min-width: 80px;
}

.inspection-badge .badge-count {
    font-size: 24px;
    font-weight: 700;
}

.inspection-badge .badge-label {
    font-size: 11px;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.inspection-badge.expired {
    background: #ffebee;
    color: var(--danger-color);
}

.inspection-badge.expiring {
    background: #fff3e0;
    color: var(--warning-color);
}

.inspection-badge.valid {
    background: #e8f5e9;
    color: var(--success-color);
}

.inspection-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.inspection-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.inspection-item:hover {
    background: var(--bg-hover);
}

.inspection-item.expired {
    border-left-color: var(--danger-color);
}

.inspection-item.expiring {
    border-left-color: var(--warning-color);
}

.inspection-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 6px;
}

.inspection-content {
    flex: 1;
    min-width: 0;
}

.inspection-title {
    font-weight: 500;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inspection-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.inspection-status {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
}

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

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

.inspection-empty,
.inspection-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 13px;
}

/* Leave Balance Summary */
.leave-balance-summary {
    margin-bottom: 20px;
}

.leave-balance-cards {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.leave-balance-card {
    background: white;
    border-radius: 10px;
    padding: 16px;
    min-width: 160px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.leave-balance-card.good {
    border-left: 4px solid var(--success-color);
}

.leave-balance-card.low {
    border-left: 4px solid var(--warning-color);
}

.leave-balance-card.exhausted {
    border-left: 4px solid var(--danger-color);
}

.balance-employee {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.balance-hours {
    font-size: 18px;
    margin-bottom: 8px;
}

.balance-hours .remaining {
    font-weight: 700;
    color: var(--text-primary);
}

.balance-hours .separator {
    color: var(--text-muted);
    margin: 0 4px;
}

.balance-hours .total {
    color: var(--text-muted);
    font-size: 14px;
}

.balance-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.balance-bar-used {
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.leave-balance-card.low .balance-bar-used {
    background: var(--warning-color);
}

.leave-balance-card.exhausted .balance-bar-used {
    background: var(--danger-color);
}

.balance-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Leave balance in table */
.balance-good {
    color: var(--success-color);
}

.balance-low {
    color: var(--warning-color);
}

.balance-exhausted {
    color: var(--danger-color);
}

/* Inline Balance Bar in Table */
.inline-balance {
    min-width: 120px;
}

.inline-balance-text {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 4px;
}

.inline-balance-text .remaining-hrs {
    font-weight: 700;
    font-size: 14px;
}

.inline-balance-text .total-hrs {
    font-size: 12px;
    color: var(--text-muted);
}

.inline-balance.good .remaining-hrs {
    color: var(--success-color);
}

.inline-balance.low .remaining-hrs {
    color: var(--warning-color);
}

.inline-balance.exhausted .remaining-hrs {
    color: var(--danger-color);
}

.inline-balance-bar {
    height: 6px;
    background: #e8f5e9;
    border-radius: 3px;
    overflow: hidden;
}

.inline-balance.low .inline-balance-bar {
    background: #fff3e0;
}

.inline-balance.exhausted .inline-balance-bar {
    background: #ffebee;
}

.inline-balance-fill {
    height: 100%;
    background: var(--success-color);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.inline-balance.low .inline-balance-fill {
    background: var(--warning-color);
}

.inline-balance.exhausted .inline-balance-fill {
    background: var(--danger-color);
}

/* Document Status Styles */
.document-status {
    margin-bottom: 8px;
}

.document-status .doc-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #e3f2fd;
    border-radius: 4px;
    color: #1565c0;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.document-status .doc-link:hover {
    background: #bbdefb;
    color: #0d47a1;
}

.document-status .doc-link svg {
    width: 16px;
    height: 16px;
}

.document-status .doc-info {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.document-status .doc-uploaded {
    display: flex;
    align-items: center;
    gap: 8px;
}

.document-status .doc-remove-btn {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
}

.document-status .doc-remove-btn:hover {
    background: #ffebee;
}

/* RTW Documents Table Styles */
.rtw-documents-section {
    margin-top: 16px;
}

.rtw-docs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.rtw-docs-table th,
.rtw-docs-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.rtw-docs-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: var(--text-secondary);
}

.rtw-docs-table .doc-category {
    font-weight: 500;
}

.doc-status-cell .status-pending {
    color: var(--text-secondary);
    font-style: italic;
}

.doc-status-cell .status-uploaded {
    display: flex;
    align-items: center;
    gap: 8px;
}

.doc-status-cell .status-uploaded .doc-filename {
    color: var(--primary-color);
    font-weight: 500;
}

.doc-status-cell .status-uploaded .doc-link {
    color: var(--primary-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.doc-status-cell .status-uploaded .doc-link:hover {
    text-decoration: underline;
}

.doc-status-cell .status-selected {
    color: var(--success-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.doc-status-cell .status-selected::before {
    content: "✓";
}

.doc-actions-cell {
    display: flex;
    gap: 8px;
    align-items: center;
}

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

/* Radio Group Styles */
.radio-group {
    display: flex;
    gap: 20px;
    padding: 8px 0;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s ease;
    flex: 1;
    justify-content: center;
}

.radio-label:hover {
    border-color: var(--primary-color);
    background: #f5f5f5;
}

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

.radio-label input[type="radio"]:checked + .radio-text {
    font-weight: 600;
    color: var(--primary-color);
}

.radio-label:has(input:checked) {
    border-color: var(--primary-color);
    background: #e3f2fd;
}

.radio-text {
    font-size: 0.95rem;
}

/* Now Link */
.now-link {
    font-size: 0.85rem;
    color: var(--primary-color);
    text-decoration: none;
    margin-left: 8px;
    padding: 2px 8px;
    background: #e3f2fd;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.now-link:hover {
    background: #bbdefb;
    text-decoration: none;
}

/* ============= Compliance Module Styles ============= */

/* Dashboard Compliance Widget */
.compliance-badges {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.compliance-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.compliance-badge:hover {
    transform: scale(1.02);
}

.compliance-badge.expired {
    background: #ffebee;
    border: 2px solid #f44336;
}

.compliance-badge.expiring {
    background: #fff3e0;
    border: 2px solid #ff9800;
}

.compliance-badge.valid {
    background: #e8f5e9;
    border: 2px solid #4caf50;
}

.compliance-badge .badge-count {
    font-size: 1.8rem;
    font-weight: 700;
}

.compliance-badge.expired .badge-count { color: #c62828; }
.compliance-badge.expiring .badge-count { color: #e65100; }
.compliance-badge.valid .badge-count { color: #2e7d32; }

.compliance-badge .badge-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 4px;
}

.compliance-badge.expired .badge-label { color: #c62828; }
.compliance-badge.expiring .badge-label { color: #e65100; }
.compliance-badge.valid .badge-label { color: #2e7d32; }

.compliance-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.compliance-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.compliance-item:hover {
    background: #f5f5f5;
}

.compliance-item.expired {
    background: #ffebee;
    border-left: 4px solid #f44336;
}

.compliance-item.expiring {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
}

.compliance-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.compliance-content {
    flex: 1;
}

.compliance-title {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.compliance-meta {
    font-size: 0.8rem;
    color: #666;
    margin-top: 2px;
}

.compliance-status {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.9rem;
}

.compliance-status.expired {
    background: #f44336;
    color: white;
}

.compliance-status.expiring {
    background: #ff9800;
    color: white;
}

.compliance-empty {
    text-align: center;
    color: #888;
    padding: 24px;
    font-style: italic;
}

/* Compliance Page */
.compliance-page-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
}

@media (max-width: 1024px) {
    .compliance-page-layout {
        grid-template-columns: 1fr;
    }
}

/* Document Types List */
.doc-types-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.doc-type-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.doc-type-item.clickable {
    cursor: pointer;
}

.doc-type-item.clickable:hover {
    background: #e9f5ff;
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.doc-type-item.clickable:hover .doc-type-name {
    color: var(--primary-color);
}

.doc-type-info {
    display: flex;
    flex-direction: column;
}

.doc-type-name {
    font-weight: 600;
    color: #333;
}

.doc-type-reminder {
    font-size: 0.8rem;
    color: #666;
}

.doc-type-actions {
    display: flex;
    gap: 4px;
}

/* Compliance Stats */
.compliance-stats {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.stat-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.stat-badge.expired {
    background: #ffebee;
    color: #c62828;
}

.stat-badge.expiring {
    background: #fff3e0;
    color: #e65100;
}

.stat-badge.valid {
    background: #e8f5e9;
    color: #2e7d32;
}

.stat-badge.warning {
    background: #fff3e0;
    color: #e65100;
}

/* Document Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.status-expired {
    background: #ffebee;
    color: #c62828;
}

.status-badge.status-expiring {
    background: #fff3e0;
    color: #e65100;
}

.status-badge.status-valid {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.status-info {
    background: #e3f2fd;
    color: #1565c0;
}

/* Document table row highlighting */
.documents-table tr.row-expired {
    background: #ffebee;
}

.documents-table tr.row-expiring {
    background: #fff8e1;
}

/* Compliance Table Status */
.status-indicator {
    font-size: 1.1rem;
}

tr.status-expired {
    background: #ffebee;
}

tr.status-expiring {
    background: #fff3e0;
}

tr.status-valid {
    background: #e8f5e9;
}

td.status-expired {
    color: #c62828;
    font-weight: 600;
}

td.status-expiring {
    color: #e65100;
    font-weight: 600;
}

td.status-valid {
    color: #2e7d32;
}

/* Collapsible Section Styles */
.collapsible-section {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.collapsible-section .collapsible-header {
    padding: 12px 16px;
    background: var(--bg-light, #f8f9fa);
    border-bottom: 1px solid var(--border-color);
}

.collapsible-section .collapsible-content {
    padding: 0;
}

.collapsible-section .table-container {
    margin: 0;
    border-radius: 0;
    border: none;
}

.collapsible-header {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
    margin: 0;
    font-weight: 500;
    color: var(--text-color);
}

.collapsible-header .badge {
    margin-left: auto;
}

.collapsible-header:hover {
    color: var(--primary-color);
}

.collapse-icon {
    transition: transform 0.2s ease;
    color: #666;
}

.collapse-arrow {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
    color: #666;
}

.collapsible-content {
    max-height: 500px;
    overflow-y: auto;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.2s ease;
}

.collapsible-content.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    overflow: hidden;
}

/* ==================== EMPLOYEE SELF-SERVICE PORTAL ==================== */

.my-portal-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.welcome-banner {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark, #0D8B6D));
    color: white;
    padding: 24px 30px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.welcome-banner h2 {
    margin: 0 0 4px 0;
    font-size: 1.5rem;
}

.welcome-banner p {
    margin: 0;
    opacity: 0.9;
}

.welcome-date {
    font-size: 1.1rem;
    opacity: 0.9;
}

.portal-month-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.portal-month-label {
    font-weight: 600;
    font-size: 1.1rem;
    min-width: 160px;
    text-align: center;
}

.portal-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 1200px) {
    .portal-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .portal-stats-grid {
        grid-template-columns: 1fr;
    }
}

.portal-stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.portal-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portal-stat-icon svg {
    width: 24px;
    height: 24px;
}

.portal-stat-icon.hours {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
}

.portal-stat-icon.salary {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.portal-stat-icon.holidays-earned {
    background: rgba(139, 92, 246, 0.1);
    color: #8B5CF6;
}

.portal-stat-icon.holidays-remaining {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}

.portal-stat-info h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.portal-stat-info p {
    margin: 4px 0 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.portal-content-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 900px) {
    .portal-content-grid {
        grid-template-columns: 1fr;
    }
}

.portal-card {
    min-height: 200px;
}

.portal-card-wide {
    grid-column: span 2;
}

@media (max-width: 900px) {
    .portal-card-wide {
        grid-column: span 1;
    }
}

/* Today's Shift Display */
.today-shift-info {
    text-align: center;
    padding: 20px;
}

.today-shift-info .shift-time {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.today-shift-info .shift-location {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.today-shift-info .shift-hours {
    margin-top: 12px;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.no-shift-today {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
}

.no-shift-today svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* Week Schedule */
.week-schedule-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.week-schedule-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.week-schedule-item.today {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: var(--primary-color);
}

.week-schedule-item.past {
    opacity: 0.6;
}

.schedule-day {
    font-weight: 600;
    min-width: 80px;
}

.schedule-time {
    color: var(--text-secondary);
}

.schedule-hours {
    font-weight: 500;
    color: var(--primary-color);
}

/* Recent Attendance */
.attendance-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.attendance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.attendance-date {
    font-weight: 500;
}

.attendance-times {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.attendance-hours {
    font-weight: 600;
    color: var(--primary-color);
}

/* Leave Summary */
.leave-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

@media (max-width: 900px) {
    .leave-summary-grid {
        grid-template-columns: 1fr;
    }
}

.leave-balance-box,
.leave-requests-box,
.leave-upcoming-box {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 10px;
}

.leave-balance-box h4,
.leave-requests-box h4,
.leave-upcoming-box h4 {
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.leave-balance-stats {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.balance-item {
    text-align: center;
}

.balance-item .balance-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.balance-item .balance-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.balance-item.highlight .balance-value {
    color: var(--primary-color);
}

/* Pending Requests List */
.pending-request-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.request-dates {
    font-weight: 500;
}

.request-type {
    font-size: 0.85rem;
    color: var(--text-muted);
}

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

.request-status.pending {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}

/* Upcoming Leave List */
.upcoming-leave-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

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

/* Leave Request Modal */
.leave-request-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

@media (max-width: 500px) {
    .leave-request-form .form-row {
        grid-template-columns: 1fr;
    }
}

/* Employee-only visibility */
.employee-only {
    display: none;
}

body.role-employee .employee-only {
    display: block;
}

/* Content pages use .active for visibility - don't override with employee-only */
body.role-employee .content-page.employee-only {
    display: none;
}

body.role-employee .content-page.employee-only.active {
    display: block;
}

body.role-employee .nav-item.employee-only {
    display: flex;
}

/* Hide admin/management features for employees */
body.role-employee .admin-only {
    display: none !important;
}

body.role-employee .nav-item[data-page="employees"],
body.role-employee .nav-item[data-page="payroll"],
body.role-employee .nav-item[data-page="reports"],
body.role-employee .nav-item[data-page="insights"],
body.role-employee .nav-item[data-page="compliance"],
body.role-employee .nav-item[data-page="rota"],
body.role-employee .nav-item[data-page="attendance"],
body.role-employee .nav-item[data-page="leave"],
body.role-employee .nav-item[data-page="dashboard"] {
    display: none;
}

/* ============================================
   OPEN SHIFTS ALERT & PANEL
   ============================================ */

.open-shifts-alert {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    border: 1px solid #ffc107;
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
}

.open-shifts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    cursor: pointer;
}

.open-shifts-header:hover {
    background: rgba(255, 193, 7, 0.1);
}

.open-shifts-icon {
    font-size: 20px;
    margin-right: 12px;
}

.open-shifts-count {
    flex: 1;
    font-weight: 600;
    color: #856404;
    font-size: 15px;
}

.open-shifts-panel {
    background: white;
    border-top: 1px solid #ffc107;
    padding: 16px 20px;
    max-height: 400px;
    overflow-y: auto;
}

.open-shifts-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.open-shift-card {
    background: white;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 14px;
    position: relative;
    transition: all 0.2s ease;
}

.open-shift-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.open-shift-card .shift-date {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color);
    margin-bottom: 6px;
}

.open-shift-card .shift-time {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.open-shift-card .shift-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.open-shift-card .detail-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--background-color);
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.open-shift-card .shift-reason {
    font-size: 12px;
    color: #856404;
    background: #fff3cd;
    padding: 6px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.open-shift-card .shift-actions {
    display: flex;
    gap: 8px;
}

.open-shift-card .btn-assign {
    flex: 1;
    padding: 8px 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.open-shift-card .btn-assign:hover {
    background: var(--primary-hover);
}

.open-shift-card .btn-delete-open {
    padding: 8px 12px;
    background: #f8d7da;
    color: #721c24;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.open-shift-card .btn-delete-open:hover {
    background: #f5c6cb;
}

/* Open shift indicator in shifts table */
.shift-tag.open-shift {
    background: linear-gradient(135deg, #ffc107 0%, #ffca28 100%);
    color: #856404;
    font-weight: 600;
    animation: pulse-open 2s infinite;
}

@keyframes pulse-open {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(255, 193, 7, 0);
    }
}

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

.active-session-row {
    background: rgba(76, 175, 80, 0.06) !important;
}

/* Pending Acceptances Alert */
.pending-acceptances-alert {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #64b5f6;
    border-radius: 10px;
    margin-bottom: 15px;
    overflow: hidden;
}

.pending-acceptances-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
}

.pending-icon {
    font-size: 24px;
}

.pending-count {
    flex: 1;
    font-weight: 600;
    color: #1565c0;
    font-size: 15px;
}

.pending-acceptances-panel {
    background: white;
    border-top: 1px solid #64b5f6;
    padding: 16px 20px;
    max-height: 400px;
    overflow-y: auto;
}

.pending-acceptances-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.acceptance-card {
    background: white;
    border: 2px solid #64b5f6;
    border-radius: 8px;
    padding: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.acceptance-card .acceptance-info {
    flex: 1;
}

.acceptance-card .employee-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-color);
}

.acceptance-card .shift-info {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

.acceptance-card .acceptance-actions {
    display: flex;
    gap: 8px;
}

/* My Open Shift Notifications Alert */
.my-notifications-alert {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 1px solid #66bb6a;
    border-radius: 10px;
    margin-bottom: 15px;
    overflow: hidden;
}

.notifications-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
}

.notification-icon {
    font-size: 24px;
}

.notification-count {
    flex: 1;
    font-weight: 600;
    color: #2e7d32;
    font-size: 15px;
}

.my-notifications-panel {
    background: white;
    border-top: 1px solid #66bb6a;
    padding: 16px 20px;
    max-height: 400px;
    overflow-y: auto;
}

.my-notifications-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification-card {
    background: white;
    border: 2px solid #66bb6a;
    border-radius: 8px;
    padding: 14px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.notification-card .notification-info {
    flex: 1;
}

.notification-card .notification-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-color);
}

.notification-card .notification-message {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

.notification-card .notification-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Mark as open shift context action */
.shift-context-menu {
    position: absolute;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 180px;
    overflow: hidden;
}

.shift-context-menu .menu-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.15s;
}

.shift-context-menu .menu-item:hover {
    background: var(--background-color);
}

.shift-context-menu .menu-item.danger {
    color: var(--danger-color);
}

.shift-context-menu .menu-item.danger:hover {
    background: #fff5f5;
}

/* Empty state for open shifts */
.open-shifts-empty {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
}

.open-shifts-empty .icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.open-shifts-empty p {
    font-size: 14px;
}

/* Open shift badge on shift items */
.shift-open-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 12px;
    z-index: 1;
}

.shift-item {
    position: relative;
}

/* ============================================
   REPORTS PAGE - TABS & CATEGORIES
   ============================================ */

.reports-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding: 4px;
    background: var(--background-color);
    border-radius: 10px;
    flex-wrap: wrap;
}

.reports-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.reports-tab:hover {
    background: white;
    color: var(--text-color);
}

.reports-tab.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.reports-tab .tab-icon {
    font-size: 18px;
}

.reports-category {
    animation: fadeIn 0.3s ease;
}

.category-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

/* Report back header for full-screen report view */
.report-back-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.report-back-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: var(--text-color);
}

.report-back-header .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Report cards - updated with proper SVG icons */
.reports-grid .report-card .report-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #5a7fd4 100%);
    border-radius: 12px;
    margin-bottom: 14px;
}

.reports-grid .report-card .report-icon svg {
    width: 32px;
    height: 32px;
    stroke: white;
    color: white;
}

/* PII Disclaimer styling */
.pii-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 13px;
    color: #856404;
    line-height: 1.5;
}

/* Report new window button */
.btn-new-window {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-new-window:hover {
    background: var(--primary-hover);
}

/* Report output container */
.report-output {
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

.report-output .report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--background-color);
    border-bottom: 1px solid var(--border-color);
}

.report-output .report-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.report-output .report-actions {
    display: flex;
    gap: 10px;
}

.report-output .report-content {
    padding: 20px;
    max-height: 600px;
    overflow-y: auto;
}

/* Report table styles */
.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.report-table th {
    background: var(--background-color);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
}

.report-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

.report-table tbody tr:hover {
    background: var(--background-color);
}

.report-table .number {
    text-align: right;
    font-family: 'Monaco', 'Consolas', monospace;
}

.report-table .positive {
    color: #28a745;
}

.report-table .negative {
    color: #dc3545;
}

.report-table .warning {
    color: #ffc107;
}

/* Report summary cards */
.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.report-summary-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.report-summary-card .label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.report-summary-card .value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
}

.report-summary-card.highlight {
    background: linear-gradient(135deg, var(--primary-color) 0%, #5a7fd4 100%);
    border: none;
}

.report-summary-card.highlight .label,
.report-summary-card.highlight .value {
    color: white;
}

/* Report loading state */
.report-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--text-muted);
}

.report-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

/* Report empty state */
.report-empty {
    text-align: center;
    padding: 60px;
    color: var(--text-muted);
}

.report-empty .icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.report-empty p {
    font-size: 14px;
}

/* Auto-resolved attendance rows */
.auto-resolved-row {
    background-color: rgba(255, 193, 7, 0.08);
}

.auto-resolved-row:hover {
    background-color: rgba(255, 193, 7, 0.15);
}

/* Needs review attendance rows */
.needs-review-row {
    background-color: rgba(244, 67, 54, 0.08);
    border-left: 3px solid var(--danger-color);
}

.needs-review-row:hover {
    background-color: rgba(244, 67, 54, 0.12);
}

/* ============= Onboarding UI ============= */

.onboarding-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
}

.onboarding-tabs .tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    position: relative;
}

.onboarding-tabs .tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.onboarding-tabs .tab-btn:hover {
    color: var(--primary-dark);
}

.tab-badge {
    font-size: 0.75em;
    background: var(--danger-color);
    color: white;
    border-radius: 10px;
    padding: 1px 7px;
    margin-left: 6px;
    vertical-align: middle;
}

.onboarding-card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.onboarding-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.onboarding-card-header h4 {
    margin: 0;
    font-size: 1em;
}

.onboarding-card-info {
    flex: 1;
}

.onboarding-card-info span {
    font-size: 0.85em;
}

.onboarding-card-docs {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 0.9em;
}

.doc-stat.danger { color: var(--danger-color); }
.doc-stat.warning { color: var(--warning-color); }

.onboarding-card-actions {
    display: flex;
    gap: 8px;
}

.btn-success {
    background: var(--success-color);
    color: white;
    border: none;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    border: none;
}

/* Portal Document Compliance */

.portal-docs-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.portal-doc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    background: #fafafa;
    border: 1px solid var(--border-color);
}

.portal-doc-item.missing {
    border-left: 3px solid var(--danger-color);
    background: #fff5f5;
}

.portal-doc-item.expired {
    border-left: 3px solid var(--danger-color);
    background: #fff5f5;
}

.portal-doc-item.expiring_soon {
    border-left: 3px solid var(--warning-color);
    background: #fff8e1;
}

.portal-doc-item.valid {
    border-left: 3px solid var(--success-color);
}

.portal-doc-icon {
    font-size: 1.2em;
    width: 28px;
    text-align: center;
}

.portal-doc-info {
    flex: 1;
}

.portal-doc-name {
    font-weight: 600;
    font-size: 0.95em;
}

.portal-doc-status {
    font-size: 0.85em;
    margin-top: 2px;
}

.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }

.badge-success { background: var(--success-color); color: white; }
.badge-danger { background: var(--danger-color); color: white; }
.badge-warning { background: var(--warning-color); color: white; }
.badge-info { background: #0288d1; color: white; }
.badge-secondary { background: #6c757d; color: white; }

.pending-icon.onboarding {
    background-color: rgba(123, 31, 162, 0.1);
    color: #7b1fa2;
}

/* Pending Attendance Banner */
.pending-attendance-banner {
    background: #fff3e0;
    border: 1px solid #ffb74d;
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.pending-banner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #ffe0b2;
    border-bottom: 1px solid #ffb74d;
}

.pending-banner-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #e65100;
}

.pending-banner-content {
    padding: 0;
}

.pending-banner-content .data-table {
    margin: 0;
    border-radius: 0;
}

.pending-banner-content .data-table th {
    background: #fff8e1;
}

/* Review Attendance Banner (needs_review) */
.review-attendance-banner {
    background: #fef3f2;
    border: 1px solid #f87171;
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.review-banner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #fee2e2;
    border-bottom: 1px solid #f87171;
}

.review-banner-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #b91c1c;
}

.review-banner-content {
    padding: 16px;
}

/* =====================================================
   SYSTEM LOGS STYLES
   ===================================================== */

.system-log-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

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

.system-log-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.system-log-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.system-log-icon.error {
    color: var(--danger-color);
}

.system-log-icon.warning {
    color: var(--warning-color);
}

.system-log-icon.info {
    color: var(--info-color);
}

.system-log-info {
    flex: 1;
}

.system-log-title {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.system-log-meta {
    font-size: 12px;
    color: var(--text-muted);
}

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

.system-log-summary {
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--bg-light);
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-muted);
}

.system-log-details {
    margin-top: 12px;
    padding: 12px;
    background: #fef3f2;
    border: 1px solid #f87171;
    border-radius: 6px;
    max-height: 300px;
    overflow-y: auto;
}

.system-log-details ul {
    margin: 0;
    padding-left: 20px;
}

.system-log-details li {
    padding: 4px 0;
    font-size: 13px;
    color: #b91c1c;
    border-bottom: 1px solid #fecaca;
}

.system-log-details li:last-child {
    border-bottom: none;
}

/* Rota drag-and-drop reordering */
.drag-handle {
    cursor: grab;
    color: var(--text-muted);
    font-size: 14px;
    margin-right: 6px;
    user-select: none;
}
.drag-handle:active { cursor: grabbing; }
tr.dragging { opacity: 0.4; }
tr.drag-over { border-top: 2px solid var(--primary-color); }

/* ============================================
   MOBILE RESPONSIVE - HEADER & NAV
   ============================================ */
@media (max-width: 600px) {
    .top-header {
        padding: 0 10px;
        height: auto;
        min-height: var(--header-height);
        flex-wrap: wrap;
        gap: 4px;
    }

    .top-header .logo-icon {
        height: 40px;
        padding: 0 4px;
    }

    .header-right {
        gap: 8px;
    }

    .header-right .location-selector {
        max-width: 110px;
        font-size: 11px;
        padding: 4px 6px;
    }

    .header-right .help-btn {
        padding: 4px;
    }

    .header-right .help-btn svg {
        width: 16px;
        height: 16px;
    }

    .header-right .user-info {
        gap: 4px;
    }

    .header-right .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .header-right .user-email {
        display: none;
    }

    #logout-btn {
        font-size: 11px;
        padding: 4px 8px;
    }

    .top-nav {
        padding: 0 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-item {
        min-width: 52px;
        padding: 4px 6px;
    }

    .nav-icon {
        width: 18px;
        height: 18px;
    }

    .nav-item span:last-child {
        font-size: 8px;
    }

    .content-body {
        padding: 10px;
    }

    .carehome-filter-bar {
        flex-direction: column;
        align-items: stretch !important;
    }

    .rota-action-buttons {
        flex-wrap: wrap;
    }

    .rota-action-buttons .btn {
        font-size: 11px;
        padding: 4px 8px;
    }

    .shifts-header-controls {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 8px !important;
    }
}