:root {
    --primary: #3b82f6;
    --primary-dark: #1d4ed8;
    --secondary: #0f172a;
    --text: #1e293b;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #f8fafc;
    --white: #ffffff;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --shadow-lg: 0 25px 80px rgba(15, 23, 42, 0.12);
    --shadow-md: 0 12px 35px rgba(15, 23, 42, 0.08);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background: var(--bg);
}
a { text-decoration: none; }
.form-control, .form-select {
    border-radius: 16px;
    border: 1px solid var(--line);
    padding: 0.95rem 1rem;
    box-shadow: none !important;
}
.form-control:focus, .form-select:focus {
    border-color: rgba(59, 130, 246, 0.45);
}
.btn {
    border-radius: 16px;
    font-weight: 600;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.25);
}
.btn-soft { padding: 0.95rem 1.3rem; }
.auth-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(59,130,246,0.18), transparent 30%),
        radial-gradient(circle at bottom right, rgba(16,185,129,0.12), transparent 28%),
        #f5f9ff;
}
.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
}
.auth-left {
    padding: 72px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.auth-left h1 {
    font-size: clamp(2.6rem, 4vw, 4.5rem);
    line-height: 1.05;
    font-weight: 800;
    color: var(--secondary);
    margin: 0 0 20px;
    max-width: 700px;
}
.auth-left p {
    max-width: 620px;
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.8;
}
.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255,255,255,0.7);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-md);
    border-radius: 999px;
    padding: 0.8rem 1.15rem;
    font-weight: 700;
    margin-bottom: 24px;
}
.hero-points {
    display: grid;
    gap: 14px;
    margin-top: 30px;
}
.hero-points div {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: var(--secondary);
}
.auth-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}
.auth-card {
    width: 100%;
    max-width: 560px;
    background: rgba(255,255,255,0.88);
    border: 1px solid rgba(255,255,255,0.7);
    backdrop-filter: blur(24px);
    box-shadow: var(--shadow-lg);
    border-radius: 34px;
    padding: 38px;
}
.auth-card h2 { font-size: 2rem; font-weight: 800; color: var(--secondary); }
.auth-card p { color: var(--muted); }
.auth-icon {
    width: 76px; height: 76px; border-radius: 24px;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 14px 32px rgba(59,130,246,0.35);
}
.auth-bottom a { font-weight: 700; }

.dashboard-page { background: #f6f9fc; }
.dashboard-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 320px 1fr;
}
.sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
    color: #fff;
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: sticky;
    top: 0;
    height: 100vh;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #fff;
}
.brand-logo {
    width: 58px;
    height: 58px;
    border-radius: 20px;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}
