:root {
    /* Primary Colors */
    --primary-color: #3b82f6;
    --primary-dark: #1d4ed8;
    --primary-light: #93c5fd;
    
    /* Status Colors */
    --success-color: #10b981;
    --success-dark: #059669;
    --warning-color: #f59e0b;
    --warning-dark: #d97706;
    --danger-color: #ef4444;
    --danger-dark: #dc2626;
    --info-color: #0ea5e9;
    
    /* Priority Colors */
    --priority-urgent: #ef4444;
    --priority-high: #f97316;
    --priority-medium: #eab308;
    --priority-low: #10b981;
    
    /* Calendar Colors */
    --calendar-has-hearing-bg: #fee2e2;
    --calendar-has-hearing-border: #dc2626;
    --calendar-has-hearing-text: #991b1b;
    --calendar-day-hover: #e6f0ff;
    --calendar-day-hover-border: #0d6efd;
    
    /* Theme Colors */
    --dark-bg: #111827;
    --dark-secondary: #1f2937;
    --light-bg: #f8fafc;
    --light-secondary: #f1f5f9;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #f9fafb;
    
    /* Border Colors */
    --border-color: #e5e7eb;
    --border-color-light: #d1d5db;
    --border-color-dark: #374151;
    
    /* Gradients */
    --sidebar-gradient: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    --primary-gradient: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    --success-gradient: linear-gradient(135deg, var(--success-color), var(--success-dark));
    --calendar-gradient: linear-gradient(135deg, #fee2e2, #fecaca);
    
    /* Shadows */
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --hover-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    --button-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    --calendar-shadow: 0 6px 18px rgba(220, 38, 38, 0.15);
    
    /* Spacing & Sizing */
    --sidebar-width: 260px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --calendar-day-size: 45px;
    
    /* Transitions */
    --transition-speed: 0.3s;
    --transition-timing: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== BASE STYLES ===== */
body {
    background-color: var(--light-bg);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* ===== DARK MODE ===== */
[data-bs-theme="dark"] {
    --light-bg: var(--dark-bg);
    --light-secondary: var(--dark-secondary);
    --text-primary: var(--text-light);
    --border-color: var(--border-color-dark);
    --calendar-has-hearing-bg: #7f1d1d;
    --calendar-has-hearing-border: #ef4444;
    --calendar-has-hearing-text: #fecaca;
    --calendar-day-hover: #2d3a4f;
    --calendar-day-hover-border: #60a5fa;
}

[data-bs-theme="dark"] #archive-section .card,
[data-bs-theme="dark"] #appointments-section .card,
[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .case-template-card {
    background-color: var(--dark-secondary);
    color: var(--text-light);
    border-color: var(--border-color-dark);
}

[data-bs-theme="dark"] .table,
[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer {
    color: var(--text-light);
    border-color: var(--border-color-dark);
}

[data-bs-theme="dark"] .table thead th {
    background: linear-gradient(135deg, #374151, #4b5563);
    color: var(--text-light);
}

[data-bs-theme="dark"] .table tbody tr:hover {
    background: rgba(59, 130, 246, 0.1);
}

[data-bs-theme="dark"] .dropdown-menu {
    background-color: var(--dark-secondary);
    border-color: var(--border-color-dark);
}

[data-bs-theme="dark"] .dropdown-item {
    color: var(--text-light);
}

[data-bs-theme="dark"] .dropdown-item:hover {
    background-color: var(--border-color-dark);
}

[data-bs-theme="dark"] .notification-item {
    color: var(--text-light) !important;
}

[data-bs-theme="dark"] .notification-item:hover {
    background-color: var(--border-color-dark) !important;
}

[data-bs-theme="dark"] .notification-item.unread {
    background-color: #1e3a5f !important;
}

[data-bs-theme="dark"] .call-timeline::before {
    background-color: var(--border-color-dark);
}

[data-bs-theme="dark"] .call-log-entry.success {
    background-color: rgba(16, 185, 129, 0.1);
}

[data-bs-theme="dark"] .call-log-entry.warning {
    background-color: rgba(245, 158, 11, 0.1);
}

[data-bs-theme="dark"] .template-tags .badge.bg-light {
    background-color: var(--border-color-dark) !important;
    color: var(--text-light) !important;
}

[data-bs-theme="dark"] #dark-mode-toggle {
    background-color: #f59e0b !important;
    border-color: #f59e0b !important;
    color: #000 !important;
}

[data-bs-theme="dark"] #dark-mode-toggle i {
    color: #000;
}

/* ===== ACCESSIBILITY ===== */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    z-index: 9999;
    text-decoration: none;
    border-radius: 0 0 var(--border-radius-sm) 0;
    transition: top var(--transition-speed);
}

.skip-to-content:focus {
    top: 0;
    outline: 2px solid white;
    outline-offset: 2px;
}

*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus, .btn:focus {
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25);
}

/* ===== SIGNUP FORM – suppress hover effects on non-submit elements ===== */
#signup-form .form-control:hover,
#signup-form .form-select:hover {
    border-color: var(--border-color-light);
    box-shadow: none;
}

#signup-form .card:hover,
#signup-form .card.border-primary:hover,
#signup-form .card.bg-light:hover,
#signup-form .card.border-primary-subtle:hover {
    transform: none !important;
    box-shadow: none !important;
    border-color: inherit !important;
}

#signup-form .form-check-input:hover,
#signup-form label:hover,
#signup-form .form-label:hover,
#signup-form small:hover,
#signup-form .text-muted:hover {
    cursor: default;
}

#signup-form .btn-link:hover,
#signup-form .btn-outline-primary:hover,
#signup-form .btn-outline-secondary:hover {
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.9;
    text-decoration: none;
}

#signup-form button[type="button"]:not(#signup-submit-btn):hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Keep hover effect ONLY on the Register/Submit button */
#signup-form button[type="submit"]:hover,
#signup-form #signup-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}


#login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: url('Backgrounds/EnhancePalicoBG.png') no-repeat center center fixed;
    background-size: cover;
}

.login-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 516px;
    transform: translateX(64%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideIn 0.6s ease-out;
}

[data-bs-theme="dark"] .login-container {
    background: rgba(31, 41, 55, 1);
    color: var(--text-light);
}

[data-bs-theme="dark"] .login-container h2,
[data-bs-theme="dark"] .login-container .form-label,
[data-bs-theme="dark"] .login-container .text-muted,
[data-bs-theme="dark"] .login-container p {
    color: var(--text-light) !important;
}

[data-bs-theme="dark"] .login-container .form-control {
    background-color: var(--border-color-dark);
    border-color: var(--border-color-dark);
    color: var(--text-light);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(64%); }
}

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

.login-container h2 {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-switch-btn {
    cursor: pointer;
    color: var(--primary-color);
    transition: color 0.2s;
    font-weight: 500;
}

.form-switch-btn:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ===== MAIN APPLICATION LAYOUT ===== */
#main-app {
    min-height: 100vh;
    background: var(--light-bg);
    display: flex;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-gradient);
    color: white;
    padding: 25px 20px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.1);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    overflow: hidden;
}

.sidebar-header {
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
    flex-shrink: 0;
}

.sidebar-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--text-light);
}

.nav-scrollable {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    margin-right: -20px;
    padding-right: 20px;
    max-height: calc(100vh - 200px);
}

.nav-scrollable::-webkit-scrollbar {
    width: 6px;
}

.nav-scrollable::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.nav-scrollable::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.nav-scrollable::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.nav-link-custom {
    color: #d1d5db;
    padding: 14px 18px;
    margin-bottom: 8px;
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    transition: all var(--transition-speed) var(--transition-timing);
    display: flex;
    align-items: center;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.nav-link-custom::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform var(--transition-speed);
}

.nav-link-custom:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    transform: translateX(5px);
}

.nav-link-custom:hover::before {
    transform: scaleY(1);
}

.nav-link-custom.active {
    background: var(--primary-gradient);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(29, 78, 216, 0.3);
}

.nav-link-custom.active::before {
    transform: scaleY(1);
    background: white;
}

.nav-link-custom i {
    margin-right: 12px;
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.logout-btn {
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding-top: 15px !important;
    margin-top: auto;
    padding-bottom: 10px !important;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, var(--dark-bg) 50%);
    z-index: 10;
    width: 100%;
}

.content-area {
    margin-left: var(--sidebar-width);
    padding: 30px;
    flex-grow: 1;
    background: var(--light-bg);
    min-height: 100vh;
}

/* ===== QUICK ACTION BAR ===== */
.quick-action-bar {
    background: white;
    border: 1px solid var(--border-color-light);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 15px 20px;
    margin-bottom: 25px;
}

[data-bs-theme="dark"] .quick-action-bar {
    background: var(--dark-secondary);
    border-color: var(--border-color-dark);
}

.quick-action-bar .btn-sm {
    padding: 8px 16px;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    transition: all 0.2s;
}

.quick-action-bar .btn-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .quick-action-bar .btn-light {
    background-color: var(--border-color-dark);
    border-color: var(--border-color-dark);
    color: var(--text-light);
}

#quick-resolution-btn {
    background: var(--success-gradient);
    color: white;
    border: none;
    font-weight: 600;
}

#quick-resolution-btn:hover {
    background: linear-gradient(135deg, var(--success-dark), #047857);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

/* ===== CONTENT SECTIONS ===== */
.content-section {
    display: block;
    animation: fadeIn 0.3s ease-out;
    max-width: 100%;
    overflow-x: hidden;
}

.content-section.d-none {
    display: none !important;
}


[data-bs-theme="dark"] h2.mb-4,
[data-bs-theme="dark"] h2.mb-3,
[data-bs-theme="dark"] .section-title,
[data-bs-theme="dark"] .card-title.fs-5,
[data-bs-theme="dark"] .content-section > h2,
[data-bs-theme="dark"] .content-section > h3 {
    border-bottom-color: var(--border-color-dark);
}

/* ===== STATS CARDS ===== */
.stat-card {
    border: 1px solid var(--border-color-light);
    border-left: 5px solid;
    box-shadow: var(--card-shadow);
    border-radius: var(--border-radius);
    transition: all var(--transition-speed);
    overflow: hidden;
    height: 100%;
}

[data-bs-theme="dark"] .stat-card {
    background: var(--dark-secondary);
    border-color: var(--border-color-dark);
}

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

.stat-card .count {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-card .count.primary {
    color: var(--primary-color);
}

.stat-card .count.ongoing {
    color: var(--warning-color);
}

.stat-card .count.resolved {
    color: var(--success-color);
}

.stats-icon {
    font-size: 2.5rem;
    opacity: 0.9;
}

/* ===== CALENDAR STYLES (ENHANCED) ===== */
#admin-calendar,
.admin-calendar-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed);
}

[data-bs-theme="dark"] #admin-calendar,
[data-bs-theme="dark"] .admin-calendar-container {
    background: var(--dark-secondary);
    border-color: var(--border-color-dark);
}

.admin-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    background: var(--light-secondary);
    border-radius: 16px;
    padding: 1rem;
    transition: all var(--transition-speed);
}

[data-bs-theme="dark"] .admin-calendar-grid {
    background: var(--border-color-dark);
}

.calendar-day-header {
    font-weight: 600;
    text-align: center;
    padding: 0.75rem 0.25rem;
    background: var(--primary-gradient);
    color: white;
    border-radius: 30px;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.calendar-day {
    aspect-ratio: 1/1;
    background: white;
    border-radius: 14px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: hidden;
}

.calendar-day::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.8) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.2s;
}

.calendar-day:hover::after {
    opacity: 0.1;
}

[data-bs-theme="dark"] .calendar-day {
    background: var(--dark-bg);
    color: var(--text-light);
}

.calendar-day:hover {
    border-color: var(--calendar-day-hover-border);
    background: var(--calendar-day-hover);
    transform: scale(0.98);
    box-shadow: 0 6px 16px rgba(13, 110, 253, 0.15);
}

[data-bs-theme="dark"] .calendar-day:hover {
    background: #2d3748;
    border-color: #60a5fa;
}

.calendar-day.has-hearing {
    background: var(--calendar-has-hearing-bg);
    border: 2px solid var(--calendar-has-hearing-border);
    font-weight: 600;
    animation: calendar-hearing-pulse 2s infinite;
}

@keyframes calendar-hearing-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0.1); }
}

[data-bs-theme="dark"] .calendar-day.has-hearing {
    background: #7f1d1d;
    border-color: #ef4444;
}

.calendar-day-number {
    font-size: 1.3rem;
    font-weight: 500;
    line-height: 1.2;
    z-index: 1;
}

.calendar-day-badge {
    background: var(--danger-color);
    color: white;
    font-size: 0.7rem;
    border-radius: 30px;
    padding: 2px 8px;
    align-self: flex-start;
    margin-top: auto;
    font-weight: 600;
    animation: badge-pulse 1.5s infinite;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
}

@keyframes badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Calendar Legend */
.calendar-legend {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    padding: 10px 15px;
    background: var(--light-secondary);
    border-radius: var(--border-radius);
}

[data-bs-theme="dark"] .calendar-legend {
    background: var(--border-color-dark);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.legend-color.urgent {
    background: var(--danger-color);
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.4);
}

.legend-color.high {
    background: var(--warning-color);
}

.legend-color.medium {
    background: var(--info-color);
}

/* ===== HEARING DAY MODAL ===== */
#hearingDayModal .modal-header {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: white;
}

#hearingDayModal .modal-body {
    padding: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.hearing-item {
    padding: 1rem;
    border-left: 4px solid transparent;
    background: var(--light-secondary);
    margin-bottom: 0.75rem;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s;
}

.hearing-item:hover {
    transform: translateX(5px);
    box-shadow: var(--card-shadow);
}

.hearing-item.urgent {
    border-left-color: var(--danger-color);
}

.hearing-item.high {
    border-left-color: var(--warning-color);
}

.hearing-item.medium {
    border-left-color: var(--info-color);
}

[data-bs-theme="dark"] .hearing-item {
    background: var(--border-color-dark);
}

/* ===== PRIORITY QUEUE ===== */
.priority-queue-list {
    border: 1px solid var(--border-color-light);
    border-radius: var(--border-radius);
    padding: 0.5rem;
    width: 100%;
    max-height: 420px;
    overflow-y: auto;
}

[data-bs-theme="dark"] .priority-queue-list {
    border-color: var(--border-color-dark);
}

.queue-item {
    padding: 0.75rem;
    border-left: 4px solid transparent;
    margin-bottom: 0.5rem;
    background: var(--light-secondary);
    border-radius: var(--border-radius-sm);
    transition: all 0.2s;
}

.queue-item:hover {
    transform: translateX(5px);
    background: var(--calendar-day-hover);
}

.queue-item.urgent-queue {
    border-left-color: var(--danger-color);
}

.queue-item.high-queue {
    border-left-color: var(--warning-color);
}

[data-bs-theme="dark"] .queue-item {
    background: var(--border-color-dark);
}

/* ===== EMERGENCY STYLES ===== */
.emergency-stats-card {
    border: 1px solid var(--border-color-light);
    border-left: 4px solid;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    height: 100%;
}

.emergency-stats-card:hover {
    transform: translateY(-5px);
}

.emergency-type-icon {
    font-size: 1.5rem;
}

