/* ============================================================
   AgendaPro AI - Design System
   ============================================================ */

/* ------------------------------------------------------------
   1. Fonts
   ------------------------------------------------------------ */
/* Inter font — Google Fonts CDN (no 404 on servers without local font files) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ------------------------------------------------------------
   2. CSS Variables - Light Theme
   ------------------------------------------------------------ */
:root {
    /* Brand */
    --brand-primary: #6366f1;
    --brand-primary-dark: #4f46e5;
    --brand-primary-light: #818cf8;
    --brand-primary-subtle: #eef2ff;
    --brand-secondary: #8b5cf6;

    /* Background layers */
    --bg-page: #f8f9fc;
    --bg-surface: #ffffff;
    --bg-surface-2: #f1f4f9;
    --bg-surface-3: #e8ecf4;
    --bg-overlay: rgba(0,0,0,0.5);

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-disabled: #cbd5e1;
    --text-inverse: #ffffff;
    --text-link: #6366f1;

    /* Borders */
    --border-color: #e2e8f0;
    --border-color-strong: #cbd5e1;
    --border-radius: 0.625rem;
    --border-radius-sm: 0.375rem;
    --border-radius-lg: 0.875rem;
    --border-radius-xl: 1.25rem;
    --border-radius-pill: 9999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);

    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-bg: #1e1b4b;
    --sidebar-text: rgba(255,255,255,0.8);
    --sidebar-text-active: #ffffff;
    --sidebar-item-active: rgba(255,255,255,0.12);
    --sidebar-item-hover: rgba(255,255,255,0.07);

    /* Topbar */
    --topbar-height: 64px;
    --topbar-bg: #ffffff;

    /* Status colors */
    --success: #10b981;
    --success-subtle: #d1fae5;
    --warning: #f59e0b;
    --warning-subtle: #fef3c7;
    --danger: #ef4444;
    --danger-subtle: #fee2e2;
    --info: #3b82f6;
    --info-subtle: #dbeafe;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
}

/* ------------------------------------------------------------
   3. Dark Theme
   ------------------------------------------------------------ */
[data-theme="dark"] {
    --bg-page: #0f172a;
    --bg-surface: #1e293b;
    --bg-surface-2: #263247;
    --bg-surface-3: #2d3f57;
    --bg-overlay: rgba(0,0,0,0.7);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-disabled: #475569;
    --text-link: #818cf8;

    --border-color: #1e3a5f;
    --border-color-strong: #2d4a6e;

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -1px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -2px rgba(0,0,0,0.2);

    --topbar-bg: #1e293b;
    --brand-primary-subtle: #1e1b4b;
}

/* ------------------------------------------------------------
   4. Base Reset & Global
   ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    background-color: var(--bg-page);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-base), color var(--transition-base);
}

a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ------------------------------------------------------------
   5. Bootstrap Overrides
   ------------------------------------------------------------ */
.btn {
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
    letter-spacing: -0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    border-color: var(--brand-primary);
    color: #fff;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--brand-primary-dark) 0%, #7c3aed 100%);
    border-color: var(--brand-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99,102,241,0.4);
}
.btn-primary:active { transform: translateY(0); box-shadow: none; }

.btn-outline-primary {
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}
.btn-outline-primary:hover {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}

.form-control, .form-select {
    border-color: var(--border-color);
    background-color: var(--bg-surface);
    color: var(--text-primary);
    border-radius: var(--border-radius-sm);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
    background-color: var(--bg-surface);
    color: var(--text-primary);
}
.form-control::placeholder { color: var(--text-muted); }

.form-label { font-weight: 500; font-size: var(--font-size-sm); color: var(--text-secondary); margin-bottom: 0.375rem; }

.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
}

/* ------------------------------------------------------------
   6. Auth Pages
   ------------------------------------------------------------ */
.auth-body {
    min-height: 100vh;
    background: var(--bg-page);
    display: flex;
    align-items: stretch;
}

