.status-badge.status-online { background:#dcfce7; color:#166534; border:2px solid #22c55e; padding:4px 10px; border-radius:999px; font-weight:700; font-size:14px; display:inline-flex; align-items:center; gap:6px; box-shadow: 0 2px 4px rgba(34, 197, 94, 0.2); }
.status-badge.status-online .dot{ width:8px; height:8px; background:#22c55e; border-radius:50%; display:inline-block; box-shadow: 0 0 6px rgba(34, 197, 94, 0.6); }
.status-badge.status-offline { background:#fef2f2; color:#991b1b; border:2px solid #ef4444; padding:4px 10px; border-radius:999px; font-weight:700; font-size:14px; display:inline-flex; align-items:center; gap:6px; box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2); }
.status-badge.status-offline .dot{ width:8px; height:8px; background:#ef4444; border-radius:50%; display:inline-block; box-shadow: 0 0 6px rgba(239, 68, 68, 0.6); }

.dark-theme .status-badge.status-online{ background:#052e16; color:#86efac; border:2px solid #22c55e; box-shadow: 0 2px 4px rgba(34, 197, 94, 0.3); }
.dark-theme .status-badge.status-online .dot{ background:#22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, 0.8); }
.dark-theme .status-badge.status-offline{ background:#7f1d1d; color:#fca5a5; border:2px solid #ef4444; box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3); }
.dark-theme .status-badge.status-offline .dot{ background:#ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.8); }
/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background: #ffffff;
    margin: 0;
    padding: 0;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="medical-pattern" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(102,126,234,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23medical-pattern)"/></svg>');
    opacity: 0.3;
    z-index: -1;
    pointer-events: none;
}

/* Keep layout width stable when the page gains/loses a vertical scrollbar
   to prevent table width shifting during filtering. */

/* Sidebar sizing variable to keep main content offset in sync */
:root { --sidebar-width: 220px; }

/* Dark Theme Styles */
.dark-theme {
    background-color: #0f172a;
    color: #f1f5f9;
}

.dark-theme .main-content {
    background-color: #0f172a;
}

.dark-theme .header {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.98) 100%);
    border-bottom-color: #334155;
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    border-top: 3px solid #60a5fa;
    min-height: 72px;
    max-height: 72px;
}

.dark-theme .header h1::before {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
}

.dark-theme .header-actions {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(51, 65, 85, 0.3);
}

.dark-theme .icon-btn {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(51, 65, 85, 0.4);
    color: #e2e8f0;
}

.dark-theme .header h1 {
    color: #f8fafc;
}

.dark-theme .content-card,
.dark-theme .summary-card {
    background-color: #1e293b;
    color: #f1f5f9;
    border: 1px solid #334155;
}

.dark-theme .card-header {
    border-bottom-color: #334155;
    background: #0f172a;
}

.dark-theme .card-header h2,
.dark-theme .card-header h3 {
    color: #f8fafc;
}

.dark-theme .data-table th {
    background-color: #0f172a;
    color: #cbd5e1;
    border-bottom-color: #334155;
}

.dark-theme .data-table td {
    color: #e2e8f0;
    border-bottom-color: #334155;
}

.dark-theme .data-table tbody tr:hover {
    background-color: #1e293b;
}

.dark-theme .icon-btn {
    color: #cbd5e1;
}

.dark-theme .icon-btn:hover {
    background-color: #334155;
    color: #f8fafc;
}

.dark-theme .user-dropdown-btn {
    background-color: #334155;
    color: #f1f5f9;
}

.dark-theme .user-dropdown-btn:hover {
    background-color: #475569;
}

.dark-theme .user-dropdown-content {
    background-color: #1e293b;
    border: 1px solid #334155;
}

.dark-theme .user-dropdown-header {
    border-bottom-color: #334155;
}

.dark-theme .user-dropdown-name {
    color: #f8fafc;
}

.dark-theme .user-dropdown-email {
    color: #94a3b8;
}

.dark-theme .user-dropdown-item {
    color: #e2e8f0;
}

.dark-theme .user-dropdown-item:hover {
    background-color: #334155;
    color: #f8fafc;
}



.dark-theme .user-dropdown-divider {
    background-color: #334155;
}

/* Dark theme text and link colors */
.dark-theme .card-content h3 {
    color: #cbd5e1;
}

.dark-theme .card-value {
    color: #f8fafc;
}

.dark-theme .card-link {
    color: #60a5fa;
}

.dark-theme .card-link:hover {
    color: #93c5fd;
}

.dark-theme .link {
    color: #60a5fa;
}

.dark-theme .link:hover {
    color: #93c5fd;
}

.dark-theme .btn {
    color: #f1f5f9;
}

.dark-theme .btn-primary {
    background-color: #3b82f6;
    color: #ffffff;
}

.dark-theme .btn-primary:hover {
    background-color: #2563eb;
}

.dark-theme .btn-secondary {
    background-color: #475569;
    color: #ffffff;
}

.dark-theme .btn-secondary:hover {
    background-color: #334155;
}

.dark-theme .btn-danger {
    background-color: #dc2626;
    color: #ffffff;
}

.dark-theme .btn-danger:hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    /* transform: translateY(-1px); - Removed to prevent button movement on hover */
}

.dark-theme .btn-warning {
    background-color: #f59e0b;
    color: #ffffff;
}

.dark-theme .btn-warning:hover {
    background-color: #d97706;
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

/* Dark theme status badges */
.dark-theme .status-badge {
    color: #f8fafc;
}

.dark-theme .status-critical {
    background-color: #450a0a;
    color: #fca5a5;
    border: 1px solid #7f1d1d;
}

.dark-theme .status-warning {
    background-color: #451a03;
    color: #fcd34d;
    border: 1px solid #78350f;
}

.dark-theme .status-normal {
    background-color: #052e16;
    color: #cbd5e1;
    border: 1px solid #14532d;
}

.dark-theme .status-active {
    background-color: #052e16;
    color: #86efac;
    border: 1px solid #14532d;
}

.dark-theme .status-inactive {
    background-color: #1e293b;
    color: #94a3b8;
    border: 1px solid #334155;
}

/* Dark theme form elements */
.dark-theme .form-select {
    background-color: #2d2d2d;
    color: #e5e5e5;
    border-color: #333;
}

.dark-theme .form-select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

/* Dark theme alert banners */
.dark-theme .alert-critical {
    background-color: #7f1d1d;
    color: #fca5a5;
    border-color: #dc2626;
}

.dark-theme .alert-warning {
    background-color: #78350f;
    color: #fcd34d;
    border-color: #d97706;
}

/* Dark theme summary cards */
.dark-theme .summary-card {
    background-color: #2d2d2d;
    border: 1px solid #333;
}

.dark-theme .summary-card:hover {
    background-color: #333;
    border-color: #444;
}

/* Dark theme table hover effects */
.dark-theme .data-table tbody tr:hover {
    background-color: #333;
}

/* Dark theme card footer */
.dark-theme .card-footer {
    border-top-color: #333;
    background-color: #2d2d2d;
}

/* Professional Healthcare Login Page Styles */
.login-body {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: auto;
}

.login-body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="%23e2e8f0" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
    z-index: 0;
    pointer-events: none;
}

.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    margin: 20px 0;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: loginCardAppear 0.6s ease-out;
}

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

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

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 28px;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo i {
    color: #3b82f6;
    font-size: 32px;
    filter: drop-shadow(0 2px 4px rgba(59, 130, 246, 0.3));
}

.login-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
    letter-spacing: -0.025em;
}

.login-header p {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.4;
}

.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.alert-error {
    background-color: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.alert i {
    font-size: 16px;
    flex-shrink: 0;
}

.input-group {
    position: relative;
}

.input-group i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 16px;
    transition: color 0.2s ease;
}

.input-group input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.2s ease;
    background: #ffffff;
    color: #1f2937;
}

.input-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    background: #ffffff;
}

.input-group input:focus + i {
    color: #3b82f6;
}

.form-options {
    margin-bottom: 24px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    padding: 0;
    border: none;
    background: transparent;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-text {
    font-weight: 500;
    color: #6b7280;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    letter-spacing: 0.025em;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    box-shadow: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    box-shadow: none;
    transform: none;
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 18px 24px;
    font-size: 16px;
}

.login-footer {
    margin-top: 40px;
    text-align: center;
    padding-top: 32px;
    border-top: 1px solid #e5e7eb;
}

.demo-section {
    margin-bottom: 24px;
}

.demo-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.demo-credentials {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.credential {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    text-align: left;
    transition: all 0.2s ease;
}

.credential:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.1);
}

.credential-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1f2937;
    font-size: 13px;
}

.credential-header i {
    color: #3b82f6;
    font-size: 14px;
}

.credential-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
}

.credential-details .email {
    color: #6b7280;
    font-family: 'Courier New', monospace;
}

.credential-details .password {
    color: #9ca3af;
    font-family: 'Courier New', monospace;
}

.login-info {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.login-info p {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-info i {
    color: #3b82f6;
    font-size: 14px;
}

/* Responsive Login Styles */
@media (max-width: 640px) {
    .login-body {
        align-items: flex-start;
        padding: 20px 10px;
    }
    
    .login-container {
        max-width: 100%;
        padding: 0 10px;
        margin: 20px 0;
    }
    
    .login-card {
        padding: 32px 24px;
        border-radius: 16px;
    }
    
    .login-header h1 {
        font-size: 28px;
    }
    
    .logo {
        font-size: 24px;
        margin-bottom: 24px;
    }
    
    .logo i {
        font-size: 28px;
    }
    
    .input-group input {
        padding: 14px 14px 14px 44px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .input-group i {
        left: 14px;
    }
    
    .btn-full {
        padding: 16px 24px;
        font-size: 16px;
    }
    
    .credential {
        padding: 12px;
    }
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Ensure the app canvas spans the full width with no unintended margins */
html, body { width: 100%; }
body { margin: 0; padding: 0; }

/* Sidebar Layout and Logo - Professional Design Optimized for 1366x768 */
.sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    color: #fff;
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    border-radius: 0;
    padding: 0;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    overflow: hidden;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

/* Sidebar appears instantly - no animation */
.sidebar {
    transform: translateX(0);
    opacity: 1;
}

/* ===== SYSTEM SETTINGS STYLES ===== */

/* Settings Header */
.settings-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.settings-header .header-content h1 {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-header .header-content p {
    color: #6b7280;
    font-size: 16px;
    margin: 0;
}

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

/* Settings Tabs */
.settings-tabs {
    display: flex;
    background: #ffffff;
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    gap: 4px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer !important;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    position: relative;
    z-index: 10;
}

.tab-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.tab-btn.active {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.tab-btn i {
    font-size: 16px;
}

/* Settings Content */
.settings-content {
    min-height: 200px;
}

.tab-content {
    display: none !important;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tab-content.active {
    display: block !important;
    opacity: 1;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

/* Settings Cards */
.settings-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.2s ease;
}

.settings-card:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); transform: none; }

.settings-card .card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.settings-card .card-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-card .card-header h3 i {
    color: #ef4444;
    font-size: 20px;
}

.settings-card .card-body {
    padding: 24px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

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

.toggle-switch label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: 0.3s;
    border-radius: 24px;
    padding: 12px;
}

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

.toggle-switch input:checked + label {
    background-color: #3b82f6;
    padding: 12px;
}

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

/* Theme Selector */
.theme-selector {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.theme-option:hover {
    background: #f3f4f6;
}

.theme-option.active {
    border-color: #ef4444;
    background: #fef2f2;
}

.theme-preview {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    position: relative;
    overflow: hidden;
}

.theme-preview.light {
    background: #ffffff;
}

.theme-preview.dark {
    background: #1f2937;
}

.theme-preview.auto {
    background: linear-gradient(45deg, #ffffff 50%, #1f2937 50%);
}

.theme-preview .preview-header {
    height: 8px;
    background: #ef4444;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

.theme-preview .preview-sidebar {
    width: 20px;
    height: 100%;
    background: #6b7280;
    position: absolute;
    left: 0;
    top: 8px;
}

.theme-preview .preview-content {
    height: 100%;
    background: #f3f4f6;
    position: absolute;
    left: 20px;
    top: 8px;
    right: 0;
}

.theme-preview.dark .preview-content {
    background: #374151;
}

.theme-option span {
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    text-align: center;
}

/* Color Picker */
.color-picker {
    display: flex;
    align-items: center;
    gap: 16px;
}

.color-input {
    width: 50px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: none;
}

.color-presets {
    display: flex;
    gap: 8px;
}

.color-preset {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.color-preset:hover {
    border-color: #d1d5db;
    transform: scale(1.1);
}

/* Range Slider */
.range-slider {
    display: flex;
    align-items: center;
    gap: 16px;
}

.range-input {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #d1d5db;
    outline: none;
}

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ef4444;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.range-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ef4444;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.range-value {
    font-weight: 600;
    color: #ef4444;
    min-width: 60px;
    text-align: center;
}

/* Dark Theme Overrides for Settings */
.dark-theme .settings-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
}

.dark-theme .settings-header .header-content h1 {
    color: #f8fafc;
}

.dark-theme .settings-header .header-content p {
    color: #cbd5e1;
}

.dark-theme .settings-tabs {
    background: #1e293b;
    border-color: #334155;
}

.dark-theme .tab-btn {
    color: #94a3b8;
}

.dark-theme .tab-btn:hover {
    background: #334155;
    color: #e2e8f0;
}

.dark-theme .settings-card {
    background: #1e293b;
    border-color: #334155;
}

.dark-theme .settings-card .card-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-color: #334155;
}

.dark-theme .settings-card .card-header h3 {
    color: #f8fafc;
}

.dark-theme .form-group label {
    color: #e2e8f0;
}

.dark-theme .theme-option span {
    color: #e2e8f0;
}

.dark-theme .range-value {
    color: #f87171;
}

/* Responsive Design */
@media (max-width: 768px) {
    .settings-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 24px;
    }
    
    .settings-header .header-actions {
        width: 100%;
        justify-content: stretch;
    }
    
    .settings-header .header-actions .btn {
        flex: 1;
    }
    
    .settings-tabs {
        padding: 4px;
    }
    
    .tab-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .theme-selector {
        justify-content: center;
    }
    
    .color-picker {
        flex-direction: column;
        align-items: flex-start;
    }
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px 12px 12px;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.sidebar-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(239, 68, 68, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.logo.big-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    width: 100%;
    position: relative;
    z-index: 2;
}

.logo.big-logo .big-heart {
    font-size: 3.2rem;
    color: #ef4444;
    margin: 0;
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
    animation: heartPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.3));
    position: relative;
    z-index: 3;
}

.logo.big-logo .big-heart::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.2) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: -1;
    animation: heartGlow 3s ease-in-out infinite;
}

.logo.big-logo .alzcare-text {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    text-align: center;
    letter-spacing: 1px;
    margin: 0;
    white-space: nowrap;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #fff 0%, #f1f5f9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Heart Pulse Animation */
@keyframes heartPulse {
    0% {
        transform: scale(1);
        color: #ef4444;
    }
    25% {
        transform: scale(1.1);
        color: #dc2626;
    }
    50% {
        transform: scale(1.05);
        color: #f87171;
    }
    75% {
        transform: scale(1.1);
        color: #dc2626;
    }
    100% {
        transform: scale(1);
        color: #ef4444;
    }
}

/* Heart Glow Animation */
@keyframes heartGlow {
    0%, 100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* Enhanced sidebar navigation styling */
.sidebar-nav {
    padding: 8px 0 0 0;
    flex: 1 1 auto;
    overflow: visible;
    background: rgba(15, 23, 42, 0.3);
    position: relative;
}

.sidebar-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(239, 68, 68, 0.2) 50%, transparent 100%);
}

/* Scrollbar styling for sidebar */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

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

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(239, 68, 68, 0.3);
    border-radius: 2px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(239, 68, 68, 0.5);
}
.sidebar-nav {
    padding: 0 0 0 0;
    flex: 1 1 auto;
    overflow: visible;
}
.nav-section {
    margin-bottom: 8px;
    padding: 0 12px;
}

.nav-list {
    gap: 0px;
    margin: 0;
    padding: 0 8px;
}

.nav-item {
    margin-bottom: 0px;
    border-radius: 8px;
    overflow: hidden;
}

.nav-link {
    color: #e2e8f0;
    padding: 6px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    margin: 0;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.1) 0%, transparent 100%);
    transition: width 0.3s ease;
}

.nav-link:hover::before {
    width: 100%;
}

