/* =============================================
   CarePro - Main Stylesheet
   Theme: Sky Blue #0EA5E9 + Green #10B981
   Dark: #0F172A
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---- CSS Variables ---- */
:root {
    --primary:       #0EA5E9;
    --primary-dark:  #0284C7;
    --primary-light: #BAE6FD;
    --secondary:     #10B981;
    --secondary-dark:#059669;
    --dark:          #0F172A;
    --dark-card:     #1E293B;
    --dark-border:   #334155;
    --light:         #F0F9FF;
    --text-muted:    #94A3B8;
    --danger:        #EF4444;
    --warning:       #F59E0B;
    --info:          #3B82F6;
    --white:         #FFFFFF;
    --sidebar-w:     260px;
    --sidebar-w-sm:  70px;
    --header-h:      64px;
    --radius:        12px;
    --radius-sm:     8px;
    --shadow:        0 4px 24px rgba(14,165,233,0.10);
    --shadow-md:     0 8px 32px rgba(14,165,233,0.15);
    --transition:    all 0.25s cubic-bezier(.4,0,.2,1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #F1F5F9;
    color: #1E293B;
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #F1F5F9; }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ================================================
   LOGIN PAGE
   ================================================ */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--dark) 0%, #0C2340 50%, #064E3B 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.login-page::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(14,165,233,0.15) 0%, transparent 70%);
    top: -200px; right: -200px;
    border-radius: 50%;
}
.login-page::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(16,185,129,0.12) 0%, transparent 70%);
    bottom: -100px; left: -100px;
    border-radius: 50%;
}
.login-card {
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    box-shadow: 0 32px 64px rgba(0,0,0,0.5);
}
.login-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}
.login-logo-icon {
    width: 52px; height: 52px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    box-shadow: 0 8px 20px rgba(14,165,233,0.4);
}
.login-logo-text h1 {
    color: white;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.login-logo-text p {
    color: var(--text-muted);
    font-size: 12px;
}
.login-card h2 {
    color: white;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}
.login-card p.sub {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 28px;
}
.login-card .form-label {
    color: #CBD5E1;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
}
.login-card .form-control {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-sm);
    color: white;
    padding: 12px 16px;
    font-size: 14px;
    transition: var(--transition);
}
.login-card .form-control:focus {
    background: rgba(255,255,255,0.12);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14,165,233,0.2);
    color: white;
}
.login-card .form-control::placeholder { color: rgba(255,255,255,0.3); }
.login-card .input-group-text {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--text-muted);
    cursor: pointer;
}
.btn-login {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.btn-login::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: var(--transition);
}
.btn-login:hover::before { left: 100%; }
.btn-login:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.lang-switcher-login { margin-top: 24px; text-align: center; }
.lang-switcher-login a {
    color: var(--text-muted);
    font-size: 12px;
    text-decoration: none;
    margin: 0 6px;
    transition: var(--transition);
}
.lang-switcher-login a:hover { color: var(--primary); }
.lang-switcher-login a.active { color: var(--primary); font-weight: 600; }

/* ================================================
   APP LAYOUT
   ================================================ */
.app-wrapper { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-w);
    background: var(--dark);
    min-height: 100vh;
    position: fixed;
    left: 0; top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}