.emergency-btn-pulse {
    animation: pulse-red 2s infinite;
    border: none;
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

.emergency-alert {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%) !important;
    border: none !important;
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.4) !important;
    animation: emergency-pulse 2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.emergency-alert::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: emergency-shine 3s linear infinite;
}

@keyframes emergency-pulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(220, 38, 38, 0.4); }
    50% { box-shadow: 0 12px 32px rgba(220, 38, 38, 0.6); }
}

@keyframes emergency-shine {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.emergency-alert .alert-heading {
    color: white !important;
    font-size: 1.25rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.emergency-alert .btn-outline-dark {
    background: white !important;
    color: #dc2626 !important;
    border: 2px solid white !important;
    font-weight: 700;
    transition: all 0.3s ease;
}

.emergency-alert .btn-outline-dark:hover {
    background: rgba(255, 255, 255, 0.9) !important;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.emergency-alert .fas.fa-exclamation-triangle {
    animation: emergency-icon-pulse 1.5s ease-in-out infinite;
}

@keyframes emergency-icon-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

[data-bs-theme="dark"] .emergency-alert {
    background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 100%) !important;
    box-shadow: 0 8px 24px rgba(153, 27, 27, 0.6) !important;
}

/* ===== TABLES ===== */
.table {
    background: white;
    border: 1px solid var(--border-color-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

[data-bs-theme="dark"] .table {
    background: var(--dark-secondary);
    border-color: var(--border-color-dark);
}

.table thead {
    background: linear-gradient(135deg, var(--dark-secondary), #374151);
    color: white;
}

.table thead th {
    border: none;
    padding: 16px 12px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: all 0.2s;
    border-bottom: 1px solid var(--light-secondary);
}

.table tbody tr:hover {
    background: var(--light-bg);
    transform: scale(1.002);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.table tbody td {
    padding: 14px 12px;
    vertical-align: middle;
    border-color: var(--light-secondary);
}

/* ===== BADGES ===== */
.badge-pending,
.badge-ongoing,
.badge-resolved,
.badge-escalated,
.priority-low,
.priority-medium,
.priority-high,
.priority-urgent,
.zone-1,
.zone-2,
.zone-3,
.zone-4 {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-pending {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
}

.badge-ongoing {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
}

.badge-resolved {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
}

.badge-escalated {
    background: linear-gradient(135deg, #f3e8ff, #e9d5ff);
    color: #6b21a8;
}

.priority-low {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: white !important;
}

.priority-medium {
    background: linear-gradient(135deg, #eab308, #ca8a04) !important;
    color: #78350f !important;
}

.priority-high {
    background: linear-gradient(135deg, #f97316, #ea580c) !important;
    color: white !important;
}

.priority-urgent {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: white !important;
    animation: pulse-red 1.5s infinite;
}

.zone-1 {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
}

.zone-2 {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
}

.zone-3 {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
}

.zone-4 {
    background: linear-gradient(135deg, #fce7f3, #fbcfe8);
    color: #9d174d;
}

.zone-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
}

/* ===== CARDS ===== */
.card {
    border: 1px solid var(--border-color-light);
    border-radius: var(--border-radius);
    transition: all var(--transition-speed);
}

[data-bs-theme="dark"] .card {
    background: var(--dark-secondary);
    border-color: var(--border-color-dark);
    color: var(--text-light);
}

.card:hover {
    box-shadow: var(--hover-shadow);
}

.card-header {
    border-bottom: 1px solid var(--border-color-light);
}

[data-bs-theme="dark"] .card-header {
    border-bottom-color: var(--border-color-dark);
}

/* ===== FORGOT PASSWORD FORM ===== */
#account-found-card {
    border-left: 4px solid #28a745;
    animation: fadeIn 0.5s ease-in;
}

.input-group-text {
    background-color: #f8f9fa;
    border-right: 0;
    border-color: var(--border-color-light);
}

[data-bs-theme="dark"] .input-group-text {
    background-color: var(--border-color-dark);
    border-color: var(--border-color-dark);
    color: var(--text-light);
}

/* ===== VOICE RECORDING ===== */
.voice-recording {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
}

.voice-wave {
    display: flex;
    align-items: flex-end;
    height: 40px;
    gap: 2px;
}

.voice-bar {
    width: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* ===== NOTIFICATION ITEMS ===== */
.notification-item {
    border-left: 3px solid transparent;
    padding-left: 10px;
    color: #1f2937 !important;
    transition: background-color 0.2s ease;
}

.notification-item:hover {
    background-color: #f3f4f6 !important;
}

.notification-item.unread {
    border-left-color: var(--primary-color);
    background-color: #eff6ff !important;
}

/* ===== DROPDOWN MENU ===== */
.dropdown-menu {
    background: white;
    border: 1px solid var(--border-color-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .dropdown-menu {
    background-color: var(--dark-secondary);
    border-color: var(--border-color-dark);
}

/* ===== CASE TEMPLATES ===== */
.case-template-card {
    transition: all 0.2s ease;
    border: 1px solid var(--border-color-light);
    cursor: pointer;
}

.case-template-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.case-template-card .card-body {
    padding: 1.5rem;
}

.template-tags {
    min-height: 24px;
}

.template-meta {
    font-size: 0.8rem;
    border-top: 1px solid #f0f0f0;
    padding-top: 10px;
    margin-top: 10px;
}

[data-bs-theme="dark"] .template-meta {
    border-top-color: var(--border-color-dark);
}

#template-details {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

#createTemplateModal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

/* ===== EVIDENCE UPLOAD ===== */
.evidence-upload-area {
    border: 2px dashed var(--border-color-light);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--light-secondary);
}

.evidence-upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.05);
}

.evidence-upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
}

[data-bs-theme="dark"] .evidence-upload-area {
    background: var(--border-color-dark);
    border-color: var(--border-color-dark);
}

.evidence-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.evidence-item {
    position: relative;
    border: 1px solid var(--border-color-light);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    aspect-ratio: 1;
}

.evidence-item img,
.evidence-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.evidence-item .file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: var(--light-secondary);
    font-size: 2rem;
    color: var(--primary-color);
}

.evidence-item .remove-btn {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.evidence-item:hover .remove-btn {
    opacity: 1;
}

[data-bs-theme="dark"] .evidence-item {
    border-color: var(--border-color-dark);
}

[data-bs-theme="dark"] .evidence-item .file-icon {
    background: #1f2937;
}

.evidence-preview {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color-light);
    cursor: pointer;
    transition: transform 0.2s;
}

.evidence-preview:hover {
    transform: scale(1.05);
}

.gallery-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

/* ===== PROFILE ===== */
.profile-pic-container {
    position: relative;
    width: 120px;
    margin: 0 auto;
}

.profile-pic {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
}

.upload-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: var(--primary-color);
    color: white;
    padding: 5px;
    border-radius: 50%;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== STEPPER ===== */
.stepper-wrapper {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    padding: 10px 0;
}

.stepper-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    transition: all 0.3s ease;
}

.stepper-item::before {
    position: absolute;
    content: "";
    border-bottom: 2px solid #e0e0e0;
    width: 100%;
    top: 20px;
    left: -50%;
    z-index: 2;
}

.stepper-item:first-child::before {
    content: none;
}

.stepper-item .step-counter {
    position: relative;
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #e0e0e0;
    margin-bottom: 6px;
    color: white;
    font-weight: bold;
}

.stepper-item.completed .step-counter {
    background-color: var(--success-color);
}

.stepper-item.completed::before {
    border-bottom-color: var(--success-color);
}

.stepper-item.active .step-counter {
    background-color: var(--primary-color);
}

/* ===== SEVERITY INDICATOR STYLING ===== */
.severity-indicator:checked + label {
    font-weight: 600;
    color: var(--danger-color);
}

.severity-indicator[data-weight="4"]:checked + label {
    color: var(--priority-urgent);
}

.severity-indicator[data-weight="3"]:checked + label {
    color: var(--priority-high);
}

.severity-indicator[data-weight="2"]:checked + label {
    color: var(--priority-medium);
}

#suggested-priority-text {
    transition: all 0.3s ease;
}

#priority-badge {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

/* Priority-specific card borders */
.card.border-primary-subtle {
    border-left: 4px solid var(--primary-color) !important;
}

.card.priority-urgent-card {
    border-left: 4px solid var(--priority-urgent) !important;
}

.card.priority-high-card {
    border-left: 4px solid var(--priority-high) !important;
}

.card.priority-medium-card {
    border-left: 4px solid var(--priority-medium) !important;
}

.card.priority-low-card {
    border-left: 4px solid var(--priority-low) !important;
}

/* ===== RESOLUTION WORKFLOW ===== */
.resolution-workflow-step {
    background: white;
    border: 2px solid var(--border-color-light);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    position: relative;
}

.resolution-workflow-step::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-color-light);
    border: 3px solid white;
    box-shadow: 0 0 0 2px var(--border-color-light);
}

.resolution-workflow-step.completed {
    border-color: var(--success-color);
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
}

.resolution-workflow-step.completed::before {
    background: var(--success-color);
    box-shadow: 0 0 0 2px var(--success-color);
}

.resolution-workflow-step.current {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.resolution-workflow-step.current::before {
    background: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color);
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.2); }
}

[data-bs-theme="dark"] .resolution-workflow-step {
    background: var(--dark-secondary);
    border-color: var(--border-color-dark);
}

[data-bs-theme="dark"] .resolution-workflow-step::before {
    background: var(--border-color-dark);
    box-shadow: 0 0 0 2px var(--border-color-dark);
    border-color: var(--dark-secondary);
}

[data-bs-theme="dark"] .resolution-workflow-step.completed {
    background: linear-gradient(135deg, #064e3b, #065f46);
}

[data-bs-theme="dark"] .resolution-workflow-step.current {
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
}

/* ===== CHART CONTAINER ===== */
canvas {
    max-width: 100%;
    height: auto;
}

.chart-container {
    position: relative;
    padding: 1rem;
    background: white;
    border: 1px solid var(--border-color-light);
    border-radius: var(--border-radius);
}

[data-bs-theme="dark"] .chart-container {
    background: var(--dark-secondary);
    border-color: var(--border-color-dark);
}

/* ===== FORM ELEMENTS ===== */
.form-control,
.form-select {
    border: 1px solid var(--border-color-light);
    border-radius: var(--border-radius-sm);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: var(--dark-secondary);
    border-color: var(--border-color-dark);
    color: var(--text-light);
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: var(--dark-secondary);
    border-color: var(--primary-color);
    color: var(--text-light);
}

[data-bs-theme="dark"] .form-check-label {
    color: var(--text-light);
}

[data-bs-theme="dark"] .form-check-input {
    background-color: var(--border-color-dark);
    border-color: #2b2b2b;
}

[data-bs-theme="dark"] .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

[data-bs-theme="dark"] .card.bg-light {
    background-color: var(--border-color-dark) !important;
    color: var(--text-light);
}

/* Input Groups */
.input-group .form-control {
    border-left: none;
}

/* Form Validation — global (non-signup forms keep default behaviour) */
.was-validated .form-control:valid,
.form-control.is-valid {
    border-color: var(--success-color);
    background-image: none;
}

.was-validated .form-control:invalid,
.form-control.is-invalid {
    border-color: var(--danger-color);
    background-image: none;
}

/* ===== SIGNUP FORM — keep borders black and no background tinting on validation ===== */
/* Rely solely on the browser's native "required" tooltip for error feedback */
#signup-form.was-validated .form-control:invalid,
#signup-form.was-validated .form-select:invalid,
#signup-form.was-validated textarea:invalid {
    border-color: #212529 !important; /* stays black */
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    color: inherit !important;
}

#signup-form.was-validated .form-control:valid,
#signup-form.was-validated .form-select:valid,
#signup-form.was-validated textarea:valid {
    border-color: #212529 !important; /* stays black */
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

/* Dark mode — keep borders as-is without colour changes */
[data-bs-theme="dark"] #signup-form.was-validated .form-control:invalid,
[data-bs-theme="dark"] #signup-form.was-validated .form-select:invalid,
[data-bs-theme="dark"] #signup-form.was-validated .form-control:valid,
[data-bs-theme="dark"] #signup-form.was-validated .form-select:valid {
    border-color: var(--border-color-dark) !important;
    background-color: var(--dark-secondary) !important;
    background-image: none !important;
    box-shadow: none !important;
}

/* ===== BUTTON STYLES ===== */
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

[data-bs-theme="dark"] .btn-outline-secondary {
    color: #9ca3af;
    border-color: #6b7280;
}

[data-bs-theme="dark"] .btn-outline-secondary:hover {
    background-color: #6b7280;
    border-color: #6b7280;
    color: var(--text-light);
}

[data-bs-theme="dark"] .btn-outline-primary {
    color: var(--primary-light);
    border-color: var(--primary-color);
}

[data-bs-theme="dark"] .btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: var(--text-light);
}

#dark-mode-toggle {
    transition: all 0.3s ease;
}

