/* ============================================================
   VoFact — App Design System v4
   Palette: Indigo #6366f1 → Cyan #06b6d4 (landing harmony)
   ============================================================ */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #eef2ff;
    --primary-glow: rgba(99,102,241,0.12);
    --accent: #06b6d4;
    --accent-light: #ecfeff;
    --gradient: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
    --gradient-subtle: linear-gradient(135deg, rgba(99,102,241,0.06) 0%, rgba(6,182,212,0.06) 100%);
    --bg: #f8faff;
    --bg-mesh: radial-gradient(at 20% 0%, rgba(99,102,241,0.04) 0%, transparent 50%),
               radial-gradient(at 80% 100%, rgba(6,182,212,0.04) 0%, transparent 50%);
    --surface: #ffffff;
    --surface-hover: #fafbff;
    --border: #e8ecf4;
    --border-light: #f1f5f9;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --pending: #f59e0b;
    --pending-bg: #fffbeb;
    --overdue: #ef4444;
    --overdue-bg: #fef2f2;
    --paid: #10b981;
    --paid-bg: #ecfdf5;
    --danger: #ef4444;
    --radius: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.03);
    --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
    --shadow-glow: 0 0 24px rgba(99,102,241,0.12);
    --sidebar-w: 240px;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg); background-image: var(--bg-mesh);
    color: var(--text); min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ===== AUTH (kept minimal — styled in app.html) ===== */
.auth-page { display: flex; min-height: 100vh; }
.auth-left {
    flex: 1; background: var(--gradient);
    color: white; padding: 60px; display: flex; flex-direction: column; justify-content: center;
    position: relative; overflow: hidden;
}
.auth-left::before {
    content: ''; position: absolute; top: -40%; right: -30%; width: 80%; height: 80%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
}
.auth-brand { display: flex; align-items: center; gap: 12px; font-size: 24px; font-weight: 800; margin-bottom: 48px; position: relative; }
.auth-brand i { font-size: 32px; background: rgba(255,255,255,0.15); padding: 10px; border-radius: 14px; }
.auth-left h1 { font-size: 42px; line-height: 1.15; margin-bottom: 20px; font-weight: 800; position: relative; }
.auth-left > p { font-size: 17px; opacity: 0.85; max-width: 400px; line-height: 1.7; position: relative; }
.auth-features { display: flex; gap: 20px; margin-top: 48px; position: relative; }
.feature { display: flex; align-items: center; gap: 8px; font-size: 14px; opacity: 0.9; background: rgba(255,255,255,0.1); padding: 10px 16px; border-radius: 12px; }
.feature i { font-size: 20px; }
.auth-right { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--bg); }
.auth-form { width: 100%; max-width: 400px; }
.auth-form h2 { font-size: 28px; margin-bottom: 6px; font-weight: 700; }
.auth-subtitle { color: var(--text-muted); margin-bottom: 28px; font-size: 15px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-secondary); }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 10px;
    font-size: 14px; font-family: inherit; transition: all var(--transition); background: var(--surface);
    color: var(--text);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.code-input { text-align: center; font-size: 28px; letter-spacing: 8px; font-weight: 700; }

/* ===== BUTTONS ===== */
.btn-primary {
    width: 100%; padding: 14px; background: var(--gradient); color: white; border: none;
    border-radius: 12px; font-size: 15px; font-weight: 600; cursor: pointer;
    transition: all var(--transition); position: relative; overflow: hidden;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(99,102,241,0.35); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
    padding: 10px 18px; background: var(--surface); color: var(--primary); border: 1.5px solid var(--border);
    border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all var(--transition);
    display: inline-flex; align-items: center; gap: 6px;
}
.btn-secondary:hover { border-color: var(--primary); background: var(--primary-light); box-shadow: var(--shadow); }
.auth-link { text-align: center; margin-top: 18px; color: var(--text-muted); font-size: 14px; }
.auth-link span { color: var(--primary); cursor: pointer; font-weight: 600; transition: color var(--transition); }
.auth-link span:hover { color: var(--primary-dark); }