.sidebar-brand {
    padding: 20px 20px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--dark-border);
    text-decoration: none;
}
.sidebar-brand-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(14,165,233,0.4);
}
.sidebar-brand-text { overflow: hidden; }
.sidebar-brand-text h2 {
    color: white;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.3px;
    line-height: 1.1;
    white-space: nowrap;
}
.sidebar-brand-text span {
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}
.sidebar-nav { padding: 16px 12px; flex: 1; }
.nav-section-label {
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    padding: 12px 8px 6px;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: #94A3B8;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2px;
    position: relative;
    white-space: nowrap;
}
.sidebar-link i { font-size: 17px; flex-shrink: 0; }
.sidebar-link:hover {
    background: rgba(14,165,233,0.1);
    color: var(--primary);
}
.sidebar-link.active {
    background: linear-gradient(135deg, rgba(14,165,233,0.2), rgba(16,185,129,0.1));
    color: var(--primary);
    border-left: 3px solid var(--primary);
}
.sidebar-link .badge { margin-left: auto; font-size: 10px; }
.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--dark-border);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: var(--transition);
}
.sidebar-user:hover { background: var(--dark-card); }
.sidebar-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    flex-shrink: 0;
}
.sidebar-avatar-placeholder {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 14px; font-weight: 700;
    flex-shrink: 0;
}
.sidebar-user-info { overflow: hidden; }
.sidebar-user-name {
    color: white;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-role {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: capitalize;
}

/* ---- Topbar ---- */
.topbar {
    height: var(--header-h);
    background: white;
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}
.topbar-toggle {
    background: none;
    border: none;
    font-size: 20px;
    color: #64748B;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.topbar-toggle:hover { background: var(--light); color: var(--primary); }
.topbar-title { font-size: 16px; font-weight: 600; color: var(--dark); flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-btn {
    background: none; border: none;
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: #64748B;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    font-size: 17px;
}
.topbar-btn:hover { background: var(--light); color: var(--primary); }
.topbar-btn .notif-dot {
    position: absolute;
    top: 6px; right: 6px;
    width: 8px; height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid white;
}
.lang-flags { display: flex; gap: 4px; }
.lang-flag {
    width: 28px; height: 28px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}
.lang-flag:hover, .lang-flag.active { background: var(--light); }
.topbar-divider { width: 1px; height: 24px; background: #E2E8F0; }
.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    text-decoration: none;
}
.topbar-user:hover { background: var(--light); }
.topbar-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}
.topbar-avatar-placeholder {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 13px; font-weight: 700;
}
.topbar-username { font-size: 13px; font-weight: 600; color: var(--dark); }
.topbar-role { font-size: 11px; color: var(--text-muted); }

/* ---- Main Content ---- */
.main-wrapper {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: var(--transition);
}
.main-content { padding: 24px; flex: 1; }

/* ---- Page Header ---- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}
.page-title-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-size: 18px;
}
.page-breadcrumb { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---- Cards ---- */
.card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid #E2E8F0;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
    overflow: hidden;
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #E2E8F0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.card-title i { color: var(--primary); }
.card-body { padding: 20px; }

/* ---- Stats Cards ---- */
.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 22px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 4px; height: 100%;
    border-radius: 0 var(--radius) var(--radius) 0;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card.primary::after { background: var(--primary); }
.stat-card.secondary::after { background: var(--secondary); }
.stat-card.warning::after { background: var(--warning); }
.stat-card.danger::after { background: var(--danger); }
.stat-icon {
    width: 56px; height: 56px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}
.stat-icon.primary { background: rgba(14,165,233,0.12); color: var(--primary); }
.stat-icon.secondary { background: rgba(16,185,129,0.12); color: var(--secondary); }
.stat-icon.warning { background: rgba(245,158,11,0.12); color: var(--warning); }
.stat-icon.danger { background: rgba(239,68,68,0.12); color: var(--danger); }
.stat-info { flex: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--dark); line-height: 1.2; }
.stat-change { font-size: 12px; margin-top: 2px; }
.stat-change.up { color: var(--secondary); }
.stat-change.down { color: var(--danger); }

/* ---- Buttons ---- */
.btn { border-radius: var(--radius-sm); font-weight: 500; font-size: 13px; transition: var(--transition); }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-secondary-cp { background: var(--secondary); border-color: var(--secondary); color: white; }
.btn-secondary-cp:hover { background: var(--secondary-dark); border-color: var(--secondary-dark); color: white; }
.btn-icon { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.btn-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: white;
}
.btn-gradient:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary-dark));
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* ---- Tables ---- */
.table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { font-size: 13px; }
.table th {
    background: #F8FAFC;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #E2E8F0;
    white-space: nowrap;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.table td { vertical-align: middle; border-color: #F1F5F9; }
.table tbody tr:hover { background: #F8FAFC; }

/* ---- Badges ---- */
.badge { font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 6px; }

/* ---- Forms ---- */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border-color: #E2E8F0;
    font-size: 13.5px;
    padding: 9px 14px;
    transition: var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14,165,233,0.15);
}
.form-label { font-weight: 500; color: #475569; font-size: 13px; margin-bottom: 6px; }
.form-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.form-section-title i { color: var(--primary); }

/* ---- Patient/Caregiver Avatar ---- */
.entity-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
}
.entity-avatar-placeholder {
    width: 42px; height: 42px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 15px; color: white;
}

/* ---- Status Indicators ---- */
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}
.status-dot.active { background: var(--secondary); box-shadow: 0 0 0 3px rgba(16,185,129,0.2); }
.status-dot.inactive { background: #94A3B8; }
.status-dot.on_leave { background: var(--warning); }

/* ---- Care Level Pills ---- */
.care-level-1 { background: rgba(16,185,129,0.15); color: #059669; }
.care-level-2 { background: rgba(14,165,233,0.15); color: #0284C7; }
.care-level-3 { background: rgba(245,158,11,0.15); color: #D97706; }
.care-level-4 { background: rgba(239,68,68,0.15); color: #DC2626; }
.care-level-5 { background: rgba(100,116,139,0.15); color: #475569; }

/* ---- DataTable Overrides ---- */
.dataTables_wrapper .dataTables_filter input {
    border-radius: var(--radius-sm);
    border: 1px solid #E2E8F0;
    padding: 6px 12px;
    font-size: 13px;
}
.dataTables_wrapper .dataTables_length select {
    border-radius: var(--radius-sm);
    border: 1px solid #E2E8F0;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: var(--radius-sm) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

/* ---- Visit Status Colors ---- */
.visit-scheduled  { border-left: 3px solid var(--primary); }
.visit-completed  { border-left: 3px solid var(--secondary); }
.visit-in_progress{ border-left: 3px solid var(--warning); }
.visit-cancelled  { border-left: 3px solid var(--danger); }
.visit-missed     { border-left: 3px solid #64748B; }

/* ---- Time Tracker ---- */
.checkin-card {
    background: linear-gradient(135deg, var(--dark), #1E3A5F);
    border-radius: var(--radius);
    padding: 28px;
    color: white;
    text-align: center;
}
.checkin-time {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -2px;
    color: white;
    font-variant-numeric: tabular-nums;
}
.checkin-date { color: #94A3B8; font-size: 14px; }
.btn-checkin {
    background: linear-gradient(135deg, var(--secondary), #34D399);
    color: white; border: none;
    padding: 14px 36px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 8px 24px rgba(16,185,129,0.4);
}
.btn-checkin:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(16,185,129,0.5); }
.btn-checkout {
    background: linear-gradient(135deg, var(--danger), #F87171);
    color: white; border: none;
    padding: 14px 36px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 8px 24px rgba(239,68,68,0.4);
}
.btn-checkout:hover { transform: translateY(-2px); }

/* ---- Invoice ---- */
.invoice-header {
    background: linear-gradient(135deg, var(--dark), #1E3A5F);
    color: white;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 28px;
}
.invoice-logo { font-size: 28px; font-weight: 800; }
.invoice-status-paid { color: var(--secondary); border: 2px solid var(--secondary); }
.invoice-status-overdue { color: var(--danger); border: 2px solid var(--danger); }

/* ---- Photo Gallery ---- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.photo-item {
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    aspect-ratio: 1;
    cursor: pointer;
}
.photo-item img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.photo-item:hover img { transform: scale(1.05); }
.photo-item-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    padding: 8px;
    color: white;
    font-size: 11px;
    font-weight: 500;
}
.photo-type-badge {
    position: absolute;
    top: 8px; left: 8px;
}

/* ---- Progress Bars ---- */
.progress { border-radius: 50px; height: 8px; background: #E2E8F0; }
.progress-bar {
    border-radius: 50px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

/* ---- Mini Charts ---- */
.sparkline-container { height: 50px; }

/* ---- Alert Overrides ---- */
.alert { border-radius: var(--radius-sm); border: none; font-size: 13.5px; }
.alert-success { background: rgba(16,185,129,0.1); color: #059669; }
.alert-danger  { background: rgba(239,68,68,0.1);  color: #DC2626; }
.alert-warning { background: rgba(245,158,11,0.1); color: #D97706; }
.alert-info    { background: rgba(14,165,233,0.1);  color: #0284C7; }

/* ---- Footer ---- */
.app-footer {
    background: white;
    border-top: 1px solid #E2E8F0;
    padding: 14px 24px;
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1050;
    }
    .sidebar.show { transform: translateX(0); }
    .main-wrapper { margin-left: 0 !important; }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
    }
    .sidebar-overlay.show { display: block; }
}
@media (max-width: 767.98px) {
    .main-content { padding: 16px; }
    .stat-card { padding: 16px; }
    .stat-value { font-size: 22px; }
    .topbar { padding: 0 16px; }
    .login-card { padding: 32px 24px; margin: 16px; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .photo-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}
@media (max-width: 575.98px) {
    .stat-value { font-size: 20px; }
    .stat-icon { width: 44px; height: 44px; font-size: 18px; }
    .topbar-username, .topbar-role { display: none; }
}

/* ---- Sidebar collapsed (desktop) ---- */
.sidebar-collapsed .sidebar { width: var(--sidebar-w-sm); }
.sidebar-collapsed .sidebar .sidebar-brand-text,
.sidebar-collapsed .sidebar .nav-section-label,
.sidebar-collapsed .sidebar .sidebar-link span,
.sidebar-collapsed .sidebar .sidebar-user-info,
.sidebar-collapsed .sidebar .sidebar-link .badge { display: none; }
.sidebar-collapsed .sidebar .sidebar-link { justify-content: center; padding: 10px; }
.sidebar-collapsed .main-wrapper { margin-left: var(--sidebar-w-sm); }

/* ---- Animations ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.4s ease both; }
.fade-in-up:nth-child(1) { animation-delay: 0.05s; }
.fade-in-up:nth-child(2) { animation-delay: 0.10s; }
.fade-in-up:nth-child(3) { animation-delay: 0.15s; }
.fade-in-up:nth-child(4) { animation-delay: 0.20s; }

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
    50% { box-shadow: 0 0 0 10px rgba(16,185,129,0); }
}
.pulse { animation: pulse-glow 2s infinite; }

/* ---- Tooltip override ---- */
.tooltip-inner { border-radius: 6px; font-size: 12px; }

/* ---- Print ---- */
@media print {
    .sidebar, .topbar, .app-footer, .no-print { display: none !important; }
    .main-wrapper { margin: 0 !important; }
    body { background: white; }
    .card { border: 1px solid #ccc; box-shadow: none; }
}

/* ================================================
   MISSING / EXTRA CLASSES (v1.1)
   ================================================ */

/* Page subtitle (used in new module pages) */
.page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Care Docs card hover */
.doc-card {
    border-radius: var(--radius) !important;
    transition: var(--transition);
    border: 1px solid #E2E8F0 !important;
}
.doc-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md) !important;
}

/* Upload area drag-drop */
.upload-area {
    border: 2px dashed var(--primary) !important;
    border-radius: var(--radius) !important;
    background: #f0f9ff;
    cursor: pointer;
    transition: var(--transition);
}
.upload-area:hover {
    background: #e0f2fe;
    border-color: var(--primary-dark) !important;
}

/* Stat card — used in reports/overview without .primary/.secondary class */
.stat-card .stat-icon { background: rgba(14,165,233,0.12); color: var(--primary); }

/* List group rounded items */
.list-group-item { border-radius: var(--radius-sm) !important; }

/* btn-delete (SweetAlert confirm) — alias of btn-delete-confirm */
/* Handled in JS, no extra CSS needed */

/* Mood selector buttons */
.btn-check:checked + .btn-outline-secondary {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Care report print vitals */
.vitals-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
@media (max-width: 575px) {
    .vitals-grid { grid-template-columns: repeat(2, 1fr); }
}

/* User management avatar */
.avatar-sm {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 13px;
    flex-shrink: 0;
}

/* Lightbox overlay */
#lightbox { cursor: zoom-out; }

/* Border dashed utility */
.border-dashed { border-style: dashed !important; }
.border-2 { border-width: 2px !important; }

/* Reports progress bars inside tables */
.table .progress { display: inline-flex; vertical-align: middle; }

/* Page subtitle on mobile */
@media (max-width: 575.98px) {
    .page-subtitle { display: none; }
}

/* Card footer bg-transparent fix */
.card-footer.bg-transparent { background: transparent !important; }

/* Language picker in settings */
.btn-check:checked + label.btn-outline-secondary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(14,165,233,0.3);
}

/* Timeline / activity list */
.timeline-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #F1F5F9;
}
.timeline-item:last-child { border-bottom: none; }
.timeline-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--primary);
    margin-top: 5px; flex-shrink: 0;
}

