/* ===================================================
   BHARAT AYUR SETU — Premium Design System
   =================================================== */

:root {
    /* Core Brand — Deep Teal (from logo icon background) */
    --primary: #0D3B4F;
    --primary-light: #175A72;
    --primary-dark: #081F28;
    --primary-50: #E6F4F8;
    --primary-100: #B8DDE8;

    /* Accent Colors */
    --ayur-green: #2D9B6F;
    --ayur-green-light: #3DB882;
    --ayur-green-50: #E8F7F1;
    --setu-orange: #E8732A;
    --setu-orange-light: #F09256;
    --setu-orange-50: #FEF0E6;
    --gold: #F0A500;
    --gold-50: #FFF8E6;

    /* Semantic */
    --success: #22C55E;
    --success-bg: #DCFCE7;
    --warning: #F59E0B;
    --warning-bg: #FEF3C7;
    --danger: #EF4444;
    --danger-bg: #FEE2E2;
    --info: #3B82F6;
    --info-bg: #DBEAFE;

    /* Category Pills — matching logo exactly */
    --allopathy: #3B82F6;
    --ayurveda: #2D9B6F;
    --homeopathy: #E8732A;
    --diagnostics: #8B5CF6;

    /* Neutrals */
    --bg: #F0F7F5;
    --bg-light: #F8FDFC;
    --white: #FFFFFF;
    --text-dark: #0F172A;
    --text: #334155;
    --text-muted: #64748B;
    --text-light: #94A3B8;
    --border: #E2EDE9;
    --border-light: #F0F7F5;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
    --shadow-glow: 0 0 20px rgba(13, 59, 79, 0.15);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0D3B4F 0%, #175A72 50%, #1A6680 100%);
    --gradient-hero: linear-gradient(135deg, #E6F4F8 0%, #F0F9F5 50%, #F8FDFC 100%);
    --gradient-accent: linear-gradient(135deg, #E8732A 0%, #F09256 100%);
    --gradient-green: linear-gradient(135deg, #2D9B6F 0%, #3DB882 100%);
    --gradient-gold: linear-gradient(135deg, #F0A500 0%, #FFD166 100%);
    --gradient-card: linear-gradient(135deg, rgba(13,59,79,0.03) 0%, rgba(45,155,111,0.05) 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%);

    /* Radius */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 999px;

    /* Focus Ring */
    --ring: 0 0 0 3px rgba(45, 155, 111, 0.25);
    --ring-primary: 0 0 0 3px rgba(13, 59, 79, 0.2);

    /* Transitions */
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;
    --transition-spring: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===================================================
   RESET & BASE
   =================================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }

/* ===================================================
   ANIMATIONS
   =================================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
@keyframes progressBar {
    from { width: 0%; }
}
@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.animate-fade-in { animation: fadeIn 0.5s ease forwards; }
.animate-fade-in-up { animation: fadeInUp 0.6s ease forwards; }
.animate-fade-in-left { animation: fadeInLeft 0.5s ease forwards; }
.animate-fade-in-right { animation: fadeInRight 0.5s ease forwards; }
.animate-scale-in { animation: scaleIn 0.3s ease forwards; }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-slide-down { animation: slideDown 0.3s ease forwards; }

.delay-1 { animation-delay: 0.1s; opacity: 0; }
.delay-2 { animation-delay: 0.2s; opacity: 0; }
.delay-3 { animation-delay: 0.3s; opacity: 0; }
.delay-4 { animation-delay: 0.4s; opacity: 0; }
.delay-5 { animation-delay: 0.5s; opacity: 0; }

/* ===================================================
   LAYOUT
   =================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-lg {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===================================================
   BUTTONS
   =================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    font-family: inherit;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    line-height: 1.4;
    white-space: nowrap;
}

.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white) !important;
    box-shadow: 0 4px 14px rgba(15, 53, 89, 0.25);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 53, 89, 0.3);
}

.btn-accent {
    background: var(--gradient-accent);
    color: var(--white) !important;
    box-shadow: 0 4px 14px rgba(229, 115, 74, 0.3);
}
.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(229, 115, 74, 0.35);
}

.btn-green {
    background: var(--gradient-green);
    color: var(--white) !important;
}
.btn-green:hover { transform: translateY(-2px); }

.btn-outline {
    background: var(--white);
    color: var(--primary);
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-xs);
}
.btn-outline:hover {
    border-color: var(--primary);
    background: var(--primary-50);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 8px 12px;
}
.btn-ghost:hover {
    background: var(--bg);
    color: var(--text-dark);
}

.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: var(--radius-lg); }
.btn-icon { padding: 10px; border-radius: var(--radius); }

.btn-white {
    background: var(--white);
    color: var(--primary) !important;
    font-weight: 700;
}
.btn-white:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* ===================================================
   CARDS & PANELS
   =================================================== */
.card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}
.card:hover {
    box-shadow: var(--shadow-md);
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.panel {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    padding: 24px;
    animation: fadeIn 0.4s ease forwards;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.panel-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-title svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.panel-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Glass Card */
.glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* ===================================================
   STAT CARDS
   =================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 24px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    opacity: 0.05;
    transform: translate(30%, -30%);
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-icon svg { width: 24px; height: 24px; }

.stat-icon-blue { background: var(--primary-50); color: var(--primary); }
.stat-icon-blue + .stat-info ~ .stat-card::after { background: var(--primary); }
.stat-icon-green { background: var(--ayur-green-50); color: var(--ayur-green); }
.stat-icon-orange { background: var(--setu-orange-50); color: var(--setu-orange); }
.stat-icon-gold { background: var(--gold-50); color: var(--gold); }
.stat-icon-purple { background: #F3E8FF; color: #8B5CF6; }
.stat-icon-pink { background: #FCE7F3; color: #EC4899; }
.stat-icon-success { background: var(--success-bg); color: var(--success); }
.stat-icon-danger { background: var(--danger-bg); color: var(--danger); }

.stat-info { flex: 1; min-width: 0; }
.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.1;
    animation: countUp 0.6s ease forwards;
}
.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}
.stat-change-up { background: var(--success-bg); color: var(--success); }
.stat-change-down { background: var(--danger-bg); color: var(--danger); }

/* ===================================================
   METRIC CARDS (backward compat)
   =================================================== */
.metric {
    border-radius: var(--radius-xl);
    padding: 20px;
    background: var(--white);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}
.metric::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.metric:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.metric-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.2;
    margin-bottom: 4px;
}
.metric-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* ===================================================
   TABLES
   =================================================== */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table th,
.table td {
    padding: 14px 16px;
    text-align: left;
    vertical-align: middle;
    font-size: 14px;
}

.table th {
    background: var(--bg);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
}
.table th:first-child { border-radius: var(--radius) 0 0 0; }
.table th:last-child { border-radius: 0 var(--radius) 0 0; }

.table td {
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
    transition: background 0.15s;
}

.table tbody tr:hover td {
    background: var(--bg-light);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ===================================================
   CHIPS / BADGES
   =================================================== */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    white-space: nowrap;
}

.chip-blue { background: var(--info-bg); color: var(--info); }
.chip-green { background: var(--success-bg); color: var(--success); }
.chip-gold { background: var(--warning-bg); color: var(--warning); }
.chip-red { background: var(--danger-bg); color: var(--danger); }
.chip-gray { background: var(--bg); color: var(--text-muted); }
.chip-purple { background: #F3E8FF; color: #8B5CF6; }
.chip-orange { background: var(--setu-orange-50); color: var(--setu-orange); }
.chip-primary { background: var(--primary-50); color: var(--primary); }

/* ===================================================
   FORMS
   =================================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 15px;
    color: var(--text-dark);
    background: var(--white);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--ayur-green);
    box-shadow: var(--ring);
}

.form-control::placeholder {
    color: var(--text-light);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.error-msg {
    color: var(--danger);
    font-size: 13px;
    margin-top: 4px;
    font-weight: 500;
}

/* ===================================================
   TOAST NOTIFICATIONS
   =================================================== */
.toast {
    margin: 0 0 20px;
    padding: 14px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}
.toast::before {
    content: '';
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 50%;
}

.toast-success {
    background: var(--success-bg);
    color: #166534;
    border: 1px solid rgba(34, 197, 94, 0.2);
}
.toast-success::before { background: var(--success); }

.toast-error {
    background: var(--danger-bg);
    color: #991B1B;
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.toast-error::before { background: var(--danger); }

/* ===================================================
   PORTAL LAYOUT (Dashboard Shell)
   =================================================== */
.portal-body {
    background: var(--bg);
}

.portal-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 272px 1fr;
}

/* Sidebar */
.portal-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: var(--gradient-primary);
    color: rgba(255, 255, 255, 0.92);
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    gap: 8px;
    z-index: 100;
    overflow-y: auto;
    border-right: 1px solid rgba(255,255,255,0.06);
}

.portal-sidebar::-webkit-scrollbar { width: 4px; }
.portal-sidebar::-webkit-scrollbar-track { background: transparent; }
.portal-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.portal-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.95);
    padding: 14px 12px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 8px;
    transition: var(--transition);
}
.portal-brand:hover { background: rgba(255,255,255,0.1); }

.portal-brand-logo {
    height: 40px;
    width: 40px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.95);
    padding: 4px;
    object-fit: contain;
}

.portal-brand-name {
    font-weight: 800;
    font-size: 15px;
    line-height: 1.2;
}

.portal-brand-sub {
    font-size: 11px;
    opacity: 0.7;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Sidebar Navigation */
.portal-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 0;
}

.portal-nav-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.35);
    padding: 16px 12px 6px;
}