/* ===== BACKGROUND COLORS ===== */
.bg-success { background-color: var(--success-color) !important; }
.bg-warning { background-color: var(--warning-color) !important; color: #000 !important; }
.bg-danger { background-color: var(--danger-color) !important; }
.bg-orange { background-color: #be5600 !important; color: white !important; }
.bg-urgent { background-color: var(--danger-color) !important; }
.bg-info { background-color: var(--info-color) !important; color: #000 !important; }
.bg-secondary { background-color: #6c757d !important; }
.bg-dark { background-color: #212529 !important; }

/* ===== TEXT COLORS ===== */
.text-priority-urgent { color: var(--priority-urgent) !important; }
.text-priority-high { color: var(--priority-high) !important; }
.text-priority-medium { color: var(--priority-medium) !important; }
.text-priority-low { color: var(--priority-low) !important; }

[data-bs-theme="dark"] .text-muted {
    color: #9ca3af !important;
}

/* ===== ROLE-BASED VISIBILITY ===== */
body.resident-view .admin-only { display: none !important; }
body.admin-view .admin-only { display: block !important; }
body.admin-view .admin-only.d-flex { display: flex !important; }
body.admin-view .admin-only.card { display: block !important; }
body.admin-view .admin-only[class*="col-"] { display: block !important; }
body.admin-view .admin-only.mb-4 { display: block !important; }

body.admin-view .resident-only { display: none !important; }
body.resident-view .resident-only { display: block !important; }
body.resident-view .resident-only.btn { display: inline-block !important; }
body.resident-view .resident-only.d-flex { display: flex !important; }
body.resident-view .resident-only.row { display: flex !important; }
body.admin-view .admin-only.row { display: flex !important; }

/* ===== SCHEDULE SECTION ===== */
#schedule-section,
#appointments-section {
    display: none;
    padding-top: 20px;
    width: 100%;
    overflow-x: hidden;
}

#schedule-section.active-section,
#appointments-section.active-section {
    display: block !important;
}

.schedule-container {
    background: white;
    border: 1px solid var(--border-color-light);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    margin-bottom: 30px;
}

[data-bs-theme="dark"] .schedule-container {
    background: var(--dark-secondary);
    border-color: var(--border-color-dark);
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light-secondary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--border-color-dark);
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #4b5563;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 992px) {
    .sidebar {
        width: 220px;
        transform: translateX(-100%);
        transition: transform var(--transition-speed);
        z-index: 1050;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .content-area {
        margin-left: 0;
        padding: 20px;
    }
    
    .login-container {
        transform: translateX(0);
        max-width: 90%;
        margin: 0 20px;
    }
    
    @keyframes slideIn {
        to { transform: translateX(0); }
    }
    
    .admin-calendar-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 4px;
        padding: 0.5rem;
    }
    
    .calendar-day-header {
        font-size: 0.7rem;
        padding: 0.5rem 0;
    }
    
    .calendar-day-number {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .stat-card .count {
        font-size: 2.2rem;
    }
    
    .stats-icon {
        font-size: 2rem;
    }
    
    .content-area {
        padding: 15px;
    }
    
    .quick-action-bar {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .quick-action-bar > div {
        width: 100%;
        justify-content: center;
    }
    
    .modal-dialog {
        margin: 10px;
    }
    
    .modal-content {
        border-radius: 12px;
    }
    
    .calendar-legend {
        flex-wrap: wrap;
        gap: 10px;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .sidebar, 
    .quick-action-bar, 
    .modal-footer, 
    .btn-close, 
    .no-print,
    button,
    .btn,
    nav,
    .navbar,
    header,
    footer {
        display: none !important;
    }
    
    .content-area {
        margin-left: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    
    .modal-content {
        border: none !important;
        box-shadow: none !important;
        background: white !important;
        color: black !important;
    }
    
    .modal-dialog {
        max-width: 100% !important;
        margin: 0 !important;
    }
    
    .modal-body {
        padding: 20px !important;
    }
    
    .badge {
        print-color-adjust: exact !important;
        -webkit-print-color-adjust: exact !important;
        border: 1px solid #000 !important;
    }
    
    body {
        color: black !important;
        background: white !important;
    }
    
    .page-break {
        page-break-before: always;
    }
    
    table {
        border-collapse: collapse !important;
        width: 100% !important;
    }
    
    table, th, td {
        border: 1px solid #000 !important;
        color: black !important;
    }
    
    th {
        background-color: #f0f0f0 !important;
        print-color-adjust: exact !important;
    }
}
/* ===== RESIDENT ACCOUNTS MODULE ===== */

/* Status Badges */
.badge-ra-pending {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.78rem;
}

.badge-ra-accepted {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.78rem;
}

.badge-ra-denied {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: #fff;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.78rem;
}

.badge-ra-blacklisted {
    background: linear-gradient(135deg, #111827, #374151);
    color: #fff;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.3px;
}

/* Extra-small action buttons */
.btn-xs {
    padding: 3px 8px;
    font-size: 0.78rem;
    border-radius: 6px;
    line-height: 1.4;
    border: 1px solid transparent;
    transition: all 0.18s ease;
}

.btn-xs:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,0.15); }
.btn-xs:disabled { opacity: 0.38; transform: none; cursor: not-allowed; }

/* colour-code each action */
.ra-accept    { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.ra-accept:hover:not(:disabled)    { background: #10b981; color: #fff; }

.ra-deny      { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.ra-deny:hover:not(:disabled)      { background: #ef4444; color: #fff; }

.ra-blacklist { background: #1f2937; color: #f9fafb; border-color: #374151; }
.ra-blacklist:hover:not(:disabled) { background: #111827; color: #fff; }

.ra-delete    { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.ra-delete:hover:not(:disabled)    { background: #f59e0b; color: #fff; }

.ra-reset-pw {
    background: #e0e7ff;
    color: #1e40af;
    border: 1px solid #c7d2fe;
}
.ra-reset-pw:hover:not(:disabled) {
    background: #6366f1;
    color: #fff;
    border-color: #4f46e5;
}

/* Location edit button inside cell */
.ra-edit-loc {
    padding: 2px 6px;
    font-size: 0.72rem;
    border-radius: 5px;
    line-height: 1.4;
    white-space: nowrap;
}

/* Monospace coord cells */
.font-monospace { font-family: 'Courier New', Courier, monospace; }

/* Very small helper text */
.x-small { font-size: 0.72rem; }

/* Resident Accounts table row highlights */
#ra-table-body tr.table-warning { background-color: rgba(245, 158, 11, 0.08) !important; }
#ra-table-body tr.table-danger  { background-color: rgba(239, 68, 68, 0.08)  !important; }

/* Proof preview container */
#proof-preview-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 8px;
}

#proof-preview-container img {
    max-width: 100%;
    max-height: 450px;
    object-fit: contain;
    border-radius: 6px;
}

/* Summary cards hover */
#ra-summary-cards .card {
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: default;
}
#ra-summary-cards .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
}

/* Sortable column headers */
.ra-sortable { cursor: pointer; user-select: none; }
.ra-sortable:hover { background: rgba(255,255,255,0.06); }

/* Dark mode adjustments */
[data-bs-theme="dark"] .badge-ra-pending    { background: linear-gradient(135deg, #92400e, #78350f); }
[data-bs-theme="dark"] .badge-ra-denied     { background: linear-gradient(135deg, #374151, #1f2937); }
[data-bs-theme="dark"] .badge-ra-blacklisted{ background: linear-gradient(135deg, #6b7280, #374151); }

[data-bs-theme="dark"] .ra-accept    { background: #064e3b; color: #6ee7b7; border-color: #065f46; }
[data-bs-theme="dark"] .ra-deny      { background: #7f1d1d; color: #fca5a5; border-color: #991b1b; }
[data-bs-theme="dark"] .ra-blacklist { background: #374151; color: #e5e7eb; border-color: #4b5563; }
[data-bs-theme="dark"] .ra-delete    { background: #78350f; color: #fde68a; border-color: #92400e; }

[data-bs-theme="dark"] #proof-preview-container {
    background: var(--dark-secondary);
    border-color: var(--border-color-dark);
}

[data-bs-theme="dark"] #ra-summary-cards .card {
    background: var(--dark-secondary);
    border-color: var(--border-color-dark);
}

/* Registration form inline validation */
#signup-form .form-control.is-invalid,
#signup-form .form-select.is-invalid {
    border-color: #dc3545;
    background-image: none;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12);
}

#signup-form .form-control.is-invalid::placeholder {
    color: #dc3545;
    opacity: 0.85;
}

#signup-form .form-control.is-valid,
#signup-form .form-select.is-valid {
    border-color: #10b981;
    background-image: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

#signup-form .form-control.is-invalid ~ .invalid-feedback,
#signup-form .form-select.is-invalid ~ .invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 0.82rem;
    margin-top: 4px;
}

#signup-form label.label-invalid {
    color: #dc3545 !important;
    font-weight: 600;
}

#signup-form small.helper-invalid {
    color: #dc3545 !important;
}

/* Live input clearing — smooth transition back */
#signup-form .form-control,
#signup-form .form-select {
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* Proof modal info card */
#proofModal .card-body p {
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

/* Edit location modal */
#editLocationModal .modal-header {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Responsive tweaks */
@media (max-width: 768px) {
    #ra-table { font-size: 0.82rem; }
    .btn-xs   { padding: 2px 5px; font-size: 0.72rem; }
    #proof-preview-container { min-height: 180px; }
    .ra-edit-loc { display: none; } /* too cramped on mobile — hide inline edit btn */
}

/* ===== NEW: Priority Cases Queue (list-group based) ===== */
.priority-cases-queue > div {
    border-radius: 6px;
}

.priority-cases-queue .list-group {
    gap: 4px;
    display: flex;
    flex-direction: column;
}

.priority-cases-queue .list-group-item {
    transition: box-shadow 0.15s ease, background 0.15s ease;
}

.priority-cases-queue .list-group-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    z-index: 1;
}

[data-bs-theme="dark"] .priority-cases-queue .list-group-item {
    background-color: var(--dark-card-bg, #1e2533);
    color: var(--dark-text, #e2e8f0);
    border-color: var(--border-color-dark, #2d3748);
}

[data-bs-theme="dark"] .priority-cases-queue .list-group-item:hover {
    background-color: rgba(255,255,255,0.06);
}
/* ============================================================
   WALK-IN REPORT & NEW FEATURES STYLES
   ============================================================ */

/* Walk-In Modal header */
#walkInModal .modal-header {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Forgot Password steps */
#forgotPasswordModal .modal-header {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}
#fp-code-input {
    letter-spacing: 0.5rem;
    font-size: 1.5rem;
    text-align: center;
}
#fp-step-2 .alert,
#fp-step-3 .alert {
    font-size: 0.875rem;
}

/* =============================================
   CALL TRACKER TABLE — Enhanced & Shake-free
   ============================================= */
.call-tracker-table-wrap {
    max-height: 600px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid #dee2e6;
    border-radius: 0 0 .5rem .5rem;
    scrollbar-gutter: stable;
}
#call-tracker-table {
    table-layout: fixed;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
#call-tracker-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    border-bottom: 2px solid rgba(255,255,255,.15);
    user-select: none;
}
.ct-sortable { cursor: pointer; }
.ct-sortable:hover { background-color: rgba(255,255,255,.12) !important; }
.ct-th-inner { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.ct-sort-icon { font-size: .72rem; opacity: .45; flex-shrink: 0; transition: opacity .15s; }
.ct-sortable:hover .ct-sort-icon { opacity: 1; }
.ct-sortable.ct-sort-active .ct-sort-icon { opacity: 1; color: #fbbf24; }
#call-tracker-table tbody tr { transition: background-color .1s ease; }
#call-tracker-body tr:hover { background-color: rgba(59,130,246,0.07); }
#call-tracker-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    padding: .5rem .6rem;
}
#call-tracker-table td.ct-cell-household { white-space: normal; line-height: 1.3; }
.ct-priority-badge {
    display: inline-block;
    min-width: 68px;
    text-align: center;
    font-size: .7rem;
    letter-spacing: .04em;
    padding: .25rem .45rem;
    border-radius: .3rem;
}
.ct-status-badge {
    display: inline-block;
    min-width: 125px;
    text-align: center;
    font-size: .7rem;
    letter-spacing: .03em;
    padding: .25rem .45rem;
    border-radius: .3rem;
}
.ct-next-action { font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.ct-actions { display: flex; gap: 3px; justify-content: center; flex-wrap: nowrap; }
.ct-actions .btn { padding: .2rem .42rem; font-size: .72rem; white-space: nowrap; }
.log-call-quick-btn { transition: all 0.2s ease; }
.log-call-quick-btn:hover {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
    color: white !important;
}
#call-tracker-table tbody tr:nth-child(odd) { background-color: rgba(0,0,0,.02); }
[data-bs-theme="dark"] #call-tracker-table tbody tr:nth-child(odd) { background-color: rgba(255,255,255,.03); }

/* =============================================
   EMERGENCY MODAL ENHANCEMENTS
   ============================================= */
#emergencyModal .modal-content { border-radius: .75rem; overflow: hidden; }
#emergencyModal .modal-body { background: #f8f9fa; }
.em-hotline-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .72rem;
    padding: .22rem .55rem;
    border-radius: .35rem;
    text-decoration: none;
    font-weight: 600;
    transition: all .15s;
}
.em-hotline-btn:hover { transform: translateY(-1px); filter: brightness(1.2); }

/* =============================================
   QUICK GUIDE MODAL
   ============================================= */
.swal2-guide-popup .swal2-html-container { max-height: 70vh; overflow-y: auto; }

/* Walk-In badge in case tables */
.badge-walkin {
    background-color: #f59e0b;
    color: #1f2937;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* Call Tracker: status badge improvements */
.call-status-badge {
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    padding: 4px 8px;
    border-radius: 6px;
}

/* Compliance progress bar */
.compliance-bar-wrap {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}
.compliance-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* Quick log button in table */
.log-call-quick-btn i {
    font-size: 0.85rem;
}

/* Forgot password step transitions */
#fp-step-1, #fp-step-2, #fp-step-3 {
    animation: fadeSlideIn 0.25s ease-out;
}
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Walk-in report form card sections */
#walk-in-form .form-label.fw-semibold {
    color: #374151;
    font-size: 0.875rem;
}

/* Export button hover effects */
#export-report-pdf-btn:hover {
    background-color: #15803d;
    border-color: #15803d;
}
#export-report-excel-btn:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
}

/* Dark mode adjustments for new components */
[data-bs-theme="dark"] #walkInModal .modal-content,
[data-bs-theme="dark"] #forgotPasswordModal .modal-content {
    background-color: var(--dark-secondary);
    color: var(--text-light);
}
[data-bs-theme="dark"] #walk-in-form .form-label.fw-semibold {
    color: var(--text-light);
}
[data-bs-theme="dark"] #fp-step-2 .alert,
[data-bs-theme="dark"] #fp-step-3 .alert {
    background-color: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border-color: #065f46;
}
/* ===== SINGLE LOCATION NOTIFICATION ===== */
#location-status-notification {
    animation: fadeIn 0.25s ease-out;
}

#location-status-content {
    transition: all 0.2s ease;
}

/* Larger font for coordinates in location verification */
#verified-lat, #verified-lng {
    font-size: 0.95rem !important;
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

/* Address field helper text styling */
#signup-address + small.text-muted {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
}

.ra-unrestrict {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}
.ra-unrestrict:hover:not(:disabled) {
    background: #10b981;
    color: #fff;
    border-color: #059669;
}

/* Limit Resident Accounts table to about 10 visible rows with scroll */
#resident-accounts-section .card-body.p-0 .table-responsive {
    max-height: 600px;
    overflow-y: auto;
}

/* Optional: style the scrollbar for better visibility */
#resident-accounts-section .card-body.p-0 .table-responsive::-webkit-scrollbar {
    width: 8px;
}
#resident-accounts-section .card-body.p-0 .table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}
#resident-accounts-section .card-body.p-0 .table-responsive::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}
#resident-accounts-section .card-body.p-0 .table-responsive::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Fixed size for evidence viewer modal */
#evidenceViewerModal .modal-body {
    height: 730px;          /* fixed height */
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
    overflow: hidden;
}

#evidenceViewerModal img,
#evidenceViewerModal video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;    /* keeps aspect ratio, no cropping */
}

/* Truncate long addresses in Resident Accounts table */
#ra-table td:nth-child(3) {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Optional: show full address on hover */
#ra-table td:nth-child(3):hover {
    white-space: normal;
    word-break: break-word;
    background-color: #fff3cd;
    cursor: help;
}

/* Optional: adjust for smaller screens */
@media (max-width: 800px) {
    #evidenceViewerModal .modal-body {
        height: 350px;
    }
}

/* Priority & Status Card – matches "new complaint" style */
.priority-status-card {
    background: var(--light-secondary);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}
[data-bs-theme="dark"] .priority-status-card {
    background: var(--dark-secondary);
    border-left-color: var(--primary-color);
}

