:root {
    --primary: #2b7a78;
    --primary-dark: #1a5c5a;
    --primary-light: #e8f6f5;
    --primary-gradient: linear-gradient(135deg, #2b7a78 0%, #17b794 100%);
    --primary-rgb: 43, 122, 120;
    --accent: #6366f1;
    --accent-light: #eef2ff;
    --bg: #f4f7fa;
    --bg-card: #ffffff;
    --bg-sidebar: #0f1729;
    --bg-sidebar-hover: rgba(255,255,255,0.05);
    --bg-sidebar-active: rgba(43,122,120,0.15);
    --text: #0f172a;
    --text-light: #475569;
    --text-muted: #94a3b8;
    --text-sidebar: rgba(255,255,255,0.5);
    --text-sidebar-active: #ffffff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --success: #10b981;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --info: #3b82f6;
    --info-light: #eff6ff;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.06);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.12);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.03), 0 0 0 1px rgba(0,0,0,0.02);
    --shadow-card-hover: 0 8px 30px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.03);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    --sidebar-width: 260px;
    --topbar-height: 64px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

::selection { background: var(--primary); color: #fff; }

.app-layout { display: flex; min-height: 100vh; }

/* ═══════════════════════ Sidebar ═══════════════════════ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform var(--transition);
    overflow: hidden;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 200px;
    background: linear-gradient(180deg, rgba(43,122,120,0.08) 0%, transparent 100%);
    pointer-events: none;
}

.sidebar-header {
    padding: 24px 22px;
    position: relative;
    z-index: 1;
}

.sidebar-close {
    display: none;
    background: none; border: none;
    color: var(--text-sidebar); font-size: 18px;
    cursor: pointer; position: absolute; top: 22px; right: 16px;
}

.logo-area { display: flex; align-items: center; gap: 13px; }

.logo-icon {
    width: 42px; height: 42px;
    background: var(--primary-gradient);
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 18px;
    box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.4);
    position: relative;
}

.logo-icon::after {
    content: '';
    position: absolute; inset: -2px;
    border-radius: 13px;
    background: var(--primary-gradient);
    opacity: 0.15;
    z-index: -1;
}

.logo-name { display: block; color: #fff; font-weight: 700; font-size: 15px; letter-spacing: -0.3px; }
.logo-sub { display: block; color: var(--text-sidebar); font-size: 10.5px; font-weight: 500; margin-top: 2px; letter-spacing: 0.3px; text-transform: uppercase; }

.sidebar-nav {
    flex: 1; padding: 8px 10px; overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    color: var(--text-sidebar);
    font-size: 13px; font-weight: 500;
    transition: all var(--transition);
    border-radius: var(--radius-sm);
    position: relative;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: var(--bg-sidebar-hover);
    color: rgba(255,255,255,0.85);
}

.nav-item.active {
    background: var(--bg-sidebar-active);
    color: #17b794;
    font-weight: 600;
}

.nav-item i {
    width: 20px; text-align: center; font-size: 14px;
    opacity: 0.7;
    transition: opacity var(--transition);
}
.nav-item:hover i { opacity: 1; }
.nav-item.active i { opacity: 1; color: #17b794; }

.nav-divider { height: 1px; background: rgba(255,255,255,0.05); margin: 10px 14px; }

.sidebar-footer {
    padding: 16px 14px;
    border-top: 1px solid rgba(255,255,255,0.05);
    margin: 0 8px;
}

.user-info { display: flex; align-items: center; gap: 11px; margin-bottom: 8px; }

.user-avatar {
    width: 36px; height: 36px;
    background: var(--primary-gradient);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 13px;
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.3);
}

.user-name { display: block; color: rgba(255,255,255,0.9); font-size: 12.5px; font-weight: 600; }
.user-role { display: block; color: var(--text-sidebar); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.3px; }

.logout-link { padding: 8px 14px !important; font-size: 12.5px !important; margin-top: 2px; }
.logout-link:hover { color: #f87171 !important; background: rgba(239,68,68,0.1) !important; }

/* ═══════════════════════ Main Content ═══════════════════════ */
.main-content { flex: 1; margin-left: var(--sidebar-width); min-height: 100vh; }

.top-bar {
    height: var(--topbar-height);
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex; align-items: center;
    padding: 0 32px; gap: 16px;
    position: sticky; top: 0; z-index: 50;
}

.menu-toggle { display: none; background: none; border: none; font-size: 20px; color: var(--text); cursor: pointer; }

.page-title { font-size: 17px; font-weight: 700; color: var(--text); flex: 1; letter-spacing: -0.4px; }

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

.lang-switch {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 14px;
    font-size: 11.5px; font-weight: 600;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 100px;
    transition: all var(--transition);
    letter-spacing: 0.3px;
}

.lang-switch:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.lang-switch i { font-size: 12px; }

.content-area { padding: 28px 32px; max-width: 1400px; }

/* ═══════════════════════ Cards ═══════════════════════ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: box-shadow var(--transition);
}

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

.card-header h2, .card-header h3 { font-size: 14px; font-weight: 650; letter-spacing: -0.2px; color: var(--text); }

.card-body { padding: 24px; }
.card-footer { padding: 18px 24px; border-top: 1px solid var(--border-light); }

/* ═══════════════════════ Stat Cards ═══════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px; margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    display: flex; align-items: center; gap: 18px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    opacity: 0;
    transition: opacity var(--transition);
}

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

.stat-card:hover::before { opacity: 1; }

.stat-icon {
    width: 50px; height: 50px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}

.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }
.stat-icon.purple { background: #f5f3ff; color: #7c3aed; }

.stat-card:nth-child(1)::before { background: var(--primary-gradient); }
.stat-card:nth-child(2)::before { background: linear-gradient(135deg, #10b981, #059669); }
.stat-card:nth-child(3)::before { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-card:nth-child(4)::before { background: linear-gradient(135deg, #7c3aed, #6366f1); }

.stat-value { font-size: 28px; font-weight: 800; color: var(--text); letter-spacing: -1px; line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-top: 4px; }

/* ═══════════════════════ Buttons ═══════════════════════ */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 18px;
    font-size: 13px; font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1.5px solid transparent;
    cursor: pointer; transition: all var(--transition);
    font-family: inherit; white-space: nowrap;
    letter-spacing: -0.1px;
    position: relative;
}

.btn-sm { padding: 6px 13px; font-size: 12px; border-radius: 7px; }
.btn-lg { padding: 12px 24px; font-size: 14px; }

.btn-primary {
    background: var(--primary);
    color: #fff; border-color: transparent;
    box-shadow: 0 1px 3px rgba(var(--primary-rgb), 0.3), inset 0 1px 0 rgba(255,255,255,0.1);
}
.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
    transform: translateY(-1px); color: #fff;
}

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

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }

.btn-warning { background: var(--warning); color: #fff; }

.btn-outline {
    background: #fff; color: var(--text);
    border-color: var(--border);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.btn-outline:hover { background: var(--bg); border-color: var(--text-muted); }

.btn-ghost { background: transparent; border: none; color: var(--text-muted); padding: 6px 10px; }
.btn-ghost:hover { color: var(--primary); background: var(--primary-light); }

/* ═══════════════════════ Tables ═══════════════════════ */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }

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

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

table th {
    font-weight: 600; color: var(--text-muted);
    font-size: 11px; text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg);
    white-space: nowrap;
}

table tr { transition: background var(--transition); }
table tbody tr:hover td { background: #f8fafc; }

table .actions { white-space: nowrap; }
table .actions a, table .actions button {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    color: var(--text-muted); background: none; border: none;
    cursor: pointer; transition: all var(--transition); font-size: 13px;
}
table .actions a:hover, table .actions button:hover { background: var(--primary-light); color: var(--primary); }

/* ═══════════════════════ Forms ═══════════════════════ */
.form-group { margin-bottom: 20px; }

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

.form-row .form-group { margin-bottom: 0; }

label {
    display: block; font-size: 12px; font-weight: 600;
    color: var(--text-light); margin-bottom: 6px;
    letter-spacing: -0.1px;
}

input[type="text"], input[type="email"], input[type="tel"],
input[type="date"], input[type="time"], input[type="number"],
input[type="password"], input[type="search"],
select, textarea {
    width: 100%; padding: 9px 13px;
    font-size: 13.5px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff; color: var(--text);
    font-family: inherit;
    transition: all var(--transition);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

textarea { resize: vertical; min-height: 80px; }
select { cursor: pointer; }

.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 5px; }

.form-section {
    margin-bottom: 32px; padding-bottom: 32px;
    border-bottom: 1px solid var(--border-light);
}

.form-section-title {
    font-size: 15px; font-weight: 700;
    color: var(--text); margin-bottom: 18px;
    display: flex; align-items: center; gap: 10px;
    letter-spacing: -0.2px;
}

.form-section-title i { color: var(--primary); font-size: 16px; }

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

.checkbox-group label {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; text-transform: none;
    font-weight: 500; cursor: pointer;
}

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

/* ═══════════════════════ Badges ═══════════════════════ */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px;
    font-size: 11px; font-weight: 600;
    border-radius: 6px; letter-spacing: 0.1px;
}