.portal-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius);
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
    position: relative;
}
.portal-nav a svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.7;
}

.portal-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.95);
}
.portal-nav a:hover svg { opacity: 1; }

.portal-nav a.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.12);
}
.portal-nav a.active svg { opacity: 1; }
.portal-nav a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--gold);
    border-radius: 0 3px 3px 0;
}

/* Sidebar Footer */
.portal-sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 12px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.portal-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    transition: var(--transition);
}
.portal-link:hover { color: #fff; }
.portal-link svg { width: 16px; height: 16px; }

.portal-logout {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 14px;
    border: none;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255,255,255,0.9);
    transition: var(--transition);
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.portal-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #FCA5A5;
}
.portal-logout svg { width: 16px; height: 16px; }

/* Main Content Area */
.portal-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
}

.portal-topbar {
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--white);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 16px;
}

.portal-topbar-left { flex: 1; min-width: 0; }

.portal-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.2;
}

.portal-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
}

.portal-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-content {
    padding: 28px 32px;
    flex: 1;
}

/* Mobile Sidebar */
.portal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.3s;
}
.portal-overlay.show {
    display: block;
    opacity: 1;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-dark);
    border-radius: var(--radius-sm);
}
.sidebar-toggle:hover { background: var(--bg); }
.sidebar-toggle svg { width: 24px; height: 24px; }