.priority-status-card .badge {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

/* Ensure priority badges use the same gradient colours as in new complaint */
.priority-urgent {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: white !important;
}
.priority-high {
    background: linear-gradient(135deg, #f97316, #ea580c) !important;
    color: white !important;
}
.priority-medium {
    background: linear-gradient(135deg, #eab308, #ca8a04) !important;
    color: #78350f !important;
}
.priority-low {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: white !important;
}

/* Make every content section scrollable, keeping the quick action bar fixed */
.content-section {
    max-height: calc(100vh - 160px); /* adjust 160px based on your header/action bar height */
    overflow-y: auto;
    padding-right: 5px; /* avoid scrollbar overlapping content */
}

/* Optional: smooth scrollbar styling */
.content-section::-webkit-scrollbar {
    width: 8px;
}
.content-section::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}
.content-section::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

/* Prevent form jump when SweetAlert appears */
#addcase-section .card {
    overflow-y: visible;
}
.scrollable-wrapper,
#addcase-section .scrollable-wrapper {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 10px;
}

/* Emergency Table Sorting Headers */
#emergency-table th[data-sort] {
    transition: background-color 0.2s ease;
}

#emergency-table th[data-sort]:hover {
    background-color: #374151; /* Lighter dark gray to indicate it's clickable */
}

/* Priority filter buttons – fixed width and priority colors */
.priority-filter-btn,
.res-priority-filter-btn {
    min-width:100px;
    text-align: center;
}

/* Default (All) – gray */
.priority-filter-btn[data-priority="all"],
.res-priority-filter-btn[data-priority="all"] {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}
.priority-filter-btn[data-priority="all"]:hover,
.res-priority-filter-btn[data-priority="all"]:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

/* Urgent – red */
.priority-filter-btn[data-priority="urgent"],
.res-priority-filter-btn[data-priority="urgent"] {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}
.priority-filter-btn[data-priority="urgent"]:hover,
.res-priority-filter-btn[data-priority="urgent"]:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* High – orange */
.priority-filter-btn[data-priority="high"],
.res-priority-filter-btn[data-priority="high"] {
    background-color: #fd7e14;
    border-color: #fd7e14;
    color: white;
}
.priority-filter-btn[data-priority="high"]:hover,
.res-priority-filter-btn[data-priority="high"]:hover {
    background-color: #e46a0e;
    border-color: #d45c0c;
}

/* Medium – yellow (dark text for contrast) */
.priority-filter-btn[data-priority="medium"],
.res-priority-filter-btn[data-priority="medium"] {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}
.priority-filter-btn[data-priority="medium"]:hover,
.res-priority-filter-btn[data-priority="medium"]:hover {
    background-color: #e0a800;
    border-color: #d39e00;
}

/* Low – green */
.priority-filter-btn[data-priority="low"],
.res-priority-filter-btn[data-priority="low"] {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}
.priority-filter-btn[data-priority="low"]:hover,
.res-priority-filter-btn[data-priority="low"]:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

/* Capitalize first letter of FullCalendar toolbar buttons */
.fc .fc-button .fc-button-text {
    text-transform: capitalize;
}

/* ===== DASHBOARD: CALENDAR & PRIORITY QUEUE ===== */
/* Row stretches both columns to equal height */
#dashboard-section .row.g-4.mb-4 {
    align-items: stretch;
}

/* Both columns use flex to allow cards to fill height */
#dashboard-section .row.g-4.mb-4 .col-md-7,
#dashboard-section .row.g-4.mb-4 .col-md-5 {
    display: flex;
    flex-direction: column;
}

/* Cards take full height of column */
#dashboard-section .row.g-4.mb-4 .card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Card bodies fill the card and use flex column */
#dashboard-section .row.g-4.mb-4 .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Calendar container – lets FullCalendar determine natural height,
   but prevents overflow with a max‑height (optional) */
#admin-calendar {
    max-height: 500px;      /* Adjust this value to your preference */
    overflow-y: auto;
    min-height: 0;          /* Allows flex child to shrink below content height */
}

/* Let FullCalendar use the full available space */
#admin-calendar .fc {
    height: 100% !important;
}

/* Make the priority queue list scrollable */
#priority-queue-list-admin,
#priority-queue-list {
    max-height: 500px;      /* Adjust to your preferred height */
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 5px;     /* Avoid scrollbar overlap */
}
/* Custom two‑line event styling for calendar */
/* Calendar two-line event styling */
.fc-event {
    padding: 4px 2px !important;
}

.fc-event-title {
    font-weight: 700;
    font-size: 0.85rem;
    line-height: 1.2;
    display: block;
    white-space: normal;
}

.fc-event-type {
    font-size: 0.7rem;
    opacity: 0.9;
    line-height: 1.2;
    display: block;
    margin-top: 2px;
    white-space: normal;
}
/* Ensure consistent event styling across all calendar views */
.fc-event {
    border-radius: 4px !important;
    padding: 2px 4px !important;
    border: none !important;
    color: white !important;
}

/* Make month view events (daygrid) look like week view blocks */
.fc-daygrid-block-event .fc-event-main {
    padding: 2px !important;
}

.fc-event-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Syncs Monthly view design with Week/Day view */
.fc-daygrid-event {
    border-radius: 4px !important;
    padding: 2px 4px !important;
    margin-top: 2px !important;
    border: none !important;
    font-size: 0.85em !important;
}

/* Ensure time and title are visible in Month view blocks */
.fc-daygrid-event .fc-event-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.fc-daygrid-event .fc-event-time {
    font-weight: bold;
    font-size: 0.7rem;
    margin-bottom: -2px;
}

.fc-daygrid-event .fc-event-title {
    white-space: nowrap;
    text-overflow: ellipsis;
    font-weight: 500;
}
/* Month View: Minimalist Dot Marker */
.month-dot-event {
    display: flex;
    align-items: center;
    font-size: 5rem;
    padding: 1px 3px;
    background: transparent !important; /* Remove the heavy box background */
    color: var(--dark-bg) !important;
}

.month-dot-event .dot {
    height: 8px;
    width: 8px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}

/* Specific dot colors based on event type if you want */
.fc-event-hearing .dot { background-color: var(--danger-color); }
.fc-event-mediation .dot { background-color: var(--warning-color); }

/* Make sure the "more" link is visible */
.fc-daygrid-more-link {
    font-weight: bold;
    font-size: 0.7rem;
    color: var(--primary-color) !important;
}
/* Hide the default list-style events in Month View only */
.fc-dayGridMonth-view .fc-event {
    display: none !important;
}

/* Style for our custom Day Marker */
.day-has-schedule {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.65rem;
    padding: 2px 5px;
    border-radius: 10px;
    font-weight: bold;
    pointer-events: none; /* Allows clicking the day behind it */
    z-index: 5;
}

/* If you want it to look like a simple dot instead of a badge */
.day-dot-marker {
    position: absolute;
    top: 5px;
    right: 5px;
    height: 8px;
    width: 8px;
    background-color: #ef4444; /* Red dot for attention */
    border-radius: 50%;
    box-shadow: 0 0 0 2px white;
}
/* Ensure the day cell can contain our absolute-positioned dot */
.fc-daygrid-day-number {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
}

/* The Dot Marker */
.day-has-schedule-dot {
    width: 8px;
    height: 8px;
    background-color: var(--danger-color, #ef4444);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 2px rgba(0,0,0,0.2);
}

/* Hide the actual event bars in Month view to keep it clean */
.fc-dayGridMonth-view .fc-event {
    display: none !important;
}
/* More visible day marker – no text, just a dot */
.day-has-schedule-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    background-color: #ef4444;  /* bright red */
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    box-shadow: 0 0 0 2px white, 0 0 0 4px rgba(239, 68, 68, 0.4);
    animation: dot-pulse 1.2s infinite ease-in-out;
}

@keyframes dot-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

/* Optional: make the whole day cell stand out more */
.fc-daygrid-day[data-date] {
    transition: background-color 0.2s;
}

/* For dark mode compatibility */
[data-bs-theme="dark"] .day-has-schedule-dot {
    box-shadow: 0 0 0 2px #1f2937, 0 0 0 4px rgba(239, 68, 68, 0.6);
}

[data-bs-theme="dark"] .fc-daygrid-day.fc-day-today {
    background-color: rgba(59, 130, 246, 0.2);
}
/* Force today's date background even when there are schedules */
.fc .fc-daygrid-day.fc-day-today,
.fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-frame {
    background-color: #fff3cd !important;
    border: 0px solid #f0ad4e !important;
    border-radius: 0px;
}

[data-bs-theme="dark"] .fc .fc-daygrid-day.fc-day-today,
[data-bs-theme="dark"] .fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-frame {
    background-color: #2c3e2f !important;
    border: 0px solid #eab308 !important;
}

.fc-day-today .fc-daygrid-day-number {
    font-weight: 800 !important;
    color: #c2410c !important;
}

[data-bs-theme="dark"] .fc-day-today .fc-daygrid-day-number {
    color: #fbbf24 !important;
}
/* Export report print styles */
@media print {
    .no-print { display: none !important; }
}
input:disabled, input:read-only, select:disabled, textarea:disabled {
    background-color: #e9ecef !important;
}
#logCallModal .form-check-input {
    pointer-events: auto !important;
    cursor: pointer !important;
}
/* ============================================================
   FIXED-WIDTH PRIORITY BADGES (UNIFORM SIZE)
   ============================================================ */

/* All priority badges – fixed width, box design */
.priority-badge,
.badge[class*="priority-"],
.table td .badge.priority-badge {
    width: 95px !important;           /* Fixed width – all badges same size */
    display: inline-block !important;
    text-align: center !important;
    padding: 6px 4px !important;      /* Adjusted padding for fixed width */
    font-weight: 500 !important;
    text-transform: uppercase !important;
    font-size: 0.8rem !important;
    border-radius: 5px !important;    /* Slightly rounded but still box‑like */
    border: none !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important; /* In case text is too long (shouldn't happen) */
    line-height: 1;         /* Ensures consistent vertical height regardless of font metrics */
}

/* Priority Badges – using the same solid colors as filter buttons */
.priority-low,
.badge-low,
.priority-badge.low {
    background-color: #28a745 !important;
    background-image: none !important;
    color: white !important;
}

.priority-medium,
.badge-medium,
.priority-badge.medium {
    background-color: #ffc107 !important;
    background-image: none !important;
    color: #212529 !important;
}

.priority-high,
.badge-high,
.priority-badge.high {
    background-color: #fd7e14 !important;
    background-image: none !important;
    color: white !important;
}

.priority-urgent,
.badge-urgent,
.priority-badge.urgent {
    background-color: #dc3545 !important;
    background-image: none !important;
    color: white !important;
    animation: pulse-red-badge 1.5s infinite !important;
}

/* Pulse animation for urgent (keep existing) */
@keyframes pulse-red-badge {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    70% { transform: scale(1.03); box-shadow: 0 0 0 6px rgba(220, 53, 69, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}
/* All status badges inside table cells (e.g., FILED, RESOLVED, UNDER INVESTIGATION) */
.status-badge-fixed {
    width: 150px;           /* Fixed width – all status badges occupy the same horizontal space,
                               preventing the column from resizing based on text length.
                               "UNDER INVESTIGATION" (the longest status) fits comfortably. */
    text-align: center;     /* Centers the status text horizontally inside the badge */
    display: inline-block;  /* Allows the badge to have width, padding, and margin,
                               while still flowing inline with surrounding content */
    white-space: nowrap;    /* Prevents the status text from wrapping to multiple lines.
                               The text stays on a single line, even if the badge width is fixed.
                               If the text is longer than 150px, it will overflow (but our badges fit). */
    
    /* === Added to match priority badge size and style === */
    padding: 6px 4px;       /* Vertical and horizontal padding – same as priority badges */
    font-size: 0.8rem;      /* Font size – matches priority badges (0.7rem ≈ 11-12px) */
    font-weight: 500;       /* Bold text – matches priority badge font weight */
    border-radius: 5px;     /* Rounded corners – same as priority badges (box‑like but slightly rounded) */
    line-height: 1;         /* Ensures consistent vertical height regardless of font metrics */
}
/* Sidebar icon styling */
.sidebar-icon {
    width: 60px;
    height: 60px;
    object-fit: contain;
    /* If your image is dark and the sidebar has a dark background, use filter to make it white */

}

/* Remove filter if your icon already has a light/white version */
/* .sidebar-icon { filter: none; } */

/* Responsive adjustment for smaller screens */
@media (max-width: 768px) {
    .sidebar-icon {
        width: 30px;
        height: 30px;
    }
}
/* BEFORE – made the text red/orange */
.fc-day-today .fc-daygrid-day-number {
    font-weight: 800 !important;
    color: #c2410c !important;
}

/* AFTER – text colour matches other dates */
.fc-day-today .fc-daygrid-day-number {
    font-weight: 800 !important;
    color: inherit !important;
}
/* Super Admin only items – hidden by default */
.super-admin-only {
    display: none !important;
}

/* Show only when body has super-admin-view class */
body.super-admin-view .super-admin-only {
    display: flex !important;
}
/* Case Details Modal – Status badge fixed width, similar to Priority */
#case-details-modal #modal-status-badge {
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    display: inline-block !important;
    min-width: 170px !important;     /* adjust as needed (table uses 150px) */
    text-align: center !important;
    padding: 0.35rem 0.5rem !important;
    border-radius: 5px !important;
}
/* Staff Accounts – simple card styling (same as Resident Accounts) */
#staff-summary-cards .card {
    transition: transform 0.2s, box-shadow 0.2s;
}
#staff-summary-cards .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
}
/* Make sort icons in Staff table same size as Complaint Records */
#staff-table th .sort-icon {
    font-size: .90rem !important;
    margin-left: 4px;
}
:root {
    /* Primary Colors */
    --primary-color: #3b82f6;
    --primary-dark: #1d4ed8;
    --primary-light: #93c5fd;
    
    /* Status Colors */
    --success-color: #10b981;
    --success-dark: #059669;
    --warning-color: #f59e0b;
    --warning-dark: #d97706;
    --danger-color: #ef4444;
    --danger-dark: #dc2626;
    --info-color: #0ea5e9;
    
    /* Priority Colors */
    --priority-urgent: #ef4444;
    --priority-high: #f97316;
    --priority-medium: #eab308;
    --priority-low: #10b981;
    
    /* Calendar Colors */
    --calendar-has-hearing-bg: #fee2e2;
    --calendar-has-hearing-border: #dc2626;
    --calendar-has-hearing-text: #991b1b;
    --calendar-day-hover: #e6f0ff;
    --calendar-day-hover-border: #0d6efd;
    
    /* Theme Colors */
    --dark-bg: #111827;
    --dark-secondary: #1f2937;
    --light-bg: #f8fafc;
    --light-secondary: #f1f5f9;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #f9fafb;
    
    /* Border Colors */
    --border-color: #e5e7eb;
    --border-color-light: #d1d5db;
    --border-color-dark: #374151;
    
    /* Gradients */
    --sidebar-gradient: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    --primary-gradient: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    --success-gradient: linear-gradient(135deg, var(--success-color), var(--success-dark));
    --calendar-gradient: linear-gradient(135deg, #fee2e2, #fecaca);
    
    /* Shadows */
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --hover-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    --button-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    --calendar-shadow: 0 6px 18px rgba(220, 38, 38, 0.15);
    
    /* Spacing & Sizing */
    --sidebar-width: 260px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --calendar-day-size: 45px;
    
    /* Transitions */
    --transition-speed: 0.3s;
    --transition-timing: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== BASE STYLES ===== */
body {
    background-color: var(--light-bg);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* ===== DARK MODE ===== */
[data-bs-theme="dark"] {
    --light-bg: var(--dark-bg);
    --light-secondary: var(--dark-secondary);
    --text-primary: var(--text-light);
    --border-color: var(--border-color-dark);
    --calendar-has-hearing-bg: #7f1d1d;
    --calendar-has-hearing-border: #ef4444;
    --calendar-has-hearing-text: #fecaca;
    --calendar-day-hover: #2d3a4f;
    --calendar-day-hover-border: #60a5fa;
}

[data-bs-theme="dark"] #archive-section .card,
[data-bs-theme="dark"] #appointments-section .card,
[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .case-template-card {
    background-color: var(--dark-secondary);
    color: var(--text-light);
    border-color: var(--border-color-dark);
}

[data-bs-theme="dark"] .table,
[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer {
    color: var(--text-light);
    border-color: var(--border-color-dark);
}

[data-bs-theme="dark"] .table thead th {
    background: linear-gradient(135deg, #374151, #4b5563);
    color: var(--text-light);
}

[data-bs-theme="dark"] .table tbody tr:hover {
    background: rgba(59, 130, 246, 0.1);
}

[data-bs-theme="dark"] .dropdown-menu {
    background-color: var(--dark-secondary);
    border-color: var(--border-color-dark);
}

[data-bs-theme="dark"] .dropdown-item {
    color: var(--text-light);
}

[data-bs-theme="dark"] .dropdown-item:hover {
    background-color: var(--border-color-dark);
}

[data-bs-theme="dark"] .notification-item {
    color: var(--text-light) !important;
}

[data-bs-theme="dark"] .notification-item:hover {
    background-color: var(--border-color-dark) !important;
}

[data-bs-theme="dark"] .notification-item.unread {
    background-color: #1e3a5f !important;
}

[data-bs-theme="dark"] .call-timeline::before {
    background-color: var(--border-color-dark);
}

[data-bs-theme="dark"] .call-log-entry.success {
    background-color: rgba(16, 185, 129, 0.1);
}

[data-bs-theme="dark"] .call-log-entry.warning {
    background-color: rgba(245, 158, 11, 0.1);
}

[data-bs-theme="dark"] .template-tags .badge.bg-light {
    background-color: var(--border-color-dark) !important;
    color: var(--text-light) !important;
}

[data-bs-theme="dark"] #dark-mode-toggle {
    background-color: #f59e0b !important;
    border-color: #f59e0b !important;
    color: #000 !important;
}

[data-bs-theme="dark"] #dark-mode-toggle i {
    color: #000;
}

/* ===== ACCESSIBILITY ===== */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    z-index: 9999;
    text-decoration: none;
    border-radius: 0 0 var(--border-radius-sm) 0;
    transition: top var(--transition-speed);
}

.skip-to-content:focus {
    top: 0;
    outline: 2px solid white;
    outline-offset: 2px;
}

*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus, .btn:focus {
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25);
}

/* ===== SIGNUP FORM – suppress hover effects on non-submit elements ===== */
#signup-form .form-control:hover,
#signup-form .form-select:hover {
    border-color: var(--border-color-light);
    box-shadow: none;
}

#signup-form .card:hover,
#signup-form .card.border-primary:hover,
#signup-form .card.bg-light:hover,
#signup-form .card.border-primary-subtle:hover {
    transform: none !important;
    box-shadow: none !important;
    border-color: inherit !important;
}