/* ===== APP LAYOUT ===== */
#app { display: flex; height: 100vh; overflow: hidden; }

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-w); background: var(--surface);
    border-right: 1px solid var(--border-light);
    display: flex; flex-direction: column; padding: 24px 14px; flex-shrink: 0;
    position: relative;
}
.sidebar::after {
    content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 1px;
    background: linear-gradient(180deg, rgba(99,102,241,0.08) 0%, rgba(6,182,212,0.08) 100%);
}
.sidebar-brand {
    display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800;
    padding: 0 10px 28px; position: relative;
}
.sidebar-brand span {
    background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.sidebar-brand i { font-size: 26px; color: var(--primary); }
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
    display: flex; align-items: center; gap: 11px; padding: 11px 14px; border: none;
    background: transparent; border-radius: 12px; font-size: 13.5px; font-weight: 500;
    color: var(--text-secondary); cursor: pointer; transition: all var(--transition); text-align: left; width: 100%;
    position: relative;
}
.nav-item:hover { background: var(--gradient-subtle); color: var(--text); }
.nav-item.active {
    background: var(--gradient-subtle); color: var(--primary); font-weight: 600;
}
.nav-item.active::before {
    content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 20px; border-radius: 0 3px 3px 0;
    background: var(--gradient);
}
.nav-item i { font-size: 19px; width: 22px; text-align: center; }
.nav-badge { background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px; margin-left: auto; }
.sidebar-footer {
    padding-top: 16px; border-top: 1px solid var(--border-light);
    display: flex; align-items: center; justify-content: space-between;
}
.user-info { display: flex; align-items: center; gap: 10px; overflow: hidden; }
.user-avatar {
    width: 34px; height: 34px; border-radius: 10px; background: var(--gradient);
    color: white; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.user-info span { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-logout {
    width: 34px; height: 34px; border: none; background: transparent; border-radius: 10px;
    cursor: pointer; font-size: 18px; color: var(--text-muted); display: flex; align-items: center;
    justify-content: center; transition: all var(--transition); flex-shrink: 0;
}
.btn-logout:hover { background: var(--overdue-bg); color: var(--overdue); }

/* ===== MOBILE NAV ===== */
.mobile-nav {
    display: none; position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(255,255,255,0.96); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-light); padding: 6px 4px calc(env(safe-area-inset-bottom, 4px) + 4px); z-index: 200;
    justify-content: space-around; align-items: center;
}
.mobile-nav-item {
    border: none; background: none; padding: 6px 10px; font-size: 22px;
    color: var(--text-muted); cursor: pointer; border-radius: 12px; transition: all var(--transition);
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    -webkit-tap-highlight-color: transparent;
}
.mobile-nav-item span { font-size: 10px; font-weight: 600; line-height: 1; }
.mobile-nav-item.active { color: var(--primary); background: var(--primary-light); }
.mobile-nav-item.logout-mobile { color: var(--overdue); }
.mobile-nav-item.logout-mobile:hover { background: var(--overdue-bg); }

/* ===== MAIN CONTENT ===== */
.main-content { flex: 1; overflow: hidden; display: flex; flex-direction: column; background: var(--bg); background-image: var(--bg-mesh); }
.page { display: none; flex: 1; overflow: hidden; flex-direction: column; }
.page.active { display: flex; }
.page-header {
    padding: 24px 32px 18px; display: flex; align-items: center; justify-content: space-between;
    background: rgba(255,255,255,0.7); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light); flex-shrink: 0;
}
.page-header h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.page-body { flex: 1; overflow-y: auto; padding: 24px 32px; }
.btn-icon {
    width: 38px; height: 38px; border: 1.5px solid var(--border); background: var(--surface);
    border-radius: 10px; cursor: pointer; font-size: 18px; color: var(--text-muted);
    display: flex; align-items: center; justify-content: center; transition: all var(--transition);
}
.btn-icon:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* ===== CHAT ===== */
.chat-container { display: flex; flex-direction: column; height: 100%; }
.chat-header {
    padding: 16px 28px; background: rgba(255,255,255,0.8); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.chat-header-left { display: flex; align-items: center; gap: 14px; }
.ai-avatar {
    width: 44px; height: 44px; border-radius: 14px;
    background: var(--gradient);
    color: white; display: flex; align-items: center; justify-content: center; font-size: 22px;
    box-shadow: 0 4px 12px rgba(99,102,241,0.25);
}
.chat-header h2 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.status-badge { font-size: 11px; padding: 3px 10px; border-radius: 20px; font-weight: 600; }
.status-badge.online { background: var(--paid-bg); color: var(--paid); }

.chat-messages {
    flex: 1; overflow-y: auto; padding: 28px; display: flex; flex-direction: column; gap: 18px;
    background: var(--bg); background-image: var(--bg-mesh);
}
.message { display: flex; gap: 12px; max-width: 75%; animation: msgSlide 0.3s ease-out; }
@keyframes msgSlide { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.message.user { margin-left: auto; flex-direction: row-reverse; }
.msg-avatar {
    width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center;
    justify-content: center; font-size: 16px; flex-shrink: 0;
}
.message.assistant .msg-avatar { background: var(--gradient); color: white; box-shadow: 0 2px 8px rgba(99,102,241,0.2); }
.message.user .msg-avatar { background: var(--surface); color: var(--primary); border: 1.5px solid var(--border); }
.msg-bubble { padding: 14px 18px; border-radius: 18px; font-size: 14px; line-height: 1.7; }
.message.assistant .msg-bubble {
    background: var(--surface); border: 1px solid var(--border-light); border-top-left-radius: 4px;
    box-shadow: var(--shadow-xs);
}
.message.user .msg-bubble {
    background: var(--gradient); color: white; border-top-right-radius: 4px;
    box-shadow: 0 2px 12px rgba(99,102,241,0.2);
}
.msg-bubble ul { margin: 8px 0; padding-left: 18px; }
.msg-bubble li { margin-bottom: 4px; }
.msg-bubble p { margin-bottom: 6px; }
.msg-bubble p:last-child { margin-bottom: 0; }

.typing-dots { display: flex; gap: 5px; padding: 6px 0; }
.typing-dots span { width: 7px; height: 7px; background: var(--primary); border-radius: 50%; opacity: 0.5; animation: pulse 1.4s infinite; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse { 0%,60%,100% { transform: scale(1); opacity: 0.4; } 30% { transform: scale(1.3); opacity: 1; } }

.chat-footer {
    padding: 16px 28px 24px; border-top: 1px solid var(--border-light);
    background: rgba(255,255,255,0.8); backdrop-filter: blur(12px); flex-shrink: 0;
}
.quick-actions { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.quick-actions button {
    padding: 8px 16px; border: 1.5px solid var(--border); border-radius: 24px; background: var(--surface);
    font-size: 13px; font-weight: 500; color: var(--text-secondary); cursor: pointer; transition: all var(--transition);
}
.quick-actions button:hover {
    border-color: var(--primary); color: var(--primary); background: var(--primary-light);
    box-shadow: 0 2px 8px rgba(99,102,241,0.1);
}
.chat-input { display: flex; gap: 10px; }
.chat-input input {
    flex: 1; padding: 14px 20px; border: 2px solid var(--border); border-radius: 16px;
    font-size: 14px; font-family: inherit; transition: all var(--transition);
    background: var(--surface);
}
.chat-input input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-glow); }
.chat-input button {
    width: 50px; height: 50px; border: none; background: var(--gradient); color: white;
    border-radius: 16px; cursor: pointer; font-size: 20px; display: flex; align-items: center;
    justify-content: center; transition: all var(--transition);
    box-shadow: 0 2px 12px rgba(99,102,241,0.25);
}
.chat-input button:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(99,102,241,0.35); }

/* ===== DASHBOARD ===== */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card {
    background: var(--surface); border-radius: var(--radius-lg); padding: 24px;
    display: flex; align-items: center; gap: 16px; border: 1px solid var(--border-light);
    transition: all var(--transition); position: relative; overflow: hidden;
}
.stat-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--border-light); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transition: background var(--transition);
}
.stat-card.pending::before { background: var(--pending); }
.stat-card.overdue::before { background: var(--overdue); }
.stat-card.paid::before { background: var(--paid); }
.stat-card.quote::before { background: var(--gradient); }
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card.clickable { cursor: pointer; }
.stat-icon {
    width: 50px; height: 50px; border-radius: 14px; display: flex; align-items: center;
    justify-content: center; font-size: 24px;
}
.stat-card.pending .stat-icon { background: var(--pending-bg); color: var(--pending); }
.stat-card.overdue .stat-icon { background: var(--overdue-bg); color: var(--overdue); }
.stat-card.paid .stat-icon { background: var(--paid-bg); color: var(--paid); }
.stat-card.quote .stat-icon { background: var(--primary-light); color: var(--primary); }
.stat-info { display: flex; flex-direction: column; }
.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; }
.stat-amount { font-size: 24px; font-weight: 800; margin: 3px 0; letter-spacing: -0.02em; }
.stat-count { font-size: 12px; color: var(--text-muted); }

