/* ================================================================
   WebToAgencia v2 — Design System
   Stack: Bootstrap 5 + Custom CSS
   Fonts: Plus Jakarta Sans + JetBrains Mono
   ================================================================ */

/* ----------------------------------------------------------------
   1. GOOGLE FONTS
   ---------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ----------------------------------------------------------------
   2. CSS VARIABLES
   ---------------------------------------------------------------- */
:root {
    /* Background & Surface */
    --bg-body: #F8FAFB;
    --bg-surface: #FFFFFF;
    --border-color: #E2E8F0;
    --border-light: #F1F5F9;

    /* Sidebar */
    --sidebar-bg: #0F172A;
    --sidebar-width: 240px;
    --sidebar-hover: rgba(255,255,255,0.06);
    --sidebar-active: rgba(59,130,246,0.15);
    --sidebar-text: #94A3B8;
    --sidebar-text-active: #FFFFFF;

    /* Primary */
    --primary: #3B82F6;
    --primary-hover: #2563EB;
    --primary-light: #EFF6FF;
    --primary-dark: #1D4ED8;

    /* Text */
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;
    --text-white: #FFFFFF;

    /* Status */
    --success: #10B981;
    --success-light: #ECFDF5;
    --warning: #F59E0B;
    --warning-light: #FFFBEB;
    --danger: #EF4444;
    --danger-light: #FEF2F2;
    --info: #3B82F6;
    --info-light: #EFF6FF;

    /* Agent Colors */
    --agent-leader: #8B5CF6;
    --agent-copywriter: #3B82F6;
    --agent-designer: #EC4899;
    --agent-video: #F59E0B;
    --agent-social: #10B981;
    --agent-traffic: #EF4444;

    /* Spacing */
    --header-height: 64px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

/* ----------------------------------------------------------------
   3. RESET & BASE
   ---------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

code, pre, .font-mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}

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

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

/* ----------------------------------------------------------------
   4. TYPOGRAPHY
   ---------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}
h1, .h1 { font-size: 1.75rem; }
h2, .h2 { font-size: 1.5rem; }
h3, .h3 { font-size: 1.25rem; }
h4, .h4 { font-size: 1.1rem; }
h5, .h5 { font-size: 1rem; }
h6, .h6 { font-size: 0.875rem; }

.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-primary-color { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-xs { font-size: 0.75rem; }
.fs-sm { font-size: 0.8125rem; }
.fs-md { font-size: 0.875rem; }
.fs-lg { font-size: 1rem; }
.fs-xl { font-size: 1.125rem; }

/* ----------------------------------------------------------------
   5. LAYOUT — SIDEBAR + MAIN
   ---------------------------------------------------------------- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-slow);
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-brand-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-white);
    letter-spacing: -0.02em;
}

.sidebar-brand-text span {
    color: var(--primary);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.sidebar-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 16px 12px 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-md);
    color: var(--sidebar-text);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    text-decoration: none;
    margin-bottom: 2px;
}

.sidebar-link i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    opacity: 0.7;
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: var(--text-white);
}
.sidebar-link:hover i { opacity: 1; }

.sidebar-link.active {
    background: var(--sidebar-active);
    color: var(--text-white);
}
.sidebar-link.active i {
    opacity: 1;
    color: var(--primary);
}

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

/* Header */
.app-header {
    height: var(--header-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.app-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.app-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-content {
    flex: 1;
    padding: 24px;
}

/* ----------------------------------------------------------------
   6. PROJECT SWITCHER (Header Dropdown)
   ---------------------------------------------------------------- */
.project-switcher {
    position: relative;
}

.project-switcher-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-body);
}

.project-switcher-btn:hover {
    border-color: var(--primary);
    cursor: pointer;
}

.project-switcher-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-switcher-chevron {
    color: var(--text-muted);
    font-size: 0.75rem;
    transition: transform var(--transition-fast);
}

.project-switcher.open .project-switcher-chevron {
    transform: rotate(180deg);
}

/* ----------------------------------------------------------------
   7. CARDS
   ---------------------------------------------------------------- */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-body {
    padding: 20px;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    background: transparent;
    font-weight: 600;
}

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
    background: transparent;
}

/* Stat card */
.stat-card {
    padding: 20px;
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
}

.stat-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.stat-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-card-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ----------------------------------------------------------------
   8. BUTTONS
   ---------------------------------------------------------------- */
.btn {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-white);
}
.btn-primary:hover { background: var(--primary-hover); color: var(--text-white); }