#signup-form .form-check-input:hover,
#signup-form label:hover,
#signup-form .form-label:hover,
#signup-form small:hover,
#signup-form .text-muted:hover {
    cursor: default;
}

#signup-form .btn-link:hover,
#signup-form .btn-outline-primary:hover,
#signup-form .btn-outline-secondary:hover {
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.9;
    text-decoration: none;
}

#signup-form button[type="button"]:not(#signup-submit-btn):hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Keep hover effect ONLY on the Register/Submit button */
#signup-form button[type="submit"]:hover,
#signup-form #signup-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}


#login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: url('Backgrounds/EnhancePalicoBG.png') no-repeat center center fixed;
    background-size: cover;
}

.login-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 516px;
    transform: translateX(64%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideIn 0.6s ease-out;
}

[data-bs-theme="dark"] .login-container {
    background: rgba(31, 41, 55, 1);
    color: var(--text-light);
}

[data-bs-theme="dark"] .login-container h2,
[data-bs-theme="dark"] .login-container .form-label,
[data-bs-theme="dark"] .login-container .text-muted,
[data-bs-theme="dark"] .login-container p {
    color: var(--text-light) !important;
}

[data-bs-theme="dark"] .login-container .form-control {
    background-color: var(--border-color-dark);
    border-color: var(--border-color-dark);
    color: var(--text-light);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(64%); }
}

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

.login-container h2 {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-switch-btn {
    cursor: pointer;
    color: var(--primary-color);
    transition: color 0.2s;
    font-weight: 500;
}

.form-switch-btn:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ===== MAIN APPLICATION LAYOUT ===== */
#main-app {
    min-height: 100vh;
    background: var(--light-bg);
    display: flex;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-gradient);
    color: white;
    padding: 25px 20px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.1);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    overflow: hidden;
}

.sidebar-header {
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
    flex-shrink: 0;
}

.sidebar-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--text-light);
}

.nav-scrollable {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    margin-right: -20px;
    padding-right: 20px;
    max-height: calc(100vh - 200px);
}

.nav-scrollable::-webkit-scrollbar {
    width: 6px;
}

.nav-scrollable::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.nav-scrollable::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.nav-scrollable::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.nav-link-custom {
    color: #d1d5db;
    padding: 14px 18px;
    margin-bottom: 8px;
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    transition: all var(--transition-speed) var(--transition-timing);
    display: flex;
    align-items: center;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.nav-link-custom::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform var(--transition-speed);
}

.nav-link-custom:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    transform: translateX(5px);
}

.nav-link-custom:hover::before {
    transform: scaleY(1);
}

.nav-link-custom.active {
    background: var(--primary-gradient);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(29, 78, 216, 0.3);
}

.nav-link-custom.active::before {
    transform: scaleY(1);
    background: white;
}

.nav-link-custom i {
    margin-right: 12px;
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.logout-btn {
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding-top: 15px !important;
    margin-top: auto;
    padding-bottom: 10px !important;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, var(--dark-bg) 50%);
    z-index: 10;
    width: 100%;
}

.content-area {
    margin-left: var(--sidebar-width);
    padding: 30px;
    flex-grow: 1;
    background: var(--light-bg);
    min-height: 100vh;
}

/* ===== QUICK ACTION BAR ===== */
.quick-action-bar {
    background: white;
    border: 1px solid var(--border-color-light);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 15px 20px;
    margin-bottom: 25px;
}

[data-bs-theme="dark"] .quick-action-bar {
    background: var(--dark-secondary);
    border-color: var(--border-color-dark);
}

.quick-action-bar .btn-sm {
    padding: 8px 16px;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    transition: all 0.2s;
}

.quick-action-bar .btn-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .quick-action-bar .btn-light {
    background-color: var(--border-color-dark);
    border-color: var(--border-color-dark);
    color: var(--text-light);
}

#quick-resolution-btn {
    background: var(--success-gradient);
    color: white;
    border: none;
    font-weight: 600;
}

#quick-resolution-btn:hover {
    background: linear-gradient(135deg, var(--success-dark), #047857);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

/* ===== CONTENT SECTIONS ===== */
.content-section {
    display: block;
    animation: fadeIn 0.3s ease-out;
    max-width: 100%;
    overflow-x: hidden;
}

.content-section.d-none {
    display: none !important;
}


[data-bs-theme="dark"] h2.mb-4,
[data-bs-theme="dark"] h2.mb-3,
[data-bs-theme="dark"] .section-title,
[data-bs-theme="dark"] .card-title.fs-5,
[data-bs-theme="dark"] .content-section > h2,
[data-bs-theme="dark"] .content-section > h3 {
    border-bottom-color: var(--border-color-dark);
}

/* ===== STATS CARDS ===== */
.stat-card {
    border: 1px solid var(--border-color-light);
    border-left: 5px solid;
    box-shadow: var(--card-shadow);
    border-radius: var(--border-radius);
    transition: all var(--transition-speed);
    overflow: hidden;
    height: 100%;
}

[data-bs-theme="dark"] .stat-card {
    background: var(--dark-secondary);
    border-color: var(--border-color-dark);
}

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

.stat-card .count {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-card .count.primary {
    color: var(--primary-color);
}

.stat-card .count.ongoing {
    color: var(--warning-color);
}

.stat-card .count.resolved {
    color: var(--success-color);
}

.stats-icon {
    font-size: 2.5rem;
    opacity: 0.9;
}

/* ===== CALENDAR STYLES (ENHANCED) ===== */
#admin-calendar,
.admin-calendar-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed);
}

[data-bs-theme="dark"] #admin-calendar,
[data-bs-theme="dark"] .admin-calendar-container {
    background: var(--dark-secondary);
    border-color: var(--border-color-dark);
}

.admin-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    background: var(--light-secondary);
    border-radius: 16px;
    padding: 1rem;
    transition: all var(--transition-speed);
}

[data-bs-theme="dark"] .admin-calendar-grid {
    background: var(--border-color-dark);
}

.calendar-day-header {
    font-weight: 600;
    text-align: center;
    padding: 0.75rem 0.25rem;
    background: var(--primary-gradient);
    color: white;
    border-radius: 30px;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.calendar-day {
    aspect-ratio: 1/1;
    background: white;
    border-radius: 14px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: hidden;
}

.calendar-day::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.8) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.2s;
}

.calendar-day:hover::after {
    opacity: 0.1;
}

[data-bs-theme="dark"] .calendar-day {
    background: var(--dark-bg);
    color: var(--text-light);
}

.calendar-day:hover {
    border-color: var(--calendar-day-hover-border);
    background: var(--calendar-day-hover);
    transform: scale(0.98);
    box-shadow: 0 6px 16px rgba(13, 110, 253, 0.15);
}

[data-bs-theme="dark"] .calendar-day:hover {
    background: #2d3748;
    border-color: #60a5fa;
}

.calendar-day.has-hearing {
    background: var(--calendar-has-hearing-bg);
    border: 2px solid var(--calendar-has-hearing-border);
    font-weight: 600;
    animation: calendar-hearing-pulse 2s infinite;
}

@keyframes calendar-hearing-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0.1); }
}

[data-bs-theme="dark"] .calendar-day.has-hearing {
    background: #7f1d1d;
    border-color: #ef4444;
}

.calendar-day-number {
    font-size: 1.3rem;
    font-weight: 500;
    line-height: 1.2;
    z-index: 1;
}

.calendar-day-badge {
    background: var(--danger-color);
    color: white;
    font-size: 0.7rem;
    border-radius: 30px;
    padding: 2px 8px;
    align-self: flex-start;
    margin-top: auto;
    font-weight: 600;
    animation: badge-pulse 1.5s infinite;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
}

@keyframes badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Calendar Legend */
.calendar-legend {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    padding: 10px 15px;
    background: var(--light-secondary);
    border-radius: var(--border-radius);
}

[data-bs-theme="dark"] .calendar-legend {
    background: var(--border-color-dark);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.legend-color.urgent {
    background: var(--danger-color);
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.4);
}

.legend-color.high {
    background: var(--warning-color);
}

.legend-color.medium {
    background: var(--info-color);
}

/* ===== HEARING DAY MODAL ===== */
#hearingDayModal .modal-header {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: white;
}

#hearingDayModal .modal-body {
    padding: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.hearing-item {
    padding: 1rem;
    border-left: 4px solid transparent;
    background: var(--light-secondary);
    margin-bottom: 0.75rem;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s;
}

.hearing-item:hover {
    transform: translateX(5px);
    box-shadow: var(--card-shadow);
}

.hearing-item.urgent {
    border-left-color: var(--danger-color);
}

.hearing-item.high {
    border-left-color: var(--warning-color);
}

.hearing-item.medium {
    border-left-color: var(--info-color);
}

[data-bs-theme="dark"] .hearing-item {
    background: var(--border-color-dark);
}

/* ===== PRIORITY QUEUE ===== */
.priority-queue-list {
    border: 1px solid var(--border-color-light);
    border-radius: var(--border-radius);
    padding: 0.5rem;
    width: 100%;
    max-height: 420px;
    overflow-y: auto;
}

[data-bs-theme="dark"] .priority-queue-list {
    border-color: var(--border-color-dark);
}

.queue-item {
    padding: 0.75rem;
    border-left: 4px solid transparent;
    margin-bottom: 0.5rem;
    background: var(--light-secondary);
    border-radius: var(--border-radius-sm);
    transition: all 0.2s;
}

.queue-item:hover {
    transform: translateX(5px);
    background: var(--calendar-day-hover);
}

.queue-item.urgent-queue {
    border-left-color: var(--danger-color);
}

.queue-item.high-queue {
    border-left-color: var(--warning-color);
}

[data-bs-theme="dark"] .queue-item {
    background: var(--border-color-dark);
}

/* ===== EMERGENCY STYLES ===== */
.emergency-stats-card {
    border: 1px solid var(--border-color-light);
    border-left: 4px solid;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    height: 100%;
}

.emergency-stats-card:hover {
    transform: translateY(-5px);
}

.emergency-type-icon {
    font-size: 1.5rem;
}

.emergency-btn-pulse {
    animation: pulse-red 2s infinite;
    border: none;
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

.emergency-alert {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%) !important;
    border: none !important;
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.4) !important;
    animation: emergency-pulse 2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.emergency-alert::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: emergency-shine 3s linear infinite;
}

@keyframes emergency-pulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(220, 38, 38, 0.4); }
    50% { box-shadow: 0 12px 32px rgba(220, 38, 38, 0.6); }
}