.auth-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Left branding panel */
.auth-brand {
    width: 45%;
    max-width: 520px;
    background: linear-gradient(145deg, #1e1b4b 0%, #312e81 40%, #4338ca 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.auth-brand::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(99,102,241,0.3) 0%, transparent 70%);
    border-radius: 50%;
}

.auth-brand::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(139,92,246,0.25) 0%, transparent 70%);
    border-radius: 50%;
}

.auth-brand-inner {
    position: relative;
    z-index: 1;
    max-width: 380px;
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}
.auth-logo span {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.auth-headline {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
    color: #fff;
    margin-bottom: 1rem;
}

.auth-subline {
    color: rgba(255,255,255,0.7);
    font-size: var(--font-size-base);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.auth-features { display: flex; flex-direction: column; gap: 1.25rem; margin-bottom: 2.5rem; }

.auth-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.auth-feature-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.12);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.auth-feature-item strong {
    display: block;
    color: #fff;
    font-weight: 600;
    font-size: var(--font-size-sm);
    margin-bottom: 0.125rem;
}
.auth-feature-item span {
    color: rgba(255,255,255,0.65);
    font-size: var(--font-size-xs);
    line-height: 1.4;
}

.auth-testimonial {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--border-radius);
    padding: 1.25rem;
}
.auth-testimonial p { color: rgba(255,255,255,0.9); font-style: italic; margin-bottom: 1rem; font-size: var(--font-size-sm); }
.auth-testimonial-author { display: flex; align-items: center; gap: 0.75rem; }
.auth-avatar { width: 36px; height: 36px; background: rgba(255,255,255,0.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: var(--font-size-sm); flex-shrink: 0; }
.auth-testimonial-author strong { display: block; color: #fff; font-size: var(--font-size-sm); }
.auth-testimonial-author span { color: rgba(255,255,255,0.6); font-size: var(--font-size-xs); }

/* Right form panel */
.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-surface);
    overflow-y: auto;
}

.auth-form-container {
    width: 100%;
    max-width: 460px;
}

.auth-mobile-logo {
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}
.auth-mobile-logo span { font-weight: 700; font-size: 1.125rem; color: var(--text-primary); }

.auth-form-header { margin-bottom: 2rem; }
.auth-form-header h2 { font-size: var(--font-size-2xl); font-weight: 800; letter-spacing: -0.03em; color: var(--text-primary); margin-bottom: 0.375rem; }
.auth-form-header p { color: var(--text-secondary); font-size: var(--font-size-sm); }

.auth-divider {
    text-align: center;
    position: relative;
    margin: 1.5rem 0;
}
.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}
.auth-divider span {
    position: relative;
    background: var(--bg-surface);
    padding: 0 1rem;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.auth-link { color: var(--text-link); font-weight: 500; }
.auth-link:hover { text-decoration: underline; }

.auth-footer-note {
    text-align: center;
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    margin-top: 1.5rem;
}

/* Register steps */
.register-steps {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
}
.step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: var(--text-muted);
    transition: all var(--transition-base);
}
.step.active .step-num {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}
.step span { font-size: var(--font-size-sm); color: var(--text-muted); font-weight: 500; }
.step.active span { color: var(--text-primary); }
.step-line { flex: 1; height: 1px; background: var(--border-color); margin: 0 0.75rem; }

/* Password strength */
.password-strength { }
.strength-bar { height: 4px; background: var(--bg-surface-3); border-radius: 2px; overflow: hidden; margin-bottom: 0.375rem; }
.strength-fill { height: 100%; width: 0; border-radius: 2px; transition: all var(--transition-base); }
.strength-fill.weak { width: 25%; background: var(--danger); }
.strength-fill.fair { width: 50%; background: var(--warning); }
.strength-fill.good { width: 75%; background: var(--info); }
.strength-fill.strong { width: 100%; background: var(--success); }
.strength-label { font-size: var(--font-size-xs); color: var(--text-muted); }