/* ===== FILTERS ===== */
.filters-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 16px; flex-wrap: wrap; }
.filter-tabs { display: flex; gap: 6px; }
.filter {
    padding: 8px 16px; border: 1.5px solid var(--border); border-radius: 24px; background: var(--surface);
    font-size: 13px; font-weight: 500; color: var(--text-secondary); cursor: pointer; transition: all var(--transition);
}
.filter:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.filter.active { background: var(--gradient); color: white; border-color: transparent; box-shadow: 0 2px 8px rgba(99,102,241,0.2); }
.search-box {
    display: flex; align-items: center; gap: 8px; padding: 9px 16px; border: 1.5px solid var(--border);
    border-radius: 12px; background: var(--surface); min-width: 240px; transition: all var(--transition);
}
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.search-box i { color: var(--text-muted); font-size: 16px; }
.search-box input { border: none; outline: none; font-size: 13px; font-family: inherit; flex: 1; background: transparent; color: var(--text); }

/* ===== INVOICE / QUOTE LIST ===== */
.invoices-list { display: flex; flex-direction: column; gap: 8px; }
.invoice-row {
    background: var(--surface); border-radius: var(--radius); padding: 16px 20px;
    display: grid; grid-template-columns: 6px 1fr 1.2fr auto auto auto;
    align-items: center; gap: 16px; border: 1px solid var(--border-light); transition: all var(--transition); cursor: pointer;
}
.invoice-row:hover { box-shadow: var(--shadow-md); border-color: rgba(99,102,241,0.15); transform: translateY(-1px); }
.inv-status-dot { width: 6px; height: 40px; border-radius: 3px; }
.inv-status-dot.pending { background: var(--pending); }
.inv-status-dot.overdue { background: var(--overdue); }
.inv-status-dot.paid { background: var(--paid); }
.inv-status-dot.sent { background: var(--primary); }
.inv-status-dot.locked { background: #d97706; }
.inv-main .inv-number { font-weight: 700; font-size: 14px; letter-spacing: -0.01em; }
.inv-main .inv-client { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.siret-warn { cursor: pointer; font-size: 12px; margin-left: 4px; opacity: 0.8; transition: opacity 0.2s; vertical-align: middle; }
.siret-warn:hover { opacity: 1; }
.inv-desc { font-size: 13px; color: var(--text-muted); }
.inv-amount { font-weight: 800; font-size: 15px; text-align: right; letter-spacing: -0.01em; }
.inv-due { font-size: 12px; color: var(--text-muted); text-align: right; }
.inv-badge {
    padding: 5px 12px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap;
}
.inv-badge.pending { background: var(--pending-bg); color: var(--pending); }
.inv-badge.overdue { background: var(--overdue-bg); color: var(--overdue); }
.inv-badge.paid { background: var(--paid-bg); color: var(--paid); }
.inv-badge.sent { background: #ede9fe; color: #7c3aed; }
.inv-badge.locked { background: #fef3c7; color: #d97706; }
.inv-actions { display: flex; gap: 4px; }
.inv-btn {
    width: 32px; height: 32px; border: 1px solid var(--border); background: var(--surface);
    border-radius: 8px; cursor: pointer; font-size: 15px; color: var(--text-muted);
    display: flex; align-items: center; justify-content: center; transition: all var(--transition);
}
.inv-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.inv-btn.pay:hover { border-color: var(--paid); color: var(--paid); background: var(--paid-bg); }

/* ===== CLIENTS ===== */
.clients-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.client-card {
    background: var(--surface); border-radius: var(--radius-lg); padding: 20px;
    border: 1px solid var(--border-light); transition: all var(--transition);
    display: flex; align-items: center; gap: 14px;
}
.client-card:hover { box-shadow: var(--shadow-md); border-color: rgba(99,102,241,0.12); transform: translateY(-1px); }
.client-avatar {
    width: 46px; height: 46px; border-radius: 14px;
    background: var(--gradient);
    color: white; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 16px; flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(99,102,241,0.2);
}
.client-info { flex: 1; min-width: 0; }
.client-name { font-weight: 700; font-size: 14px; }
.client-email { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
.client-badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.client-badge.ok { background: var(--paid-bg); color: var(--paid); }
.client-badge.late { background: var(--overdue-bg); color: var(--overdue); }
.client-actions { display: flex; gap: 4px; flex-shrink: 0; }
.client-actions .inv-btn:last-child:hover { border-color: var(--overdue); color: var(--overdue); background: var(--overdue-bg); }

/* ===== SETTINGS ===== */
.settings-card {
    background: var(--surface); border-radius: var(--radius-lg); padding: 28px;
    border: 1px solid var(--border-light); max-width: 700px;
    box-shadow: var(--shadow-xs);
}
.settings-card h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.settings-card h3 i { color: var(--primary); }
.settings-hint { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; overflow: visible; }
.settings-grid .full { grid-column: 1 / -1; }
/* Smart search dropdown — autonomous component */
.search-dropdown {
    display: none;
    position: fixed;
    z-index: 9999;
    background: #fff;
    border: 1px solid var(--primary);
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 320px;
    overflow-y: auto;
    box-shadow: 0 12px 32px rgba(0,0,0,0.18);
}
.search-dropdown .search-item {
    display: block;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}
.search-dropdown .search-item:last-child { border-bottom: none; }
.search-dropdown .search-item:hover { background: var(--bg); }
.search-dropdown .search-item-name {
    font-weight: 600; font-size: 14px; line-height: 1.4;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 100%; display: block; color: var(--text);
}
.search-dropdown .search-item-meta {
    font-size: 12px; color: var(--text-muted); line-height: 1.4;
    margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 100%; display: block;
}
.search-dropdown .search-item-manual {
    padding: 12px 16px; cursor: pointer; color: var(--primary);
    font-weight: 600; font-size: 13px; border-top: 2px solid var(--border);
}
.search-dropdown .search-item-manual:hover { background: var(--bg); }
.search-autofill-warning {
    margin-top: 8px; padding: 10px 14px; font-size: 12px; color: #6b7280;
    background: #f9fafb; border-radius: 8px; border: 1px solid var(--border);
    line-height: 1.5;
}
.profile-legal-notice {
    margin-top: 12px; font-size: 11px; color: var(--text-muted);
    line-height: 1.6; max-width: 600px;
}
.settings-card .btn-primary { width: auto; padding: 12px 32px; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 80px 20px; color: var(--text-muted); }
.empty-state i { font-size: 52px; margin-bottom: 16px; opacity: 0.2; display: block; }
.empty-state p { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-state span { font-size: 13px; color: var(--text-muted); }

/* ===== TOAST ===== */
.toast {
    position: fixed; top: 24px; right: 24px; padding: 14px 22px; border-radius: 14px;
    font-size: 13px; font-weight: 600; color: white; animation: toastIn 0.35s ease-out;
    z-index: 10000; box-shadow: 0 8px 32px rgba(0,0,0,0.15); transition: opacity 0.3s ease;
    max-width: 380px; word-break: break-word; backdrop-filter: blur(8px);
}
@keyframes toastIn { from { transform: translateX(100%) scale(0.9); opacity: 0; } to { transform: translateX(0) scale(1); opacity: 1; } }
.toast.success { background: linear-gradient(135deg, #10b981, #059669); }
.toast.error { background: linear-gradient(135deg, #ef4444, #dc2626); }
.toast.info { background: var(--gradient); }

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    z-index: 1000; display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.2s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
    background: var(--surface); border-radius: var(--radius-xl);
    width: 90%; max-width: 700px; max-height: 90vh;
    display: flex; flex-direction: column;
    box-shadow: 0 24px 80px rgba(0,0,0,0.12);
    animation: modalIn 0.3s ease-out;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(24px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header {
    padding: 22px 28px; border-bottom: 1px solid var(--border-light);
    display: flex; align-items: center; justify-content: space-between;
}
.modal-header h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.modal-close {
    width: 36px; height: 36px; border: none; background: var(--bg);
    border-radius: 10px; cursor: pointer; font-size: 20px; color: var(--text-muted);
    display: flex; align-items: center; justify-content: center; transition: all var(--transition);
}
.modal-close:hover { background: var(--overdue-bg); color: var(--overdue); }
.modal-body { padding: 28px; overflow-y: auto; flex: 1; }
.modal-footer {
    padding: 18px 28px; border-top: 1px solid var(--border-light);
    display: flex; flex-direction: column; gap: 12px;
}
.modal-email-section { display: flex; gap: 8px; align-items: end; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* Document detail */
.doc-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.doc-detail-label {
    font-size: 10px; text-transform: uppercase; color: var(--text-muted);
    font-weight: 600; letter-spacing: 0.6px; margin-bottom: 4px;
}
.doc-detail-value { font-size: 14px; font-weight: 500; }
.doc-detail-items {
    border: 1px solid var(--border-light); border-radius: 12px; overflow: hidden; margin-bottom: 16px;
}
.doc-detail-items table { width: 100%; border-collapse: collapse; }
.doc-detail-items th {
    background: var(--bg); padding: 10px 14px; text-align: left;
    font-size: 11px; text-transform: uppercase; color: var(--text-muted); font-weight: 600; letter-spacing: 0.3px;
}
.doc-detail-items td { padding: 12px 14px; border-top: 1px solid var(--border-light); font-size: 13px; }
.doc-totals { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin-bottom: 16px; }
.doc-total-row { display: flex; gap: 24px; font-size: 14px; }
.doc-total-row.grand {
    font-size: 18px; font-weight: 800; padding-top: 10px; margin-top: 4px;
    border-top: 2px solid transparent;
    border-image: var(--gradient) 1;
    background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.doc-notes { background: var(--bg); padding: 14px 18px; border-radius: 12px; font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .invoice-row { grid-template-columns: 6px 1fr auto auto; }
    .inv-desc { display: none; }
}
@media (max-width: 768px) {
    /* Reset — empêcher le scroll horizontal */
    html, body { overflow-x: hidden; width: 100%; }
    .app-container { flex-direction: column; }
    .auth-page { flex-direction: column; }
    .auth-left { padding: 32px 20px; min-height: auto; }
    .auth-left h1 { font-size: 24px; }
    .auth-features { flex-wrap: wrap; gap: 8px; }
    .auth-right { padding: 20px; }
    .auth-form { padding: 24px 20px; max-width: 100%; }
    /* Sidebar cachée, nav mobile visible */
    .sidebar { display: none !important; }
    .mobile-nav { display: flex !important; }
    .main-content { padding-bottom: 76px; margin-left: 0 !important; width: 100%; max-width: 100vw; overflow-x: hidden; }
    /* Pages */
    .page { width: 100%; max-width: 100vw; overflow-x: hidden; }
    .page-header { padding: 14px 16px 10px; }
    .page-header h1 { font-size: 18px; gap: 8px; }
    .page-header h1 i { font-size: 20px; }
    .page-body { padding: 10px 14px; }
    /* Stats grid — 2 colonnes compactes */
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-card .stat-value { font-size: 20px; }
    .stat-card .stat-label { font-size: 11px; }
    /* Chat — style iMessage/WhatsApp natif */
    .chat-messages { padding: 10px 12px; gap: 10px; }
    .chat-footer { padding: 8px 12px calc(env(safe-area-inset-bottom, 0px) + 8px); background: rgba(255,255,255,0.96); }
    .chat-header { padding: 10px 14px; }
    .chat-header h2 { font-size: 15px; }
    .ai-avatar { width: 36px; height: 36px; border-radius: 12px; }
    .chat-input { font-size: 16px; padding: 12px 16px; border-radius: 22px; } /* 16px empêche zoom iOS */
    .message { max-width: 85%; gap: 8px; }
    .msg-avatar { width: 28px; height: 28px; border-radius: 8px; font-size: 13px; }
    .msg-bubble { padding: 10px 14px; border-radius: 18px; font-size: 14px; line-height: 1.55; }
    .message.user .msg-bubble { border-radius: 18px 18px 4px 18px; }
    .message.assistant .msg-bubble { border-radius: 18px 18px 18px 4px; }
    /* Filtres et recherche */
    .filters-bar { flex-direction: column; align-items: stretch; gap: 8px; padding: 0; }
    .search-box { min-width: auto; width: 100%; }
    .filter-btn { padding: 8px 14px; font-size: 12px; }
    /* Clients */
    .clients-list { grid-template-columns: 1fr; gap: 8px; }
    .client-card { padding: 12px 14px; }
    /* Factures */
    .invoice-row { grid-template-columns: 6px 1fr auto; gap: 8px; padding: 12px 14px; }
    .inv-main .inv-number { font-size: 13px; }
    .inv-main .inv-client { font-size: 12px; }
    .inv-desc { display: none; }
    .inv-badge { font-size: 10px; padding: 3px 8px; }
    .inv-amount { font-size: 14px; }
    /* Settings */
    .settings-grid { grid-template-columns: 1fr; gap: 12px; }
    .settings-card { padding: 16px; }
    .settings-card h3 { font-size: 14px; }
    /* Modals */
    .modal-content { width: 96%; max-height: 96vh; border-radius: 16px; margin: 8px; }
    .modal-header { padding: 16px; }
    .modal-body { padding: 16px; }
    .doc-detail-grid { grid-template-columns: 1fr; }
    .modal-email-section { flex-direction: column; }
    /* Boutons */
    .btn-primary, .btn-secondary { padding: 12px 20px; font-size: 14px; width: 100%; }
    /* Onboarding */
    .onboarding-modal { width: 95%; }
    .onboarding-form { grid-template-columns: 1fr; }
}

/* ===== SCROLLBAR ===== */
.line-row.drag-over { border-top: 2px solid var(--primary); }
.drag-handle:active { cursor: grabbing; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== SUBSCRIPTION PLANS GRID ===== */
.sub-plans-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.sub-plan-card {
    background: var(--surface); border: 2px solid var(--border-light); border-radius: var(--radius-lg);
    padding: 28px 24px; position: relative; transition: all var(--transition);
    display: flex; flex-direction: column;
}
.sub-plan-card:hover { border-color: rgba(99,102,241,0.2); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.sub-plan-card.current { border-color: var(--primary); box-shadow: var(--shadow-glow); }
.sub-plan-card.current::before {
    content: 'Plan actuel'; position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
    background: var(--gradient); color: #fff; padding: 3px 16px; border-radius: 20px;
    font-size: 11px; font-weight: 700; white-space: nowrap;
}
.sub-plan-card.popular { border-color: var(--accent); }
.sub-plan-card.popular::after {
    content: 'Populaire'; position: absolute; top: -11px; right: 16px;
    background: linear-gradient(135deg, #06b6d4, #0891b2); color: #fff; padding: 3px 12px; border-radius: 20px;
    font-size: 10px; font-weight: 700;
}
.sub-plan-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.sub-plan-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }
.sub-plan-price { display: flex; align-items: baseline; gap: 2px; margin-bottom: 4px; }
.sub-plan-price .amount { font-size: 36px; font-weight: 900; letter-spacing: -0.03em; line-height: 1; }
.sub-plan-price .currency { font-size: 16px; font-weight: 700; color: var(--text-secondary); }
.sub-plan-price .period { font-size: 13px; color: var(--text-muted); margin-left: 2px; }
.sub-plan-trial { font-size: 12px; color: var(--paid); font-weight: 600; margin-bottom: 18px; }
.sub-plan-features { list-style: none; margin-bottom: 24px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.sub-plan-features li {
    display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary);
}
.sub-plan-features li i { font-size: 16px; width: 18px; text-align: center; }
.sub-plan-features li i.ri-check-line { color: var(--paid); }
.sub-plan-features li i.ri-close-line { color: var(--text-muted); opacity: 0.4; }
.sub-plan-features li.disabled { opacity: 0.45; }
.sub-plan-btn {
    width: 100%; padding: 12px; border-radius: 12px; font-size: 14px; font-weight: 600;
    border: none; cursor: pointer; transition: all var(--transition); text-align: center;
}
.sub-plan-btn.upgrade { background: var(--gradient); color: #fff; }
.sub-plan-btn.upgrade:hover { box-shadow: 0 4px 16px rgba(99,102,241,0.3); transform: translateY(-1px); }
.sub-plan-btn.current-btn { background: var(--primary-light); color: var(--primary); cursor: default; }
.sub-plan-btn.downgrade { background: var(--surface); color: var(--text-secondary); border: 1.5px solid var(--border); }
.sub-plan-btn.downgrade:hover { border-color: var(--primary); color: var(--primary); }
.sub-plan-btn:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 1024px) {
    .sub-plans-grid { grid-template-columns: 1fr 1fr; }
    #sub-info > div:first-child { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .sub-plans-grid { grid-template-columns: 1fr; max-width: 400px; }
}

/* ===== UPGRADE POPUP ===== */
.upgrade-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.2s ease-out;
}
.upgrade-modal {
    background: var(--surface); border-radius: var(--radius-xl); padding: 40px 36px 32px;
    max-width: 480px; width: 90%; text-align: center; position: relative;
    box-shadow: 0 24px 80px rgba(0,0,0,0.15);
    animation: modalIn 0.35s ease-out;
}
.upgrade-close {
    position: absolute; top: 16px; right: 16px; width: 32px; height: 32px;
    border: none; background: var(--bg); border-radius: 8px; cursor: pointer;
    font-size: 18px; color: var(--text-muted); display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
}
.upgrade-close:hover { background: var(--overdue-bg); color: var(--overdue); }
.upgrade-icon { margin-bottom: 20px; }
.upgrade-title {
    font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 8px;
}
.upgrade-message { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 28px; }
.upgrade-plans { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.upgrade-plan-option {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border: 1.5px solid var(--border); border-radius: 14px;
    cursor: pointer; transition: all var(--transition); background: var(--surface);
}
.upgrade-plan-option:hover { border-color: var(--primary); background: var(--primary-light); box-shadow: var(--shadow); }
.upgrade-plan-left { display: flex; align-items: center; gap: 12px; }
.upgrade-plan-left .plan-icon {
    width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}
.upgrade-plan-left .plan-icon.solo { background: #ede9fe; color: #7c3aed; }
.upgrade-plan-left .plan-icon.pro { background: var(--primary-light); color: var(--primary); }
.upgrade-plan-name { font-size: 14px; font-weight: 700; }
.upgrade-plan-detail { font-size: 12px; color: var(--text-muted); }
.upgrade-plan-price { font-size: 16px; font-weight: 800; color: var(--primary); }
.upgrade-dismiss {
    background: none; border: none; color: var(--text-muted); font-size: 13px;
    cursor: pointer; padding: 8px 16px; transition: color var(--transition);
}
.upgrade-dismiss:hover { color: var(--text); }

/* ===== ONBOARDING WIZARD ===== */
.onboarding-overlay {
    position: fixed; inset: 0; z-index: 3000;
    background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.3s ease-out;
}
.onboarding-modal {
    background: var(--surface); border-radius: var(--radius-xl); padding: 0;
    max-width: 520px; width: 92%; max-height: 90vh; overflow-y: auto;
    box-shadow: 0 32px 100px rgba(0,0,0,0.18);
    animation: modalIn 0.4s ease-out;
}
.onboarding-header {
    padding: 28px 32px 0; display: flex; align-items: center; justify-content: space-between;
}
.onboarding-logo {
    display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 800;
    background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.onboarding-logo svg { flex-shrink: 0; }
.onboarding-logo span { -webkit-text-fill-color: var(--text); }
.onboarding-steps-indicator { display: flex; gap: 6px; }
.step-dot {
    width: 28px; height: 4px; border-radius: 2px; background: var(--border);
    transition: all 0.3s;
}
.step-dot.active { background: var(--gradient); width: 36px; }
.onboarding-step { padding: 24px 32px 32px; }
.onboarding-step h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; }
.onboarding-subtitle { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; }
.onboarding-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ob-form-group { display: flex; flex-direction: column; gap: 5px; }
.ob-form-group.full { grid-column: 1 / -1; }
.ob-form-group label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.ob-form-group input {
    padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 10px;
    font-size: 14px; font-family: inherit; transition: all var(--transition);
    background: var(--surface); color: var(--text);
}
.ob-form-group input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.ob-hint { font-size: 11px; color: var(--text-muted); }
@media (max-width: 768px) {
    .onboarding-modal { width: 96%; max-height: 92vh; border-radius: 20px; }
    .onboarding-form { grid-template-columns: 1fr; gap: 14px; }
    .onboarding-step { padding: 20px 20px 28px; }
    .onboarding-step h2 { font-size: 20px; }
    .onboarding-header { padding: 20px 20px 0; }
    .ob-form-group input, .ob-form-group select { font-size: 16px; padding: 12px 14px; border-radius: 12px; }
    .ob-form-group label { font-size: 13px; }
    .onboarding-step .btn-primary { font-size: 16px; padding: 14px; border-radius: 12px; }
}

/* ============ OVERDUE ALERTS BANNER ============ */
.overdue-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, rgba(239,68,68,0.12), rgba(239,68,68,0.06));
    border: 1px solid rgba(239,68,68,0.3);
    border-left: 4px solid #ef4444;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
}
@keyframes slideDown { from { opacity:0; transform:translateY(-10px); } to { opacity:1; transform:translateY(0); } }
.overdue-banner-icon { font-size: 28px; color: #ef4444; flex-shrink: 0; }
.overdue-banner-content { flex: 1; min-width: 0; }
.overdue-banner-title { font-weight: 600; color: #dc2626; font-size: 0.95rem; margin-bottom: 6px; }
.overdue-banner-details { display: flex; flex-wrap: wrap; gap: 8px; }
.overdue-item {
    background: rgba(239,68,68,0.08);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    color: #991b1b;
    cursor: pointer;
    transition: background 0.2s;
}
.overdue-item:hover { background: rgba(239,68,68,0.18); }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }

/* ============================================================
   VoFact — Premium Animations & Micro-interactions v2
   ============================================================ */

/* Page transitions — smooth fade when switching pages */
.page { animation: pageIn 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* Sidebar nav items — stagger entrance */
.nav-item { animation: navIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both; }
.nav-item:nth-child(1) { animation-delay: 0.05s; }
.nav-item:nth-child(2) { animation-delay: 0.1s; }
.nav-item:nth-child(3) { animation-delay: 0.15s; }
.nav-item:nth-child(4) { animation-delay: 0.2s; }
.nav-item:nth-child(5) { animation-delay: 0.25s; }
.nav-item:nth-child(6) { animation-delay: 0.3s; }
.nav-item:nth-child(7) { animation-delay: 0.35s; }
.nav-item:nth-child(8) { animation-delay: 0.4s; }
@keyframes navIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: translateX(0); } }

/* Stat cards — count up feel */
.stat-card { animation: statIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }
@keyframes statIn { from { opacity: 0; transform: translateY(20px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* Invoice/quote rows — stagger entrance */
.invoice-row { animation: rowIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both; }
.invoice-row:nth-child(1) { animation-delay: 0.05s; }
.invoice-row:nth-child(2) { animation-delay: 0.08s; }
.invoice-row:nth-child(3) { animation-delay: 0.11s; }
.invoice-row:nth-child(4) { animation-delay: 0.14s; }
.invoice-row:nth-child(5) { animation-delay: 0.17s; }
.invoice-row:nth-child(6) { animation-delay: 0.20s; }
@keyframes rowIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }

/* Client cards — stagger */
.client-card { animation: cardIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both; }
.client-card:nth-child(1) { animation-delay: 0.05s; }
.client-card:nth-child(2) { animation-delay: 0.1s; }
.client-card:nth-child(3) { animation-delay: 0.15s; }
.client-card:nth-child(4) { animation-delay: 0.2s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* Chat send button — pulse on hover */
.chat-input button:hover {
    animation: sendPulse 0.6s ease-in-out;
}
@keyframes sendPulse {
    0% { box-shadow: 0 2px 12px rgba(99,102,241,0.25); }
    50% { box-shadow: 0 4px 30px rgba(99,102,241,0.5); }
    100% { box-shadow: 0 4px 20px rgba(99,102,241,0.35); }
}

/* Chat messages — smoother entrance */
.message { animation: msgSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.message.user .msg-bubble { transition: transform 0.2s; }
.message.user .msg-bubble:hover { transform: scale(1.01); }

/* AI avatar — subtle breathing glow */
.ai-avatar {
    animation: aiGlow 3s ease-in-out infinite alternate;
}
@keyframes aiGlow {
    0% { box-shadow: 0 4px 12px rgba(99,102,241,0.25); }
    100% { box-shadow: 0 4px 24px rgba(99,102,241,0.4); }
}

/* Quick action buttons — hover lift */
.quick-actions button {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.quick-actions button:hover {
    transform: translateY(-2px);
}
.quick-actions button:active {
    transform: translateY(0) scale(0.97);
}

/* Filter pills — active state animation */
.filter.active {
    animation: filterPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes filterPop { 0% { transform: scale(0.95); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }

/* Buttons — ripple-like press effect */
.btn-primary:active, .btn-secondary:active {
    transform: scale(0.97);
    transition: transform 0.1s;
}

/* Invoice badge — subtle pulse for overdue */
.inv-badge.overdue {
    animation: overduePulse 2s ease-in-out infinite;
}
@keyframes overduePulse {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: 0 0 8px rgba(239,68,68,0.3); }
}

/* Settings card — entrance */
.settings-card {
    animation: settingsIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes settingsIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Form inputs — smooth focus ring */
.form-group input, .form-group textarea, .form-group select,
.ob-form-group input, .chat-input input {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Sidebar brand — gradient shimmer on hover */
.sidebar-brand:hover span {
    animation: shimmerText 1.5s ease-in-out;
}
@keyframes shimmerText {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
    100% { filter: brightness(1); }
}

/* Modal — smoother entrance */
.modal-content {
    animation: modalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Upgrade popup — attention-grabbing entrance */
.upgrade-modal {
    animation: upgradeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes upgradeIn {
    from { opacity: 0; transform: translateY(40px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Subscription plan cards — hover glow */
.sub-plan-card:hover {
    box-shadow: 0 8px 32px rgba(99,102,241,0.12);
}
.sub-plan-card.popular:hover {
    box-shadow: 0 8px 32px rgba(6,182,212,0.15);
}

/* Toast — improved entrance */
.toast {
    animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Empty state icon — float animation */
.empty-state i {
    animation: emptyFloat 3s ease-in-out infinite;
}
@keyframes emptyFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Smooth scrollbar appearance */
.page-body, .chat-messages, .modal-body {
    scroll-behavior: smooth;
}

/* Loading skeleton shimmer (for future use) */
@keyframes skeletonShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.skeleton {
    background: linear-gradient(90deg, var(--border-light) 25%, var(--bg) 50%, var(--border-light) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}