@keyframes emergency-shine {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.emergency-alert .alert-heading {
    color: white !important;
    font-size: 1.25rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.emergency-alert .btn-outline-dark {
    background: white !important;
    color: #dc2626 !important;
    border: 2px solid white !important;
    font-weight: 700;
    transition: all 0.3s ease;
}

.emergency-alert .btn-outline-dark:hover {
    background: rgba(255, 255, 255, 0.9) !important;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.emergency-alert .fas.fa-exclamation-triangle {
    animation: emergency-icon-pulse 1.5s ease-in-out infinite;
}

@keyframes emergency-icon-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

[data-bs-theme="dark"] .emergency-alert {
    background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 100%) !important;
    box-shadow: 0 8px 24px rgba(153, 27, 27, 0.6) !important;
}

/* ===== TABLES ===== */
.table {
    background: white;
    border: 1px solid var(--border-color-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

[data-bs-theme="dark"] .table {
    background: var(--dark-secondary);
    border-color: var(--border-color-dark);
}

.table thead {
    background: linear-gradient(135deg, var(--dark-secondary), #374151);
    color: white;
}

.table thead th {
    border: none;
    padding: 16px 12px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: all 0.2s;
    border-bottom: 1px solid var(--light-secondary);
}

.table tbody tr:hover {
    background: var(--light-bg);
    transform: scale(1.002);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.table tbody td {
    padding: 14px 12px;
    vertical-align: middle;
    border-color: var(--light-secondary);
}

/* ===== BADGES ===== */
.badge-pending,
.badge-ongoing,
.badge-resolved,
.badge-escalated,
.priority-low,
.priority-medium,
.priority-high,
.priority-urgent,
.zone-1,
.zone-2,
.zone-3,
.zone-4 {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-pending {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
}

.badge-ongoing {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
}

.badge-resolved {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
}

.badge-escalated {
    background: linear-gradient(135deg, #f3e8ff, #e9d5ff);
    color: #6b21a8;
}

.priority-low {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: white !important;
}

.priority-medium {
    background: linear-gradient(135deg, #eab308, #ca8a04) !important;
    color: #78350f !important;
}

.priority-high {
    background: linear-gradient(135deg, #f97316, #ea580c) !important;
    color: white !important;
}

.priority-urgent {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: white !important;
    animation: pulse-red 1.5s infinite;
}

.zone-1 {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
}

.zone-2 {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
}

.zone-3 {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
}

.zone-4 {
    background: linear-gradient(135deg, #fce7f3, #fbcfe8);
    color: #9d174d;
}

.zone-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
}

/* ===== CARDS ===== */
.card {
    border: 1px solid var(--border-color-light);
    border-radius: var(--border-radius);
    transition: all var(--transition-speed);
}

[data-bs-theme="dark"] .card {
    background: var(--dark-secondary);
    border-color: var(--border-color-dark);
    color: var(--text-light);
}

.card:hover {
    box-shadow: var(--hover-shadow);
}

.card-header {
    border-bottom: 1px solid var(--border-color-light);
}

[data-bs-theme="dark"] .card-header {
    border-bottom-color: var(--border-color-dark);
}

/* ===== FORGOT PASSWORD FORM ===== */
#account-found-card {
    border-left: 4px solid #28a745;
    animation: fadeIn 0.5s ease-in;
}

.input-group-text {
    background-color: #f8f9fa;
    border-right: 0;
    border-color: var(--border-color-light);
}

[data-bs-theme="dark"] .input-group-text {
    background-color: var(--border-color-dark);
    border-color: var(--border-color-dark);
    color: var(--text-light);
}

/* ===== VOICE RECORDING ===== */
.voice-recording {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
}

.voice-wave {
    display: flex;
    align-items: flex-end;
    height: 40px;
    gap: 2px;
}

.voice-bar {
    width: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* ===== NOTIFICATION ITEMS ===== */
.notification-item {
    border-left: 3px solid transparent;
    padding-left: 10px;
    color: #1f2937 !important;
    transition: background-color 0.2s ease;
}

.notification-item:hover {
    background-color: #f3f4f6 !important;
}

.notification-item.unread {
    border-left-color: var(--primary-color);
    background-color: #eff6ff !important;
}

/* ===== DROPDOWN MENU ===== */
.dropdown-menu {
    background: white;
    border: 1px solid var(--border-color-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .dropdown-menu {
    background-color: var(--dark-secondary);
    border-color: var(--border-color-dark);
}

/* ===== CASE TEMPLATES ===== */
.case-template-card {
    transition: all 0.2s ease;
    border: 1px solid var(--border-color-light);
    cursor: pointer;
}

.case-template-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.case-template-card .card-body {
    padding: 1.5rem;
}

.template-tags {
    min-height: 24px;
}

.template-meta {
    font-size: 0.8rem;
    border-top: 1px solid #f0f0f0;
    padding-top: 10px;
    margin-top: 10px;
}

[data-bs-theme="dark"] .template-meta {
    border-top-color: var(--border-color-dark);
}

#template-details {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

#createTemplateModal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

/* ===== EVIDENCE UPLOAD ===== */
.evidence-upload-area {
    border: 2px dashed var(--border-color-light);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--light-secondary);
}

.evidence-upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.05);
}

.evidence-upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
}

[data-bs-theme="dark"] .evidence-upload-area {
    background: var(--border-color-dark);
    border-color: var(--border-color-dark);
}

.evidence-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.evidence-item {
    position: relative;
    border: 1px solid var(--border-color-light);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    aspect-ratio: 1;
}

.evidence-item img,
.evidence-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.evidence-item .file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: var(--light-secondary);
    font-size: 2rem;
    color: var(--primary-color);
}

.evidence-item .remove-btn {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.evidence-item:hover .remove-btn {
    opacity: 1;
}

[data-bs-theme="dark"] .evidence-item {
    border-color: var(--border-color-dark);
}

[data-bs-theme="dark"] .evidence-item .file-icon {
    background: #1f2937;
}

.evidence-preview {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color-light);
    cursor: pointer;
    transition: transform 0.2s;
}

.evidence-preview:hover {
    transform: scale(1.05);
}

.gallery-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

/* ===== PROFILE ===== */
.profile-pic-container {
    position: relative;
    width: 120px;
    margin: 0 auto;
}

.profile-pic {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
}

.upload-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: var(--primary-color);
    color: white;
    padding: 5px;
    border-radius: 50%;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== STEPPER ===== */
.stepper-wrapper {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    padding: 10px 0;
}

.stepper-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    transition: all 0.3s ease;
}

.stepper-item::before {
    position: absolute;
    content: "";
    border-bottom: 2px solid #e0e0e0;
    width: 100%;
    top: 20px;
    left: -50%;
    z-index: 2;
}

.stepper-item:first-child::before {
    content: none;
}

.stepper-item .step-counter {
    position: relative;
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #e0e0e0;
    margin-bottom: 6px;
    color: white;
    font-weight: bold;
}

.stepper-item.completed .step-counter {
    background-color: var(--success-color);
}

.stepper-item.completed::before {
    border-bottom-color: var(--success-color);
}

.stepper-item.active .step-counter {
    background-color: var(--primary-color);
}

/* ===== SEVERITY INDICATOR STYLING ===== */
.severity-indicator:checked + label {
    font-weight: 600;
    color: var(--danger-color);
}

.severity-indicator[data-weight="4"]:checked + label {
    color: var(--priority-urgent);
}

.severity-indicator[data-weight="3"]:checked + label {
    color: var(--priority-high);
}

.severity-indicator[data-weight="2"]:checked + label {
    color: var(--priority-medium);
}

#suggested-priority-text {
    transition: all 0.3s ease;
}

#priority-badge {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

/* Priority-specific card borders */
.card.border-primary-subtle {
    border-left: 4px solid var(--primary-color) !important;
}

.card.priority-urgent-card {
    border-left: 4px solid var(--priority-urgent) !important;
}

.card.priority-high-card {
    border-left: 4px solid var(--priority-high) !important;
}

.card.priority-medium-card {
    border-left: 4px solid var(--priority-medium) !important;
}

.card.priority-low-card {
    border-left: 4px solid var(--priority-low) !important;
}

/* ===== RESOLUTION WORKFLOW ===== */
.resolution-workflow-step {
    background: white;
    border: 2px solid var(--border-color-light);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    position: relative;
}

.resolution-workflow-step::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-color-light);
    border: 3px solid white;
    box-shadow: 0 0 0 2px var(--border-color-light);
}

.resolution-workflow-step.completed {
    border-color: var(--success-color);
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
}

.resolution-workflow-step.completed::before {
    background: var(--success-color);
    box-shadow: 0 0 0 2px var(--success-color);
}

.resolution-workflow-step.current {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.resolution-workflow-step.current::before {
    background: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color);
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.2); }
}

[data-bs-theme="dark"] .resolution-workflow-step {
    background: var(--dark-secondary);
    border-color: var(--border-color-dark);
}

[data-bs-theme="dark"] .resolution-workflow-step::before {
    background: var(--border-color-dark);
    box-shadow: 0 0 0 2px var(--border-color-dark);
    border-color: var(--dark-secondary);
}

[data-bs-theme="dark"] .resolution-workflow-step.completed {
    background: linear-gradient(135deg, #064e3b, #065f46);
}

[data-bs-theme="dark"] .resolution-workflow-step.current {
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
}

/* ===== CHART CONTAINER ===== */
canvas {
    max-width: 100%;
    height: auto;
}

.chart-container {
    position: relative;
    padding: 1rem;
    background: white;
    border: 1px solid var(--border-color-light);
    border-radius: var(--border-radius);
}

[data-bs-theme="dark"] .chart-container {
    background: var(--dark-secondary);
    border-color: var(--border-color-dark);
}

/* ===== FORM ELEMENTS ===== */
.form-control,
.form-select {
    border: 1px solid var(--border-color-light);
    border-radius: var(--border-radius-sm);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: var(--dark-secondary);
    border-color: var(--border-color-dark);
    color: var(--text-light);
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: var(--dark-secondary);
    border-color: var(--primary-color);
    color: var(--text-light);
}

[data-bs-theme="dark"] .form-check-label {
    color: var(--text-light);
}

[data-bs-theme="dark"] .form-check-input {
    background-color: var(--border-color-dark);
    border-color: #2b2b2b;
}

[data-bs-theme="dark"] .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

[data-bs-theme="dark"] .card.bg-light {
    background-color: var(--border-color-dark) !important;
    color: var(--text-light);
}

/* Input Groups */
.input-group .form-control {
    border-left: none;
}

/* Form Validation — global (non-signup forms keep default behaviour) */
.was-validated .form-control:valid,
.form-control.is-valid {
    border-color: var(--success-color);
    background-image: none;
}

.was-validated .form-control:invalid,
.form-control.is-invalid {
    border-color: var(--danger-color);
    background-image: none;
}

/* ===== SIGNUP FORM — keep borders black and no background tinting on validation ===== */
/* Rely solely on the browser's native "required" tooltip for error feedback */
#signup-form.was-validated .form-control:invalid,
#signup-form.was-validated .form-select:invalid,
#signup-form.was-validated textarea:invalid {
    border-color: #212529 !important; /* stays black */
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    color: inherit !important;
}

#signup-form.was-validated .form-control:valid,
#signup-form.was-validated .form-select:valid,
#signup-form.was-validated textarea:valid {
    border-color: #212529 !important; /* stays black */
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

/* Dark mode — keep borders as-is without colour changes */
[data-bs-theme="dark"] #signup-form.was-validated .form-control:invalid,
[data-bs-theme="dark"] #signup-form.was-validated .form-select:invalid,
[data-bs-theme="dark"] #signup-form.was-validated .form-control:valid,
[data-bs-theme="dark"] #signup-form.was-validated .form-select:valid {
    border-color: var(--border-color-dark) !important;
    background-color: var(--dark-secondary) !important;
    background-image: none !important;
    box-shadow: none !important;
}

/* ===== BUTTON STYLES ===== */
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

[data-bs-theme="dark"] .btn-outline-secondary {
    color: #9ca3af;
    border-color: #6b7280;
}

[data-bs-theme="dark"] .btn-outline-secondary:hover {
    background-color: #6b7280;
    border-color: #6b7280;
    color: var(--text-light);
}

[data-bs-theme="dark"] .btn-outline-primary {
    color: var(--primary-light);
    border-color: var(--primary-color);
}

[data-bs-theme="dark"] .btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: var(--text-light);
}

#dark-mode-toggle {
    transition: all 0.3s ease;
}