/* Plan preview (register page) */
.auth-plan-preview { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15); border-radius: var(--border-radius); padding: 1.5rem; margin-bottom: 2rem; }
.auth-plan-badge { font-size: var(--font-size-xs); font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: rgba(255,255,255,0.7); margin-bottom: 1rem; }
.auth-plan-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.625rem; }
.auth-plan-list li { display: flex; align-items: center; gap: 0.625rem; font-size: var(--font-size-sm); color: rgba(255,255,255,0.85); }
.auth-plan-list .check { color: #34d399; font-weight: 700; }
.auth-plan-list .check.ai { color: #fbbf24; }
.auth-pricing-preview { text-align: center; }
.auth-pricing-preview p { color: rgba(255,255,255,0.65); font-size: var(--font-size-sm); margin-bottom: 0.25rem; }
.auth-price { display: flex; align-items: baseline; justify-content: center; gap: 0.25rem; }
.price-amount { font-size: 3rem; font-weight: 800; color: #fff; letter-spacing: -0.04em; }
.price-period { font-size: var(--font-size-lg); color: rgba(255,255,255,0.65); }

/* Theme toggle button */
.theme-toggle {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}
.theme-toggle:hover { box-shadow: var(--shadow-lg); transform: scale(1.05); }
[data-theme="dark"] .theme-toggle .sun-icon { display: none; }
[data-theme="light"] .theme-toggle .moon-icon { display: none; }

/* ------------------------------------------------------------
   7. App Shell (Dashboard)
   ------------------------------------------------------------ */
.app-body { overflow: hidden; height: 100vh; }

#app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.app-sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform var(--transition-base);
    z-index: 100;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.25rem 0.75rem;
    flex-shrink: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
}
.sidebar-logo-text {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    letter-spacing: -0.02em;
}

.sidebar-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
}

.sidebar-tenant {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 0.5rem;
}

.tenant-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-sm);
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: var(--font-size-sm);
    flex-shrink: 0;
}

.tenant-name { font-weight: 600; color: #fff; font-size: var(--font-size-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tenant-plan { margin-top: 2px; }
.plan-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--border-radius-pill);
    background: rgba(99,102,241,0.35);
    color: #a5b4fc;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0.75rem;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    padding: 0.75rem 0.5rem 0.375rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    border-radius: var(--border-radius);
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
    margin-bottom: 2px;
    position: relative;
}

.nav-item:hover { background: var(--sidebar-item-hover); color: var(--sidebar-text-active); text-decoration: none; }
.nav-item.active { background: var(--sidebar-item-active); color: var(--sidebar-text-active); }
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--brand-primary-light);
    border-radius: 0 2px 2px 0;
}

.nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.8; }
.nav-item.active .nav-icon { opacity: 1; }
.nav-item:hover .nav-icon { opacity: 1; }

.nav-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--border-radius-pill);
    background: var(--brand-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.portal-link-box { background: rgba(255,255,255,0.07); border-radius: var(--border-radius); padding: 0.875rem; }
.portal-link-label { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255,255,255,0.5); margin-bottom: 0.5rem; }
.portal-link-url {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: rgba(255,255,255,0.8);
    font-size: var(--font-size-xs);
    text-decoration: none;
    margin-bottom: 0.5rem;
    word-break: break-all;
}
.portal-link-url:hover { color: #fff; }

.btn-copy {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.7);
    font-size: var(--font-size-xs);
    padding: 0.25rem 0.625rem;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}
.btn-copy:hover { background: rgba(255,255,255,0.15); color: #fff; }

.btn-logout {
    color: rgba(255,255,255,0.55) !important;
    font-size: var(--font-size-sm);
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
}
.btn-logout:hover { color: rgba(255,255,255,0.85) !important; }

/* Sidebar overlay for mobile */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}
.sidebar-overlay.active { opacity: 1; pointer-events: auto; }

/* Mobile sidebar behavior */
@media (max-width: 1199px) {
    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        z-index: 200;
    }
    .app-sidebar.open { transform: translateX(0); }
}

/* App main area */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    min-width: 0;
}