.btn-secondary {
    background: var(--bg-body);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover { background: var(--border-light); border-color: var(--text-muted); }

.btn-success { background: var(--success); color: var(--text-white); }
.btn-success:hover { background: #059669; color: var(--text-white); }

.btn-danger { background: var(--danger); color: var(--text-white); }
.btn-danger:hover { background: #DC2626; color: var(--text-white); }

.btn-warning { background: var(--warning); color: var(--text-primary); }
.btn-warning:hover { background: #D97706; }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 6px 10px;
}
.btn-ghost:hover { background: var(--bg-body); color: var(--text-primary); }

.btn-sm { font-size: 0.8125rem; padding: 5px 10px; }
.btn-lg { font-size: 1rem; padding: 12px 24px; }
.btn-block { width: 100%; justify-content: center; }

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: var(--radius-md);
}

.btn:disabled, .btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ----------------------------------------------------------------
   9. FORMS & INPUTS
   ---------------------------------------------------------------- */
.form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-control, .form-select {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.875rem;
    padding: 9px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
    background: var(--bg-surface);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control.is-invalid {
    border-color: var(--danger);
}
.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239,68,68,0.12);
}

.invalid-feedback {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 4px;
}

/* ----------------------------------------------------------------
   10. BADGES & PILLS
   ---------------------------------------------------------------- */
.badge {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1.4;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-muted { background: var(--bg-body); color: var(--text-muted); }

/* Status badges */
.badge-status { padding: 4px 10px; font-size: 0.75rem; }
.badge-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* ----------------------------------------------------------------
   11. AGENT AVATARS
   ---------------------------------------------------------------- */
.agent-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
}

.agent-avatar-sm { width: 32px; height: 32px; font-size: 0.9rem; }
.agent-avatar-lg { width: 56px; height: 56px; font-size: 1.4rem; }

.agent-avatar.leader { background: linear-gradient(135deg, #8B5CF6, #7C3AED); }
.agent-avatar.copywriter { background: linear-gradient(135deg, #3B82F6, #2563EB); }
.agent-avatar.designer { background: linear-gradient(135deg, #EC4899, #DB2777); }
.agent-avatar.video { background: linear-gradient(135deg, #F59E0B, #D97706); }
.agent-avatar.social { background: linear-gradient(135deg, #10B981, #059669); }
.agent-avatar.traffic { background: linear-gradient(135deg, #EF4444, #DC2626); }

/* Agent color utilities */
.text-agent-leader { color: var(--agent-leader); }
.text-agent-copywriter { color: var(--agent-copywriter); }
.text-agent-designer { color: var(--agent-designer); }
.text-agent-video { color: var(--agent-video); }
.text-agent-social { color: var(--agent-social); }
.text-agent-traffic { color: var(--agent-traffic); }

.bg-agent-leader-light { background: rgba(139,92,246,0.1); }
.bg-agent-copywriter-light { background: rgba(59,130,246,0.1); }
.bg-agent-designer-light { background: rgba(236,72,153,0.1); }
.bg-agent-video-light { background: rgba(245,158,11,0.1); }
.bg-agent-social-light { background: rgba(16,185,129,0.1); }
.bg-agent-traffic-light { background: rgba(239,68,68,0.1); }

/* ----------------------------------------------------------------
   12. TABLES
   ---------------------------------------------------------------- */
.table-clean {
    width: 100%;
    border-collapse: collapse;
}

.table-clean th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.table-clean td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
    vertical-align: middle;
}

.table-clean tr:last-child td {
    border-bottom: none;
}

.table-clean tr:hover td {
    background: var(--bg-body);
}

/* ----------------------------------------------------------------
   13. ALERTS
   ---------------------------------------------------------------- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.alert i { margin-top: 2px; flex-shrink: 0; }

.alert-success { background: var(--success-light); color: #065F46; border-color: #A7F3D0; }
.alert-danger { background: var(--danger-light); color: #991B1B; border-color: #FECACA; }
.alert-warning { background: var(--warning-light); color: #92400E; border-color: #FDE68A; }
.alert-info { background: var(--info-light); color: #1E40AF; border-color: #BFDBFE; }

.alert-dismissible { padding-right: 40px; position: relative; }
.alert-dismiss-btn {
    position: absolute;
    right: 12px;
    top: 12px;
    background: none;
    border: none;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
}
.alert-dismiss-btn:hover { opacity: 1; }

/* ----------------------------------------------------------------
   14. DROPDOWN (Generic)
   ---------------------------------------------------------------- */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 200px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 1050;
    display: none;
}

.dropdown-menu.show { display: block; }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: background var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
}
.dropdown-item:hover { background: var(--bg-body); }
.dropdown-item.active { background: var(--primary-light); color: var(--primary); }

.dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 0;
}

/* ----------------------------------------------------------------
   15. NOTIFICATIONS DROPDOWN
   ---------------------------------------------------------------- */
.notification-bell {
    position: relative;
    cursor: pointer;
}

.notification-bell .badge-count {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-surface);
}

.notification-dropdown {
    width: 360px;
    max-height: 420px;
    overflow-y: auto;
    padding: 0;
}

.notification-dropdown-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
    cursor: pointer;
}
.notification-item:hover { background: var(--bg-body); }
.notification-item.unread { background: var(--primary-light); }
.notification-item.unread:hover { background: #DBEAFE; }

.notification-item-text {
    font-size: 0.8125rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.notification-item-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ----------------------------------------------------------------
   16. PIPELINE VISUAL
   ---------------------------------------------------------------- */
.pipeline-flow {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    padding: 8px 0;
}

.pipeline-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    min-width: 100px;
    text-align: center;
}

.pipeline-node-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.pipeline-node.active .pipeline-node-label { color: var(--primary); }
.pipeline-node.completed .agent-avatar { opacity: 0.6; }
.pipeline-node.completed .pipeline-node-label { color: var(--success); }

.pipeline-arrow {
    width: 32px;
    height: 2px;
    background: var(--border-color);
    position: relative;
    flex-shrink: 0;
}

.pipeline-arrow::after {
    content: '';
    position: absolute;
    right: 0;
    top: -4px;
    border: 5px solid transparent;
    border-left-color: var(--border-color);
}

.pipeline-arrow.completed { background: var(--success); }
.pipeline-arrow.completed::after { border-left-color: var(--success); }

/* ----------------------------------------------------------------
   17. CHAT (WhatsApp-style)
   ---------------------------------------------------------------- */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height) - 48px);
    background: var(--bg-body);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.875rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-bubble.user {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-bubble.assistant {
    background: var(--bg-surface);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
}

.chat-bubble-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.chat-bubble.user .chat-bubble-time { color: rgba(255,255,255,0.7); }

/* Idea card inside chat */
.chat-idea-card {
    background: var(--bg-surface);
    border: 2px solid var(--primary-light);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-top: 8px;
}

.chat-idea-card-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.chat-input-area {
    padding: 16px 20px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    font-size: 0.875rem;
    resize: none;
    outline: none;
    font-family: 'Plus Jakarta Sans', sans-serif;
}
.chat-input:focus { border-color: var(--primary); }

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: background var(--transition-fast);
    flex-shrink: 0;
}
.chat-send-btn:hover { background: var(--primary-hover); }
.chat-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ----------------------------------------------------------------
   18. AUTH LAYOUT
   ---------------------------------------------------------------- */
.auth-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sidebar-bg);
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.auth-card-logo {
    text-align: center;
    margin-bottom: 28px;
}

.auth-card-logo h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.auth-card-logo h2 span {
    color: var(--primary);
}

.auth-card-logo p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 4px;
}

/* ----------------------------------------------------------------
   19. ONBOARDING LAYOUT
   ---------------------------------------------------------------- */
.onboarding-layout {
    min-height: 100vh;
    background: var(--bg-body);
    display: flex;
    flex-direction: column;
}

.onboarding-header {
    height: var(--header-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
}

.onboarding-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.onboarding-step-dot {
    width: 32px;
    height: 4px;
    border-radius: 2px;
    background: var(--border-color);
    transition: background var(--transition-base);
}

.onboarding-step-dot.active { background: var(--primary); }
.onboarding-step-dot.completed { background: var(--success); }

.onboarding-body {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
}

.onboarding-card {
    width: 100%;
    max-width: 680px;
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    padding: 40px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.onboarding-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.onboarding-card-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 32px;
}

/* ----------------------------------------------------------------
   20. CALENDAR MINI
   ---------------------------------------------------------------- */
.calendar-mini {
    width: 100%;
}

.calendar-mini-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.calendar-mini-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-mini-day-label {
    text-align: center;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    padding: 4px 0;
}

.calendar-mini-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background var(--transition-fast);
    position: relative;
}

.calendar-mini-cell:hover { background: var(--bg-body); }
.calendar-mini-cell.today {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
}
.calendar-mini-cell.has-tasks::after {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary);
    position: absolute;
    bottom: 3px;
}
.calendar-mini-cell.other-month { color: var(--text-muted); opacity: 0.4; }

/* ----------------------------------------------------------------
   21. LOADING & SPINNERS
   ---------------------------------------------------------------- */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
.spinner-sm { width: 14px; height: 14px; }
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

/* ----------------------------------------------------------------
   22. EMPTY STATES
   ---------------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.empty-state-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    max-width: 360px;
    margin: 0 auto 16px;
}

/* ----------------------------------------------------------------
   23. UTILITIES
   ---------------------------------------------------------------- */
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 24px; }

.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-md { border-radius: var(--radius-md) !important; }

.border-0 { border: none !important; }
.shadow-none { box-shadow: none !important; }

.bg-body { background: var(--bg-body) !important; }
.bg-surface { background: var(--bg-surface) !important; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cursor-pointer { cursor: pointer; }

/* Scrollbar clean */
::-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(--text-muted); }

/* ----------------------------------------------------------------
   24. RESPONSIVE (Mobile sidebar)
   ---------------------------------------------------------------- */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1039;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .sidebar-backdrop.show {
        display: block;
    }
    .sidebar-toggle {
        display: block;
    }
    .main-content {
        margin-left: 0;
    }
    .chat-bubble {
        max-width: 85%;
    }
}

@media (max-width: 575.98px) {
    .page-content { padding: 16px; }
    .auth-card { padding: 28px 20px; }
    .onboarding-card { padding: 28px 20px; }
    .notification-dropdown { width: 300px; }
}