/* ===== BACKGROUND COLORS ===== */
.bg-success { background-color: var(--success-color) !important; }
.bg-warning { background-color: var(--warning-color) !important; color: #000 !important; }
.bg-danger { background-color: var(--danger-color) !important; }
.bg-orange { background-color: #be5600 !important; color: white !important; }
.bg-urgent { background-color: var(--danger-color) !important; }
.bg-info { background-color: var(--info-color) !important; color: #000 !important; }
.bg-secondary { background-color: #6c757d !important; }
.bg-dark { background-color: #212529 !important; }

/* ===== TEXT COLORS ===== */
.text-priority-urgent { color: var(--priority-urgent) !important; }
.text-priority-high { color: var(--priority-high) !important; }
.text-priority-medium { color: var(--priority-medium) !important; }
.text-priority-low { color: var(--priority-low) !important; }

[data-bs-theme="dark"] .text-muted {
    color: #9ca3af !important;
}

/* ===== ROLE-BASED VISIBILITY ===== */
body.resident-view .admin-only { display: none !important; }
body.admin-view .admin-only { display: block !important; }
body.admin-view .admin-only.d-flex { display: flex !important; }
body.admin-view .admin-only.card { display: block !important; }
body.admin-view .admin-only[class*="col-"] { display: block !important; }
body.admin-view .admin-only.mb-4 { display: block !important; }

body.admin-view .resident-only { display: none !important; }
body.resident-view .resident-only { display: block !important; }
body.resident-view .resident-only.btn { display: inline-block !important; }
body.resident-view .resident-only.d-flex { display: flex !important; }
body.resident-view .resident-only.row { display: flex !important; }
body.admin-view .admin-only.row { display: flex !important; }

/* ===== SCHEDULE SECTION ===== */
#schedule-section,
#appointments-section {
    display: none;
    padding-top: 20px;
    width: 100%;
    overflow-x: hidden;
}

#schedule-section.active-section,
#appointments-section.active-section {
    display: block !important;
}

.schedule-container {
    background: white;
    border: 1px solid var(--border-color-light);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    margin-bottom: 30px;
}

[data-bs-theme="dark"] .schedule-container {
    background: var(--dark-secondary);
    border-color: var(--border-color-dark);
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light-secondary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--border-color-dark);
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #4b5563;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 992px) {
    .sidebar {
        width: 220px;
        transform: translateX(-100%);
        transition: transform var(--transition-speed);
        z-index: 1050;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .content-area {
        margin-left: 0;
        padding: 20px;
    }
    
    .login-container {
        transform: translateX(0);
        max-width: 90%;
        margin: 0 20px;
    }
    
    @keyframes slideIn {
        to { transform: translateX(0); }
    }
    
    .admin-calendar-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 4px;
        padding: 0.5rem;
    }
    
    .calendar-day-header {
        font-size: 0.7rem;
        padding: 0.5rem 0;
    }
    
    .calendar-day-number {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .stat-card .count {
        font-size: 2.2rem;
    }
    
    .stats-icon {
        font-size: 2rem;
    }
    
    .content-area {
        padding: 15px;
    }
    
    .quick-action-bar {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .quick-action-bar > div {
        width: 100%;
        justify-content: center;
    }
    
    .modal-dialog {
        margin: 10px;
    }
    
    .modal-content {
        border-radius: 12px;
    }
    
    .calendar-legend {
        flex-wrap: wrap;
        gap: 10px;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .sidebar, 
    .quick-action-bar, 
    .modal-footer, 
    .btn-close, 
    .no-print,
    button,
    .btn,
    nav,
    .navbar,
    header,
    footer {
        display: none !important;
    }
    
    .content-area {
        margin-left: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    
    .modal-content {
        border: none !important;
        box-shadow: none !important;
        background: white !important;
        color: black !important;
    }
    
    .modal-dialog {
        max-width: 100% !important;
        margin: 0 !important;
    }
    
    .modal-body {
        padding: 20px !important;
    }
    
    .badge {
        print-color-adjust: exact !important;
        -webkit-print-color-adjust: exact !important;
        border: 1px solid #000 !important;
    }
    
    body {
        color: black !important;
        background: white !important;
    }
    
    .page-break {
        page-break-before: always;
    }
    
    table {
        border-collapse: collapse !important;
        width: 100% !important;
    }
    
    table, th, td {
        border: 1px solid #000 !important;
        color: black !important;
    }
    
    th {
        background-color: #f0f0f0 !important;
        print-color-adjust: exact !important;
    }
}
/* ===== RESIDENT ACCOUNTS MODULE ===== */

/* Status Badges */
.badge-ra-pending {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.78rem;
}

.badge-ra-accepted {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.78rem;
}

.badge-ra-denied {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: #fff;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.78rem;
}

.badge-ra-blacklisted {
    background: linear-gradient(135deg, #111827, #374151);
    color: #fff;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.3px;
}

/* Extra-small action buttons */
.btn-xs {
    padding: 3px 8px;
    font-size: 0.78rem;
    border-radius: 6px;
    line-height: 1.4;
    border: 1px solid transparent;
    transition: all 0.18s ease;
}

.btn-xs:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,0.15); }
.btn-xs:disabled { opacity: 0.38; transform: none; cursor: not-allowed; }

/* colour-code each action */
.ra-accept    { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.ra-accept:hover:not(:disabled)    { background: #10b981; color: #fff; }

.ra-deny      { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.ra-deny:hover:not(:disabled)      { background: #ef4444; color: #fff; }

.ra-blacklist { background: #1f2937; color: #f9fafb; border-color: #374151; }
.ra-blacklist:hover:not(:disabled) { background: #111827; color: #fff; }

.ra-delete    { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.ra-delete:hover:not(:disabled)    { background: #f59e0b; color: #fff; }

.ra-reset-pw {
    background: #e0e7ff;
    color: #1e40af;
    border: 1px solid #c7d2fe;
}
.ra-reset-pw:hover:not(:disabled) {
    background: #6366f1;
    color: #fff;
    border-color: #4f46e5;
}

/* Location edit button inside cell */
.ra-edit-loc {
    padding: 2px 6px;
    font-size: 0.72rem;
    border-radius: 5px;
    line-height: 1.4;
    white-space: nowrap;
}

/* Monospace coord cells */
.font-monospace { font-family: 'Courier New', Courier, monospace; }

/* Very small helper text */
.x-small { font-size: 0.72rem; }

/* Resident Accounts table row highlights */
#ra-table-body tr.table-warning { background-color: rgba(245, 158, 11, 0.08) !important; }
#ra-table-body tr.table-danger  { background-color: rgba(239, 68, 68, 0.08)  !important; }

/* Proof preview container */
#proof-preview-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 8px;
}

#proof-preview-container img {
    max-width: 100%;
    max-height: 450px;
    object-fit: contain;
    border-radius: 6px;
}

/* Summary cards hover */
#ra-summary-cards .card {
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: default;
}
#ra-summary-cards .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
}

/* Sortable column headers */
.ra-sortable { cursor: pointer; user-select: none; }
.ra-sortable:hover { background: rgba(255,255,255,0.06); }

/* Dark mode adjustments */
[data-bs-theme="dark"] .badge-ra-pending    { background: linear-gradient(135deg, #92400e, #78350f); }
[data-bs-theme="dark"] .badge-ra-denied     { background: linear-gradient(135deg, #374151, #1f2937); }
[data-bs-theme="dark"] .badge-ra-blacklisted{ background: linear-gradient(135deg, #6b7280, #374151); }

[data-bs-theme="dark"] .ra-accept    { background: #064e3b; color: #6ee7b7; border-color: #065f46; }
[data-bs-theme="dark"] .ra-deny      { background: #7f1d1d; color: #fca5a5; border-color: #991b1b; }
[data-bs-theme="dark"] .ra-blacklist { background: #374151; color: #e5e7eb; border-color: #4b5563; }
[data-bs-theme="dark"] .ra-delete    { background: #78350f; color: #fde68a; border-color: #92400e; }

[data-bs-theme="dark"] #proof-preview-container {
    background: var(--dark-secondary);
    border-color: var(--border-color-dark);
}

[data-bs-theme="dark"] #ra-summary-cards .card {
    background: var(--dark-secondary);
    border-color: var(--border-color-dark);
}

/* Registration form inline validation */
#signup-form .form-control.is-invalid,
#signup-form .form-select.is-invalid {
    border-color: #dc3545;
    background-image: none;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12);
}

#signup-form .form-control.is-invalid::placeholder {
    color: #dc3545;
    opacity: 0.85;
}

#signup-form .form-control.is-valid,
#signup-form .form-select.is-valid {
    border-color: #10b981;
    background-image: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

#signup-form .form-control.is-invalid ~ .invalid-feedback,
#signup-form .form-select.is-invalid ~ .invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 0.82rem;
    margin-top: 4px;
}

#signup-form label.label-invalid {
    color: #dc3545 !important;
    font-weight: 600;
}

#signup-form small.helper-invalid {
    color: #dc3545 !important;
}

/* Live input clearing — smooth transition back */
#signup-form .form-control,
#signup-form .form-select {
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* Proof modal info card */
#proofModal .card-body p {
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

/* Edit location modal */
#editLocationModal .modal-header {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Responsive tweaks */
@media (max-width: 768px) {
    #ra-table { font-size: 0.82rem; }
    .btn-xs   { padding: 2px 5px; font-size: 0.72rem; }
    #proof-preview-container { min-height: 180px; }
    .ra-edit-loc { display: none; } /* too cramped on mobile — hide inline edit btn */
}

/* ===== NEW: Priority Cases Queue (list-group based) ===== */
.priority-cases-queue > div {
    border-radius: 6px;
}

.priority-cases-queue .list-group {
    gap: 4px;
    display: flex;
    flex-direction: column;
}

.priority-cases-queue .list-group-item {
    transition: box-shadow 0.15s ease, background 0.15s ease;
}

.priority-cases-queue .list-group-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    z-index: 1;
}

[data-bs-theme="dark"] .priority-cases-queue .list-group-item {
    background-color: var(--dark-card-bg, #1e2533);
    color: var(--dark-text, #e2e8f0);
    border-color: var(--border-color-dark, #2d3748);
}

[data-bs-theme="dark"] .priority-cases-queue .list-group-item:hover {
    background-color: rgba(255,255,255,0.06);
}
/* ============================================================
   WALK-IN REPORT & NEW FEATURES STYLES
   ============================================================ */

/* Walk-In Modal header */
#walkInModal .modal-header {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Forgot Password steps */
#forgotPasswordModal .modal-header {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}
#fp-code-input {
    letter-spacing: 0.5rem;
    font-size: 1.5rem;
    text-align: center;
}
#fp-step-2 .alert,
#fp-step-3 .alert {
    font-size: 0.875rem;
}

/* =============================================
   CALL TRACKER TABLE — Enhanced & Shake-free
   ============================================= */
.call-tracker-table-wrap {
    max-height: 600px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid #dee2e6;
    border-radius: 0 0 .5rem .5rem;
    scrollbar-gutter: stable;
}
#call-tracker-table {
    table-layout: fixed;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
#call-tracker-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    border-bottom: 2px solid rgba(255,255,255,.15);
    user-select: none;
}
.ct-sortable { cursor: pointer; }
.ct-sortable:hover { background-color: rgba(255,255,255,.12) !important; }
.ct-th-inner { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.ct-sort-icon { font-size: .72rem; opacity: .45; flex-shrink: 0; transition: opacity .15s; }
.ct-sortable:hover .ct-sort-icon { opacity: 1; }
.ct-sortable.ct-sort-active .ct-sort-icon { opacity: 1; color: #fbbf24; }
#call-tracker-table tbody tr { transition: background-color .1s ease; }
#call-tracker-body tr:hover { background-color: rgba(59,130,246,0.07); }
#call-tracker-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    padding: .5rem .6rem;
}
#call-tracker-table td.ct-cell-household { white-space: normal; line-height: 1.3; }
.ct-priority-badge {
    display: inline-block;
    min-width: 68px;
    text-align: center;
    font-size: .7rem;
    letter-spacing: .04em;
    padding: .25rem .45rem;
    border-radius: .3rem;
}
.ct-status-badge {
    display: inline-block;
    min-width: 125px;
    text-align: center;
    font-size: .7rem;
    letter-spacing: .03em;
    padding: .25rem .45rem;
    border-radius: .3rem;
}
.ct-next-action { font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.ct-actions { display: flex; gap: 3px; justify-content: center; flex-wrap: nowrap; }
.ct-actions .btn { padding: .2rem .42rem; font-size: .72rem; white-space: nowrap; }
.log-call-quick-btn { transition: all 0.2s ease; }
.log-call-quick-btn:hover {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
    color: white !important;
}
#call-tracker-table tbody tr:nth-child(odd) { background-color: rgba(0,0,0,.02); }
[data-bs-theme="dark"] #call-tracker-table tbody tr:nth-child(odd) { background-color: rgba(255,255,255,.03); }

/* =============================================
   EMERGENCY MODAL ENHANCEMENTS
   ============================================= */
#emergencyModal .modal-content { border-radius: .75rem; overflow: hidden; }
#emergencyModal .modal-body { background: #f8f9fa; }
.em-hotline-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .72rem;
    padding: .22rem .55rem;
    border-radius: .35rem;
    text-decoration: none;
    font-weight: 600;
    transition: all .15s;
}
.em-hotline-btn:hover { transform: translateY(-1px); filter: brightness(1.2); }

/* =============================================
   QUICK GUIDE MODAL
   ============================================= */
.swal2-guide-popup .swal2-html-container { max-height: 70vh; overflow-y: auto; }

/* Walk-In badge in case tables */
.badge-walkin {
    background-color: #f59e0b;
    color: #1f2937;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* Call Tracker: status badge improvements */
.call-status-badge {
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    padding: 4px 8px;
    border-radius: 6px;
}

/* Compliance progress bar */
.compliance-bar-wrap {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}
.compliance-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* Quick log button in table */
.log-call-quick-btn i {
    font-size: 0.85rem;
}

/* Forgot password step transitions */
#fp-step-1, #fp-step-2, #fp-step-3 {
    animation: fadeSlideIn 0.25s ease-out;
}
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Walk-in report form card sections */
#walk-in-form .form-label.fw-semibold {
    color: #374151;
    font-size: 0.875rem;
}

/* Export button hover effects */
#export-report-pdf-btn:hover {
    background-color: #15803d;
    border-color: #15803d;
}
#export-report-excel-btn:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
}

/* Dark mode adjustments for new components */
[data-bs-theme="dark"] #walkInModal .modal-content,
[data-bs-theme="dark"] #forgotPasswordModal .modal-content {
    background-color: var(--dark-secondary);
    color: var(--text-light);
}
[data-bs-theme="dark"] #walk-in-form .form-label.fw-semibold {
    color: var(--text-light);
}
[data-bs-theme="dark"] #fp-step-2 .alert,
[data-bs-theme="dark"] #fp-step-3 .alert {
    background-color: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border-color: #065f46;
}
/* ===== SINGLE LOCATION NOTIFICATION ===== */
#location-status-notification {
    animation: fadeIn 0.25s ease-out;
}

#location-status-content {
    transition: all 0.2s ease;
}

/* Larger font for coordinates in location verification */
#verified-lat, #verified-lng {
    font-size: 0.95rem !important;
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

/* Address field helper text styling */
#signup-address + small.text-muted {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
}

.ra-unrestrict {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}
.ra-unrestrict:hover:not(:disabled) {
    background: #10b981;
    color: #fff;
    border-color: #059669;
}

/* Limit Resident Accounts table to about 10 visible rows with scroll */
#resident-accounts-section .card-body.p-0 .table-responsive {
    max-height: 600px;
    overflow-y: auto;
}

/* Optional: style the scrollbar for better visibility */
#resident-accounts-section .card-body.p-0 .table-responsive::-webkit-scrollbar {
    width: 8px;
}
#resident-accounts-section .card-body.p-0 .table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}
#resident-accounts-section .card-body.p-0 .table-responsive::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}
#resident-accounts-section .card-body.p-0 .table-responsive::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Fixed size for evidence viewer modal */
#evidenceViewerModal .modal-body {
    height: 730px;          /* fixed height */
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
    overflow: hidden;
}

#evidenceViewerModal img,
#evidenceViewerModal video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;    /* keeps aspect ratio, no cropping */
}

/* Truncate long addresses in Resident Accounts table */
#ra-table td:nth-child(3) {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Optional: show full address on hover */
#ra-table td:nth-child(3):hover {
    white-space: normal;
    word-break: break-word;
    background-color: #fff3cd;
    cursor: help;
}

/* Optional: adjust for smaller screens */
@media (max-width: 800px) {
    #evidenceViewerModal .modal-body {
        height: 350px;
    }
}

/* Priority & Status Card – matches "new complaint" style */
.priority-status-card {
    background: var(--light-secondary);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}
[data-bs-theme="dark"] .priority-status-card {
    background: var(--dark-secondary);
    border-left-color: var(--primary-color);
}

.priority-status-card .badge {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

/* Ensure priority badges use the same gradient colours as in new complaint */
.priority-urgent {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: white !important;
}
.priority-high {
    background: linear-gradient(135deg, #f97316, #ea580c) !important;
    color: white !important;
}
.priority-medium {
    background: linear-gradient(135deg, #eab308, #ca8a04) !important;
    color: #78350f !important;
}
.priority-low {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: white !important;
}

/* Make every content section scrollable, keeping the quick action bar fixed */
.content-section {
    max-height: calc(100vh - 160px); /* adjust 160px based on your header/action bar height */
    overflow-y: auto;
    padding-right: 5px; /* avoid scrollbar overlapping content */
}

/* Optional: smooth scrollbar styling */
.content-section::-webkit-scrollbar {
    width: 8px;
}
.content-section::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}
.content-section::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

/* Prevent form jump when SweetAlert appears */
#addcase-section .card {
    overflow-y: visible;
}
.scrollable-wrapper,
#addcase-section .scrollable-wrapper {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 10px;
}

/* Emergency Table Sorting Headers */
#emergency-table th[data-sort] {
    transition: background-color 0.2s ease;
}

#emergency-table th[data-sort]:hover {
    background-color: #374151; /* Lighter dark gray to indicate it's clickable */
}

/* Priority filter buttons – fixed width and priority colors */
.priority-filter-btn,
.res-priority-filter-btn {
    min-width:100px;
    text-align: center;
}

/* Default (All) – gray */
.priority-filter-btn[data-priority="all"],
.res-priority-filter-btn[data-priority="all"] {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}
.priority-filter-btn[data-priority="all"]:hover,
.res-priority-filter-btn[data-priority="all"]:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

/* Urgent – red */
.priority-filter-btn[data-priority="urgent"],
.res-priority-filter-btn[data-priority="urgent"] {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}
.priority-filter-btn[data-priority="urgent"]:hover,
.res-priority-filter-btn[data-priority="urgent"]:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* High – orange */
.priority-filter-btn[data-priority="high"],
.res-priority-filter-btn[data-priority="high"] {
    background-color: #fd7e14;
    border-color: #fd7e14;
    color: white;
}
.priority-filter-btn[data-priority="high"]:hover,
.res-priority-filter-btn[data-priority="high"]:hover {
    background-color: #e46a0e;
    border-color: #d45c0c;
}