/* Topbar */
.app-topbar {
    height: var(--topbar-height);
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    flex-shrink: 0;
    gap: 1rem;
    box-shadow: var(--shadow-xs);
}

.topbar-left { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

.topbar-menu-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.375rem;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    transition: all var(--transition-fast);
}
.topbar-menu-btn:hover { background: var(--bg-surface-2); color: var(--text-primary); }

.topbar-breadcrumb {
    font-weight: 600;
    font-size: var(--font-size-base);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-action {
    white-space: nowrap;
}

.topbar-icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.topbar-icon-btn:hover { background: var(--bg-surface-2); color: var(--text-primary); }
[data-theme="dark"] .topbar-icon-btn .sun-icon { display: none; }
[data-theme="light"] .topbar-icon-btn .moon-icon { display: none; }

.topbar-user-btn {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.375rem 0.625rem;
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
    color: var(--text-primary);
}
.topbar-user-btn:hover { background: var(--bg-surface-2); }

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-size-xs);
    flex-shrink: 0;
}

.user-info { text-align: left; }
.user-name { font-size: var(--font-size-sm); font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.user-role { font-size: var(--font-size-xs); color: var(--text-muted); text-transform: capitalize; }

/* Dropdown */
.dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    background: var(--bg-surface);
    padding: 0.5rem;
    min-width: 220px;
}
.dropdown-item {
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}
.dropdown-item:hover { background: var(--bg-surface-2); color: var(--text-primary); }
.dropdown-header { padding: 0.5rem 0.75rem; font-size: var(--font-size-sm); }
.dropdown-divider { border-color: var(--border-color); margin: 0.375rem 0; }

/* App content area */
.app-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background: var(--bg-page);
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.app-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}
.loading-spinner { text-align: center; }
.loading-spinner p { color: var(--text-muted); margin-top: 1rem; font-size: var(--font-size-sm); }

/* ------------------------------------------------------------
   8. Dashboard / Page Components
   ------------------------------------------------------------ */
.page-header {
    margin-bottom: 1.5rem;
}
.page-header h1 {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}
.page-header p { color: var(--text-secondary); font-size: var(--font-size-sm); }

/* Stats cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.stat-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.stat-card-title { font-size: var(--font-size-xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.stat-card-icon {
    width: 36px; height: 36px;
    border-radius: var(--border-radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
}
.stat-card-icon.blue { background: var(--info-subtle); }
.stat-card-icon.green { background: var(--success-subtle); }
.stat-card-icon.purple { background: var(--brand-primary-subtle); }
.stat-card-icon.orange { background: var(--warning-subtle); }

.stat-card-value { font-size: var(--font-size-3xl); font-weight: 800; letter-spacing: -0.03em; color: var(--text-primary); line-height: 1; margin-bottom: 0.5rem; }
.stat-card-trend { font-size: var(--font-size-xs); }
.stat-card-trend.up { color: var(--success); }
.stat-card-trend.down { color: var(--danger); }
.stat-card-trend.neutral { color: var(--text-muted); }

/* AI Insight card */
.ai-insight-card {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    border: none;
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    color: #fff;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}
.ai-insight-card::before {
    content: '✨';
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.5rem;
    opacity: 0.6;
}
.ai-insight-title { font-size: var(--font-size-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255,255,255,0.6); margin-bottom: 0.5rem; }
.ai-insight-text { color: rgba(255,255,255,0.9); font-size: var(--font-size-sm); line-height: 1.6; }

/* ------------------------------------------------------------
   9. Toast Notifications
   ------------------------------------------------------------ */
.toast {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    min-width: 280px;
    max-width: 400px;
    background: var(--bg-surface);
}
.toast-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 600;
    font-size: var(--font-size-sm);
}
.toast-body { font-size: var(--font-size-sm); color: var(--text-secondary); padding: 0.875rem 1rem; }
.toast.toast-success .toast-header { color: var(--success); }
.toast.toast-error .toast-header { color: var(--danger); }
.toast.toast-warning .toast-header { color: var(--warning); }