/* ===================================================
   GRID UTILITIES
   =================================================== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}

/* ===================================================
   CHART CONTAINERS
   =================================================== */
.chart-container {
    position: relative;
    padding: 20px;
    background: var(--white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
}
.chart-container canvas {
    max-height: 280px;
}

/* ===================================================
   WELCOME BANNER
   =================================================== */
.welcome-banner {
    background: var(--gradient-primary);
    border-radius: var(--radius-2xl);
    padding: 32px;
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}
.welcome-banner::before {
    content: '';
    position: absolute;
    right: -50px;
    top: -50px;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}
.welcome-banner::after {
    content: '';
    position: absolute;
    right: 80px;
    bottom: -60px;
    width: 150px;
    height: 150px;
    background: rgba(255,255,255,0.03);
    border-radius: 50%;
}
.welcome-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 6px;
}
.welcome-subtitle {
    font-size: 15px;
    opacity: 0.85;
    font-weight: 500;
}

/* ===================================================
   QUICK ACTIONS GRID
   =================================================== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 16px;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    text-decoration: none;
    color: var(--text-dark);
    transition: var(--transition-spring);
    box-shadow: var(--shadow-xs);
    text-align: center;
}
.quick-action:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-100);
}
.quick-action-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}
.quick-action-icon svg { width: 28px; height: 28px; }
.quick-action-label {
    font-weight: 700;
    font-size: 14px;
}

/* ===================================================
   APPOINTMENT CARDS
   =================================================== */
.appointment-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    margin-bottom: 12px;
}
.appointment-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border);
}
.appointment-card:last-child { margin-bottom: 0; }

.appointment-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: var(--primary-50);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    flex-shrink: 0;
}

.appointment-info { flex: 1; min-width: 0; }
.appointment-name {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 15px;
}
.appointment-meta {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 2px;
}
.appointment-meta svg { width: 14px; height: 14px; }

.appointment-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ===================================================
   PROGRESS STEPS
   =================================================== */
.progress-steps {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 12px 0;
}
.progress-step {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-light);
}
.progress-step.active { color: var(--primary); }
.progress-step.completed { color: var(--success); }
.progress-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.progress-step.active .progress-dot { border-color: var(--primary); background: var(--primary-50); }
.progress-step.completed .progress-dot { border-color: var(--success); background: var(--success); color: #fff; }
.progress-line {
    width: 40px;
    height: 2px;
    background: var(--border);
    margin: 0 4px;
}
.progress-step.completed + .progress-line { background: var(--success); }

/* ===================================================
   EMPTY STATE
   =================================================== */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
}
.empty-state svg {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    opacity: 0.3;
}
.empty-state h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}
.empty-state p {
    font-size: 14px;
    max-width: 300px;
    margin: 0 auto;
}