.badge-active, .badge-completed, .badge-confirmed { background: var(--success-light); color: #059669; }
.badge-inactive, .badge-cancelled { background: var(--danger-light); color: #dc2626; }
.badge-scheduled { background: var(--info-light); color: #2563eb; }
.badge-discharged, .badge-no_show { background: var(--warning-light); color: #d97706; }

/* ═══════════════════════ Alerts ═══════════════════════ */
.alert {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 500;
    margin: 0 32px; margin-top: 16px;
    display: flex; align-items: center; gap: 10px;
    animation: slideDown 0.35s var(--transition-spring);
}

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

.alert-success { background: var(--success-light); color: #065f46; border-left: 3px solid var(--success); }
.alert-danger { background: var(--danger-light); color: #991b1b; border-left: 3px solid var(--danger); }
.alert-warning { background: var(--warning-light); color: #92400e; border-left: 3px solid var(--warning); }
.alert-info { background: var(--info-light); color: #1e40af; border-left: 3px solid var(--info); }

/* ═══════════════════════ Search & Filters ═══════════════════════ */
.toolbar {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 20px; flex-wrap: wrap;
}

.search-box { position: relative; flex: 1; min-width: 200px; max-width: 400px; }
.search-box input {
    padding-left: 38px; border-radius: 100px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.search-box i {
    position: absolute; left: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted); font-size: 13px;
}

.filter-group { display: flex; gap: 8px; align-items: center; }
.filter-group select { width: auto; min-width: 130px; border-radius: 100px; padding: 8px 14px; font-size: 12.5px; }

/* ═══════════════════════ Patient Photo ═══════════════════════ */
.patient-photo {
    width: 56px; height: 56px;
    border-radius: 14px; object-fit: cover;
    background: var(--bg); flex-shrink: 0;
    border: 2px solid var(--border-light);
}

.patient-photo-lg {
    width: 88px; height: 88px;
    border-radius: 20px; object-fit: cover;
    background: var(--bg);
    border: 3px solid var(--primary-light);
    box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.12);
}

/* ═══════════════════════ Profile ═══════════════════════ */
.profile-header {
    display: flex; align-items: center; gap: 24px;
    margin-bottom: 24px;
    background: var(--bg-card);
    padding: 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

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

.profile-info h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.profile-info .meta {
    color: var(--text-light); font-size: 13px;
    display: flex; gap: 16px; margin-top: 6px; flex-wrap: wrap;
}
.profile-info .meta span { display: flex; align-items: center; gap: 5px; }

.profile-tabs {
    display: flex; gap: 0;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 24px;
    background: var(--bg-card);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 0 8px;
    overflow-x: auto;
}

.profile-tab {
    padding: 13px 20px;
    font-size: 13px; font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition); cursor: pointer;
    display: flex; align-items: center; gap: 7px;
    white-space: nowrap;
}

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

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.detail-item label { margin-bottom: 3px; }
.detail-item .value { font-size: 14px; font-weight: 500; color: var(--text); }

/* ═══════════════════════ Pagination ═══════════════════════ */
.pagination {
    display: flex; align-items: center; justify-content: center;
    gap: 4px; margin-top: 24px;
}

.pagination a, .pagination span {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600;
    color: var(--text-light);
    border: 1px solid var(--border);
    transition: all var(--transition);
    background: #fff;
}

.pagination a:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.pagination .active {
    background: var(--primary); color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 6px rgba(var(--primary-rgb), 0.3);
}

/* ═══════════════════════ Empty State ═══════════════════════ */
.empty-state { text-align: center; padding: 56px 24px; color: var(--text-muted); }
.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
.empty-state h3 { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 6px; letter-spacing: -0.2px; }
.empty-state p { font-size: 13px; margin-bottom: 18px; }

/* ═══════════════════════ Login Page ═══════════════════════ */
.login-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-sidebar);
    padding: 20px;
    position: relative; overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 800px; height: 800px;
    background: radial-gradient(circle, rgba(43,122,120,0.15) 0%, transparent 70%);
    top: -200px; right: -200px;
    animation: loginGlow 8s ease-in-out infinite alternate;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(23,183,148,0.1) 0%, transparent 70%);
    bottom: -150px; left: -150px;
    animation: loginGlow 10s ease-in-out infinite alternate-reverse;
}

@keyframes loginGlow {
    from { transform: scale(1) translate(0, 0); }
    to { transform: scale(1.1) translate(20px, -10px); }
}

.login-card {
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    box-shadow: 0 30px 80px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.1);
    width: 100%; max-width: 420px;
    padding: 44px 38px;
    position: relative; z-index: 1;
}

.login-card .logo-area { justify-content: center; margin-bottom: 32px; }
.login-card .logo-icon { width: 52px; height: 52px; font-size: 22px; border-radius: 14px; }
.login-card .logo-name { color: var(--text); font-size: 17px; }
.login-card .logo-sub { color: var(--text-muted); }

.login-card h1 { text-align: center; font-size: 21px; font-weight: 800; letter-spacing: -0.4px; color: var(--text); }
.login-card .subtitle { text-align: center; color: var(--text-muted); font-size: 13px; margin-bottom: 28px; }

.login-card .form-group { margin-bottom: 18px; }
.login-card label { font-size: 12px; color: var(--text-light); font-weight: 600; letter-spacing: -0.1px; text-transform: none; }
.login-card input { padding: 11px 14px; font-size: 14px; border-radius: var(--radius-sm); }
.login-card .btn {
    width: 100%; justify-content: center; padding: 12px; font-size: 14px;
    border-radius: var(--radius-sm);
    margin-top: 4px;
}

.login-error {
    background: var(--danger-light); color: var(--danger);
    padding: 11px 16px; border-radius: var(--radius-sm);
    font-size: 13px; margin-bottom: 18px;
    text-align: center; font-weight: 500;
    border-left: 3px solid var(--danger);
}

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

.login-lang a {
    font-size: 12px; font-weight: 600;
    color: var(--text-muted);
    padding: 5px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 100px;
    transition: all var(--transition);
}

.login-lang a:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

/* ═══════════════════════ Appointments ═══════════════════════ */
.appointment-item {
    display: flex; align-items: center; gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition);
}

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

.appointment-time {
    min-width: 72px;
    font-size: 13px; font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.appointment-info { flex: 1; }
.appointment-info h4 { font-size: 13.5px; font-weight: 600; }
.appointment-info p { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

/* ═══════════════════════ Photo Upload ═══════════════════════ */
.photo-upload { display: flex; align-items: center; gap: 18px; }

.photo-preview {
    width: 84px; height: 84px;
    border-radius: 18px; background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    border: 2px dashed var(--border);
    transition: border-color var(--transition);
}

.photo-preview:hover { border-color: var(--primary); }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview i { font-size: 28px; color: var(--text-muted); }

/* ═══════════════════════ Dashboard Grid ═══════════════════════ */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close { display: block; }
    .menu-toggle { display: block; }
    .main-content { margin-left: 0; }
    .content-area { padding: 18px 16px; }
    .top-bar { padding: 0 16px; }
    .form-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .profile-header { flex-direction: column; text-align: center; padding: 24px 18px; }
    .profile-info .meta { justify-content: center; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .search-box { max-width: 100%; }
    .btn-label { display: none; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .alert { margin: 0 16px; margin-top: 12px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .login-card { padding: 32px 24px; }
}

.avatar-placeholder {
    width: 100%; height: 100%;
    background: var(--primary-light);
    display: flex; align-items: center; justify-content: center;
    color: var(--primary); font-weight: 700; font-size: 20px;
}

/* ═══════════════════════ Calendar ═══════════════════════ */
.calendar-table { table-layout: fixed; }
.calendar-table th { text-align: center; padding: 10px; font-size: 11px; background: var(--bg); }
.cal-cell { height: 110px; vertical-align: top; padding: 6px !important; border: 1px solid var(--border-light) !important; position: relative; }
.cal-other-month { background: #fafbfc; }
.cal-other-month .cal-day-num { color: var(--text-muted); }
.cal-today { background: var(--primary-light) !important; }
.cal-today-badge { background: var(--primary); color: #fff !important; border-radius: 8px; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.cal-today-header { background: var(--primary-light) !important; }
.cal-day-num { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.cal-event { display: block; padding: 2px 6px; margin-bottom: 2px; font-size: 10.5px; background: var(--primary-light); border-left: 2px solid var(--primary); border-radius: 0 4px 4px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); transition: background var(--transition); }
.cal-event:hover { background: rgba(var(--primary-rgb), 0.15); color: var(--primary-dark); }
.cal-event strong { margin-right: 3px; }
.cal-more { font-size: 10px; color: var(--primary); font-weight: 600; cursor: pointer; padding: 1px 4px; }

.calendar-week-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.calendar-week-table th { padding: 10px; text-align: center; font-size: 11px; background: var(--bg); border: 1px solid var(--border-light); }
.cal-time-cell { font-size: 11px; color: var(--text-muted); font-weight: 600; text-align: right; padding: 8px !important; background: #fafbfc; border-right: 2px solid var(--border) !important; white-space: nowrap; }
.cal-week-cell { padding: 4px !important; vertical-align: top; border: 1px solid var(--border-light); min-height: 44px; }

/* ═══════════════════════ Exercises Grid ═══════════════════════ */
.exercises-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.exercise-card { transition: all var(--transition); }
.exercise-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }

/* ═══════════════════════ Modal ═══════════════════════ */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15,23,42,0.6);
    z-index: 200; display: flex; align-items: center; justify-content: center;
    padding: 20px;
    backdrop-filter: blur(6px);
}
.modal-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%; max-width: 800px; max-height: 90vh;
    overflow: hidden;
    animation: modalIn 0.3s var(--transition-spring);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(-16px) scale(0.97); } to { opacity: 1; transform: none; } }

/* ═══════════════════════ Progress ═══════════════════════ */
.progress-bar-sm { height: 6px; background: var(--border-light); border-radius: 3px; flex: 1; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--primary-gradient); border-radius: 3px; transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
.progress-circle {
    width: 120px; height: 120px; border-radius: 50%;
    background: conic-gradient(var(--primary) calc(var(--progress) * 1%), var(--border-light) 0);
    display: inline-flex; align-items: center; justify-content: center;
    margin: 8px auto; position: relative;
}
.progress-circle::before { content: ''; width: 92px; height: 92px; background: var(--bg-card); border-radius: 50%; position: absolute; }
.progress-value { position: relative; z-index: 1; font-size: 22px; font-weight: 800; color: var(--primary); }

/* ═══════════════════════ Badge extras ═══════════════════════ */
.badge-paused { background: #f5f3ff; color: #7c3aed; }
.badge-easy { background: var(--success-light); color: #059669; }
.badge-moderate { background: var(--info-light); color: #2563eb; }
.badge-hard { background: var(--danger-light); color: #dc2626; }

/* ═══════════════════════ WhatsApp ═══════════════════════ */
.btn-whatsapp { background: #25D366; color: #fff; border-color: transparent; }
.btn-whatsapp:hover { background: #1ebe5d; color: #fff; }

/* ═══════════════════════ Print ═══════════════════════ */
@media print {
    .sidebar, .top-bar, .toolbar, .form-actions, .btn { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}