.nav-link i {
    font-size: 1.1rem;
    width: 18px;
    text-align: center;
    color: #94a3b8;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    /* Prevent layout shift on hover */
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-link:hover i {
    color: #ef4444;
    transform: scale(1.1);
}

.nav-item.active .nav-link {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.05) 100%);
    color: #ffffff;
    /* Use inset shadow instead of border to avoid padding shift */
    box-shadow: inset 3px 0 0 0 #ef4444, 0 4px 12px rgba(239, 68, 68, 0.2);
}

.nav-item.active .nav-link i {
    color: #ef4444;
}

/* User Dropdown in Header */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-dropdown-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.user-profile-image {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #b2b4b9;
}

.dropdown-profile-image {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5e7eb;
    margin-right: 12px;
}

.user-dropdown-btn:hover {
    background-color: #e5e7eb;
}

.user-dropdown-btn i {
    font-size: 16px;
    color: #6b7280;
}

.user-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-radius: 8px;
    z-index: 1000;
    margin-top: 4px;
    border: 1px solid #e5e7eb;
}

.user-dropdown-content.show {
    display: block;
}

.user-dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.user-dropdown-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 2px;
}

.user-dropdown-email {
    font-size: 12px;
    color: #6b7280;
}

.user-dropdown-menu {
    padding: 8px 0;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s;
}

.user-dropdown-item:hover {
    background-color: #f9fafb;
    color: #1f2937;
}

.user-dropdown-item i {
    font-size: 16px;
    width: 16px;
    text-align: center;
}

.user-dropdown-divider {
    height: 1px;
    background-color: #e5e7eb;
    margin: 8px 0;
}



.main-content {
    flex: 1;
    margin-left: calc(var(--sidebar-width) - 8px);
    padding: 20px 24px 20px 20px;
    background: transparent;
    min-height: 100vh;
    max-width: calc(100vw - var(--sidebar-width));
    overflow-x: hidden;
}

/* Keep symmetrical side spacing inside content area */
.main-content > * { box-sizing: border-box; }

/* Header Styles - Medical Theme */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 20px;
    border-radius: 0;
    border-top: 3px solid #667eea;
    min-height: 72px;
    max-height: 72px;
}

.header-left {
    display: flex;
    align-items: center;
}

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

.header h1 {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
    position: relative;
    padding-left: 16px;
}

.header h1::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 2px;
}

/* Icon buttons in header-right */
.header-right .icon-btn {
    /* Keep size identical in light/dark */
    background-color: #ffffff;
    border: 1px solid rgba(102, 126, 234, 0.2);
    padding: 12px;
    border-radius: 8px;
    color: #667eea;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
    backdrop-filter: none; /* match dark-mode dimensions */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-right .icon-btn:hover {
    background-color: #f8fafc; 
    color: #667eea; 
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.15); 
    border-color: rgba(102, 126, 234, 0.3); 
}

.header-right .icon-btn:active { transform: none; }

/* User dropdown button in header-right */
.header-right .user-dropdown-btn {
    background-color: #ffffff;
    border: 1px solid rgba(102, 126, 234, 0.2);
    padding: 10px 16px;
    border-radius: 8px;
    color: #667eea;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: none; /* ensure same size as dark mode */
    min-height: 48px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-right .user-dropdown-btn:hover {
    background-color: #f8fafc; 
    color: #667eea; 
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.15); 
    border-color: rgba(102, 126, 234, 0.3); 
}

.header-right .user-dropdown-btn:active { transform: none; }

.message-badge {
    top: -6px;
    right: -6px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.dark-theme .notification-badge,
.dark-theme .message-badge {
    border: 2px solid #1e293b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Notification Dropdowns - Fixed */
.notification-dropdown,
.message-dropdown {
    position: relative;
    display: inline-block;
}

.notification-dropdown .notification-content,
.message-dropdown .message-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    min-width: 350px;
    max-width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    z-index: 1000;
    margin-top: 8px;
    border: 1px solid #e5e7eb;
    max-height: 500px;
    overflow: hidden;
}

.notification-dropdown .notification-content.show,
.message-dropdown .message-content.show {
    display: block;
    animation: slideDown 0.3s ease-out;
}

/* User Dropdown - Fixed */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-dropdown-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.user-dropdown-btn:hover {
    background-color: #f3f4f6;
}

.user-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-radius: 8px;
    z-index: 1000;
    margin-top: 4px;
    border: 1px solid #e5e7eb;
}

.user-dropdown-content.show {
    display: block;
    animation: slideDown 0.3s ease-out;
}

/* Dark Theme Header styles are handled by the main .dark-theme .header class above */

.dark-theme .notification-content,
.dark-theme .message-content,
.dark-theme .user-dropdown-content {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

.dark-theme .user-dropdown-btn {
    color: #e2e8f0;
}

.dark-theme .user-dropdown-btn:hover {
    background-color: #334155;
}

/* Ensure proper z-index for all header elements */
.header * {
    box-sizing: border-box;
}

/* Fix any medication tracker conflicts */
.medication-dashboard .header-content {
    margin-bottom: 0;
}

.medication-dashboard .header-content h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 12px;
}

.medication-dashboard .header-content p {
    margin: 8px 0 0 0;
    color: #6b7280;
    font-size: 16px;
}

.dark-theme .medication-dashboard .header-content h2 {
    color: #f8fafc;
}

.dark-theme .medication-dashboard .header-content p {
    color: #cbd5e1;
}

.summary-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid #e5e7eb;
}

.card-header h2, .card-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.data-table th {
    background-color: #f9fafb;
    color: #374151;
    font-weight: 700;
    font-size: 11.5px;
    padding: 18px 14px; /* match dark mode to avoid layout shift */
    text-align: left;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
    min-width: 120px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    color: #374151;
    padding: 18px 14px; /* match dark mode */
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
    font-size: 13px; /* keep same size as dark mode */
}

/* Health monitoring table specific column widths */
.data-table th:nth-child(1), /* PATIENT */
.data-table td:nth-child(1) {
    min-width: 150px;
    max-width: 180px;
}

.data-table th:nth-child(2), /* VITAL SIGNS */
.data-table td:nth-child(2) {
    min-width: 120px;
    max-width: 140px;
}

.data-table th:nth-child(3), /* HEALTH METRICS */
.data-table td:nth-child(3) {
    min-width: 180px;
    max-width: 200px;
}

.data-table th:nth-child(4), /* MEDICATION */
.data-table td:nth-child(4) {
    min-width: 120px;
    max-width: 140px;
}

.data-table th:nth-child(5), /* STATUS */
.data-table td:nth-child(5) {
    min-width: 100px;
    max-width: 120px;
}

.data-table th:nth-child(6), /* TREND */
.data-table td:nth-child(6) {
    min-width: 100px;
    max-width: 120px;
}

.data-table th:nth-child(7), /* ALERTS */
.data-table td:nth-child(7) {
    min-width: 120px;
    max-width: 140px;
}

.data-table th:nth-child(8), /* ACTION */
.data-table td:nth-child(8) {
    min-width: 120px;
    max-width: 140px;
}

/* Patient Profiles table column sizing (override generic widths above) */
#patientsTable { table-layout: fixed; width: 100%; }
#patientsTable th, #patientsTable td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 1: Patient ID – make it compact, just enough for text */
#patientsTable th:nth-child(1),
#patientsTable td:nth-child(1) {
    min-width: 90px;
    width: 110px;
    max-width: 130px;
}

/* 2: Patient Name */
#patientsTable th:nth-child(2),
#patientsTable td:nth-child(2) {
    min-width: 180px;
    width: 220px;
}

/* 3: Guardian */
#patientsTable th:nth-child(3),
#patientsTable td:nth-child(3) {
    min-width: 160px;
    width: 220px;
}

/* 4: Stage – keep consistent to avoid layout shift */
#patientsTable th:nth-child(4),
#patientsTable td:nth-child(4) {
    min-width: 120px;
    width: 130px;
    text-align: left;
}
#patientsTable td:nth-child(4) .status-badge { min-width: 90px; display: inline-flex; justify-content: center; }

/* 5: Phone */
#patientsTable th:nth-child(5),
#patientsTable td:nth-child(5) {
    min-width: 140px;
    width: 170px;
}

/* 6: Action */
#patientsTable th:nth-child(6),
#patientsTable td:nth-child(6) {
    min-width: 160px;
    width: 180px;
}

/* Medication table sizing */
#medicationTable { table-layout: fixed; width: 100%; }
#medicationTable th, #medicationTable td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#medicationTable th:nth-child(1), #medicationTable td:nth-child(1) { min-width: 100px; width: 150px; } /* Patient smaller */
#medicationTable th:nth-child(2), #medicationTable td:nth-child(2) { min-width: 200px; width: 260px; } /* Medication */
#medicationTable th:nth-child(3), #medicationTable td:nth-child(3) { min-width: 220px; width: 280px; } /* Dosage & Frequency (expanded for readability) */
#medicationTable th:nth-child(4), #medicationTable td:nth-child(4) { min-width: 160px; width: 200px; } /* Next Dose */
#medicationTable th:nth-child(5), #medicationTable td:nth-child(5) { min-width: 130px; width: 150px; } /* Status */
#medicationTable th:nth-child(6), #medicationTable td:nth-child(6) { min-width: 160px; width: 180px; } /* Actions width tuned */
#medicationTable td:nth-child(6) { overflow: hidden; display: flex; align-items: center; border-bottom: 1px solid #f3f4f6; }
#medicationTable td:nth-child(6) .action-buttons { justify-content: flex-start; position: static !important; margin: 0; }

/* Keep action buttons inside the cell and wrap nicely */
#medicationTable td:nth-child(6) .action-buttons {
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    max-width: 100%;
}
#medicationTable td:nth-child(6) .btn-medical { padding: 8px 10px; }

/* Ensure patient profile action buttons use elegant style */
#patientsTable td:nth-child(6) .action-buttons .btn-action {
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

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

.status-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-critical {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.status-warning {
    background-color: #fffbeb;
    color: #d97706;
    border: 1px solid #fed7aa;
}

.status-normal {
    background-color: #f0fdf4;
    color: #059669;
    border: 1px solid #bbf7d0;
}

/* Badge for destructive actions (deleted) */
.status-danger {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.status-active {
    background-color: #f0fdf4;
    color: #059669;
    border: 1px solid #bbf7d0;
}

.status-inactive {
    background-color: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.status-medical {
    background-color: #f0f4ff;
    color: #667eea;
    border: 1px solid #c7d2fe;
}

/* Dark theme header styles are handled by the main .dark-theme .header class above */

/* Removed duplicate header-actions definition */

.icon-btn {
    background: none;
    border: none;
    padding: 10px;
    border-radius: 6px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.icon-btn:hover {
    background-color: #f3f4f6;
    color: #374151;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.dark-theme .icon-btn:hover {
    background-color: #475569;
    color: #f8fafc;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: #f3f4f6;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

/* Medical Theme Cards */
.content-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.1), 0 0 0 1px rgba(102, 126, 234, 0.1);
    overflow: hidden;
    border: 1px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
}

.content-card:hover {
    /* transform: translateY(-2px); - Removed to prevent button movement on hover */
    box-shadow: 0 25px 50px rgba(102, 126, 234, 0.15), 0 0 0 1px rgba(102, 126, 234, 0.2);
}

.dark-theme .content-card {
    background: #1e293b;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    border: 1px solid #334155;
}

.summary-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.08), 0 0 0 1px rgba(102, 126, 234, 0.08);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.08);
}

.summary-card:hover {
    /* transform: translateY(-2px); - Removed to prevent button movement on hover */
    box-shadow: 0 25px 50px rgba(102, 126, 234, 0.15), 0 0 0 1px rgba(102, 126, 234, 0.2);
}

.dark-theme .summary-card {
    background: #2d2d2d;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    border: 1px solid #333;
}

.summary-card:hover {
    box-shadow: 0 15px 20px -5px rgba(0, 0, 0, 0.15), 0 8px 8px -5px rgba(0, 0, 0, 0.08);
}

.dark-theme .summary-card:hover {
    box-shadow: 0 15px 20px -5px rgba(0, 0, 0, 0.5), 0 8px 8px -5px rgba(0, 0, 0, 0.4);
}

/* Enhanced User Dropdown Shadow */
.user-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-radius: 8px;
    z-index: 1000;
    margin-top: 4px;
    border: 1px solid #e5e7eb;
}

.dark-theme .user-dropdown-content {
    background-color: #2d2d2d;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
}

/* Enhanced Table Container Shadow */

/* Enhanced Table Container Shadow */
.table-container {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    max-width: 100%;
    border: 1px solid #e5e7eb;
}

.table-container .data-table {
    width: 100%;
    min-width: 1000px;
    table-layout: fixed;
}

.dark-theme .table-container {
    background: #1f2937;
    border: 1px solid #374151;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

/* Alert Banners */
.alert-banners {
    margin-bottom: 24px;
}

.alert-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
}