.brand strong { display: block; font-size: 1.15rem; }
.brand span { color: rgba(255,255,255,0.65); font-size: 0.92rem; }
.user-card {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 18px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 24px;
}
.avatar-circle,
.profile-avatar-large {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    background: linear-gradient(135deg, #3b82f6, #0ea5e9);
    color: #fff;
}
.avatar-circle { width: 54px; height: 54px; border-radius: 18px; }
.sidebar-nav { display: grid; gap: 10px; }
.sidebar-nav a {
    color: rgba(255,255,255,0.82);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 16px;
    border-radius: 18px;
    transition: 0.25s ease;
    font-weight: 600;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255,255,255,0.11);
    color: #fff;
    transform: translateX(3px);
}
.sidebar-help .glass-card {
    border-radius: 24px;
    padding: 18px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
}
.main-content {
    padding: 34px;
}
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}
.topbar h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
    color: var(--secondary);
}
.topbar p { margin: 8px 0 0; color: var(--muted); }
.custom-alert {
    border-radius: 18px;
    border: none;
    box-shadow: var(--shadow-md);
}
.fade-out { opacity: 0; transition: opacity 0.5s ease; }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}
.stat-card,
.content-card,
.appointment-card,
.auth-card,
.profile-side-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}
.stat-card {
    padding: 28px;
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: '';
    position: absolute;
    inset: auto -40px -40px auto;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
}
.stat-card span { display: block; font-size: 0.95rem; color: rgba(255,255,255,0.88); }
.stat-card strong { display: block; font-size: 2.7rem; line-height: 1; color: #fff; margin: 14px 0 10px; }
.stat-card small { color: rgba(255,255,255,0.8); }
.stat-card.primary { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.stat-card.success { background: linear-gradient(135deg, #10b981, #059669); }
.stat-card.danger { background: linear-gradient(135deg, #f97316, #ef4444); }
.content-card {
    padding: 28px;
}
.section-title-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
.section-title-wrap h3 { margin: 0; font-size: 1.35rem; font-weight: 800; color: var(--secondary); }
.section-title-wrap p { margin: 6px 0 0; color: var(--muted); }
.next-appointment-card {
    display: flex;
    gap: 18px;
    align-items: center;
    padding: 22px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(16,185,129,0.08));
    border: 1px solid rgba(59,130,246,0.12);
}
.icon-box {
    min-width: 74px; height: 74px; border-radius: 24px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary), #06b6d4);
    color: #fff; font-size: 2rem;
}
.next-appointment-card h4 { margin: 0 0 6px; font-size: 1.25rem; font-weight: 800; }
.next-appointment-card h4 span { font-size: 0.95rem; color: var(--muted); font-weight: 600; margin-left: 8px; }
.next-appointment-card p { margin: 0 0 10px; color: var(--muted); }
.meta-row { display: flex; flex-wrap: wrap; gap: 14px; font-weight: 600; color: var(--secondary); }
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 16px;
}
.quick-actions-grid a {
    padding: 24px 18px;
    border-radius: 24px;
    background: #f8fbff;
    border: 1px solid var(--line);
    color: var(--secondary);
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-weight: 700;
    transition: 0.25s ease;
}
.quick-actions-grid a:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.quick-actions-grid i { font-size: 1.8rem; color: var(--primary); }
.empty-state {
    padding: 42px 24px;
    text-align: center;
    border: 2px dashed #dbeafe;
    border-radius: 28px;
    background: #f8fbff;
}
.empty-state i { font-size: 3rem; color: var(--primary); display: block; margin-bottom: 14px; }
.empty-state h4 { font-weight: 800; }
.empty-state p { color: var(--muted); max-width: 520px; margin: 0 auto 18px; }
.empty-state.full-width { grid-column: 1 / -1; }
.custom-table thead th {
    color: var(--muted);
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom-color: var(--line);
}
.custom-table tbody td { padding: 1rem 0.75rem; }
.form-card { max-width: 980px; }
.appointments-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 22px;
}
.appointment-card {
    padding: 22px;
    border: 1px solid rgba(226,232,240,0.85);
}
.appointment-head {
    display: flex; justify-content: space-between; gap: 16px; align-items: flex-start;
    margin-bottom: 14px;
}
.appointment-head h4 { margin: 0 0 6px; font-size: 1.15rem; font-weight: 800; }
.appointment-head p { margin: 0; color: var(--muted); }
.appointment-body { display: grid; gap: 10px; padding: 14px 0 18px; }
.info-line { display: flex; gap: 10px; color: var(--text); }
.info-line i { color: var(--primary); }
.appointment-actions {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.custom-modal {
    border: none;
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
}
.profile-side-card {
    padding: 30px;
    text-align: center;
}
.profile-avatar-large {
    width: 110px;
    height: 110px;
    border-radius: 32px;
    font-size: 2.3rem;
    margin: 0 auto 18px;
    box-shadow: 0 14px 30px rgba(59,130,246,0.25);
}
.profile-side-card h3 { font-weight: 800; margin-bottom: 6px; }
.profile-side-card p { color: var(--muted); }
.profile-meta {
    margin-top: 24px;
    display: grid;
    gap: 14px;
    text-align: left;
}
.profile-meta div {
    padding: 16px 18px;
    border-radius: 18px;
    background: #f8fbff;
    border: 1px solid var(--line);
}
.profile-meta span { display: block; color: var(--muted); font-size: 0.9rem; }
.profile-meta strong { color: var(--secondary); font-size: 1rem; }

@media (max-width: 1400px) {
    .dashboard-shell { grid-template-columns: 280px 1fr; }
    .stats-grid, .appointments-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 1100px) {
    .auth-shell,
    .dashboard-shell,
    .stats-grid,
    .appointments-grid { grid-template-columns: 1fr; }
    .sidebar {
        position: relative;
        height: auto;
        border-radius: 0 0 28px 28px;
    }
}
@media (max-width: 767px) {
    .auth-left,
    .auth-right,
    .main-content,
    .sidebar { padding: 20px; }
    .auth-card,
    .content-card,
    .stat-card,
    .appointment-card { border-radius: 24px; }
    .topbar,
    .section-title-wrap,
    .appointment-head { flex-direction: column; align-items: stretch; }
    .quick-actions-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .topbar h1 { font-size: 1.6rem; }
    .auth-left h1 { font-size: 2.2rem; }
}