/* ------------------------------------------------------------
   10. Booking Portal (see booking-portal.css for more)
   ------------------------------------------------------------ */
.portal-body {
    background: var(--bg-page);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Chatbot widget */
.chatbot-widget { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 999; }
.chatbot-toggle {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-xl);
    color: #fff;
    position: relative;
    transition: all var(--transition-fast);
}
.chatbot-toggle:hover { transform: scale(1.05); }
.chatbot-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #fbbf24;
    color: #000;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 6px;
    letter-spacing: 0.04em;
}

.chatbot-drawer {
    position: absolute;
    bottom: 68px;
    right: 0;
    width: 320px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    display: none;
    flex-direction: column;
    max-height: 480px;
}
.chatbot-drawer.open { display: flex; }

.chatbot-header {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: #fff;
    flex-shrink: 0;
}
.chatbot-avatar { font-size: 1.5rem; }
.chatbot-name { font-weight: 700; font-size: var(--font-size-sm); }
.chatbot-status { font-size: var(--font-size-xs); color: rgba(255,255,255,0.75); }

.chatbot-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.chat-msg { display: flex; }
.chat-msg.bot { justify-content: flex-start; }
.chat-msg.user { justify-content: flex-end; }
.chat-bubble {
    max-width: 80%;
    padding: 0.625rem 0.875rem;
    border-radius: 1rem;
    font-size: var(--font-size-sm);
    line-height: 1.5;
}
.chat-msg.bot .chat-bubble { background: var(--bg-surface-2); color: var(--text-primary); border-bottom-left-radius: 4px; }
.chat-msg.user .chat-bubble { background: var(--brand-primary); color: #fff; border-bottom-right-radius: 4px; }

.chatbot-input-area { display: flex; gap: 0.5rem; padding: 0.75rem; border-top: 1px solid var(--border-color); flex-shrink: 0; }
.chatbot-input-area .form-control { border-radius: var(--border-radius-pill); font-size: var(--font-size-sm); }
.chatbot-input-area .btn { border-radius: var(--border-radius-pill); width: 38px; height: 38px; padding: 0; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Typing indicator */
.chat-typing .chat-bubble {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0.75rem 1rem;
}
.typing-dot {
    width: 6px; height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-8px); } }

/* ------------------------------------------------------------
   11. Utilities
   ------------------------------------------------------------ */
.text-gradient {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-surface-2) 25%, var(--bg-surface-3) 50%, var(--bg-surface-2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--border-radius-sm);
}
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: var(--font-size-lg); font-weight: 600; color: var(--text-secondary); margin-bottom: 0.5rem; }
.empty-state p { font-size: var(--font-size-sm); max-width: 320px; margin: 0 auto 1.5rem; }

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--border-radius-pill);
    font-size: var(--font-size-xs);
    font-weight: 600;
    letter-spacing: 0.03em;
}
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.status-pending { background: var(--warning-subtle); color: #92400e; }
.status-pending::before { background: var(--warning); }
.status-confirmed { background: var(--info-subtle); color: #1e40af; }
.status-confirmed::before { background: var(--info); }
.status-completed { background: var(--success-subtle); color: #065f46; }
.status-completed::before { background: var(--success); }
.status-cancelled { background: var(--danger-subtle); color: #991b1b; }
.status-cancelled::before { background: var(--danger); }
.status-no_show { background: var(--bg-surface-3); color: var(--text-muted); }
.status-no_show::before { background: var(--text-muted); }

/* Alert styles */
.alert { border-radius: var(--border-radius); border: none; font-size: var(--font-size-sm); }
.alert-success { background: var(--success-subtle); color: #065f46; }
.alert-danger { background: var(--danger-subtle); color: #991b1b; }
.alert-warning { background: var(--warning-subtle); color: #92400e; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-color-strong); }

/* Responsive */
@media (max-width: 768px) {
    .auth-wrapper { flex-direction: column; }
    .app-content { padding: 1rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
    .stats-grid { grid-template-columns: 1fr; }
    .auth-form-panel { padding: 1.5rem 1rem; }
}