/* Medium – yellow (dark text for contrast) */
.priority-filter-btn[data-priority="medium"],
.res-priority-filter-btn[data-priority="medium"] {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}
.priority-filter-btn[data-priority="medium"]:hover,
.res-priority-filter-btn[data-priority="medium"]:hover {
    background-color: #e0a800;
    border-color: #d39e00;
}

/* Low – green */
.priority-filter-btn[data-priority="low"],
.res-priority-filter-btn[data-priority="low"] {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}
.priority-filter-btn[data-priority="low"]:hover,
.res-priority-filter-btn[data-priority="low"]:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

/* Capitalize first letter of FullCalendar toolbar buttons */
.fc .fc-button .fc-button-text {
    text-transform: capitalize;
}

/* ===== DASHBOARD: CALENDAR & PRIORITY QUEUE ===== */
/* Row stretches both columns to equal height */
#dashboard-section .row.g-4.mb-4 {
    align-items: stretch;
}

/* Both columns use flex to allow cards to fill height */
#dashboard-section .row.g-4.mb-4 .col-md-7,
#dashboard-section .row.g-4.mb-4 .col-md-5 {
    display: flex;
    flex-direction: column;
}

/* Cards take full height of column */
#dashboard-section .row.g-4.mb-4 .card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Card bodies fill the card and use flex column */
#dashboard-section .row.g-4.mb-4 .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Calendar container – lets FullCalendar determine natural height,
   but prevents overflow with a max‑height (optional) */
#admin-calendar {
    max-height: 500px;      /* Adjust this value to your preference */
    overflow-y: auto;
    min-height: 0;          /* Allows flex child to shrink below content height */
}

/* Let FullCalendar use the full available space */
#admin-calendar .fc {
    height: 100% !important;
}

/* Make the priority queue list scrollable */
#priority-queue-list-admin,
#priority-queue-list {
    max-height: 500px;      /* Adjust to your preferred height */
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 5px;     /* Avoid scrollbar overlap */
}
/* Custom two‑line event styling for calendar */
/* Calendar two-line event styling */
.fc-event {
    padding: 4px 2px !important;
}

.fc-event-title {
    font-weight: 700;
    font-size: 0.85rem;
    line-height: 1.2;
    display: block;
    white-space: normal;
}

.fc-event-type {
    font-size: 0.7rem;
    opacity: 0.9;
    line-height: 1.2;
    display: block;
    margin-top: 2px;
    white-space: normal;
}
/* Ensure consistent event styling across all calendar views */
.fc-event {
    border-radius: 4px !important;
    padding: 2px 4px !important;
    border: none !important;
    color: white !important;
}

/* Make month view events (daygrid) look like week view blocks */
.fc-daygrid-block-event .fc-event-main {
    padding: 2px !important;
}

.fc-event-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Syncs Monthly view design with Week/Day view */
.fc-daygrid-event {
    border-radius: 4px !important;
    padding: 2px 4px !important;
    margin-top: 2px !important;
    border: none !important;
    font-size: 0.85em !important;
}

/* Ensure time and title are visible in Month view blocks */
.fc-daygrid-event .fc-event-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.fc-daygrid-event .fc-event-time {
    font-weight: bold;
    font-size: 0.7rem;
    margin-bottom: -2px;
}

.fc-daygrid-event .fc-event-title {
    white-space: nowrap;
    text-overflow: ellipsis;
    font-weight: 500;
}
/* Month View: Minimalist Dot Marker */
.month-dot-event {
    display: flex;
    align-items: center;
    font-size: 5rem;
    padding: 1px 3px;
    background: transparent !important; /* Remove the heavy box background */
    color: var(--dark-bg) !important;
}

.month-dot-event .dot {
    height: 8px;
    width: 8px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}

/* Specific dot colors based on event type if you want */
.fc-event-hearing .dot { background-color: var(--danger-color); }
.fc-event-mediation .dot { background-color: var(--warning-color); }

/* Make sure the "more" link is visible */
.fc-daygrid-more-link {
    font-weight: bold;
    font-size: 0.7rem;
    color: var(--primary-color) !important;
}
/* Hide the default list-style events in Month View only */
.fc-dayGridMonth-view .fc-event {
    display: none !important;
}

/* Style for our custom Day Marker */
.day-has-schedule {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.65rem;
    padding: 2px 5px;
    border-radius: 10px;
    font-weight: bold;
    pointer-events: none; /* Allows clicking the day behind it */
    z-index: 5;
}

/* If you want it to look like a simple dot instead of a badge */
.day-dot-marker {
    position: absolute;
    top: 5px;
    right: 5px;
    height: 8px;
    width: 8px;
    background-color: #ef4444; /* Red dot for attention */
    border-radius: 50%;
    box-shadow: 0 0 0 2px white;
}
/* Ensure the day cell can contain our absolute-positioned dot */
.fc-daygrid-day-number {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
}

/* The Dot Marker */
.day-has-schedule-dot {
    width: 8px;
    height: 8px;
    background-color: var(--danger-color, #ef4444);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 2px rgba(0,0,0,0.2);
}

/* Hide the actual event bars in Month view to keep it clean */
.fc-dayGridMonth-view .fc-event {
    display: none !important;
}
/* More visible day marker – no text, just a dot */
.day-has-schedule-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    background-color: #ef4444;  /* bright red */
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    box-shadow: 0 0 0 2px white, 0 0 0 4px rgba(239, 68, 68, 0.4);
    animation: dot-pulse 1.2s infinite ease-in-out;
}

@keyframes dot-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

/* Optional: make the whole day cell stand out more */
.fc-daygrid-day[data-date] {
    transition: background-color 0.2s;
}

/* For dark mode compatibility */
[data-bs-theme="dark"] .day-has-schedule-dot {
    box-shadow: 0 0 0 2px #1f2937, 0 0 0 4px rgba(239, 68, 68, 0.6);
}

[data-bs-theme="dark"] .fc-daygrid-day.fc-day-today {
    background-color: rgba(59, 130, 246, 0.2);
}
/* Force today's date background even when there are schedules */
.fc .fc-daygrid-day.fc-day-today,
.fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-frame {
    background-color: #fff3cd !important;
    border: 0px solid #f0ad4e !important;
    border-radius: 0px;
}

[data-bs-theme="dark"] .fc .fc-daygrid-day.fc-day-today,
[data-bs-theme="dark"] .fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-frame {
    background-color: #2c3e2f !important;
    border: 0px solid #eab308 !important;
}

.fc-day-today .fc-daygrid-day-number {
    font-weight: 800 !important;
    color: #c2410c !important;
}

[data-bs-theme="dark"] .fc-day-today .fc-daygrid-day-number {
    color: #fbbf24 !important;
}
/* Export report print styles */
@media print {
    .no-print { display: none !important; }
}
input:disabled, input:read-only, select:disabled, textarea:disabled {
    background-color: #e9ecef !important;
}
#logCallModal .form-check-input {
    pointer-events: auto !important;
    cursor: pointer !important;
}
/* ============================================================
   FIXED-WIDTH PRIORITY BADGES (UNIFORM SIZE)
   ============================================================ */

/* All priority badges – fixed width, box design */
.priority-badge,
.badge[class*="priority-"],
.table td .badge.priority-badge {
    width: 95px !important;           /* Fixed width – all badges same size */
    display: inline-block !important;
    text-align: center !important;
    padding: 6px 4px !important;      /* Adjusted padding for fixed width */
    font-weight: 500 !important;
    text-transform: uppercase !important;
    font-size: 0.8rem !important;
    border-radius: 5px !important;    /* Slightly rounded but still box‑like */
    border: none !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important; /* In case text is too long (shouldn't happen) */
    line-height: 1;         /* Ensures consistent vertical height regardless of font metrics */
}

/* Priority Badges – using the same solid colors as filter buttons */
.priority-low,
.badge-low,
.priority-badge.low {
    background-color: #28a745 !important;
    background-image: none !important;
    color: white !important;
}

.priority-medium,
.badge-medium,
.priority-badge.medium {
    background-color: #ffc107 !important;
    background-image: none !important;
    color: #212529 !important;
}

.priority-high,
.badge-high,
.priority-badge.high {
    background-color: #fd7e14 !important;
    background-image: none !important;
    color: white !important;
}

.priority-urgent,
.badge-urgent,
.priority-badge.urgent {
    background-color: #dc3545 !important;
    background-image: none !important;
    color: white !important;
    animation: pulse-red-badge 1.5s infinite !important;
}

/* Pulse animation for urgent (keep existing) */
@keyframes pulse-red-badge {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    70% { transform: scale(1.03); box-shadow: 0 0 0 6px rgba(220, 53, 69, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}
/* All status badges inside table cells (e.g., FILED, RESOLVED, UNDER INVESTIGATION) */
.status-badge-fixed {
    width: 150px;           /* Fixed width – all status badges occupy the same horizontal space,
                               preventing the column from resizing based on text length.
                               "UNDER INVESTIGATION" (the longest status) fits comfortably. */
    text-align: center;     /* Centers the status text horizontally inside the badge */
    display: inline-block;  /* Allows the badge to have width, padding, and margin,
                               while still flowing inline with surrounding content */
    white-space: nowrap;    /* Prevents the status text from wrapping to multiple lines.
                               The text stays on a single line, even if the badge width is fixed.
                               If the text is longer than 150px, it will overflow (but our badges fit). */
    
    /* === Added to match priority badge size and style === */
    padding: 6px 4px;       /* Vertical and horizontal padding – same as priority badges */
    font-size: 0.8rem;      /* Font size – matches priority badges (0.7rem ≈ 11-12px) */
    font-weight: 500;       /* Bold text – matches priority badge font weight */
    border-radius: 5px;     /* Rounded corners – same as priority badges (box‑like but slightly rounded) */
    line-height: 1;         /* Ensures consistent vertical height regardless of font metrics */
}
/* Sidebar icon styling */
.sidebar-icon {
    width: 60px;
    height: 60px;
    object-fit: contain;
    /* If your image is dark and the sidebar has a dark background, use filter to make it white */

}

/* Remove filter if your icon already has a light/white version */
/* .sidebar-icon { filter: none; } */

/* Responsive adjustment for smaller screens */
@media (max-width: 768px) {
    .sidebar-icon {
        width: 30px;
        height: 30px;
    }
}
/* BEFORE – made the text red/orange */
.fc-day-today .fc-daygrid-day-number {
    font-weight: 800 !important;
    color: #c2410c !important;
}

/* AFTER – text colour matches other dates */
.fc-day-today .fc-daygrid-day-number {
    font-weight: 800 !important;
    color: inherit !important;
}

/* Force summon status badges in the table to have fixed width (same as priority badges) */
#summon-table td .summon-status-badge,
#summon-table .summon-status-badge {
    display: inline-block !important;
    width: 210px !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    padding: 6px 4px !important;
    border-radius: 5px !important;
    border: none !important;
    line-height: 1 !important;
    vertical-align: middle !important;
}

/* Ensure the status badge inside the Summon Detail modal has same style */
#summonDetailModal .sdm-status-badge {
    width: 210px !important;
    display: inline-block !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    padding: 6px 8px !important;
    border-radius: 5px !important;
    line-height: 1.2 !important;
}
/* FORCE Summon Detail Admin Controls to look EXACTLY like Case Details */
#summonDetailModal .cdm-section-head.admin-head {
    background: #fff8e1 !important;
    border-left: 4px solid #f59e0b !important;
    color: #92400e !important;
    padding: 0.6rem 1rem !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    margin-top: 0.5rem !important;
}

/* Remove any extra background from the content area */
#summonDetailModal .px-3.py-3 {
    background: transparent !important;
}
/* Center the pagination (already there, but ensure) */
#summon-pagination {
    justify-content: center !important;
    display: flex !important;
}
#summon-pagination .page-link {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
}

/* ── Staff Accounts summary card hover ── */
#staff-accounts-section .row.g-3.mb-4 .card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: default;
}
#staff-accounts-section .row.g-3.mb-4 .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

/* ── Staff table sortable headers ── */
#staff-table th[data-sort] {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
#staff-table th[data-sort]:hover {
    background: rgba(255, 255, 255, 0.08);
}
/* Summon table – date/time column: 2-line display matching Complaint Records Date Filed */
/* No display:block overrides here — the <br> tag handles the line break */
#summon-table td:nth-child(3) strong {
    font-size: inherit;
    font-weight: 700;
}
#summon-table td:nth-child(3) span {
    font-size: inherit;
    font-weight: 400;
}
/* Kill any pseudo-elements that might create extra lines */
#summon-table td:nth-child(3)::before,
#summon-table td:nth-child(3)::after {
    display: none !important;
    content: none !important;
}/* ============================================================
   APPOINTMENTS TABLE – Type & Status badges (same as Priority)
   ============================================================ */

/* Force all badges inside appointments table to look like priority badges */
#appointments-table-body .badge,
#appointments-table td .badge {
    width: 110px !important;          /* Slightly wider for longer status text (e.g., "Rescheduled") */
    display: inline-block !important;
    text-align: center !important;
    padding: 6px 4px !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    font-size: 0.8rem !important;
    border-radius: 5px !important;
    border: none !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1 !important;
}

/* Keep existing background colours for appointment types and statuses */
#appointments-table-body .badge.bg-secondary,
#appointments-table td .badge.bg-secondary {
    background-color: #6c757d !important;
    color: white !important;
}
#appointments-table-body .badge.bg-primary,
#appointments-table td .badge.bg-primary {
    background-color: #1d4ed8 !important;
    color: white !important;
}
#appointments-table-body .badge.bg-success,
#appointments-table td .badge.bg-success {
    background-color: #059669 !important;
    color: white !important;
}
#appointments-table-body .badge.bg-danger,
#appointments-table td .badge.bg-danger {
    background-color: #dc2626 !important;
    color: white !important;
}
#appointments-table-body .badge.bg-warning,
#appointments-table td .badge.bg-warning {
    background-color: #d97706 !important;
    color: white !important;
}
#appointments-table-body .badge.bg-info,
#appointments-table td .badge.bg-info {
    background-color: #0284c7 !important;
    color: white !important;
}

/* ============================================================
   BLOTTER MANAGEMENT TABLE – Status badge (same as Priority)
   ============================================================ */

/* Apply to all status badges inside blotter table */
#incident-table td .badge,
#incident-table .blotter-status-badge {
    width: 110px !important;
    display: inline-block !important;
    text-align: center !important;
    padding: 6px 4px !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    font-size: 0.8rem !important;
    border-radius: 5px !important;
    border: none !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1 !important;
}

/* Preserve existing background colours for each status */
#incident-table td .badge.bg-primary {
    background-color: #1d4ed8 !important;
    color: white !important;
}
#incident-table td .badge.bg-warning {
    background-color: #d97706 !important;
    color: white !important;
}
#incident-table td .badge.bg-success {
    background-color: #059669 !important;
    color: white !important;
}
#incident-table td .badge.bg-secondary {
    background-color: #4b5563 !important;
    color: white !important;
}
#incident-table td .badge.bg-dark {
    background-color: #1f2937 !important;
    color: white !important;
}
#incident-table td .badge.bg-danger {
    background-color: #dc2626 !important;
    color: white !important;
}