/* ===================================================
   LANDING PAGE SPECIFICS
   =================================================== */
.brand-nav {
    background: var(--white);
    padding: 14px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-light);
}
.brand-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--primary);
    flex-shrink: 0;
}
.brand-logo img {
    height: 52px;
    width: auto;
    object-fit: contain;
}
.brand-name {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
}
.brand-tagline {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 600;
}

.nav-links {
    display: flex;
    gap: 8px;
    list-style: none;
    align-items: center;
}
.nav-links a {
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    transition: var(--transition);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
}
.nav-links a:hover {
    color: var(--primary);
    background: var(--primary-50);
}

/* ===================================================
   FOOTER
   =================================================== */
.brand-footer {
    background: var(--primary);
    color: var(--white);
    padding: 64px 0 32px;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--white);
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.footer-links a {
    color: rgba(255,255,255,0.65);
    font-size: 14px;
    transition: var(--transition);
}
.footer-links a:hover { color: #fff; }

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 13px;
    color: rgba(255,255,255,0.5);
}

/* ===================================================
   DASHBOARD LAYOUT (2-col)
   =================================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    align-items: start;
}

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 1280px) {
    .dashboard-grid { grid-template-columns: 1fr 320px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
    .portal-shell { grid-template-columns: 1fr; }
    .portal-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 100;
        width: 280px;
    }
    .portal-sidebar.open { transform: translateX(0); }
    .portal-main { margin-left: 0; }
    .sidebar-toggle { display: block; }
    .portal-content { padding: 20px 16px; }
    .portal-topbar { padding: 16px 20px; }
    .dashboard-grid { grid-template-columns: 1fr; }

    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .quick-actions { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .portal-content { padding: 16px; }
    .portal-topbar { padding: 12px 16px; }
    .portal-title { font-size: 18px; }

    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .quick-actions { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr; }

    .welcome-banner { flex-direction: column; text-align: center; padding: 24px; }
    .stat-value { font-size: 24px; }
    .metric-value { font-size: 22px; }
    .btn-lg { font-size: 14px; padding: 12px 20px; }
}

/* ===================================================
   UTILITIES
   =================================================== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-dark { color: var(--text-dark); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none !important; }
.overflow-auto { overflow: auto; }
.w-full { width: 100%; }
.rounded-xl { border-radius: var(--radius-xl); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===================================================
   UTILITY CLASSES (Tailwind-like)
   =================================================== */
/* Flexbox */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.justify-center { justify-content: center; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }

/* Spacing - Gap */
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

/* Margin */
.m-0 { margin: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-10 { margin-top: 40px; }
.mt-auto { margin-top: auto; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.ml-auto { margin-left: auto; }
.-mx-6 { margin-left: -24px; margin-right: -24px; }
.-mb-6 { margin-bottom: -24px; }

/* Padding */
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.pt-4 { padding-top: 16px; }
.pt-6 { padding-top: 24px; }

/* Text */
.text-xs { font-size: 10px; }
.text-sm { font-size: 13px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.uppercase { text-transform: uppercase; }
.tracking-wider { letter-spacing: 0.05em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Colors */
.text-primary { color: var(--primary); }
.text-dark { color: var(--text-dark); }
.text-muted { color: var(--text-muted); }
.bg-gray-50 { background-color: var(--bg-light); }
.bg-white { background-color: var(--white); }

/* Layout & Sizing */
.w-full { width: 100%; }
.w-24 { width: 96px; }
.h-full { height: 100%; }
.block { display: block; }
.hidden { display: none; }
.relative { position: relative; }
.absolute { position: absolute; }

/* Borders & Rounded */
.border-t { border-top: 1px solid var(--border-light); }
.rounded { border-radius: var(--radius-sm); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-b-xl { border-radius: 0 0 var(--radius-xl) var(--radius-xl); }

/* Common */
.shadow-sm { box-shadow: var(--shadow-xs); }
.shadow { box-shadow: var(--shadow); }
.cursor-not-allowed { cursor: not-allowed; }
.opacity-50 { opacity: 0.5; }
.transition-colors { transition: background-color 0.2s, color 0.2s, border-color 0.2s; }