.alert-critical {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-warning {
    background-color: #f0f4ff;
    color: #667eea;
    border: 1px solid #c7d2fe;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
    max-width: 100%;
}



.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.card-icon.blue {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.card-icon.red {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.card-icon.yellow {
    background: linear-gradient(135deg, #93c5fd, #60a5fa);
}

.card-icon.green {
    background: linear-gradient(135deg, #10b981, #059669);
}

.card-content {
    flex: 1;
}

.card-content h3 {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-value {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 6px;
}

.card-link {
    color: #3b82f6;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Prevent long titles from wrapping to two lines in analytics headers */
.card-header h2, .card-header h3 {
    white-space: nowrap;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.link {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

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

/* Tables */
.table-container {
    overflow-x: auto;
}



/* Buttons */
/* .btn-sm styles moved to text button section */

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .login-card {
        padding: 24px;
    }
    
    .main-content {
        padding: 16px;
    }
    
    /* Header styles are handled by the main .header class above */
    
    .data-table th,
    .data-table td {
        padding: 12px 16px;
    }
} 

/* Chart Container Fix for User Accounts */
.chart-container {
    height: 360px !important;
    padding: 16px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
} 

/* Ensure the canvas scales and stays inside the card */
.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* Adherence chart alignment (centered and contained) */
/* Make adherence chart container match analytics chart sizing */
.adherence-container { align-items: stretch; }
.adherence-container canvas { width: 100% !important; }

/* When legend is placed in header, keep it compact and inline */
.card-header .chart-legend { margin-left: auto; }

/* Responsive adjustments for smaller screens */
@media (max-width: 1400px) {
    .sidebar { --sidebar-width: 180px; width: var(--sidebar-width); min-width: var(--sidebar-width); max-width: var(--sidebar-width); }
    .main-content {
        margin-left: var(--sidebar-width);
        padding: 16px 20px;
    }
    .logo.big-logo .big-heart {
        font-size: 2.8rem;
    }
    .logo.big-logo .alzcare-text {
        font-size: 1.6rem;
    }
    .nav-link {
        padding: 9px 14px;
        font-size: 12.5px;
    }
    .nav-link i {
        font-size: 1rem;
    }
}

@media (max-width: 1366px) {
    .sidebar { --sidebar-width: 200px; width: var(--sidebar-width); min-width: var(--sidebar-width); max-width: var(--sidebar-width); }
    .main-content {
        margin-left: var(--sidebar-width);
        padding: 12px 16px;
    }
    .logo.big-logo .big-heart {
        font-size: 2.4rem;
    }
    .logo.big-logo .alzcare-text {
        font-size: 1.4rem;
    }
    .nav-link {
        padding: 8px 12px;
        font-size: 12px;
    }
    .nav-link i {
        font-size: 1rem;
    }
    
    /* Table adjustments for 1366px screens */
    .data-table th {
        font-size: 11.5px;
        padding: 16px 12px;
        min-width: 130px;
    }
    
    .data-table td {
        padding: 18px 14px;
        font-size: 13px;
    }
    
    /* Adjust column widths for better fit on 1366px */
    .data-table th:nth-child(1), /* PATIENT */
    .data-table td:nth-child(1) {
        min-width: 160px;
        max-width: 190px;
    }
    
    .data-table th:nth-child(2), /* VITAL SIGNS */
    .data-table td:nth-child(2) {
        min-width: 140px;
        max-width: 150px;
    }
    
    .data-table th:nth-child(3), /* HEALTH METRICS */
    .data-table td:nth-child(3) {
        min-width: 160px;
        max-width: 190px;
    }
    
    .data-table th:nth-child(4), /* MEDICATION */
    .data-table td:nth-child(4) {
        min-width: 130px;
        max-width: 150px;
    }
    
    .data-table th:nth-child(5), /* STATUS */
    .data-table td:nth-child(5) {
        min-width: 110px;
        max-width: 130px;
    }
    
    .data-table th:nth-child(6), /* TREND */
    .data-table td:nth-child(6) {
        min-width: 110px;
        max-width: 130px;
    }
    
    .data-table th:nth-child(7), /* ALERTS */
    .data-table td:nth-child(7) {
        min-width: 130px;
        max-width: 150px;
    }
    
    .data-table th:nth-child(8), /* ACTION */
    .data-table td:nth-child(8) {
        min-width: 130px;
        max-width: 150px;
    }
    
    /* Adjust health metrics for better readability */
    .health-metrics .metric-value,
    .data-table .health-metrics .metric-value,
    .table-container .health-metrics .metric-value,
    .data-table tbody .health-metrics .metric-value,
    .table-container .data-table .health-metrics .metric-value {
        font-size: 10px !important;
        line-height: 1.2;
    }
    
    .metric-label {
        font-size: 10px;
    }
    
    .metric-item {
        font-size: 10px;
        padding: 3px 0;
    }
    
    /* Adjust patient info for better readability */
    .patient-name {
        font-size: 14px;
    }
    
    .patient-id {
        font-size: 12px;
    }
    
    .patient-age {
        font-size: 11px;
    }
    
    /* Adjust vital signs for better readability */
    .vital-item {
        font-size: 12px;
    }
    
    /* Dark theme column width adjustments for 1366px */
    .dark-theme .data-table th:nth-child(1), /* PATIENT */
    .dark-theme .data-table td:nth-child(1) {
        min-width: 160px;
        max-width: 190px;
    }
    
    .dark-theme .data-table th:nth-child(2), /* VITAL SIGNS */
    .dark-theme .data-table td:nth-child(2) {
        min-width: 120px;
        max-width: 140px;
    }
    
    .dark-theme .data-table th:nth-child(3), /* HEALTH METRICS */
    .dark-theme .data-table td:nth-child(3) {
        min-width: 180px;
        max-width: 200px;
    }
    
    .dark-theme .data-table th:nth-child(4), /* MEDICATION */
    .dark-theme .data-table td:nth-child(4) {
        min-width: 130px;
        max-width: 150px;
    }
    
    .dark-theme .data-table th:nth-child(5), /* STATUS */
    .dark-theme .data-table td:nth-child(5) {
        min-width: 110px;
        max-width: 130px;
    }
    
    .dark-theme .data-table th:nth-child(6), /* TREND */
    .dark-theme .data-table td:nth-child(6) {
        min-width: 110px;
        max-width: 130px;
    }
    
    .dark-theme .data-table th:nth-child(7), /* ALERTS */
    .dark-theme .data-table td:nth-child(7) {
        min-width: 130px;
        max-width: 150px;
    }
    
    .dark-theme .data-table th:nth-child(8), /* ACTION */
    .dark-theme .data-table td:nth-child(8) {
        min-width: 130px;
        max-width: 150px;
    }
    
    /* Dark theme health metrics adjustments for 1366px */
    .dark-theme .health-metrics .metric-value,
    .dark-theme .data-table .health-metrics .metric-value,
    .dark-theme .table-container .health-metrics .metric-value,
    .dark-theme .data-table tbody .health-metrics .metric-value,
    .dark-theme .table-container .data-table .health-metrics .metric-value {
        font-size: 10px !important;
        line-height: 1.2;
    }
    
    .dark-theme .metric-label {
        font-size: 10px;
    }
    
    .dark-theme .metric-item {
        font-size: 10px;
        padding: 3px 0;
    }
    
    /* Dark theme patient info adjustments for 1366px */
    .dark-theme .patient-name {
        font-size: 14px;
    }
    
    .dark-theme .patient-id {
        font-size: 12px;
    }
    
    .dark-theme .patient-age {
        font-size: 11px;
    }
    
    /* Dark theme vital signs adjustments for 1366px */
    .dark-theme .vital-item {
        font-size: 12px;
    }
} 

/* Search and Filter Styles */
.search-filter-section {
    margin-bottom: 24px;
    padding: 0 24px;
}

.search-filter-section.inside-card {
    margin-bottom: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    margin: 0 0 16px 0;
}

.dark-theme .search-filter-section.inside-card {
    background: #1a1a1a;
    border-bottom-color: #333;
}

.search-container {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 16px;
    z-index: 2;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    background: #ffffff;
    color: #374151;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.search-clear:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.filter-container {
    min-width: 150px;
}

.filter-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    background: #ffffff;
    color: #374151;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.filter-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Dark theme search styles */
.dark-theme .search-input {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

.dark-theme .search-input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2), 0 4px 6px rgba(0, 0, 0, 0.3);
}

.dark-theme .search-icon {
    color: #94a3b8;
}

.dark-theme .search-clear {
    color: #9ca3af;
}

.dark-theme .search-clear:hover {
    background-color: #333;
    color: #e5e5e5;
}

.dark-theme .filter-select {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

.dark-theme .filter-select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    /* Remove heavy backdrop blur to keep modal content crisp */
    backdrop-filter: none;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background: #ffffff;
    margin: 0;
    padding: 0;
    border-radius: 16px;
    width: 50%;
    max-height: 88vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid #e5e7eb;
    position: relative;
    transform: translateY(12px) scale(0.98);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
    display: flex;
    flex-direction: column;
}

.modal.show .modal-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 16px 16px 0 0;
}
.modal-header { display: flex; align-items: center; gap: 8px; }
.modal-header h3 { margin-right: auto; }
.thread-search-wrap { display: flex; align-items: center; gap: 8px; }
.thread-search-wrap input { height: 32px; padding: 6px 10px; border: 1px solid #e5e7eb; border-radius: 6px; }
.thread-highlight { background: #fde68a; padding: 0 2px; border-radius: 3px; }

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 24px;
    font-weight: bold;
    color: #6b7280;
    cursor: pointer;
    transition: color 0.3s ease;
    border: none;
    background: none;
}

.close:hover {
    color: #374151;
}

.modal-body {
    padding: 24px;
    color: #374151;
    overflow-y: auto;
    overflow-x: hidden; /* prevent bottom horizontal scroll */
    flex: 1 1 auto;
    min-height: 0;
}

/* Health Details Layout */
.health-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.health-details .detail-section h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #111827;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #e5e7eb;
}

.detail-label {
    color: #6b7280;
    font-weight: 500;
    font-size: 13px;
}

.detail-value {
    color: #374151;
    font-weight: 600;
    font-size: 13px;
}

.alerts-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.alert-badge {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

/* Dark theme overrides for patient details for proper contrast */
.dark-theme .health-details .detail-section h4 {
    color: #f8fafc;
}

.dark-theme .detail-label {
    color: #cbd5e1;
}

.dark-theme .detail-value {
    color: #f8fafc;
}

.dark-theme .detail-row {
    border-bottom-color: #334155;
}

.dark-theme .alert-badge {
    background: #0f172a;
    color: #93c5fd;
    border: 1px solid #334155;
}

.dark-theme .history-chart-container {
    background: #0f172a;
    border-color: #334155;
}

/* History Modal Enhancements */
.health-history {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Compact table inside history to avoid horizontal scroll */
.health-history .data-table {
    width: 100%;
    table-layout: fixed;
}

.health-history .data-table th,
.health-history .data-table td {
    font-size: 12px;
    padding: 8px 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-filters {
    display: flex;
    justify-content: flex-end;
}

.history-period-select {
    padding: 6px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.history-chart-container {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    overflow: hidden;
}

.history-chart-container canvas {
    width: 100% !important;
    height: 240px !important;
    display: block;
}

.threshold-inputs {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.threshold-inputs input {
    width: 84px;
}

@media (max-width: 768px) {
    .health-details {
        grid-template-columns: 1fr;
    }
}

/* Enhanced Dark Mode Modal */
.dark-theme .modal-content {
    background: #1e293b;
    border: 1px solid #334155;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.dark-theme .modal-header {
    background: #0f172a;
    border-bottom-color: #334155;
}

.dark-theme .modal-header h3 {
    color: #f8fafc;
}

.dark-theme .close {
    color: #94a3b8;
}

.dark-theme .close:hover {
    color: #cbd5e1;
}

.dark-theme .modal-body {
    color: #e2e8f0;
}

/* Delete Modal Specific Styles */
.warning-icon {
    background: #fef3c7;
    color: #b45309;
}

.dark-theme .warning-icon {
    background: #451a03;
    color: #fbbf24;
}

.delete-warning-text {
    color: #475569;
}

.dark-theme .delete-warning-text {
    color: #cbd5e1;
}

.delete-patient-id {
    color: #334155;
}

.dark-theme .delete-patient-id {
    color: #e2e8f0;
}

.dark-theme .modal-actions {
    border-top-color: #334155;
}

/* Professional Healthcare Button Styles - Text Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Text Button Variants */
.btn-primary {
    background-color: #3b82f6;
}

.btn-primary:hover {
    background-color: #2563eb;
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background-color: #6b7280;
}

.btn-secondary:hover {
    background-color: #4b5563;
    box-shadow: 0 4px 8px rgba(55, 65, 81, 0.3);
}

.btn-success {
    background-color: #10b981;
}

.btn-success:hover {
    background-color: #059669;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.btn-warning {
    background-color: #f59e0b;
}

.btn-warning:hover {
    background-color: #d97706;
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

.btn-danger {
    background-color: #ef4444;
}

.btn-danger:hover {
    background-color: #dc2626;
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.btn-info {
    background-color: #06b6d4;
}

.btn-info:hover {
    background-color: #0891b2;
    box-shadow: 0 4px 8px rgba(6, 182, 212, 0.3);
}

/* Small Text Buttons */
.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
    border-radius: 6px;
}

/* Large Text Buttons */
.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
    border-radius: 10px;
}

/* Elegant Action Buttons - Icon Only */
.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.action-buttons .btn-action {
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.action-buttons .btn-action:hover {
    /* transform: translateY(-1px); - Removed to prevent button movement on hover */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.action-buttons .btn-action:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Action Button Color Variants */
.action-buttons .btn-action.primary {
    background-color: #3b82f6;
    color: white;
}

.action-buttons .btn-action.primary:hover {
    background-color: #2563eb;
}

.action-buttons .btn-action.secondary {
    background-color: #6b7280;
    color: white;
}

.action-buttons .btn-action.secondary:hover {
    background-color: #4b5563;
}

.action-buttons .btn-action.success {
    background-color: #10b981;
    color: white;
}

.action-buttons .btn-action.success:hover {
    background-color: #059669;
}

.action-buttons .btn-action.warning {
    background-color: #f59e0b;
    color: white;
}

.action-buttons .btn-action.warning:hover {
    background-color: #d97706;
}

.action-buttons .btn-action.danger {
    background-color: #ef4444;
    color: white;
}

.action-buttons .btn-action.danger:hover {
    background-color: #dc2626;
}

.action-buttons .btn-action.info {
    background-color: #06b6d4;
    color: white;
}

.action-buttons .btn-action.info:hover {
    background-color: #0891b2;
}

/* Patient Count */
#patientCount {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.dark-theme #patientCount {
    color: #9ca3af;
} 

/* Health Monitoring Dashboard Styles */
.health-overview-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.health-stat-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.health-stat-card:hover {
    /* transform: translateY(-2px); - Removed to prevent button movement on hover */
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.stat-icon.normal {
    background: linear-gradient(135deg, #10b981, #059669);
}

.stat-icon.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.stat-icon.critical {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.stat-icon.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.stat-icon.alert {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.stat-content h3 {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 2px 0;
}

.stat-content p {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
    font-weight: 500;
}

/* Analytics Grid */
.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 12px;
    margin-bottom: 12px;
    max-width: 100%;
    width: 100%;
}

.analytics-grid .content-card {
    margin-bottom: 0;
    height: 420px;
    min-height: 420px;
    max-height: 420px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.chart-legend {
    display: flex;
    gap: 16px;
    align-items: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-color.normal {
    background: #10b981;
}

.legend-color.warning {
    background: #f59e0b;
}

.legend-color.critical {
    background: #dc2626;
}

.vital-sign-select {
    padding: 6px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 12px;
    background: white;
    color: #374151;
}

/* Enhanced Table Styles */
.patient-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.patient-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 13px;
    margin-bottom: 2px;
}

.patient-id {
    font-size: 11px;
    color: #6b7280;
    font-family: 'Courier New', monospace;
    margin-bottom: 1px;
}

.patient-age {
    font-size: 10px;
    color: #9ca3af;
}

.vital-signs {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

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

.vital-item i {
    width: 12px;
    color: #6b7280;
}

.vital-item .normal {
    color: #10b981;
    font-weight: 500;
}

.vital-item .warning {
    color: #f59e0b;
    font-weight: 600;
}

.health-metrics {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 9px;
    padding: 2px 0;
    min-height: 16px;
    width: 100%;
}

.metric-label {
    color: #6b7280;
    font-weight: 500;
    font-size: 9px;
    flex-shrink: 0;
    min-width: 60px;
}

.metric-value {
    font-weight: 600;
    font-size: 9px;
    line-height: 1.1;
    text-align: right;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}

/* Specific override for health monitoring table metric values */
.health-metrics .metric-value,
.data-table .health-metrics .metric-value,
.table-container .health-metrics .metric-value,
.data-table tbody .health-metrics .metric-value,
.table-container .data-table .health-metrics .metric-value {
    font-size: 9px !important;
    font-weight: 600;
    line-height: 1.1;
    text-align: right !important;
    flex: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 80px !important;
}

.metric-value.normal {
    color: #10b981;
}

.metric-value.warning {
    color: #f59e0b;
}

.medication-status {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.medication-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
}

.medication-indicator.taken {
    background: #d1fae5;
    color: #065f46;
}

.medication-indicator.missed {
    background: #fef3c7;
    color: #92400e;
}

.last-updated {
    font-size: 10px;
    color: #9ca3af;
}

.trend-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 12px;
}

.trend-indicator.stable {
    background: #d1fae5;
    color: #065f46;
}

.trend-indicator.increasing {
    background: #fef3c7;
    color: #92400e;
}

.trend-indicator.decreasing {
    background: #fee2e2;
    color: #991b1b;
}

.alerts-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: 120px;
}

.no-alerts {
    font-size: 11px;
    color: #9ca3af;
    font-style: italic;
}

.alert-badge {
    background: #fee2e2;
    color: #991b1b;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
}

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

.btn-outline {
    background: transparent;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

.footer-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Large Modal */
.large-modal {
    max-width: 800px;
}

/* Dark Theme Styles */
.dark-theme .health-stat-card {
    background: #2d2d2d;
    border-color: #333;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

.dark-theme .health-stat-card:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

.dark-theme .stat-content h3 {
    color: #e5e5e5;
}

.dark-theme .stat-content p {
    color: #9ca3af;
}

.dark-theme .patient-name {
    color: #e5e5e5;
}

.dark-theme .patient-id {
    color: #9ca3af;
}

.dark-theme .patient-age {
    color: #6b7280;
}

.dark-theme .vital-item i {
    color: #9ca3af;
}

.dark-theme .metric-label {
    color: #9ca3af;
}

.dark-theme .last-updated {
    color: #6b7280;
}

.dark-theme .no-alerts {
    color: #6b7280;
}

.dark-theme .vital-sign-select {
    background: #1a1a1a;
    border-color: #333;
    color: #e5e5e5;
}

.dark-theme .btn-outline {
    border-color: #333;
    color: #9ca3af;
}

.dark-theme .btn-outline:hover {
    background: #333;
    border-color: #4b5563;
    color: #e5e5e5;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .health-overview-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .health-overview-grid {
        grid-template-columns: 1fr;
    }
    
    .header-actions {
        flex-direction: row;
        align-items: center;
        gap: 16px;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .search-box {
        min-width: auto;
    }
} 

/* Animation for real-time updates */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.health-stat-card.updating {
    animation: pulse 1s ease-in-out;
}

/* Threshold Inputs */
.threshold-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.threshold-inputs input {
    width: 80px;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}

.threshold-inputs span {
    color: #6b7280;
    font-weight: 500;
}

.dark-theme .threshold-inputs input {
    background: #1a1a1a;
    border-color: #333;
    color: #e5e5e5;
}

.dark-theme .threshold-inputs span {
    color: #9ca3af;
} 

/* Professional Dashboard Styles */
.welcome-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 32px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.welcome-content h1 {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

.welcome-content p {
    font-size: 16px;
    color: #6b7280;
    margin: 0;
}

.welcome-stats {
    display: flex;
    gap: 24px;
    margin-top: 24px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.stat-value.online {
    color: #059669;
}

/* Enhanced Metric Cards - Light Mode */
.metric-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
}

.metric-card:hover {
    /* transform: translateY(-2px); - Removed to prevent button movement on hover */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

.metric-label {
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Enhanced Dark Mode Welcome Section */
.dark-theme .welcome-section {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid #334155;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

.dark-theme .welcome-content h1 {
    color: #f8fafc;
}

.dark-theme .welcome-content p {
    color: #94a3b8;
}

.dark-theme .stat-label {
    color: #94a3b8;
}

.dark-theme .stat-value {
    color: #f8fafc;
}

.dark-theme .stat-value.online {
    color: #86efac;
}

/* Enhanced Dark Mode Metric Cards */
.dark-theme .metric-card {
    background: #1e293b;
    border: 1px solid #334155;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

.dark-theme .metric-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

.dark-theme .metric-value {
    color: #f8fafc;
}

.dark-theme .metric-label {
    color: #94a3b8;
}

/* Dark theme override for health monitoring table metric values */
.dark-theme .health-metrics .metric-value,
.dark-theme .data-table .health-metrics .metric-value,
.dark-theme .table-container .health-metrics .metric-value,
.dark-theme .data-table tbody .health-metrics .metric-value,
.dark-theme .table-container .data-table .health-metrics .metric-value {
    font-size: 9px !important;
    font-weight: 600;
    line-height: 1.1;
    color: #f8fafc;
    text-align: right !important;
    flex: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 80px !important;
}

/* Critical Alerts Banner - Medical Theme */
.critical-alerts-banner {
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    border: 1px solid #667eea;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(102, 126, 234, 0.1);
}

.banner-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-weight: 600;
    color: #667eea;
}

.alert-count {
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.alert-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.alert-item.priority-high {
    border-left-color: #dc2626;
}

.alert-item.priority-medium {
    border-left-color: #667eea;
}

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

.patient-name {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.alert-message {
    color: #6b7280;
    font-size: 12px;
}

.alert-time {
    color: #9ca3af;
    font-size: 11px;
}

/* Metrics Dashboard */
.metrics-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.metric-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
}

.metric-card.warning::before {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.metric-card.success::before {
    background: linear-gradient(90deg, #10b981, #059669);
}

.metric-card.info::before {
    background: linear-gradient(90deg, #06b6d4, #0891b2);
}

.metric-card:hover {
    /* transform: translateY(-2px); - Removed to prevent button movement on hover */
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 14px;
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    margin-bottom: 0;
}

.metric-card.warning .metric-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.metric-card.success .metric-icon {
    background: linear-gradient(135deg, #10b981, #059669);
}

.metric-card.info .metric-icon {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.metric-content {
    display: flex;
    flex-direction: column;
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}

.metric-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 8px;
}

.metric-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 500;
}

.metric-trend.positive {
    color: #10b981;
}

.metric-trend.negative {
    color: #dc2626;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
    max-width: 100%;
}

.dashboard-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
}

.dashboard-card.large {
    grid-column: span 2;
}

.card-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

/* Compact toggle switch used in Alerts Configuration */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; vertical-align: middle; margin-right: 8px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #e5e7eb; transition: .2s; border-radius: 22px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 2px; bottom: 2px; background-color: white; transition: .2s; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
input:checked + .slider { background-color: #10b981; }
input:checked + .slider:before { transform: translateX(18px); }

.time-range-select {
    padding: 6px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 12px;
    background: white;
    color: #374151;
}

/* Quick Actions */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.quick-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border-radius: 12px;
    background: #f9fafb;
    text-decoration: none;
    color: #374151;
    transition: all 0.2s ease;
}

.quick-action-item:hover {
    background: #f3f4f6;
    /* transform: translateY(-1px); - Removed to prevent button movement on hover */
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.action-icon.blue { background: linear-gradient(135deg, #667eea, #764ba2); }
.action-icon.red { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.action-icon.green { background: linear-gradient(135deg, #10b981, #059669); }
.action-icon.purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.action-icon.orange { background: linear-gradient(135deg, #f59e0b, #d97706); }
.action-icon.gray { background: linear-gradient(135deg, #93c5fd, #60a5fa); }

.action-title {
    font-size: 12px;
    font-weight: 500;
    text-align: center;
}

/* Enhanced Activity Feed - Light Mode */
.activity-feed {
    max-height: 400px;
    overflow-y: auto;
    padding: 0;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #ffffff;
    border: 1px solid #f3f4f6;
    transition: all 0.3s ease;
}

.activity-item:hover {
    background: #f9fafb;
    border-color: #e5e7eb;
    transform: translateX(4px);
}

.activity-item.status-critical {
    border-left: 4px solid #dc2626;
    background: #fef2f2;
}

.activity-item.status-warning {
    border-left: 4px solid #d97706;
    background: #fffbeb;
}

.activity-item.status-normal {
    border-left: 4px solid #059669;
    background: #f0fdf4;
}

.activity-item.status-completed {
    border-left: 4px solid #667eea;
    background: #f0f4ff;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #ffffff;
    background: linear-gradient(135deg, #93c5fd, #60a5fa);
}

.activity-item.status-critical .activity-icon {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.activity-item.status-warning .activity-icon {
    background: linear-gradient(135deg, #d97706, #b45309);
}

.activity-item.status-normal .activity-icon {
    background: linear-gradient(135deg, #059669, #047857);
}

.activity-item.status-completed .activity-icon {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.activity-description {
    font-size: 14px;
    color: #6b7280;
}

.activity-time {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 500;
}

/* Enhanced System Health - Light Mode */
.system-health {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.health-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.health-label {
    font-weight: 500;
    color: #374151;
    min-width: 120px;
}

.health-bar {
    flex: 1;
    height: 8px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
}

.health-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.health-value {
    font-weight: 600;
    color: #111827;
    min-width: 40px;
    text-align: right;
}

/* Enhanced Dark Mode Activity Feed */
.dark-theme .activity-item {
    background: #1e293b;
    border: 1px solid #334155;
}

.dark-theme .activity-item:hover {
    background: #334155;
    border-color: #475569;
}

.dark-theme .activity-item.status-critical {
    background: #450a0a;
    border-left-color: #dc2626;
}

.dark-theme .activity-item.status-warning {
    background: #451a03;
    border-left-color: #d97706;
}

.dark-theme .activity-item.status-normal {
    background: #052e16;
    border-left-color: #059669;
}

.dark-theme .activity-item.status-completed {
    background: #1e3a8a;
    border-left-color: #3b82f6;
}

.dark-theme .activity-title {
    color: #f8fafc;
}

.dark-theme .activity-description {
    color: #94a3b8;
}

.dark-theme .activity-time {
    color: #64748b;
}

/* Enhanced Dark Mode System Health */
.dark-theme .health-label {
    color: #cbd5e1;
}

.dark-theme .health-bar {
    background: #334155;
}

.dark-theme .health-value {
    color: #f8fafc;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-card.large {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .welcome-section {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .welcome-stats {
        justify-content: center;
    }
    
    .metrics-dashboard {
        grid-template-columns: 1fr;
    }
    
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }
    
    .alerts-summary {
        flex-direction: column;
        gap: 16px;
    }
} 





.sidebar-nav {
    flex: 1;
    padding: 16px 0 0 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Dark theme adjustments */


/* (Removed) Clock section styling for sidebar */

/* Enhanced Dark Theme Styles - Critical Alerts and System Performance */
.dark-theme .alert-critical {
    background-color: #450a0a;
    color: #fca5a5;
    border: 1px solid #dc2626;
}

.dark-theme .alert-warning {
    background-color: #451a03;
    color: #fcd34d;
    border: 1px solid #d97706;
}

.dark-theme .alert-normal {
    background-color: #052e16;
    color: #86efac;
    border: 1px solid #059669;
}

.dark-theme .alert-info {
    color: #93c5fd;
    border: 1px solid #3b82f6;
}

/* Enhanced Dark Theme - System Performance and Metrics */
.dark-theme .system-health {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 16px;
}

.dark-theme .health-item {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
}

.dark-theme .health-label {
    color: #cbd5e1;
    font-weight: 500;
}

.dark-theme .health-bar {
    background: #334155;
}

.dark-theme .health-value {
    color: #f8fafc;
    font-weight: 600;
}

/* Enhanced Dark Theme - Performance Metrics */
.dark-theme .performance-metrics {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 16px;
}

.dark-theme .metric-label {
    color: #cbd5e1;
}

.dark-theme .metric-value {
    color: #f8fafc;
}

/* Enhanced Dark Theme - Critical Alerts Banner */
.dark-theme .critical-alerts-banner {
    background: linear-gradient(135deg, #450a0a 0%, #7f1d1d 100%);
    border: 1px solid #dc2626;
    color: #fca5a5;
}

.dark-theme .banner-header {
    border-bottom: 1px solid #334155;
}

.dark-theme .alert-count {
    background: #dc2626;
    color: #ffffff;
}

.dark-theme .alert-item {
    background: #0f172a;
    border: 1px solid #334155;
    color: #f1f5f9;
}

.dark-theme .alert-item.priority-high {
    background: #450a0a;
    border-left: 4px solid #dc2626;
}

.dark-theme .alert-item.priority-medium {
    background: #451a03;
    border-left: 4px solid #d97706;
}

.dark-theme .alert-info {
    background: #0f172a;
}

.dark-theme .patient-name {
    color: #f8fafc;
}

.dark-theme .alert-message {
    color: #cbd5e1;
}

.dark-theme .alert-time {
    color: #64748b;
}

/* Enhanced Dark Theme - Metrics Dashboard */
.dark-theme .metrics-dashboard {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 16px;
}

.dark-theme .metric-card {
    background: #0f172a;
    border: 1px solid #334155;
    color: #f1f5f9;
}

.dark-theme .metric-card:hover {
    background: #1e293b;
    border-color: #475569;
}

.dark-theme .metric-icon {
    background: #1e293b;
    border: 1px solid #334155;
}

.dark-theme .metric-value {
    color: #f8fafc;
}

.dark-theme .metric-label {
    color: #cbd5e1;
}

.dark-theme .metric-trend {
    color: #94a3b8;
}

.dark-theme .metric-trend.positive {
    color: #86efac;
}

.dark-theme .metric-trend.negative {
    color: #fca5a5;
}

/* Enhanced Dark Theme - Dashboard Cards */
.dark-theme .dashboard-card {
    background: #1e293b;
    border: 1px solid #334155;
    color: #f1f5f9;
}

.dark-theme .dashboard-card:hover {
    background: #334155;
    border-color: #475569;
}

.dark-theme .dashboard-card.large {
    background: #1e293b;
    border: 1px solid #334155;
}

/* Enhanced Dark Theme - Activity Feed */
.dark-theme .activity-feed {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 16px;
}

.dark-theme .activity-item {
    background: #0f172a;
    border: 1px solid #334155;
    color: #f1f5f9;
}

.dark-theme .activity-item:hover {
    background: #1e293b;
    border-color: #475569;
}

.dark-theme .activity-item.status-critical {
    background: #450a0a;
    border-left: 4px solid #dc2626;
}

.dark-theme .activity-item.status-warning {
    background: #451a03;
    border-left: 4px solid #d97706;
}

.dark-theme .activity-item.status-normal {
    background: #052e16;
    border-left: 4px solid #059669;
}

.dark-theme .activity-item.status-completed {
    background: #1e3a8a;
    border-left: 4px solid #3b82f6;
}

.dark-theme .activity-title {
    color: #f8fafc;
}

.dark-theme .activity-description {
    color: #cbd5e1;
}

.dark-theme .activity-time {
    color: #64748b;
}

/* Enhanced Dark Theme - Welcome Section */
.dark-theme .welcome-section {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid #334155;
    color: #f1f5f9;
}

.dark-theme .welcome-content h1 {
    color: #f8fafc;
}

.dark-theme .welcome-content p {
    color: #cbd5e1;
}

.dark-theme .stat-label {
    color: #94a3b8;
}

.dark-theme .stat-value {
    color: #f8fafc;
}

.dark-theme .stat-value.online {
    color: #86efac;
}

/* Enhanced Dark Theme - Summary Cards */
.dark-theme .summary-card {
    background: #1e293b;
    border: 1px solid #334155;
    color: #f1f5f9;
}

.dark-theme .summary-card:hover {
    background: #334155;
    border-color: #475569;
}

.dark-theme .card-content h3 {
    color: #cbd5e1;
}

.dark-theme .card-value {
    color: #f8fafc;
}

.dark-theme .card-link {
    color: #93c5fd;
}

.dark-theme .card-link:hover {
    color: #60a5fa;
}

/* Enhanced Dark Theme - Status Badges */
.dark-theme .status-badge {
    background: #334155;
    color: #cbd5e1;
    border: 1px solid #475569;
}

.dark-theme .status-critical {
    background: #450a0a;
    color: #fca5a5;
    border: 1px solid #dc2626;
}

.dark-theme .status-warning {
    background: #451a03;
    color: #fcd34d;
    border: 1px solid #d97706;
}

.dark-theme .status-normal {
    background: #052e16;
    color: #86efac;
    border: 1px solid #059669;
}

.dark-theme .status-active {
    background: #052e16;
    color: #86efac;
    border: 1px solid #059669;
}

.dark-theme .status-inactive {
    background: #334155;
    color: #94a3b8;
    border: 1px solid #475569;
}

/* Enhanced Dark Theme - Login Card */
.dark-theme .login-card {
    background: #1e293b;
    border: 1px solid #334155;
    color: #f1f5f9;
}

.dark-theme .login-header h1 {
    color: #f8fafc;
}

.dark-theme .login-header p {
    color: #cbd5e1;
}

.dark-theme .form-group label {
    color: #cbd5e1;
}

.dark-theme .input-group input {
    background: #0f172a;
    border: 1px solid #334155;
    color: #f1f5f9;
}

.dark-theme .input-group input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.dark-theme .input-group i {
    color: #64748b;
}

/* Enhanced Dark Theme - User Dropdown */
.dark-theme .user-dropdown-content {
    background: #1e293b;
    border: 1px solid #334155;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

.dark-theme .user-dropdown-header {
    border-bottom: 1px solid #334155;
    background: #0f172a;
}

.dark-theme .user-dropdown-name {
    color: #f8fafc;
}

.dark-theme .user-dropdown-email {
    color: #94a3b8;
}

.dark-theme .user-dropdown-item {
    color: #cbd5e1;
}

.dark-theme .user-dropdown-item:hover {
    background: #334155;
    color: #f8fafc;
}

.dark-theme .user-dropdown-divider {
    background: #334155;
}



/* Enhanced Dark Theme - Alert Banners */
.dark-theme .alert-banner {
    background: #1e293b;
    border: 1px solid #334155;
    color: #f1f5f9;
}

.dark-theme .alert-critical {
    background: #450a0a;
    color: #fca5a5;
    border: 1px solid #dc2626;
}

.dark-theme .alert-warning {
    background: #451a03;
    color: #fcd34d;
    border: 1px solid #d97706;
}

.dark-theme .alert-normal {
    background: #052e16;
    color: #86efac;
    border: 1px solid #059669;
}

.dark-theme .alert-info {
    background: none;
    color: #93c5fd;
    border: none;
}

/* Enhanced Dark Theme - Chart Containers */
.dark-theme .chart-container {
    background: #0f172a;
    border: 1px solid #334155;
    height: 360px !important;
    padding: 16px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.dark-theme .legend-item {
    color: #cbd5e1;
}

/* Dark theme analytics grid - matching light theme */
.dark-theme .analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
    max-width: 100%;
    width: 100%;
}

.dark-theme .analytics-grid .content-card {
    margin-bottom: 0;
    height: 420px;
    min-height: 420px;
    max-height: 420px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* Enhanced Dark Theme - Form Elements */
.dark-theme .form-select {
    background: #0f172a;
    border: 1px solid #334155;
    color: #f1f5f9;
}

.dark-theme .form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.dark-theme .form-select option {
    background: #1e293b;
    color: #f1f5f9;
}

/* Enhanced Dark Theme - Modal Enhancements */
.dark-theme .modal-content {
    background: #1e293b;
    border: 1px solid #334155;
}

.dark-theme .modal-header {
    background: #0f172a;
    border-bottom: 1px solid #334155;
}

.dark-theme .modal-header h3 {
    color: #f8fafc;
}

.dark-theme .modal-body {
    background: #1e293b;
    color: #f1f5f9;
}

.dark-theme .close {
    color: #cbd5e1;
}

.dark-theme .close:hover {
    color: #f8fafc;
    background: #334155;
}

/* Enhanced Dark Theme - Table Enhancements */
.dark-theme .data-table {
    background: #1e293b;
    border: 1px solid #334155;
}

.dark-theme .data-table th {
    background-color: #0f172a;
    color: #cbd5e1;
    font-weight: 700;
    font-size: 11.5px;
    padding: 16px 12px;
    text-align: left;
    border-bottom: 2px solid #334155;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dark-theme .data-table td {
    color: #f1f5f9;
    padding: 18px 14px;
    border-bottom: 1px solid #334155;
    vertical-align: top;
    font-size: 13px; /* sync with light mode to avoid size shifts */
}

.dark-theme .data-table tbody tr:hover {
    background: #334155;
}

/* Medication table sizing – dark theme mirrors light theme for consistent UI */
.dark-theme #medicationTable { table-layout: fixed; width: 100%; }
.dark-theme #medicationTable th, .dark-theme #medicationTable td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dark-theme #medicationTable th:nth-child(1), .dark-theme #medicationTable td:nth-child(1) { min-width: 100px; width: 150px; }
.dark-theme #medicationTable th:nth-child(2), .dark-theme #medicationTable td:nth-child(2) { min-width: 200px; width: 260px; }
.dark-theme #medicationTable th:nth-child(3), .dark-theme #medicationTable td:nth-child(3) { min-width: 220px; width: 280px; }
.dark-theme #medicationTable th:nth-child(4), .dark-theme #medicationTable td:nth-child(4) { min-width: 160px; width: 200px; }
.dark-theme #medicationTable th:nth-child(5), .dark-theme #medicationTable td:nth-child(5) { min-width: 130px; width: 150px; }
.dark-theme #medicationTable th:nth-child(6), .dark-theme #medicationTable td:nth-child(6) { min-width: 160px; width: 180px; }
.dark-theme #medicationTable td:nth-child(6) { overflow: hidden; display: flex; align-items: center; border-bottom: 1px solid #334155; }
.dark-theme #medicationTable td:nth-child(6) .action-buttons { justify-content: flex-start; position: static !important; margin: 0; }

.dark-theme .data-table th:nth-child(1), /* PATIENT */
.dark-theme .data-table td:nth-child(1) {
    min-width: 100px;
    max-width: 150px;
}

.dark-theme .data-table th:nth-child(2), /* VITAL SIGNS */
.dark-theme .data-table td:nth-child(2) {
    min-width: 120px;
    max-width: 140px;
}

.dark-theme .data-table th:nth-child(3), /* HEALTH METRICS */
.dark-theme .data-table td:nth-child(3) {
    min-width: 180px;
    max-width: 200px;
}

.dark-theme .data-table th:nth-child(4), /* MEDICATION */
.dark-theme .data-table td:nth-child(4) {
    min-width: 120px;
    max-width: 140px;
}

.dark-theme .data-table th:nth-child(5), /* STATUS */
.dark-theme .data-table td:nth-child(5) {
    min-width: 100px;
    max-width: 120px;
}

.dark-theme .data-table th:nth-child(6), /* TREND */
.dark-theme .data-table td:nth-child(6) {
    min-width: 100px;
    max-width: 120px;
}

.dark-theme .data-table th:nth-child(7), /* ALERTS */
.dark-theme .data-table td:nth-child(7) {
    min-width: 120px;
    max-width: 140px;
}

.dark-theme .data-table th:nth-child(8), /* ACTION */
.dark-theme .data-table td:nth-child(8) {
    min-width: 120px;
    max-width: 140px;
}

/* Enhanced Dark Theme - Button Enhancements */
.dark-theme .btn {
    background-color: #334155;
    color: #f1f5f9;
    border: 1px solid #475569;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dark-theme .btn:hover {
    background-color: #475569;
    color: #f8fafc;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.dark-theme .btn-primary {
    background-color: #3b82f6;
    color: #ffffff;
    border: 1px solid #2563eb;
}

.dark-theme .btn-primary:hover {
    background-color: #2563eb;
    border-color: #1d4ed8;
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.dark-theme .btn-secondary {
    background-color: #64748b;
    color: #f1f5f9;
    border: 1px solid #475569;
}

.dark-theme .btn-secondary:hover {
    background-color: #475569;
    color: #f8fafc;
    box-shadow: 0 4px 8px rgba(100, 116, 139, 0.3);
}

.dark-theme .btn-danger {
    background-color: #dc2626;
    color: #ffffff;
    border: 1px solid #b91c1c;
}

.dark-theme .btn-danger:hover {
    background-color: #b91c1c;
    border-color: #991b1b;
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3);
}

/* Professional Notification and Message Dropdowns */
.notification-dropdown,
.message-dropdown {
    position: relative;
    display: inline-block;
}

.notification-badge{
    border: 2px solid #fff;
    position: absolute;
    top: -6px; /* align with dark-mode positioning */
    right: -6px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    /* Allow width to expand for two digits while keeping center alignment */
    width: auto;
    min-width: 18px;
    height: 18px;
    font-size: 11px; /* match dark */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    padding: 2.2px 5px;
    margin: 0;
    min-height: 18px;
    box-sizing: border-box;
    border-radius: 999px; /* pill shape when wider than tall */
    font-variant-numeric: tabular-nums;
}

.message-badge {
    border: 2px solid #fff;
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: auto;
    min-width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    padding: 2.2px 5px;
    margin: 0;
    min-height: 18px;
    box-sizing: border-box;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
}

.notification-content,
.message-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    min-width: 350px;
    max-width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    z-index: 1000;
    margin-top: 8px;
    border: 1px solid #e5e7eb;
    max-height: 500px;
    overflow: hidden;
}

.notification-content.show,
.message-content.show {
    display: block;
    animation: slideDown 0.3s ease-out;
}

.notification-header,
.message-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.notification-header h3,
.message-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.mark-all-read,
.compose-btn {
    background: none;
    border: none;
    color: #3b82f6;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.mark-all-read:hover,
.compose-btn:hover {
    background: #eff6ff;
}

.notification-list,
.message-list {
    max-height: 350px;
    overflow-y: auto;
}

.notification-item,
.message-item {
    padding: 12px 20px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: background-color 0.2s;
    position: relative;
    cursor: pointer;
}

/* Three-dots menu on message items */
.message-more-btn {
    margin-left: 6px;
    background: transparent;
    border: none;
    color: #6b7280;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
}
.message-item:hover .message-more-btn { color: #111827; }
.message-more-btn:hover { background: #f3f4f6; }

.notification-item:hover,
.message-item:hover {
    background: #f9fafb;
}

.notification-item.unread,
.message-item.unread {
    background: #eff6ff;
}

/* Pinned conversation styling */
.message-item.pinned {
    background: #fff7ed;
    border-left: 3px solid #f59e0b;
}
.message-pin-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 11px;
    background: #fde68a;
    color: #92400e;
    margin-left: 8px;
}
.dark-theme .message-item.pinned {
    background: #2a1f0f;
    border-left-color: #d97706;
}
.dark-theme .message-pin-badge {
    background: #f59e0b;
    color: #0b1020;
}

.notification-item.unread:hover,
.message-item.unread:hover {
    background: #dbeafe;
}

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

.notification-item.critical .notification-icon {
    background: #fef2f2;
    color: #dc2626;
}

.notification-item.warning .notification-icon {
    background: #fffbeb;
    color: #d97706;
}

.notification-item.success .notification-icon {
    background: #f0fdf4;
    color: #059669;
}

.notification-item.info .notification-icon {
    background: #eff6ff;
    color: #2563eb;
}

.notification-details,
.message-details {
    flex: 1;
    min-width: 0;
}

.notification-title,
.message-sender {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
    margin-bottom: 2px;
}

.notification-message,
.message-subject {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 4px;
    line-height: 1.4;
}

.message-preview {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 4px;
    line-height: 1.3;
}

.notification-time,
.message-time {
    font-size: 11px;
    color: #9ca3af;
}

.notification-close,
.message-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0;
}

.notification-item:hover .notification-close,
.message-item:hover .message-close {
    opacity: 1;
}

.notification-close:hover,
.message-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    flex-shrink: 0;
}

.notification-footer,
.message-footer {
    padding: 12px 20px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    background: #f8fafc;
}

.notification-footer a,
.message-footer a {
    color: #3b82f6;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.notification-footer a:hover,
.message-footer a:hover {
    text-decoration: underline;
}

/* Profile Modal Styles */
.profile-modal {
    max-width: 600px;
    width: 90%;
}

.profile-section {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

.profile-avatar {
    position: relative;
    flex-shrink: 0;
}

.profile-avatar img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e5e7eb;
}

.change-avatar-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #3b82f6;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.change-avatar-btn:hover {
    background: #2563eb;
    transform: scale(1.1);
}

.profile-actions {
    display:flex; 
    gap:12px; 
    justify-content:flex-end; 
    padding-top:12px; 
    border-top:1px solid #e5e7eb; }

/* Settings Modal Styles */
.settings-modal {
    max-width: 600px;
    width: 85%;
    max-height: 80vh;
}

.settings-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 24px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    color: #6b7280;
    font-weight: 500;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #374151;
    background: #f9fafb;
}

.tab-btn.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.settings-content {
    max-height: 400px;
    overflow-y: auto;
}

.settings-tab {
    display: none;
}

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

.settings-tab h4 {
    margin: 0 0 16px 0;
    color: #1f2937;
    font-size: 16px;
    font-weight: 600;
}

.color-scheme-options {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s;
}

.color-option.active {
    border-color: #3b82f6;
    transform: scale(1.1);
}

.color-option[data-color="blue"] { background: #3b82f6; }
.color-option[data-color="green"] { background: #10b981; }
.color-option[data-color="purple"] { background: #8b5cf6; }
.color-option[data-color="orange"] { background: #f59e0b; }

.settings-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    margin-top: 24px;
}

/* Compose Message Modal */
.compose-modal {
    max-width: 500px;
    width: 90%;
}

.compose-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    margin-top: 16px;
}

/* Enhanced Message Features Styles */

/* Message Header with Actions */
.message-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Message Search and Filters */
.message-search-filters {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    background: #f9fafb;
}

.message-search-wrapper {
    position: relative;
    flex: 1;
    min-width: 0;
}

.message-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 14px;
    pointer-events: none;
}

.message-search-wrapper input#messageSearchInput {
    padding-left: 34px;
}

.message-search-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: #e5e7eb;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    width: 30px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    cursor: pointer;
}
.message-search-btn:hover { background: #dbeafe; border-color: #bfdbfe; }

#messageSearchInput {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: #ffffff;
    transition: all 0.2s;
}

#messageSearchInput:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.message-filter-select {
    min-width: 120px;
    padding: 8px 32px 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: #ffffff;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    transition: all 0.2s;
}

.message-filter-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Message Item Enhancements */
.message-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.message-priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.message-priority-badge.critical {
    background: #fef2f2;
    color: #dc2626;
}

.message-priority-badge.urgent {
    background: #fffbeb;
    color: #d97706;
}

.message-patient-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    background: #f0f9ff;
    color: #0369a1;
}

.message-footer-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.message-read-indicator {
    color: #10b981;
    font-size: 11px;
}

.message-thread-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    background: #f3f4f6;
    color: #6b7280;
}

.message-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.message-item:hover .message-actions {
    opacity: 1;
}

.message-action-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-action-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.message-empty {
    padding: 32px 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

/* Message Item Priority Colors */
.message-item.critical {
    border-left: 3px solid #dc2626;
}

.message-item.urgent {
    border-left: 3px solid #d97706;
}

.message-item.info {
    border-left: 3px solid #3b82f6;
}

/* Quick Reply Modal */
.quick-reply-modal {
    max-width: 600px;
    width: 90%;
}

.reply-to-message {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.reply-original-header {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reply-original-content {
    font-size: 13px;
    color: #374151;
}

.reply-original-from,
.reply-original-subject {
    margin-bottom: 6px;
    line-height: 1.5;
}

.reply-original-preview {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
    color: #6b7280;
    font-style: italic;
    line-height: 1.5;
}

/* Message Thread Modal */
.message-thread-modal {
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
}

#messageThreadBody {
    max-height: calc(90vh - 200px);
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.thread-composer { 
    border-top: 1px solid #e5e7eb; 
    padding: 10px; 
    background: #fff; 
    position: sticky; 
    bottom: 0; 
}
.thread-composer textarea { 
    width: 100%; 
    border: 1px solid #e5e7eb; 
    border-radius: 8px; 
    padding: 10px 12px; 
    resize: vertical; 
}
.thread-composer-actions { 
    display: flex; 
    gap: 8px; 
    justify-content: flex-end; 
    margin-top: 8px; 
}
.thread-unread-separator { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    color: #1d4ed8; 
    font-weight: 600; 
    margin: 6px 0; 
}
.thread-unread-separator::before, .thread-unread-separator::after {
    content: ''; 
    flex: 1; 
    height: 1px; 
    background: #bfdbfe; 
}

.thread-message.optimistic {
    opacity: 0.7;
}

.thread-message-status {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.thread-typing-indicator {
    padding: 8px 16px;
    color: #6b7280;
    font-size: 13px;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 6px;
}

.thread-typing-indicator .dots {
    display: flex;
    gap: 3px;
}

.thread-typing-indicator .dots span {
    width: 6px;
    height: 6px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

.thread-typing-indicator .dots span:nth-child(2) { animation-delay: 0.2s; }
.thread-typing-indicator .dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
    30% { opacity: 1; transform: scale(1); }
}

.thread-message-reactions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.thread-reaction-btn {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 4px 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.thread-reaction-btn:hover {
    background: #e5e7eb;
}

.thread-reaction-btn.active {
    background: #dbeafe;
    border-color: #3b82f6;
}

.thread-message {
    position: relative;
    padding: 16px;
    border-radius: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.thread-message.sent {
    background: #eff6ff;
    border-color: #bfdbfe;
    margin-left: 20%;
}

.thread-message.received {
    background: #ffffff;
    border-color: #e5e7eb;
    margin-right: 20%;
}

/* Messenger-like per-message more menu */
.thread-more-btn {
    position: absolute;
    top: 4px;
    right: 6px;
    background: transparent;
    border: none;
    color: #6b7280;
    opacity: 1;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.thread-message:hover .thread-more-btn { opacity: 1; }
.thread-more-btn:hover { background: #f3f4f6; color: #111827; }

.thread-message-menu {
    position: absolute;
    z-index: 9999;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.12);
    padding: 6px;
    min-width: 180px;
}
.thread-message-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: transparent;
    border: none;
    text-align: left;
    padding: 8px 10px;
    border-radius: 6px;
    color: #111827;
    cursor: pointer;
}
.thread-message-menu button:hover { background: #f3f4f6; }

.dark-theme .thread-more-btn { color: #9ca3af; }
.dark-theme .thread-more-btn:hover { background: #334155; color: #f8fafc; }
.dark-theme .thread-message-menu { background: #0f172a; border-color: #334155; }
.dark-theme .thread-message-menu button { color: #e5e7eb; }
.dark-theme .thread-message-menu button:hover { background: #1e293b; }

.thread-message.critical {
    border-left: 4px solid #dc2626;
}

.thread-message.urgent {
    border-left: 4px solid #d97706;
}

.thread-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.thread-message-sender {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
}

.thread-patient-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    background: #f0f9ff;
    color: #0369a1;
    font-weight: 500;
}

.thread-message-time {
    font-size: 11px;
    color: #9ca3af;
}

.thread-message-priority {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.thread-message-priority.critical {
    background: #fef2f2;
    color: #dc2626;
}

.thread-message-priority.urgent {
    background: #fffbeb;
    color: #d97706;
}

.thread-message-subject {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
    margin-bottom: 8px;
}

.thread-message-content {
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.thread-message-read {
    margin-top: 8px;
    font-size: 11px;
    color: #9ca3af;
    font-style: italic;
}

/* Dark Theme Enhancements */
.dark-theme .message-search-filters {
    background: #1e293b;
    border-color: #334155;
}

.dark-theme #messageSearchInput {
    background: #334155;
    border-color: #475569;
    color: #f1f5f9;
}

.dark-theme #messageSearchInput:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.dark-theme .message-search-icon {
    color: #94a3b8;
}

.dark-theme .message-filter-select {
    background: #334155;
    border-color: #475569;
    color: #f1f5f9;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

.dark-theme .message-filter-select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.dark-theme .message-priority-badge.critical {
    background: #7f1d1d;
    color: #fca5a5;
}

.dark-theme .message-priority-badge.urgent {
    background: #78350f;
    color: #fcd34d;
}

.dark-theme .message-patient-badge {
    background: #0c4a6e;
    color: #7dd3fc;
}

.dark-theme .message-thread-indicator {
    background: #334155;
    color: #cbd5e1;
}

.dark-theme .message-action-btn:hover {
    background: #475569;
    color: #f1f5f9;
}

.dark-theme .message-empty {
    color: #64748b;
}

.dark-theme .thread-message {
    background: #1e293b;
    border-color: #334155;
}

.dark-theme .thread-message.sent {
    background: #1e3a8a;
    border-color: #3b82f6;
}

.dark-theme .thread-message.received {
    background: #334155;
    border-color: #475569;
}

.dark-theme .thread-message-sender {
    color: #f1f5f9;
}

.dark-theme .thread-patient-badge {
    background: #0c4a6e;
    color: #7dd3fc;
}

.dark-theme .thread-message-time {
    color: #94a3b8;
}

.dark-theme .thread-message-priority.critical {
    background: #7f1d1d;
    color: #fca5a5;
}

.dark-theme .thread-message-priority.urgent {
    background: #78350f;
    color: #fcd34d;
}

.dark-theme .thread-message-subject {
    color: #f1f5f9;
}

.dark-theme .thread-message-content {
    color: #cbd5e1;
}

.dark-theme .thread-message-read {
    color: #64748b;
}

.dark-theme .reply-to-message {
    background: #1e293b;
    border-color: #334155;
}

.dark-theme .reply-original-header {
    color: #94a3b8;
}

.dark-theme .reply-original-content {
    color: #cbd5e1;
}

.dark-theme .reply-original-from strong,
.dark-theme .reply-original-subject strong {
    color: #f1f5f9;
}

.dark-theme .reply-original-preview {
    border-color: #334155;
    color: #94a3b8;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .message-search-filters {
        flex-direction: column;
    }
    
    .message-filter-select {
        width: 100%;
    }
    
    .message-item.critical,
    .message-item.urgent,
    .message-item.info {
        border-left-width: 2px;
    }
    
    .thread-message.sent {
        margin-left: 10%;
    }
    
    .thread-message.received {
        margin-right: 10%;
    }
    
    .thread-message-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dark Theme Support */
.dark-theme .notification-content,
.dark-theme .message-content {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

.dark-theme .notification-header,
.dark-theme .message-header,
.dark-theme .notification-footer,
.dark-theme .message-footer {
    background: #0f172a;
    border-color: #334155;
}

.dark-theme .notification-header h3,
.dark-theme .message-header h3 {
    color: #f8fafc;
}

.dark-theme .notification-item,
.dark-theme .message-item {
    border-color: #334155;
}

.dark-theme .notification-item:hover,
.dark-theme .message-item:hover {
    background: #334155;
}

.dark-theme .notification-item.unread,
.dark-theme .message-item.unread {
    background: #1e3a8a;
}

.dark-theme .notification-item.unread:hover,
.dark-theme .message-item.unread:hover {
    background: #1e40af;
}

.dark-theme .notification-title,
.dark-theme .message-sender {
    color: #f1f5f9;
}

.dark-theme .notification-message,
.dark-theme .message-subject {
    color: #cbd5e1;
}

.dark-theme .notification-time,
.dark-theme .message-time,
.dark-theme .message-preview {
    color: #94a3b8;
}

.dark-theme .notification-close:hover,
.dark-theme .message-close:hover {
    background: #475569;
    color: #f1f5f9;
}

.dark-theme .message-avatar {
    background: #475569;
    color: #cbd5e1;
}

.dark-theme .settings-tabs {
    border-color: #334155;
}

.dark-theme .tab-btn {
    color: #cbd5e1;
}

.dark-theme .tab-btn:hover {
    color: #f1f5f9;
    background: #334155;
}

.dark-theme .tab-btn.active {
    color: #60a5fa;
    border-bottom-color: #60a5fa;
}

.dark-theme .settings-tab h4 {
    color: #f1f5f9;
}

.dark-theme .color-option {
    border-color: #475569;
}

.dark-theme .color-option.active {
    border-color: #60a5fa;
}

/* Responsive Design */
@media (max-width: 768px) {
    .notification-content,
    .message-content {
        min-width: 300px;
        max-width: 350px;
        right: -50px;
    }
    
    .profile-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .profile-info {
        grid-template-columns: 1fr;
    }
    
    .settings-tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 120px;
    }
}

/* Improved Profile and Settings Styles */
.profile-modal {
    max-width: 760px;
    width: 90%;
}

.profile-section { display:flex; gap: 1.25rem; margin-bottom: 1.25rem; }

.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.profile-avatar {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.4) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(2px);
    pointer-events: auto;
    z-index: 5;
}

.profile-avatar:hover .avatar-overlay {
    transform: translateY(0);
}

.change-avatar-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
    width: 100%;
}

.change-avatar-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.profile-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 20px;
    color: #166534;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    animation: pulse 2s infinite;
}

.status-indicator.online {
    background: #22c55e;
}

.status-text {
    font-size: 0.875rem;
    font-weight: 500;
}

.profile-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-row { display:grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.form-group label {
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.required {
    color: #dc2626;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    color: #6b7280;
    font-size: 1rem;
    z-index: 1;
}

.input-wrapper input,
.input-wrapper select,
.input-wrapper textarea {
    width: 100%;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s;
    background: #ffffff;
}

.input-wrapper input:focus,
.input-wrapper select:focus,
.input-wrapper textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.readonly-input {
    background-color: #f9fafb !important;
    color: #6b7280;
    cursor: not-allowed;
}

.profile-actions { display:flex; gap:0.75rem; justify-content:flex-end; padding-top:0.75rem; border-top:1px solid #e5e7eb; }

/* Settings Modal Improvements */
.settings-modal {
    max-width: 600px;
    width: 85%;
}

.settings-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1rem;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s;
}

.tab-btn:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.tab-btn.active {
    background-color: #3b82f6;
    color: white;
}

.tab-btn i {
    font-size: 1rem;
}

.settings-content {
    min-height: 200px;
}

.settings-tab {
    display: none;
}

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

.settings-tab h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: #111827;
    font-size: 1.25rem;
}

.settings-tab h4 i {
    color: #3b82f6;
}

.notification-settings {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #ffffff;
}

.checkbox-label:hover {
    border-color: #3b82f6;
    background-color: #f8fafc;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid #d1d5db;
    border-radius: 6px;
    flex-shrink: 0;
    transition: all 0.2s ease;
    background-color: #ffffff;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background-color: #3b82f6;
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
    transform: scale(1);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.875rem;
    animation: checkmarkAppear 0.2s ease;
}

@keyframes checkmarkAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.checkbox-content {
    flex: 1;
}

.checkbox-title {
    display: block;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.checkbox-description {
    display: block;
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.4;
}

.settings-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    border-top: 1px solid #e5e7eb;
}

/* Dark Theme Support */
.dark-theme .profile-avatar {
    border-color: #334155;
}

.dark-theme .profile-status {
    background: #052e16;
    border-color: #166534;
    color: #86efac;
}

.dark-theme .form-group label {
    color: #e5e7eb;
}

.dark-theme .input-wrapper input,
.dark-theme .input-wrapper select,
.dark-theme .input-wrapper textarea {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

.dark-theme .input-wrapper input:focus,
.dark-theme .input-wrapper select:focus,
.dark-theme .input-wrapper textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.dark-theme .readonly-input {
    background-color: #0f172a !important;
    color: #94a3b8;
}

.dark-theme .profile-actions {
    border-top-color: #334155;
}

.dark-theme .settings-tabs {
    border-bottom-color: #334155;
}

.dark-theme .tab-btn {
    color: #94a3b8;
}

.dark-theme .tab-btn:hover {
    background-color: #334155;
    color: #f1f5f9;
}

.dark-theme .tab-btn.active {
    background-color: #3b82f6;
    color: white;
}

.dark-theme .settings-tab h4 {
    color: #f1f5f9;
}

.dark-theme .checkbox-label {
    background: #1e293b;
    border-color: #334155;
}

.dark-theme .checkbox-label:hover {
    border-color: #3b82f6;
    background-color: #0f172a;
}

.dark-theme .checkbox-title {
    color: #f1f5f9;
}

.dark-theme .checkbox-description {
    color: #94a3b8;
}

.dark-theme .settings-actions {
    border-top-color: #334155;
}

/* Responsive Design */
@media (max-width: 768px) {
    .profile-section {
        flex-direction: column;
        align-items: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .settings-tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 120px;
    }
}

.checkbox-label:hover .checkmark {
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

/* Dark theme support for checkboxes */
.dark-theme .checkmark {
    background-color: #1e293b;
    border-color: #475569;
}

.dark-theme .checkbox-label:hover .checkmark {
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.dark-theme .checkbox-label input[type="checkbox"]:checked + .checkmark {
    background-color: #3b82f6;
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.4);
}

/* Specific styles for notification settings checkboxes */
.notification-settings .checkbox-label .checkmark {
    position: relative;
    width: 24px !important;
    height: 24px !important;
    border: 3px solid #d1d5db !important;
    border-radius: 6px !important;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.2s ease;
    background-color: #ffffff;
    cursor: pointer;
}

/* Professional Form Styles */
.large-modal {
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    margin: 0;
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.3s ease;
}

/* Compact modal for short forms like Alert Settings */
.small-modal {
    max-width: 520px;
    width: 92%;
    margin-left: 16px; /* requested offset */
}

.modal.show .large-modal {
    transform: scale(1);
    opacity: 1;
}

.modal-header-content {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.modal-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.modal-title h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
}

.modal-title p {
    margin: 4px 0 0 0;
    color: #6b7280;
    font-size: 14px;
}

.professional-form {
    padding: 0;
}

.form-sections {
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding: 24px;
}

.form-section {
    background: #f9fafb;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.form-section:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: #d1d5db;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
}

.section-header i {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.section-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 0;
}

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

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.form-label i {
    color: #6b7280;
    font-size: 12px;
}

.required {
    color: #dc2626;
    font-weight: 700;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 12px; /* even padding; room for text */
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    background: #ffffff;
    transition: all 0.3s ease;
    color: #374151;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: #ffffff;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: #9ca3af;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
    padding-top: 12px;
    padding-bottom: 12px;
}

/* Hide input icons in all forms (add/edit) and align placeholders left */
.input-icon { display: none !important; }

.form-input:focus + .input-icon,
.form-select:focus + .input-icon,
.form-textarea:focus + .input-icon {
    color: #3b82f6;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    gap: 16px;
}

.form-actions-left,
.form-actions-right {
    display: flex;
    gap: 12px;
}

.btn-outline {
    background: transparent;
    border: 2px solid #d1d5db;
    color: #374151;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #1f2937;
}

/* Dark theme support */
.dark-theme .large-modal {
    background: #1e293b;
    border: 1px solid #334155;
}

.dark-theme .modal-title h3 {
    color: #f8fafc;
}

.dark-theme .modal-title p {
    color: #cbd5e1;
}

.dark-theme .form-section {
    background: #0f172a;
    border: 1px solid #334155;
}

.dark-theme .form-section:hover {
    border-color: #475569;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dark-theme .section-header {
    border-bottom-color: #334155;
}

.dark-theme .section-header h4 {
    color: #f8fafc;
}

.dark-theme .form-label {
    color: #e2e8f0;
}

.dark-theme .form-input,
.dark-theme .form-select,
.dark-theme .form-textarea {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

.dark-theme .form-input:focus,
.dark-theme .form-select:focus,
.dark-theme .form-textarea:focus {
    border-color: #3b82f6;
    background: #1e293b;
}

.dark-theme .form-input::placeholder,
.dark-theme .form-textarea::placeholder {
    color: #64748b;
}

.dark-theme .input-icon {
    color: #64748b;
}

.dark-theme .form-input:focus + .input-icon,
.dark-theme .form-select:focus + .input-icon,
.dark-theme .form-textarea:focus + .input-icon {
    color: #3b82f6;
}

.dark-theme .form-actions {
    background: #0f172a;
    border-top-color: #334155;
}

.dark-theme .btn-outline {
    border-color: #475569;
    color: #e2e8f0;
}

.dark-theme .btn-outline:hover {
    background: #1e293b;
    border-color: #64748b;
    color: #f8fafc;
}

/* Responsive design */
@media (max-width: 768px) {
    .large-modal {
        width: 95%;
        margin: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .form-sections {
        padding: 16px;
        gap: 24px;
    }
    
    .form-section {
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .form-actions-left,
    .form-actions-right {
        width: 100%;
        justify-content: center;
    }
    
    .modal-header-content {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .modal-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* Form validation states */
.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-input.success,
.form-select.success,
.form-textarea.success {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.input-wrapper.error .input-icon {
    color: #dc2626;
}

.input-wrapper.success .input-icon {
    color: #10b981;
}

/* Enhanced form styling */
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: #ffffff;
    /* transform: translateY(-1px); - Removed to prevent button movement on hover */
}

.form-section {
    background: #f9fafb;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.form-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.form-section:hover::before {
    opacity: 1;
}

.form-section:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    border-color: #d1d5db;
}

/* Outline Button Variant */
.btn-outline {
    background: transparent;
    border: 2px solid #d1d5db;
    color: #374151;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
    color: #1f2937;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Dark theme validation states */
.dark-theme .form-input.error,
.dark-theme .form-select.error,
.dark-theme .form-textarea.error {
    border-color: #f87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.2);
}

.dark-theme .form-input.success,
.dark-theme .form-select.success,
.dark-theme .form-textarea.success {
    border-color: #34d399;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
}

.dark-theme .input-wrapper.error .input-icon {
    color: #f87171;
}

.dark-theme .input-wrapper.success .input-icon {
    color: #34d399;
}

.dark-theme .form-input:focus,
.dark-theme .form-select:focus,
.dark-theme .form-textarea:focus {
    border-color: #3b82f6;
    background: #1e293b;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.dark-theme .form-section::before {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.dark-theme .form-section:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: #475569;
}

/* Medication Tracker Styles */
.medication-dashboard {
    margin-bottom: 32px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.stat-icon.pending {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.stat-icon.missed {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.stat-icon.success {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.stat-content h3 {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
}

.stat-content p {
    margin: 4px 0 0 0;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
}

.quick-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.quick-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

/* Prevent shift between light/dark: keep borders and shadows consistent */
.quick-actions .btn,
.dark-theme .quick-actions .btn {
    border-width: 2px;
    border-style: solid;
}
.quick-actions .btn-primary { border-color: #1d4ed8; }
.quick-actions .btn-secondary { border-color: #4b5563; }
.quick-actions .btn-outline { border-color: #d1d5db; }
.dark-theme .quick-actions .btn-primary { border-color: #2563eb; }
.dark-theme .quick-actions .btn-secondary { border-color: #475569; }
.dark-theme .quick-actions .btn-outline { border-color: #475569; color: #e2e8f0; }

/* Normalize vertical alignment and height */
.quick-actions .btn,
.dark-theme .quick-actions .btn {
    line-height: 1;
    min-height: 44px;
}

/* Enhanced Table Styles */
.medication-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.medication-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
}

.medication-notes {
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
}

.dosage-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dosage {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
}

.frequency {
    font-size: 12px;
    color: #6b7280;
}

.dose-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.next-dose {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
}

.last-dose {
    font-size: 12px;
    color: #6b7280;
}

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

.adherence-bar {
    width: 80px;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.adherence-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.adherence-text {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    min-width: 35px;
}

/* Enhanced Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

.status-badge.status-missed {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
}

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

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

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

/* Schedule Styles */
.schedule-container {
    padding: 20px;
}

.schedule-timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.schedule-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 12px;
    border-left: 4px solid #3b82f6;
    transition: all 0.3s ease;
}

.schedule-item:hover {
    background: #f3f4f6;
    transform: translateX(4px);
}

.schedule-time {
    font-weight: 700;
    color: #1f2937;
    font-size: 14px;
    min-width: 80px;
}

.schedule-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.schedule-patient {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
}

.schedule-medication {
    font-size: 12px;
    color: #6b7280;
}

.schedule-status {
    flex-shrink: 0;
}

.chart-container .chart-legend {
    margin-top: 8px;
    position: static;
    transform: none;
    display: flex;
    flex-direction: row;
    background: #ffffff;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Today's Schedule: make list scrollable within fixed-height card */
.schedule-container {
    padding: 20px;
    max-height: 330px; /* 420 card height - header area */
    overflow-y: auto;
}

/* Legend when placed inside a card header (to the right of the title) */
.card-header .chart-legend {
    position: static;
    transform: none;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    background: transparent;
    padding: 0;
    border: 0;
    box-shadow: none;
    margin-left: auto;
}

/* Make header legend compact so the two analytics cards align nicely */
.card-header .legend-item {
    font-size: 12px;
}

.card-header .legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #374151;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
}

.legend-color.taken {
    background: #1e3a8a;
}

.legend-color.late {
    background: #3b82f6;
}

.legend-color.missed {
    background: #93c5fd;
}

.legend-color.skipped {
    background: #d1d5db;
}

/* Dark Theme Support */
.dark-theme .stat-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.dark-theme .stat-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

.dark-theme .stat-content h3 {
    color: #f8fafc;
}

.dark-theme .stat-content p {
    color: #cbd5e1;
}

.dark-theme .medication-name,
.dark-theme .dosage,
.dark-theme .next-dose {
    color: #f1f5f9;
}

.dark-theme .medication-notes,
.dark-theme .frequency,
.dark-theme .last-dose {
    color: #94a3b8;
}

.dark-theme .schedule-item {
    background: #1e293b;
    border-left-color: #3b82f6;
}

.dark-theme .schedule-item:hover {
    background: #334155;
}

.dark-theme .schedule-patient {
    color: #f1f5f9;
}

.dark-theme .schedule-medication {
    color: #94a3b8;
}

/* Improve time visibility in dark mode */
.dark-theme .schedule-time {
    color: #f8fafc;
}

.dark-theme .chart-container .chart-legend {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.dark-theme .legend-item {
    color: #e2e8f0;
}

/* Content Header Styles */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    padding: 0 24px;
}

.header-left h1 {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-left p {
    font-size: 16px;
    color: #64748b;
    margin: 0;
}

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

/* Dark Theme Support */
.dark-theme .header-left h1 {
    color: #f1f5f9;
}

.dark-theme .header-left p {
    color: #94a3b8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .content-header {
        flex-direction: column;
        gap: 16px;
        padding: 0 16px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .stat-content h3 {
        font-size: 28px;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .quick-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .schedule-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .schedule-time {
    min-width: auto;
    color: #1f2937; /* darker for readability */
    font-weight: 700;
    }
    
    .chart-container .chart-legend {
        position: static;
        transform: none;
        margin-top: 20px;
        right: auto;
        top: auto;
    }
}

/* Notification Styles */
/* Container fixed at top-center so notifications are visible regardless of scroll */
.notification-container {
    position: fixed;
    top: 12px;
    right: 12px;
    left: auto;
    transform: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    width: auto;
    max-width: 640px;
    z-index: 9999;
    pointer-events: none; /* allow clicks to pass through except the toasts */
}

.notification {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    color: #ffffff;
    background: #334155; /* default fallback */
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.15);
    width: auto;            /* size to content, avoid full-width bar */
    max-width: 520px;
    pointer-events: auto;
    animation: toastSlideDown 0.25s ease-out;
}

.notification i { font-size: 18px; }
.notification span { font-weight: 600; color: #ffffff; }

/* If any legacy inner wrapper exists, make it transparent to avoid white card inside colored bar */
.notification .notification-content {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.notification .notification-content span { color: #ffffff !important; }
.notification .notification-content i { color: #ffffff !important; }

/* Color coding by type */
.notification-success { background-color: #16a34a; }
.notification-error { background-color: #dc2626; }
.notification-warning { background-color: #f59e0b; }
.notification-info { background-color: #3b82f6; }

.notification-close {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.35);
    color: #ffffff;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    margin-left: 6px;
}

.notification-close:hover { background: rgba(255,255,255,0.12); }

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

/* Dark theme keeps strong background; buttons remain legible */
.dark-theme .notification { box-shadow: 0 12px 30px -12px rgba(0,0,0,0.6); }

/* Enhanced Search Styles */
.search-highlight {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
}

.dark-theme .search-highlight {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: #ffffff;
}

/* Additional Medication Tracker Enhancements */
.medication-dashboard .header-content h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 12px;
}

.medication-dashboard .header-content p {
    margin: 8px 0 0 0;
    color: #6b7280;
    font-size: 16px;
}

.dark-theme .medication-dashboard .header-content h2 {
    color: #f8fafc;
}

.dark-theme .medication-dashboard .header-content p {
    color: #cbd5e1;
}

/* Enhanced Action Buttons - Elegant Icon Style */
.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-buttons .btn-action {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.action-buttons .btn-action:hover {
    /* transform: translateY(-1px); - Removed to prevent button movement on hover */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.action-buttons .btn-action.primary {
    background-color: #3b82f6;
    color: white;
}

.action-buttons .btn-action.primary:hover {
    background-color: #2563eb;
}

.action-buttons .btn-action.secondary {
    background-color: #6b7280;
    color: white;
}

.action-buttons .btn-action.secondary:hover {
    background-color: #4b5563;
}

.action-buttons .btn-action.warning {
    background-color: #f59e0b;
    color: white;
}

.action-buttons .btn-action.warning:hover {
    background-color: #d97706;
}

.action-buttons .btn-action.danger {
    background-color: #ef4444;
    color: white;
}

.action-buttons .btn-action.danger:hover {
    background-color: #dc2626;
}

.action-buttons .btn-action.success {
    background-color: #10b981;
    color: white;
}

.action-buttons .btn-action.success:hover {
    background-color: #059669;
}

/* Icon Action Buttons - Elegant Style */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background-color: #6b7280;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-icon:hover {
    background-color: #4b5563;
    /* transform: translateY(-1px); - Removed to prevent button movement on hover */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-icon i {
    font-size: 14px;
    line-height: 1;
}

.btn-icon:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Dark theme support for elegant action buttons */
.dark-theme .btn-icon {
    background-color: #4b5563;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.dark-theme .btn-icon:hover {
    background-color: #374151;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.dark-theme .action-buttons .btn-action.primary {
    background-color: #2563eb;
}

.dark-theme .action-buttons .btn-action.primary:hover {
    background-color: #1d4ed8;
}

.dark-theme .action-buttons .btn-action.secondary {
    background-color: #4b5563;
}

.dark-theme .action-buttons .btn-action.secondary:hover {
    background-color: #374151;
}

.dark-theme .action-buttons .btn-action.success {
    background-color: #059669;
}

.dark-theme .action-buttons .btn-action.success:hover {
    background-color: #047857;
}

.dark-theme .action-buttons .btn-action.warning {
    background-color: #d97706;
}

.dark-theme .action-buttons .btn-action.warning:hover {
    background-color: #b45309;
}

.dark-theme .action-buttons .btn-action.danger {
    background-color: #dc2626;
}

.dark-theme .action-buttons .btn-action.danger:hover {
    background-color: #b91c1c;
}

.dark-theme .action-buttons .btn-action.info {
    background-color: #0891b2;
}

.dark-theme .action-buttons .btn-action.info:hover {
    background-color: #0e7490;
}

/* Recent Activities header alignment */
.pagination-controls { row-gap: 8px; }
.pagination-controls .btn.btn-sm { height: 36px; display: inline-flex; align-items: center; gap: 8px; }
.pagination-controls .form-input { height: 36px; }

/* Enhanced Table Responsiveness */
@media (max-width: 1024px) {
    .action-buttons {
        flex-direction: column;
        gap: 4px;
    }
    
    .action-buttons .btn-action {
        width: 100%;
        justify-content: center;
    }
}

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

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f4f6;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.dark-theme .header h1 {
    color: #f8fafc;
}

.dark-theme .header-right .icon-btn {
    background-color: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(51, 65, 85, 0.6);
    color: #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dark-theme .header-right .icon-btn:hover {
    background-color: rgba(30, 41, 59, 1);
    color: #f8fafc;
    border-color: rgba(96, 165, 250, 0.4);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.dark-theme .header-right .user-dropdown-btn {
    background-color: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(51, 65, 85, 0.6);
    color: #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dark-theme .header-right .user-dropdown-btn:hover {
    background-color: rgba(30, 41, 59, 1);
    color: #f8fafc;
    border-color: rgba(96, 165, 250, 0.4);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0;
    transition: all 0.2s ease;
    min-height: 48px; /* Increased from thin styling */
}

.input-wrapper input,
.input-wrapper select {
    flex: 1;
    border: none;
    outline: none;
    padding: 14px 16px 14px;
    font-size: 14px;
    background: transparent;
    color: #374151;
    min-height: 48px; /* Ensure consistent height */
    box-sizing: border-box;
}

.input-wrapper input:focus,
.input-wrapper select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-wrapper .input-icon {
    position: absolute;
    left: 16px;
    color: #9ca3af;
    font-size: 16px;
    pointer-events: none;
    z-index: 1;
}

.profile-avatar {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #e5e7eb;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.profile-avatar:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
    border-color: #3b82f6;
}

.profile-avatar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.profile-avatar:hover::after {
    opacity: 1;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.4) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(2px);
    pointer-events: auto;
    z-index: 5;
}

.profile-avatar:hover .avatar-overlay {
    opacity: 1;
}

.profile-avatar .avatar-overlay {
    opacity: 1;
}

.change-avatar-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border: 2px solid rgba(255, 255, 255, 0.9);
    color: white;
    cursor: pointer;
    padding: 14px;
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
    position: relative;
    overflow: hidden;
    z-index: 10;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

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

.change-avatar-btn:hover::before {
    left: 100%;
}

.change-avatar-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    border-color: rgba(255, 255, 255, 1);
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 35px rgba(59, 130, 246, 0.6);
}

.change-avatar-btn:hover {
    background: rgba(59, 130, 246, 1);
    border-color: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.change-avatar-btn i {
    font-size: 20px;
    color: white;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
    z-index: 2;
    position: relative;
}

.dark-theme .input-wrapper {
    background: #1f2937;
    border-color: #374151;
}

.dark-theme .input-wrapper input,
.dark-theme .input-wrapper select {
    color: #e5e7eb;
}

.dark-theme .input-wrapper input:focus,
.dark-theme .input-wrapper select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

.dark-theme .input-wrapper .input-icon {
    color: #6b7280;
}

.dark-theme .profile-avatar {
    border-color: #4b5563;
}

.dark-theme .avatar-overlay {
    background: rgba(0, 0, 0, 0.8);
}

.dark-theme .change-avatar-btn {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

.dark-theme .change-avatar-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Image Cropper Modal Styles - Professional Design */
.cropper-modal {
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.cropper-container {
    width: 100%;
    max-height: 300px;
    overflow: hidden;
    border-radius: 12px;
    border: 3px solid #3b82f6;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    flex-shrink: 0;
}

.cropper-container img {
    width: 100%;
    height: auto;
    max-height: 300px;
    display: block;
    object-fit: contain;
}

.cropper-instructions {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 12px;
    border-radius: 12px;
    border: 2px solid #3b82f6;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    flex-shrink: 0;
}

.cropper-instructions p {
    margin: 0;
    color: #1e40af;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    line-height: 1.4;
}

.cropper-instructions i {
    color: #1d4ed8;
    font-size: 16px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 0 0 0;
    border-top: 2px solid #3b82f6;
    margin-top: auto;
    flex-shrink: 0;
}

.modal-footer .btn {
    padding: 12px 24px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-width: 120px;
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    color: white;
}

.modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    /* transform: translateY(-2px); - Removed to prevent button movement on hover */
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.modal-footer .btn-secondary {
    background: #4b5563;
    border: 2px solid #374151;
    color: #ffffff;
}

.modal-footer .btn-secondary:hover {
    background: #374151;
    border-color: #1f2937;
    color: #ffffff;
}

/* Responsive design for cropper modal */
@media (max-width: 768px) {
    .cropper-modal {
        max-width: 95%;
        max-height: 90vh;
    }
    
    .cropper-container {
        max-height: 250px;
    }
    
    .cropper-container img {
        max-height: 250px;
    }
    
    .cropper-instructions {
        padding: 10px;
        margin-bottom: 12px;
    }
    
    .cropper-instructions p {
        font-size: 13px;
        gap: 6px;
    }
    
    .modal-footer {
        padding: 12px 0 0 0;
        gap: 8px;
    }
    
    .modal-footer .btn {
        padding: 10px 16px;
        min-width: 100px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .cropper-modal {
        max-width: 98%;
        max-height: 95vh;
    }
    
    .cropper-container {
        max-height: 200px;
    }
    
    .cropper-container img {
        max-height: 200px;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-footer .btn {
        width: 100%;
        min-width: auto;
    }
}

/* Dark theme for cropper */
.dark-theme .cropper-modal {
    background: #1e293b;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.dark-theme .cropper-container {
    border-color: #4b5563;
    background: #0f172a;
}

.dark-theme .cropper-instructions {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: #4b5563;
}

.dark-theme .cropper-instructions p {
    color: #cbd5e1;
}

.dark-theme .modal-footer {
    border-top-color: #4b5563;
}

.dark-theme .modal-footer .btn-secondary {
    background: #1e293b;
    border-color: #4b5563;
    color: #cbd5e1;
}

.dark-theme .modal-footer .btn-secondary:hover {
    background: #0f172a;
    border-color: #64748b;
    color: #f1f5f9;
}

/* Password eye toggle sizing and input alignment */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.input-wrapper .form-input {
    width: 100%;
    height: 40px;
    padding-right: 36px; /* room for eye icon */
}
.input-wrapper .icon-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
}
.input-wrapper .icon-btn i {
    font-size: 13px; /* smaller eye */
}
.input-wrapper .icon-btn:hover { color: #374151; }

/* Match focus styling with other inputs (light theme) */
.input-wrapper .form-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* User Profile sizing adjustments */
.profile-modal{ max-width: 920px; width: 95%; }
.profile-modal .profile-info .form-row{ display:grid; grid-template-columns: 1fr 1fr; gap:16px; }
@media (max-width: 768px){ .profile-modal .profile-info .form-row{ grid-template-columns: 1fr; }}

/* Medical Theme Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 4px 0 20px rgba(102, 126, 234, 0.1);
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    padding: 16px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: white;
}

.sidebar-header .logo i {
    font-size: 20px;
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Custom Heartbeat Logo for Sidebar */
.sidebar .heartbeat-logo {
    position: relative;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar .heart {
    position: relative;
    width: 16px;
    height: 14px;
    background: white;
    border-radius: 8px 8px 0 0;
    transform: rotate(-45deg);
    animation: heartbeat 1.5s ease-in-out infinite;
}

.sidebar .heart:before,
.sidebar .heart:after {
    content: '';
    position: absolute;
    width: 16px;
    height: 14px;
    background: white;
    border-radius: 8px 8px 0 0;
}

.sidebar .heart:before {
    top: -7px;
    left: 0;
    transform: rotate(90deg);
}

.sidebar .heart:after {
    top: 0;
    left: 7px;
    transform: rotate(90deg);
}

.sidebar .ecg-line {
    position: absolute;
    top: 50%;
    left: -6px;
    right: -6px;
    height: 2px;
    background: white;
    transform: translateY(-50%);
    z-index: 2;
}

.sidebar .ecg-line:before {
    content: '';
    position: absolute;
    top: -2px;
    left: 2px;
    width: 2px;
    height: 6px;
    background: white;
}

.sidebar .ecg-line:after {
    content: '';
    position: absolute;
    top: -4px;
    left: 5px;
    width: 2px;
    height: 10px;
    background: white;
}

@keyframes heartbeat {
    0% { transform: rotate(-45deg) scale(1); }
    25% { transform: rotate(-45deg) scale(1.1); }
    50% { transform: rotate(-45deg) scale(1); }
    75% { transform: rotate(-45deg) scale(1.05); }
    100% { transform: rotate(-45deg) scale(1); }
}

.sidebar-nav {
    padding: 12px 0;
}

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

.nav-section h3 {
    color: rgba(255, 255, 255, 0.6);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 2px 16px;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 0 20px 20px 0;
    margin-right: 8px;
}

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

.nav-item.active .nav-link {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-link i {
    font-size: 14px;
    width: 16px;
    text-align: center;
}

/* Dark theme sidebar */
.dark-theme .sidebar {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-right-color: #334155;
}

.dark-theme .sidebar-header {
    background: rgba(0, 0, 0, 0.1);
    border-bottom-color: #334155;
}

.dark-theme .nav-section h3 {
    color: #94a3b8;
}

.dark-theme .nav-link {
    color: #cbd5e1;
}

.dark-theme .nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #f8fafc;
}

.dark-theme .nav-item.active .nav-link {
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 24px 0 32px 0;
    padding: 0 16px;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    padding: 8px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: #f3f4f6;
    color: #374151;
}

.pagination-btn.active {
    background: #667eea;
    color: #ffffff;
    font-weight: 600;
}

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

.pagination-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: #9ca3af;
    font-size: 14px;
}

/* Dark theme pagination */
.dark-theme .pagination {
    background: #1f2937;
    border-color: #374151;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.dark-theme .pagination-btn {
    color: #d1d5db;
}

.dark-theme .pagination-btn:hover:not(:disabled) {
    background: #374151;
    color: #f9fafb;
}

.dark-theme .pagination-btn.active {
    background: #667eea;
    color: #ffffff;
}

.dark-theme .pagination-ellipsis {
    color: #6b7280;
}

/* Modal Actions Styling */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    margin-top: 16px;
    flex-shrink: 0;
    background: #ffffff;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.modal-actions .btn {
    margin: 0;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.modal-actions .btn:hover {
    /* transform: translateY(-1px); - Removed to prevent button movement on hover */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Dark theme modal actions */
.dark-theme .modal-actions {
    border-top-color: #334155;
    background: #1e293b;
}
.dark-theme .modal-content {
    background: #1e293b;
}

.dark-theme .modal-actions .btn:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Search and Filter Section Styling */
.search-filter-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.search-container {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 300px;
    display: flex;
    align-items: center;
}

/* Removed duplicate search-input styles - using main definition */

.search-icon {
    position: absolute;
    left: 12px;
    color: #9ca3af;
    z-index: 1;
}

.search-clear {
    position: absolute;
    right: 8px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    z-index: 2;
}

.filter-container {
    display: flex;
    gap: 12px;
    align-items: center;
}

.filter-select {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Dark theme search and filter */
.dark-theme .search-filter-section {
    background: #1f2937;
    border-color: #374151;
}

/* Removed duplicate dark theme search-input styles - using main definition */

.dark-theme .search-icon {
    color: #9ca3af;
}

.dark-theme .filter-select {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

.dark-theme .filter-select:focus {
    border-color: #667eea;
    background: #4b5563;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .search-container {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        min-width: auto;
    }

    .filter-container {
        justify-content: space-between;
    }
}

/* ========================================
   PROFESSIONAL MEDICAL DASHBOARD STYLES
   ======================================== */

/* Health Monitoring Dashboard */
.medical-dashboard {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
}

.medical-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.medical-stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.medical-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.medical-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
}

.medical-stat-card.critical::before {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.medical-stat-card.warning::before {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.medical-stat-card.success::before {
    background: linear-gradient(90deg, #10b981, #059669);
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    color: white;
}

.stat-icon.primary { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.stat-icon.critical { background: linear-gradient(135deg, #ef4444, #dc2626); }
.stat-icon.warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-icon.success { background: linear-gradient(135deg, #10b981, #059669); }

.stat-trend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.stat-trend.positive { color: #10b981; }
.stat-trend.negative { color: #ef4444; }
.stat-trend.neutral { color: #6b7280; }

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.medical-table-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.table-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.table-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.table-subtitle {
    color: #6b7280;
    font-size: 0.875rem;
}

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

.medical-table th {
    background: #f8fafc;
    color: #374151;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
}

.medical-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.medical-table tbody tr:hover {
    background: #f8fafc;
}

.patient-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.patient-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.patient-details h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 0.125rem 0;
}

.patient-details p {
    font-size: 0.625rem;
    color: #6b7280;
    margin: 0;
}

.vital-sign {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.vital-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1f2937;
}

.vital-unit {
    font-size: 0.625rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.normal {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.elevated {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.critical {
    background: #fee2e2;
    color: #991b1b;
}

/* Duplicate action-buttons definition removed - using main definition above */

.btn-medical {
    padding: 0;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-medical.primary {
    background-color: #3b82f6;
    color: white;
}

.btn-medical.primary:hover {
    background-color: #2563eb;
    /* transform: translateY(-1px); - Removed to prevent button movement on hover */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-medical.secondary {
    background-color: #6b7280;
    color: white;
}

.btn-medical.secondary:hover {
    background-color: #4b5563;
    /* transform: translateY(-1px); - Removed to prevent button movement on hover */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.search-filter-bar {
    background: white;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Removed duplicate search-input styles - using main definition */

.filter-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    background: white;
    cursor: pointer;
}

/* Medication Tracker Dashboard */
.medication-dashboard {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    min-height: 100vh;
}

.medication-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.medication-stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0f2fe;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.medication-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.medication-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0ea5e9, #0284c7);
}

.medication-stat-card.warning::before {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.medication-stat-card.success::before {
    background: linear-gradient(90deg, #10b981, #059669);
}

.medication-stat-card.danger::before {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.medication-table-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0f2fe;
    overflow: hidden;
}

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

.medication-table th {
    background: #f0f9ff;
    color: #374151;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 2px solid #e0f2fe;
}

.medication-table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.medication-table tbody tr:hover {
    background: #f0f9ff;
}

.medication-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.medication-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
}

.medication-type {
    font-size: 0.625rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dosage-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dosage-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
}

.frequency-info {
    font-size: 0.75rem;
    color: #6b7280;
}

.next-dose {
    font-size: 0.75rem;
    color: #1f2937;
    font-weight: 500;
}

.status-badge.pending {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.taken {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.missed {
    background: #fee2e2;
    color: #991b1b;
}

.adherence-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.adherence-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.adherence-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1f2937;
}

.btn-medical.success {
    background-color: #10b981;
    color: white;
}

.btn-medical.success:hover {
    background-color: #059669;
    /* transform: translateY(-1px); - Removed to prevent button movement on hover */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Analytics Dashboard */
.analytics-dashboard {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    min-height: 100vh;
}

.analytics-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.analytics-summary-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #dcfce7;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.analytics-summary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.analytics-summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #059669, #047857);
}

.analytics-summary-card.warning::before {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.analytics-summary-card.danger::before {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.analytics-summary-card.info::before {
    background: linear-gradient(90deg, #0ea5e9, #0284c7);
}

.summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.summary-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    color: white;
}

.summary-icon.primary { background: linear-gradient(135deg, #059669, #047857); }
.summary-icon.warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
.summary-icon.danger { background: linear-gradient(135deg, #ef4444, #dc2626); }
.summary-icon.info { background: linear-gradient(135deg, #0ea5e9, #0284c7); }

.summary-trend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.summary-trend.positive { color: #059669; }
.summary-trend.negative { color: #ef4444; }
.summary-trend.neutral { color: #6b7280; }

.summary-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.summary-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-container {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #dcfce7;
}

.chart-header {
    margin-bottom: 1.5rem;
}

.chart-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.chart-subtitle {
    color: #6b7280;
    font-size: 0.875rem;
}

.chart-canvas {
    height: 300px;
    width: 100%;
}

.export-controls {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #dcfce7;
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.date-range-selector {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.date-range-selector select {
    padding: 0.75rem 1rem;
    border: 2px solid #dcfce7;
    border-radius: 8px;
    font-size: 0.875rem;
    background: white;
    cursor: pointer;
}

.export-buttons {
    display: flex;
    gap: 0.75rem;
}

.btn-export {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-export.primary {
    background: #059669;
    color: white;
}

.btn-export.primary:hover {
    background: #047857;
    /* transform: translateY(-1px); - Removed to prevent button movement on hover */
}

.btn-export.secondary {
    background: #6b7280;
    color: white;
}

.btn-export.secondary:hover {
    background: #4b5563;
    /* transform: translateY(-1px); - Removed to prevent button movement on hover */
}

.performance-metrics {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #dcfce7;
    margin-bottom: 2rem;
}

.metrics-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.metric-item {
    text-align: center;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.metric-value {
    font-size: 2rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.metric-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

/* Dark Theme Support for Medical Dashboards */
.dark-theme .medical-dashboard {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.dark-theme .medication-dashboard {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.dark-theme .analytics-dashboard {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.dark-theme .medical-stat-card,
.dark-theme .medication-stat-card,
.dark-theme .analytics-summary-card,
.dark-theme .medical-table-container,
.dark-theme .medication-table-container,
.dark-theme .search-filter-bar,
.dark-theme .chart-container,
.dark-theme .export-controls,
.dark-theme .performance-metrics {
    background: #1e293b;
    border-color: #334155;
}

.dark-theme .stat-value,
.dark-theme .summary-value,
.dark-theme .patient-details h4,
.dark-theme .vital-value,
.dark-theme .medication-name,
.dark-theme .dosage-value,
.dark-theme .next-dose,
.dark-theme .adherence-text,
.dark-theme .chart-title,
.dark-theme .metrics-title,
.dark-theme .metric-value {
    color: #f1f5f9;
}

.dark-theme .stat-label,
.dark-theme .summary-label,
.dark-theme .patient-details p,
.dark-theme .vital-unit,
.dark-theme .medication-type,
.dark-theme .frequency-info,
.dark-theme .chart-subtitle,
.dark-theme .metric-label {
    color: #94a3b8;
}

.dark-theme .medical-table th,
.dark-theme .medication-table th {
    background: #334155;
    color: #cbd5e1;
}

.dark-theme .medical-table td,
.dark-theme .medication-table td {
    color: #e2e8f0;
    border-bottom-color: #334155;
}

.dark-theme .medical-table tbody tr:hover,
.dark-theme .medication-table tbody tr:hover {
    background: #334155;
}

.dark-theme .metric-item {
    background: #334155;
    border-color: #475569;
}

/* User Accounts Page Styles */
.form-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background-color: white;
}

/* Prevent layout shift: lock widths of controls in the header */
#roleFilterSelect { 
    width: 180px; 
    min-width: 180px; 
    flex: 0 0 180px; 
}

#userSearch { 
    width: 240px; 
    min-width: 240px; 
    flex: 0 0 240px; 
}

#refreshUsersBtn { 
    min-width: 150px; 
}

.chart-container {
    height: 300px !important;
    min-height: 300px !important;
    max-height: 300px !important;
    position: relative;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-danger {
    background-color: #dc2626;
    color: white;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

/* Compact header buttons */
.btn-compact { 
    padding: 8px 12px; 
    font-size: 14px; 
    line-height: 1.2; 
}

/* User table column sizing and text overflow */
#usersTable { 
    table-layout: fixed; 
    width: 100%; 
}

#usersTable th:nth-child(1),
#usersTable td:nth-child(1) { 
    width: 8%; 
}

#usersTable th:nth-child(2),
#usersTable td:nth-child(2) { 
    width: 10%; 
}

#usersTable th:nth-child(3),
#usersTable td:nth-child(3) { 
    width: 20%; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    white-space: nowrap; 
}

#usersTable th:nth-child(4),
#usersTable td:nth-child(4) { 
    width: 5%; 
}

#usersTable th:nth-child(5),
#usersTable td:nth-child(5) { 
    width: 8%; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    white-space: nowrap; 
}

#usersTable th:nth-child(6),
#usersTable td:nth-child(6) { 
    width: 8%; 
}

#usersTable th:nth-child(7),
#usersTable td:nth-child(7) { 
    width: 10%; 
}

/* Info cards for Firebase status */
.info-card {
    display: flex;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.info-icon {
    font-size: 2.5rem;
    margin-right: 16px;
    opacity: 0.8;
}

.info-content h4 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e293b;
}

.info-content p {
    margin: 4px 0 0 0;
    color: #64748b;
    font-size: 0.9rem;
}

.dark-theme .info-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
}

.dark-theme .info-content h4 {
    color: #f1f5f9;
}

.dark-theme .info-content p {
    color: #94a3b8;
}

.gap-2 { 
    gap: 0.5rem; 
}

.gap-3 { 
    gap: 1rem; 
}

.d-flex { 
    display: flex; 
}

.align-items-center { 
    align-items: center; 
}

/* GPS Tracking Page Styles */
.form-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background-color: white;
}

/* System Settings Page Styles */
#system-settings .tabs { 
    display:flex; 
    gap:8px; 
    padding:12px 16px; 
    border-bottom:1px solid #e5e7eb; 
    flex-wrap:wrap; 
}

#system-settings .tab-btn { 
    padding:8px 12px; 
    border:none; 
    border-radius:999px; 
    background:#e9efff; 
    color:#4f46e5; 
    cursor:pointer; 
    font-weight:600; 
    transition: all 0.2s ease;
}

#system-settings .tab-btn.active { 
    background:#667eea; 
    color:#fff; 
}

#system-settings .tab-panel { 
    display:none; 
    padding:16px; 
}

#system-settings .tab-panel.active { 
    display:block; 
}

#system-settings .form-grid { 
    display:grid; 
    grid-template-columns: repeat(2, minmax(0, 1fr)); 
    gap:12px; 
}

#system-settings .form-grid label { 
    display:flex; 
    flex-direction:column; 
    gap:6px; 
    font-weight:600; 
    color:#1f2937; 
}

#system-settings .form-input, 
#system-settings .form-select { 
    padding:10px 12px; 
    border:2px solid #e5e7eb; 
    border-radius:10px; 
    font-size:14px; 
    background:#ffffff; 
    transition: all 0.2s ease;
}

#system-settings .form-input:focus, 
#system-settings .form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Medical accents */
#system-settings .content-card { 
    border:1px solid rgba(99,102,241,0.15); 
    box-shadow: 0 12px 30px rgba(99,102,241,0.08); 
}

#system-settings .card-header { 
    background: linear-gradient(135deg,#f0f7ff 0%, #e8f5ff 100%); 
    border-bottom:1px solid #e5e7eb; 
}

#system-settings .card-header h2 { 
    color:#1e40af; 
}

#system-settings .form-grid label::after { 
    content:''; 
    height:2px; 
    background:linear-gradient(90deg,#60a5fa,#34d399); 
    width:0; 
    transition:width .2s; 
}

#system-settings .form-grid label:focus-within::after { 
    width:100%; 
}

/* Dark theme overrides */
.dark-theme #system-settings .tabs { 
    border-bottom-color: #334155; 
}

.dark-theme #system-settings .tab-btn { 
    background: #334155; 
    color: #cbd5e1; 
}

.dark-theme #system-settings .tab-btn:hover { 
    background: #475569; 
}

.dark-theme #system-settings .tab-btn.active { 
    background: #3b82f6; 
    color: #fff; 
}

.dark-theme #system-settings .form-input, 
.dark-theme #system-settings .form-select { 
    background: #1f2937; 
    border-color: #374151; 
    color: #f9fafb; 
}

.dark-theme #system-settings .form-input:focus, 
.dark-theme #system-settings .form-select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.dark-theme #system-settings .form-grid label { 
    color: #e5e7eb; 
}

.dark-theme #system-settings .content-card { 
    border-color: rgba(99,102,241,0.3); 
    box-shadow: 0 12px 30px rgba(0,0,0,0.3); 
}

.dark-theme #system-settings .card-header { 
    background: linear-gradient(135deg,#1e293b 0%, #0f172a 100%); 
    border-bottom-color: #374151; 
}

.dark-theme #system-settings .card-header h2 { 
    color:#60a5fa; 
}

/* Global responsive refinements */
@media (max-width: 1024px) {
    .medical-stats-grid,
    .analytics-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
}

@media (max-width: 768px) {
    /* Cards/grid */
    .medical-stats-grid,
    .analytics-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .content-card .card-header .card-actions,
    .card-header .d-flex {
        flex-wrap: wrap;
        row-gap: 8px;
    }

    /* Header controls */
    .card-actions .d-flex {
        flex-wrap: wrap;
    }

    /* Tables */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .data-table {
        min-width: 640px;
    }

    /* Action buttons stack on small screens */
    .action-buttons {
        flex-wrap: wrap;
        gap: 6px;
    }
    .action-buttons .btn-action {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    /* Forms */
    .form-row { 
        display: grid; 
        grid-template-columns: 1fr; 
        gap: 12px; 
    }
    .form-input, .form-select, .form-textarea {
        font-size: 16px;
    }

    /* Modals */
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 16px;
    }
}

@media (max-width: 480px) {
    .card-header h2 { font-size: 18px; }
    .btn { min-height: 44px; }
}

/* Phase 5-6: Thread Actions and Performance Optimizations */
.thread-actions-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.thread-actions-group button {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.thread-actions-group button.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.thread-actions-group button:hover {
    background: #dbeafe;
    border-color: #bfdbfe;
}

.thread-actions-group button.active:hover {
    background: #2563eb;
    border-color: #1d4ed8;
}

.dark-theme .thread-actions-group button {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

.dark-theme .thread-actions-group button:hover {
    background: #475569;
    border-color: #64748b;
}

.dark-theme .thread-actions-group button.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.dark-theme .thread-actions-group button.active:hover {
    background: #2563eb;
    border-color: #1d4ed8;
}

/* Modal header flex layout for thread actions */
.modal-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header h3 {
    margin-right: auto;
}

/* Performance: Smooth transitions */
.message-list {
    transition: opacity 0.2s ease;
}

/* Thread search highlight */
.thread-highlight {
    background: #fde68a;
    padding: 0 2px;
    border-radius: 3px;
    font-weight: 500;
}

.dark-theme .thread-highlight {
    background: #fbbf24;
    color: #1e293b;
}