:root {
    --primary: #013861;
    --primary-dark: #012a4a;
    --primary-light: #1a6fbb;
    --primary-xlight: #e8f2fb;
    --accent: #0ea5e9;
    --secondary: #64748b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #0ea5e9;
    --bg: #f0f6fb;
    --surface: #ffffff;
    --surface-hover: #f0f6fb;
    --border: #d1e3f0;
    --text: #0f1f2e;
    --text-muted: #5a7a96;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(1,56,97,.08), 0 1px 2px rgba(1,56,97,.06);
    --shadow-md: 0 4px 12px rgba(1,56,97,.1), 0 2px 4px rgba(1,56,97,.06);
    --sidebar-w: 240px;
    --topbar-h: 56px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; }

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

/* ── Auth layout — split screen ───────────────────────────── */
.auth-split { display: flex; min-height: 100vh; }

/* Left panel — image + branding */
.auth-panel-left {
    flex: 0 0 42%;
    position: relative;
    overflow: hidden;
    background: #011e35;
}
.auth-panel-left-bg {
    position: absolute; inset: 0;
    background-image: url('https://images.unsplash.com/photo-1521737604893-d14cc237f11d?auto=format&fit=crop&w=1200&q=80');
    background-size: cover; background-position: center;
    opacity: .22;
}
.auth-panel-left--login .auth-panel-left-bg {
    background-image: url('https://images.unsplash.com/photo-1460925895917-afdab827c52f?auto=format&fit=crop&w=1200&q=80');
    background-position: center top;
}
.auth-panel-left-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(160deg, rgba(1,30,53,.95) 0%, rgba(1,56,97,.80) 100%);
}
.auth-panel-left-content {
    position: relative; z-index: 1;
    height: 100%; display: flex; flex-direction: column; justify-content: space-between;
    padding: 48px 48px 40px;
}
.auth-panel-left-logo { height: 40px; width: auto; }
.auth-panel-left-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.auth-panel-left-body h2 {
    font-size: 28px; font-weight: 800; color: #fff;
    line-height: 1.3; margin-bottom: 16px;
}
.auth-panel-left-body p {
    font-size: 15px; color: rgba(255,255,255,.65); line-height: 1.7; margin-bottom: 36px;
}
.auth-panel-bullets { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.auth-panel-bullets li {
    display: flex; align-items: center; gap: 12px;
    font-size: 14px; color: rgba(255,255,255,.8);
}
.auth-panel-bullets li i {
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255,255,255,.12);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; color: #7dd3fc; flex-shrink: 0;
}
.auth-panel-left-footer { font-size: 12px; color: rgba(255,255,255,.3); display: flex; flex-direction: column; gap: 8px; }

/* Right panel — form */
.auth-panel-right {
    flex: 1;
    display: flex; align-items: center; justify-content: center;
    background: #f8fafc;
    padding: 40px 24px;
}
.auth-form-box {
    width: 100%; max-width: 440px;
    background: #fff;
    border-radius: 16px;
    padding: 44px 40px;
    box-shadow: 0 4px 32px rgba(1,56,97,.08);
}
.auth-form-box .auth-logo { height: 44px; width: auto; display: block; margin: 0 auto 28px; }
.auth-form-box .subtitle {
    font-size: 22px; font-weight: 700; color: var(--primary);
    text-align: center; margin-bottom: 6px;
}
.auth-form-box .subtitle-sub {
    font-size: 14px; color: var(--text-muted); text-align: center; margin-bottom: 28px;
}
.auth-input-wrap { position: relative; }
.auth-input-wrap i.auth-input-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 14px; pointer-events: none;
}
.auth-input-wrap .form-control { padding-left: 40px; }
.auth-form-footer { text-align: center; font-size: 14px; margin-top: 20px; color: var(--text-muted); }
.auth-form-footer a { color: var(--primary-light); font-weight: 600; }

/* Responsive — hide left panel on small screens */
@media(max-width: 768px) {
    .auth-panel-left { display: none; }
    .auth-panel-right { background: linear-gradient(135deg, #013861 0%, #0a5fa8 60%, #0ea5e9 100%); }
    .auth-form-box { padding: 32px 24px; }
}

/* Legacy compat (login page still uses old classes) */
.auth-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #013861 0%, #0a5fa8 60%, #0ea5e9 100%); padding: 20px; }
.auth-card { background: var(--surface); border-radius: 12px; padding: 40px; width: 100%; max-width: 420px; box-shadow: var(--shadow-md); }
.auth-card h1 { font-size: 24px; margin-bottom: 8px; text-align: center; color: var(--primary); }
.auth-logo { height: 48px; width: auto; display: block; margin: 0 auto; }
.auth-card .subtitle { color: var(--text-muted); text-align: center; margin-bottom: 24px; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 4px; font-size: 13px; color: var(--text-muted); }
.form-control { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; transition: border-color .2s; background: var(--surface); color: var(--text); }
.form-control:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(1,56,97,.1); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media(max-width:600px){ .form-row { grid-template-columns: 1fr; } }

/* ── Buttons ─────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border: none; border-radius: var(--radius); font-size: 14px; font-weight: 500; cursor: pointer; transition: all .2s; text-decoration: none; }
.btn i { font-size: 13px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #0284c7; color: #fff; }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: #475569; color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--surface-hover); color: var(--text); }
.btn-outline-white { background: transparent; border: 2px solid rgba(255,255,255,.6); color: #fff; }
.btn-outline-white:hover { background: rgba(255,255,255,.15); color: #fff; border-color: #fff; }
.btn-block { display: flex; justify-content: center; width: 100%; }
.btn-lg { padding: 13px 28px; font-size: 16px; border-radius: 10px; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13px; }
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

/* ── App layout ──────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }

.sidebar { width: var(--sidebar-w); background: var(--primary); color: rgba(255,255,255,.7); position: fixed; top: 0; left: 0; bottom: 0; display: flex; flex-direction: column; z-index: 100; transition: transform .3s; }
.sidebar-brand { padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,.12); display: flex; align-items: center; }
.sidebar-logo { height: 36px; width: auto; display: block; }
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.sidebar-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 20px; color: rgba(255,255,255,.65); font-size: 14px; transition: all .15s; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: rgba(255,255,255,.12); color: #fff; }
.sidebar-nav a.active { border-left: 3px solid var(--accent); padding-left: 17px; }
.sidebar-nav a i { width: 20px; text-align: center; }
.sidebar-footer { padding: 12px 20px; border-top: 1px solid rgba(255,255,255,.12); font-size: 13px; }
.sidebar-footer a { color: rgba(255,255,255,.6); }
.sidebar-footer a:hover { color: #fff; }

/* ── Nav groupes accordéon ────────────────────────────────── */
.nav-group { }
.nav-group-header { display: flex; align-items: center; position: relative; }
.nav-group-link { flex: 1; display: flex; align-items: center; gap: 12px; padding: 10px 20px; padding-right: 36px; color: rgba(255,255,255,.65); font-size: 14px; text-decoration: none; transition: all .15s; }
.nav-group-link i { width: 20px; text-align: center; }
.nav-group-link:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav-group-link.active { background: rgba(255,255,255,.12); color: #fff; border-left: 3px solid var(--accent); padding-left: 17px; }
.nav-group-toggle { position: absolute; right: 0; top: 0; bottom: 0; width: 36px; background: none; border: none; color: rgba(255,255,255,.35); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: color .15s; }
.nav-group-toggle:hover { color: rgba(255,255,255,.75); }
.nav-group-toggle i { font-size: 10px; transition: transform .25s; }
.nav-group.open .nav-group-toggle i { transform: rotate(180deg); }
.nav-sub { display: none; background: rgba(0,0,0,.22); }
.nav-group.open .nav-sub { display: block; }
.nav-sub a { display: flex; align-items: center; gap: 10px; padding: 8px 20px 8px 44px; color: rgba(255,255,255,.5); font-size: 13px; transition: all .15s; }
.nav-sub a i { width: 16px; text-align: center; font-size: 12px; }
.nav-sub a:hover { background: rgba(0,0,0,.15); color: rgba(255,255,255,.85); }
.nav-sub a.active { background: rgba(0,0,0,.2); color: #fff; border-left: 3px solid var(--accent); padding-left: 41px; }
.nav-separator { height: 1px; background: rgba(255,255,255,.1); margin: 10px 16px; }


.main-content { flex: 1; margin-left: var(--sidebar-w); }

.topbar { height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 4px rgba(1,56,97,.06); }
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar h2 { font-size: 18px; font-weight: 600; color: var(--primary); }
.menu-toggle { display: none; background: none; border: none; font-size: 20px; cursor: pointer; color: var(--primary); }

.breadcrumb-bar { padding: 8px 24px; background: var(--bg); border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.breadcrumb-bar a { color: var(--text-muted); text-decoration: none; transition: color .15s; }
.breadcrumb-bar a:hover { color: var(--primary-light); }
.breadcrumb-bar .bc-sep { color: var(--border); }
.breadcrumb-bar .bc-current { color: var(--text); font-weight: 500; }
@media(max-width:768px){ .breadcrumb-bar { padding: 6px 14px; } }

.page-content { padding: 24px; padding-bottom: 80px; max-width: 1400px; }
.page-footer { position: fixed; bottom: 0; left: var(--sidebar-w); right: 0; z-index: 40; padding: 7px 24px; border-top: 1px solid rgba(0,0,0,.07); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 11px; color: var(--text-muted); background: rgba(255,255,255,.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
@media(max-width:768px){ .page-footer { left: 0; } }
.page-footer a { color: var(--text-muted); text-decoration: none; margin: 0 6px; transition: color .15s; }
.page-footer a:hover { color: var(--primary-light); }

/* ── Cards ───────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
.card-body { padding: 20px; }

/* ── Stats ───────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.stat-card .stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; color: #fff; margin-bottom: 12px; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; line-height: 1.2; color: var(--primary); }
.stat-card .stat-label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ── Tables ──────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
table th { font-size: 12px; text-transform: uppercase; color: var(--text-muted); font-weight: 600; background: var(--bg); letter-spacing: .04em; }
table tr:hover td { background: var(--surface-hover); }
table .actions { white-space: nowrap; }

/* ── Badges ──────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-status { color: #fff; }

/* ── Dashboard contact list ──────────────────────────────── */
.contact-list { list-style: none; }
.contact-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
.contact-item:last-child { border-bottom: none; }
.contact-info { display: flex; align-items: center; gap: 12px; }
.contact-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-light); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; }
.contact-name { font-weight: 500; }
.contact-company { font-size: 12px; color: var(--text-muted); }
.days-badge { font-size: 12px; padding: 4px 10px; border-radius: 20px; font-weight: 500; white-space: nowrap; }
.days-ok { background: #dcfce7; color: #166534; }
.days-warn { background: #fef3c7; color: #92400e; }
.days-danger { background: #fef2f2; color: #991b1b; }

/* ── Pipeline board ──────────────────────────────────────── */
.pipeline-form { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; align-items: end; }
.pipeline-board { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 16px; }
.pipeline-col { min-width: 260px; flex: 1; background: var(--bg); border-radius: var(--radius); border: 1px solid var(--border); }
.pipeline-col-header { padding: 12px 16px; font-weight: 600; font-size: 13px; text-transform: uppercase; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; color: var(--primary); }
.pipeline-col-header .count { background: var(--border); border-radius: 10px; padding: 1px 8px; font-size: 12px; }
.pipeline-cards { padding: 8px; min-height: 60px; }
.pipeline-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 8px; cursor: grab; box-shadow: var(--shadow); }
.pipeline-card:active { cursor: grabbing; }
.pipeline-card .deal-name { font-weight: 500; margin-bottom: 4px; }
.pipeline-card .deal-client { font-size: 12px; color: var(--text-muted); }
.pipeline-card .deal-value { font-weight: 600; color: var(--primary-light); margin-top: 6px; }

/* ── Modal ───────────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(1,28,50,.5); z-index: 200; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop.show { display: flex; }
.modal { background: var(--surface); border-radius: 12px; padding: 24px; width: 100%; max-width: 500px; box-shadow: var(--shadow-md); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal > .flex-between { flex-shrink: 0; margin-bottom: 16px; }
.modal h3 { margin-bottom: 0; color: var(--primary); }
.modal-body-scroll { overflow-y: auto; flex: 1; min-height: 0; padding-right: 4px; }

/* ── Topbar search ───────────────────────────────────────── */
.topbar-search { position: relative; display: flex; align-items: center; }
.topbar-search-icon { position: absolute; left: 10px; color: var(--text-muted); font-size: 13px; pointer-events: none; }
.topbar-search-input { padding: 7px 12px 7px 32px; border: 1px solid var(--border); border-radius: 20px; font-size: 13px; background: var(--bg); color: var(--text); width: 220px; transition: all .2s; }
.topbar-search-input:focus { outline: none; border-color: var(--primary-light); background: #fff; width: 280px; box-shadow: 0 0 0 3px rgba(1,56,97,.08); }
@media(max-width:768px){ .topbar-search { display: none; } }

/* ── Notification bell ───────────────────────────────────── */
.notif-wrap { position: relative; }
.notif-btn { position: relative; background: none; border: none; cursor: pointer; padding: 6px 8px; color: var(--text-muted); font-size: 16px; border-radius: var(--radius); transition: all .2s; display: flex; align-items: center; }
.notif-btn:hover { background: var(--bg); color: var(--primary); }
.notif-badge { position: absolute; top: 0; right: 0; background: #ef4444; color: #fff; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 3px; line-height: 1; }
.notif-dropdown { position: absolute; right: 0; top: calc(100% + 6px); width: 300px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); z-index: 200; display: none; overflow: hidden; }
.notif-dropdown.open { display: block; }
.notif-header { padding: 10px 14px; font-size: 13px; font-weight: 600; color: var(--primary); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.notif-count { background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 7px; }
.notif-empty { padding: 20px 14px; text-align: center; color: var(--text-muted); font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.notif-section { padding: 6px 14px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); background: var(--bg); border-top: 1px solid var(--border); }
.notif-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text); transition: background .15s; }
.notif-item:hover { background: var(--bg); }
.notif-item-title { font-size: 13px; font-weight: 500; }
.notif-item-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.notif-footer { display: flex; justify-content: space-between; padding: 8px 14px; border-top: 1px solid var(--border); background: var(--bg); }
.notif-footer a { font-size: 12px; color: var(--primary-light); font-weight: 500; }
.notif-footer a:hover { color: var(--primary); }

/* ── Profile avatar & dropdown ───────────────────────────── */
.profile-menu-wrap { position: relative; }
.profile-avatar-btn { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-light); color: #fff; border: none; cursor: pointer; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; letter-spacing: .02em; transition: background .2s, box-shadow .2s; flex-shrink: 0; }
.profile-avatar-btn:hover { background: var(--primary); box-shadow: 0 0 0 3px rgba(1,56,97,.15); }
.profile-dropdown { display: none; position: absolute; right: 0; top: calc(100% + 8px); min-width: 180px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-md); z-index: 300; overflow: hidden; }
.profile-dropdown.open { display: block; }
.profile-dropdown-name { padding: 10px 14px 8px; font-size: 13px; font-weight: 600; color: var(--primary); border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-dropdown-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: 13px; color: var(--text); text-decoration: none; transition: background .12s; }
.profile-dropdown-item:hover { background: var(--bg); color: var(--text); }
.profile-dropdown-item i { width: 16px; text-align: center; color: var(--text-muted); }
.profile-dropdown-sep { height: 1px; background: var(--border); margin: 2px 0; }
.profile-dropdown-logout { color: var(--danger); }
.profile-dropdown-logout i { color: var(--danger); }
.profile-dropdown-logout:hover { background: #fef2f2; color: var(--danger); }

/* ── Lang switcher ───────────────────────────────────────── */
.lang-switch { display: flex; gap: 4px; }
.lang-switch a { padding: 4px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; color: var(--text-muted); }
.lang-switch a.active { background: var(--primary); color: #fff; }

/* ── AI Assistant ────────────────────────────────────────── */
.ai-fab { position: fixed; bottom: 28px; right: 28px; width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; border: none; cursor: pointer; font-size: 20px; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 16px rgba(1,56,97,.35); z-index: 300; transition: all .2s; }
.ai-fab:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(1,56,97,.45); }
.ai-panel { position: fixed; bottom: 90px; right: 28px; width: 340px; max-height: 500px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-md); z-index: 299; display: flex; flex-direction: column; overflow: hidden; opacity: 0; pointer-events: none; transform: translateY(12px); transition: all .25s; }
.ai-panel.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.ai-panel-header { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 14px; gap: 8px; flex-shrink: 0; }
.ai-panel-messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.ai-msg { display: flex; }
.ai-msg-user { justify-content: flex-end; }
.ai-msg-bot  { justify-content: flex-start; }
.ai-bubble { max-width: 85%; padding: 9px 13px; border-radius: 14px; font-size: 13px; line-height: 1.55; }
.ai-msg-user .ai-bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.ai-msg-bot  .ai-bubble { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.ai-panel-input { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--surface); flex-shrink: 0; }
.ai-panel-input .form-control { font-size: 13px; padding: 8px 12px; }
.ai-panel-input .btn { padding: 8px 12px; }
.ai-loading { text-align: center; color: var(--text-muted); padding: 20px; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.ai-result { color: var(--text); }
@media(max-width:480px) { .ai-panel { width: calc(100vw - 16px); right: 8px; bottom: 76px; } .ai-fab { bottom: 16px; right: 16px; } }

/* ── Clients page ────────────────────────────────────────── */
.clients-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.clients-search  { display: flex; gap: 8px; align-items: center; }
.clients-actions { display: flex; gap: 8px; align-items: center; }

/* ── Responsive ──────────────────────────────────────────── */
@media(max-width:768px) {
    /* Sidebar */
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay { display: block; }
    .main-content { margin-left: 0; }
    .menu-toggle { display: block; }

    /* Topbar */
    .topbar { padding: 0 12px; }
    .topbar h2 { font-size: 16px; }
    .topbar-right { gap: 6px; }

    /* Page content */
    .page-content { padding: 14px; padding-bottom: 80px; }

    /* Stats */
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
    .stat-card { padding: 14px; }
    .stat-card .stat-value { font-size: 22px; }

    /* Pipeline */
    .pipeline-board { flex-direction: column; }
    .pipeline-col { min-width: 100%; }

    /* Card headers */
    .card-header { flex-wrap: wrap; gap: 8px; }
    .card-header .btn, .card-header a.btn { font-size: 12px; padding: 6px 10px; }

    /* Tables */
    table th, table td { padding: 8px 10px; font-size: 13px; }

    /* Contact list */
    .contact-item { flex-wrap: wrap; gap: 6px; }

    /* Notification dropdown */
    .notif-dropdown { width: calc(100vw - 24px); right: -8px; }

    /* Modals */
    .modal { padding: 16px; }

    /* Grid utilities */
    .grid-2 { grid-template-columns: 1fr; }
    .flex-between { flex-wrap: wrap; gap: 8px; }

    /* Lang switch — hide on small screens */
    .lang-switch { display: none; }

    /* ── Client show header ── */
    .client-show-header { flex-direction: column; align-items: flex-start; }
    .client-show-actions { flex-wrap: wrap; }

    /* ── Clients toolbar ── */
    .clients-toolbar { display: flex; flex-direction: column; gap: 10px; }
    .clients-search  { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
    .clients-search input,
    .clients-search select { flex: 1; min-width: 120px; }
    .clients-actions { display: flex; flex-direction: column; gap: 8px; }
    .clients-actions .btn { width: 100%; justify-content: center; }

    /* ── Clients table → cards ── */
    .clients-table thead { display: none; }
    .clients-table tbody tr {
        display: block;
        border: 1px solid var(--border);
        border-radius: 10px;
        margin-bottom: 10px;
        padding: 4px 0;
        background: var(--surface);
        box-shadow: var(--shadow-sm);
    }
    .clients-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 9px 14px;
        border-bottom: 1px solid var(--border);
        font-size: 13px;
        gap: 10px;
    }
    .clients-table td:last-child { border-bottom: none; }
    .clients-table td[data-label]::before {
        content: attr(data-label);
        font-size: 11px;
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: .04em;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .clients-table td.actions {
        justify-content: flex-end;
        padding: 10px 14px;
    }

    /* ── Pipeline form ── */
    .pipeline-form { grid-template-columns: 1fr 1fr !important; }
    .pipeline-form button[type=submit] { grid-column: 1 / -1; }

    /* ── Contracts stats → 2 columns ── */
    .contracts-stats { grid-template-columns: repeat(2, 1fr) !important; }

    /* ── Contracts search ── */
    .contracts-search-bar { flex-direction: column; }
    .contracts-search-bar input { max-width: 100% !important; width: 100%; }

    /* ── Contracts table → cards ── */
    .contracts-table thead { display: none; }
    .contracts-table tbody tr {
        display: block;
        border: 1px solid var(--border);
        border-radius: 10px;
        margin-bottom: 10px;
        padding: 4px 0;
        background: var(--surface);
        box-shadow: var(--shadow-sm);
    }
    .contracts-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 9px 14px;
        border-bottom: 1px solid var(--border);
        font-size: 13px;
        gap: 10px;
    }
    .contracts-table td:last-child { border-bottom: none; }
    .contracts-table td[data-label]::before {
        content: attr(data-label);
        font-size: 11px;
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: .04em;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .contracts-table td.actions { justify-content: flex-end; padding: 10px 14px; }
}

/* Sidebar dark overlay when menu is open */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 99; }

/* ── Tweekee mobile overrides ────────────────────────────── */
@media(max-width:768px) {
    .twc-input-bar { padding:14px 14px; padding-bottom:max(14px, env(safe-area-inset-bottom)); gap:10px; }
    /* font-size:16px prevents iOS from auto-zooming on focus */
    .twc-textarea { font-size:16px; min-height:120px; padding:14px 16px; border-radius:16px; line-height:1.55; }
    .twc-send-btn { width:50px; height:50px; font-size:18px; }
    .twc-mic-btn  { width:50px; height:50px; font-size:18px; }
    /* orb slightly smaller */
    .twc-orb { width:90px; height:90px; font-size:30px; }
}

@media(max-width:480px) {
    /* Topbar */
    .topbar h2 { font-size: 14px; max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .topbar-right { gap: 4px; }

    /* Page content */
    .page-content { padding: 10px; padding-bottom: 80px; }

    /* Stats → single column */
    .stats-grid { grid-template-columns: 1fr; }
    .stat-card { padding: 12px; display: flex; align-items: center; gap: 12px; }
    .stat-card .stat-icon { margin-bottom: 0; flex-shrink: 0; }
    .stat-card .stat-value { font-size: 20px; }

    /* Buttons — tighter on tiny screens */
    .btn { padding: 7px 12px; font-size: 13px; }
    .btn-sm { padding: 4px 8px; font-size: 12px; }

    /* Tables — hide less-important cols via parent class applied on views */
    table th, table td { padding: 7px 8px; font-size: 12px; }

    /* Auth card */
    .auth-card { padding: 24px 18px; }
    .auth-form-box { padding: 28px 18px; }
}

/* ── Charts ──────────────────────────────────────────────── */
.chart-container { position: relative; height: 260px; }

/* ── Misc utilities ──────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-2 { margin-top: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.client-show-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.client-show-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media(max-width:900px){ .grid-2 { grid-template-columns: 1fr; } }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state i { font-size: 48px; margin-bottom: 12px; display: block; color: var(--border); }

/* ── API key display ─────────────────────────────────────── */
.api-key-box { background: var(--primary-dark); color: #38bdf8; padding: 14px 18px; border-radius: var(--radius); font-family: 'Fira Code', monospace; word-break: break-all; font-size: 13px; position: relative; }
.api-key-box .copy-btn { position: absolute; right: 8px; top: 8px; }

/* ════════════════════════════════════════════════════════════
   LANDING PAGE
   ════════════════════════════════════════════════════════════ */

/* Nav */
.lp-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: rgba(1,56,97,.97); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(255,255,255,.08); }
.lp-nav-inner { max-width: 1140px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; justify-content: space-between; }
.lp-logo { display: flex; align-items: center; }
.lp-logo-img { height: 32px; width: auto; display: block; }
.lp-footer-logo { height: 36px; }
.lp-nav-links { display: flex; align-items: center; gap: 28px; }
.lp-nav-links a { color: rgba(255,255,255,.75); font-size: 14px; font-weight: 500; transition: color .2s; }
.lp-nav-links a:hover { color: #fff; }
.lp-nav-login { color: rgba(255,255,255,.8) !important; font-size: 14px; font-weight: 500; margin-left: 8px; padding-left: 16px; border-left: 1px solid rgba(255,255,255,.2); }
.lp-nav-register { background: var(--accent); color: #fff !important; padding: 8px 18px; border-radius: 6px; font-size: 14px; font-weight: 600; transition: background .2s; }
.lp-nav-register:hover { background: #0284c7 !important; color: #fff; }
.lp-nav-hamburger { display: none; background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; }

/* Hero */
.lp-hero { min-height: 100vh; background: linear-gradient(160deg, #012a4a 0%, #013861 40%, #0a5fa8 80%, #0d7cc7 100%); display: flex; align-items: center; padding-top: 64px; position: relative; overflow: hidden; }
.lp-hero::before { content: ''; position: absolute; inset: 0; background: url("https://images.unsplash.com/photo-1551434678-e076c223a692?w=1600&q=80&auto=format&fit=crop") center/cover no-repeat; opacity: .55; pointer-events: none; }
.lp-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(1,42,74,.92) 0%, rgba(1,56,97,.88) 40%, rgba(10,95,168,.82) 80%, rgba(13,124,199,.80) 100%); pointer-events: none; }
.lp-hero-inner { max-width: 1140px; margin: 0 auto; padding: 80px 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; position: relative; z-index: 1; }
.lp-hero-tag { display: inline-flex; align-items: center; gap: 8px; background: rgba(14,165,233,.2); border: 1px solid rgba(14,165,233,.35); color: #7dd3fc; padding: 5px 14px; border-radius: 20px; font-size: 13px; font-weight: 500; margin-bottom: 20px; }
.lp-hero h1 { font-size: 52px; font-weight: 800; color: #fff; line-height: 1.1; letter-spacing: -.5px; margin-bottom: 20px; }
.lp-hero h1 em { font-style: normal; color: #38bdf8; }
.lp-hero p { font-size: 18px; color: rgba(255,255,255,.75); line-height: 1.7; margin-bottom: 36px; max-width: 480px; }
.lp-hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.lp-hero-visual { display: flex; justify-content: center; align-items: center; }
.lp-hero-card { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 16px; padding: 28px; width: 100%; max-width: 380px; backdrop-filter: blur(10px); }
.lp-hero-card-title { color: rgba(255,255,255,.5); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 16px; }
.lp-mini-stat { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.lp-mini-stat:last-child { border-bottom: none; padding-bottom: 0; }
.lp-mini-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.lp-mini-icon.blue { background: rgba(14,165,233,.25); color: #38bdf8; }
.lp-mini-icon.green { background: rgba(34,197,94,.2); color: #4ade80; }
.lp-mini-icon.orange { background: rgba(245,158,11,.2); color: #fbbf24; }
.lp-mini-val { font-size: 22px; font-weight: 700; color: #fff; line-height: 1; }
.lp-mini-lbl { font-size: 12px; color: rgba(255,255,255,.5); margin-top: 2px; }

/* AI Demo widget (hero) */
.lp-ai-demo { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); border-radius: 20px; padding: 20px; width: 100%; max-width: 400px; backdrop-filter: blur(14px); box-shadow: 0 8px 40px rgba(0,0,0,.35); }
.lp-ai-demo-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,.1); }
.lp-ai-demo-orb { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 15px; flex-shrink: 0; box-shadow: 0 0 16px rgba(14,165,233,.5); }
.lp-ai-demo-header-title { font-size: 14px; font-weight: 700; color: #fff; line-height: 1.2; }
.lp-ai-demo-header-sub { font-size: 11px; color: rgba(255,255,255,.45); }
.lp-ai-demo-body { display: flex; flex-direction: column; gap: 10px; }
.lp-ai-bubble { padding: 10px 14px; border-radius: 14px; font-size: 13px; line-height: 1.5; max-width: 88%; }
.lp-ai-bubble-user { background: rgba(14,165,233,.22); border: 1px solid rgba(14,165,233,.3); color: rgba(255,255,255,.9); align-self: flex-end; border-bottom-right-radius: 4px; }
.lp-ai-bubble-bot { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); color: rgba(255,255,255,.85); align-self: flex-start; border-bottom-left-radius: 4px; }
.lp-ai-chips { display: flex; flex-direction: column; gap: 6px; }
.lp-ai-chip { display: flex; align-items: center; gap: 8px; background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.3); color: #86efac; border-radius: 8px; padding: 7px 12px; font-size: 12px; font-weight: 500; }
.lp-ai-confirm { display: flex; align-items: center; gap: 8px; background: rgba(14,165,233,.15); border: 1px solid rgba(14,165,233,.25); color: #7dd3fc; border-radius: 10px; padding: 9px 14px; font-size: 12px; font-weight: 600; margin-top: 2px; }
.lp-ai-confirm-dot { width: 8px; height: 8px; border-radius: 50%; background: #38bdf8; flex-shrink: 0; animation: lp-pulse 1.4s ease-in-out infinite; }
@keyframes lp-pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(.7)} }

/* Stats band */
.lp-stats-band { background: #012a4a; border-top: 1px solid rgba(255,255,255,.08); border-bottom: 1px solid rgba(255,255,255,.08); padding: 40px 24px; }
.lp-stats-band-inner { max-width: 900px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; text-align: center; }
.lp-band-num { font-size: 42px; font-weight: 800; color: #38bdf8; line-height: 1; }
.lp-band-lbl { font-size: 14px; color: rgba(255,255,255,.6); margin-top: 6px; }

/* Section base */
.lp-section { padding: 96px 24px; }
.lp-section-inner { max-width: 1140px; margin: 0 auto; }
.lp-section-tag { display: inline-flex; align-items: center; gap: 6px; background: var(--primary-xlight); color: var(--primary-light); padding: 4px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 14px; }
.lp-section h2 { font-size: 38px; font-weight: 800; color: var(--primary); line-height: 1.15; letter-spacing: -.3px; margin-bottom: 14px; }
.lp-section-sub { font-size: 17px; color: var(--text-muted); max-width: 560px; line-height: 1.7; margin-bottom: 56px; }
.lp-centered { text-align: center; }
.lp-centered .lp-section-sub { margin: 0 auto 56px; }

/* Features grid */
.lp-features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.lp-feat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 28px; box-shadow: var(--shadow); transition: box-shadow .25s, transform .25s; }
.lp-feat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.lp-feat-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--primary-xlight); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 18px; }
.lp-feat-card h3 { font-size: 17px; font-weight: 700; color: var(--primary); margin-bottom: 10px; }
.lp-feat-card p { font-size: 14px; color: var(--text-muted); line-height: 1.7; }

/* Testimonials & Pricing grids */
.lp-testimonials-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.lp-pricing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 760px; margin: 0 auto; }

/* How it works */
.lp-steps { background: var(--primary-xlight); }
.lp-steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; position: relative; }
.lp-steps-grid::before { content: ''; position: absolute; top: 250px; left: calc(16.66% + 16px); right: calc(16.66% + 16px); height: 2px; background: var(--border); }
.lp-step { text-align: center; }
.lp-step-num { width: 60px; height: 60px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 22px; font-weight: 800; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; position: relative; z-index: 1; box-shadow: 0 4px 12px rgba(1,56,97,.3); }
.lp-step h3 { font-size: 16px; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.lp-step p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* CTA band */
.lp-cta-band { background: linear-gradient(135deg, #012a4a 0%, #013861 50%, #0a5fa8 100%); padding: 80px 24px; text-align: center; }
.lp-cta-band h2 { font-size: 38px; font-weight: 800; color: #fff; margin-bottom: 14px; }
.lp-cta-band p { font-size: 17px; color: rgba(255,255,255,.7); margin-bottom: 36px; }
.lp-cta-band-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* Footer */
.lp-footer { background: #011e35; color: rgba(255,255,255,.6); padding: 64px 24px 24px; }
.lp-footer-inner { max-width: 1140px; margin: 0 auto; }
.lp-footer-top { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.lp-footer-brand { }
.lp-footer-brand .lp-logo-name { font-size: 22px; font-weight: 700; color: #fff; }
.lp-footer-brand .lp-logo-by { font-size: 11px; color: rgba(255,255,255,.4); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 14px; }
.lp-footer-brand p { font-size: 14px; line-height: 1.7; color: rgba(255,255,255,.5); max-width: 260px; }
.lp-footer-col h4 { font-size: 13px; font-weight: 600; color: #fff; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 16px; }
.lp-footer-col a { display: block; font-size: 14px; color: rgba(255,255,255,.5); margin-bottom: 10px; transition: color .2s; }
.lp-footer-col a:hover { color: #fff; }
.lp-footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding-top: 24px; display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.lp-footer-bottom a { color: rgba(255,255,255,.4); }
.lp-footer-bottom a:hover { color: #fff; }
.lp-footer-socials { display: flex; gap: 12px; }
.lp-footer-socials a { width: 34px; height: 34px; border-radius: 8px; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.6); transition: all .2s; }
.lp-footer-socials a:hover { background: var(--accent); color: #fff; }

/* Swiss-made badge */
.swiss-made { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 500; color: rgba(255,255,255,.45); letter-spacing: .02em; }
.swiss-made svg { flex-shrink: 0; border-radius: 3px; }

/* On auth/sign pages (white background) */
.swiss-made--dark { color: #aaa; }

/* Landing responsive */
@media(max-width:900px) {
    .lp-hero-inner { grid-template-columns: 1fr; gap: 40px; padding: 60px 24px; }
    .lp-hero h1 { font-size: 38px; }
    .lp-hero-visual { display: flex; }
    .lp-ai-demo { max-width: 100%; }
    .lp-features-grid { grid-template-columns: 1fr 1fr; }
    .lp-footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
    .lp-stats-band-inner { grid-template-columns: 1fr 1fr; }
    .lp-steps-grid::before { display: none; }
}
@media(max-width:600px) {
    .lp-nav-links { display: none; }
    .lp-nav-hamburger { display: block; }
    .lp-nav-login { margin-left: 0; padding-left: 0; border-left: none; }
    .lp-hero h1 { font-size: 30px; }
    .lp-features-grid { grid-template-columns: 1fr; }
    .lp-steps-grid { grid-template-columns: 1fr; }
    .lp-testimonials-grid { grid-template-columns: 1fr; }
    .lp-pricing-grid { grid-template-columns: 1fr; }
    .lp-stats-band-inner { grid-template-columns: 1fr; }
    .lp-footer-top { grid-template-columns: 1fr; gap: 24px; }
    .lp-section h2 { font-size: 28px; }
    .lp-cta-band h2 { font-size: 26px; }
    .lp-footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}

/* ── Status picker ──────────────────────────────────────── */
.status-picker { position:relative; }
.status-picker-btn { display:flex;align-items:center;gap:8px;padding:8px 12px;border:1px solid var(--border);border-radius:8px;background:var(--surface);cursor:pointer;user-select:none;transition:border-color .15s; }
.status-picker-btn:hover,.status-picker-btn.open { border-color:var(--primary); }
.status-picker-dot { width:10px;height:10px;border-radius:50%;flex-shrink:0; }
.status-picker-label { flex:1;font-size:14px; }
.status-picker-label strong { color:#013861; }
.status-picker-chevron { font-size:11px;color:var(--text-muted);transition:transform .2s; }
.status-picker-btn.open .status-picker-chevron { transform:rotate(180deg); }
.status-picker-list { display:none;position:absolute;top:calc(100% + 4px);left:0;right:0;background:var(--surface);border:1px solid var(--border);border-radius:10px;box-shadow:var(--shadow);z-index:200;overflow:hidden; }
.status-picker-list.open { display:block; }
.status-picker-item { display:flex;align-items:center;gap:10px;padding:10px 14px;cursor:pointer;transition:background .12s; }
.status-picker-item:hover { background:var(--bg); }
.status-picker-item.selected { background:var(--primary-bg,#eff6ff); }
.status-picker-text { flex:1;min-width:0; }
.status-picker-name { display:block;font-size:13px;font-weight:700;color:#013861; }
.status-picker-desc { display:block;font-size:11px;color:var(--text-muted);margin-top:1px;white-space:normal;line-height:1.35; }
.status-picker-check { font-size:12px;color:var(--primary);flex-shrink:0; }

/* ── Contracts ──────────────────────────────────────────── */
.contract-status { display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:20px;font-size:12px;font-weight:600; }
.contract-content { white-space:pre-wrap;line-height:1.8;font-size:14px; }

/* ── Sign page ───────────────────────────────────────────── */
.sign-body { background:var(--bg);min-height:100vh; }
.sign-wrap { max-width:760px;margin:0 auto;padding:24px 16px 48px; }
.sign-header { text-align:center;padding:24px 0 16px;border-bottom:2px solid var(--border);margin-bottom:24px; }
.sign-header h1 { font-size:18px;color:var(--primary);margin:8px 0 4px; }
.sign-header p { color:var(--text-muted);font-size:14px;margin:0; }
.sign-contract-card { background:var(--surface);border-radius:12px;padding:28px 32px;box-shadow:var(--shadow-sm);margin-bottom:24px;max-height:45vh;overflow-y:auto;border:1px solid var(--border); }
.sign-form-card { background:var(--surface);border-radius:12px;padding:24px;box-shadow:var(--shadow-sm);border:1px solid var(--border); }
.signature-wrap { border:2px dashed var(--border);border-radius:8px;background:#fff;position:relative;margin:12px 0;cursor:crosshair; }
.signature-wrap canvas { display:block;width:100%;height:200px;border-radius:6px;touch-action:none; }
.signature-wrap .sig-placeholder { position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:var(--text-muted);font-size:14px;pointer-events:none;user-select:none; }
.sign-footer-note { text-align:center;font-size:12px;color:var(--text-muted);margin-top:16px; }
.sign-done { text-align:center;padding:48px 24px; }
.sign-done .done-icon { font-size:64px;color:#22c55e;margin-bottom:16px; }
.sign-done h2 { color:var(--primary);margin-bottom:8px; }

/* ── Print ───────────────────────────────────────────────── */
.print-wrap { max-width:800px;margin:0 auto;padding:32px;background:#fff; }
.print-header { border-bottom:3px solid var(--primary);padding-bottom:16px;margin-bottom:32px; }
.print-sig-block { display:flex;gap:48px;margin-top:32px;padding-top:24px;border-top:1px solid var(--border); }
.print-sig-box { flex:1; }
.print-sig-label { font-size:12px;color:var(--text-muted);margin-bottom:8px; }
.print-sig-img { border:1px solid var(--border);border-radius:6px;max-width:280px; }
.print-actions { text-align:center;margin:24px 0; }
@media print {
    .print-actions,.btn,.sidebar,.topbar { display:none!important; }
    .print-wrap { padding:0;max-width:100%; }
    body { background:white; }
}


/* ── Mobile layout ───────────────────────────────────────── */
body.mobile-layout {
    background: var(--bg);
    height: 100vh;
    height: 100dvh; /* dvh = viewport excluant le clavier virtuel */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.mob-header {
    background: linear-gradient(135deg, var(--primary) 0%, #012a4a 100%);
    padding: 0 16px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.22);
    gap: 10px;
}
.mob-header-left { display:flex; align-items:center; gap:10px; min-width:0; }
.mob-header-back { color:rgba(255,255,255,.75); font-size:18px; flex-shrink:0; text-decoration:none; display:flex; align-items:center; }
.mob-header-back:hover { color:#fff; }
.mob-header-logo { display:flex; align-items:center; gap:8px; color:#fff; font-weight:700; font-size:16px; text-decoration:none; white-space:nowrap; }
.mob-header-logo i { font-size:17px; color:rgba(255,255,255,.85); }
.mob-header-title { color:#fff; font-size:16px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mob-header-title small { font-size:10px; font-weight:500; letter-spacing:.06em; text-transform:uppercase; opacity:.6; display:block; margin-top:-2px; }
.mob-header-right { display:flex; align-items:center; gap:10px; flex-shrink:0; }
.mob-header-right a { color:rgba(255,255,255,.65); font-size:17px; text-decoration:none; display:flex; align-items:center; }
.mob-header-right a:hover { color:#fff; }
.mob-header-user { font-size:12px; color:rgba(255,255,255,.6); max-width:80px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mob-content { flex:1; min-height:0; overflow:hidden; display:flex; flex-direction:column; }

/* ── Tweekee chat layout ─────────────────────────────────── */
.twc-wrap { display:flex;flex-direction:column;flex:1;min-height:0;position:relative;overflow:hidden; }

/* Messages scrollable area */
.twc-messages { display:none;flex-direction:column;gap:12px;flex:1;min-height:0;overflow-y:auto;padding:20px 20px 8px;scroll-behavior:smooth; }

/* Orb centered */
.twc-orb-wrap { flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px; }
.twc-orb { width:110px;height:110px;border-radius:50%;background:radial-gradient(circle at 38% 35%,#38bdf8 0%,#0284c7 45%,#013861 100%);display:flex;align-items:center;justify-content:center;font-size:38px;color:#fff;cursor:pointer;animation:twc-aurora 4s ease-in-out infinite;transition:transform .2s; }
.twc-orb:hover { transform:scale(1.06); }
.twc-orb.twc-orb-loading { animation:twc-spin 1.2s linear infinite; }
.twc-orb-label { font-size:13px;font-weight:600;color:var(--text-muted);letter-spacing:.08em;text-transform:uppercase; }
@keyframes twc-aurora {
    0%,100% { box-shadow:0 0 32px 8px rgba(56,189,248,.45),0 0 80px 24px rgba(14,165,233,.22),0 0 140px 50px rgba(1,56,97,.12); }
    50%      { box-shadow:0 0 55px 18px rgba(56,189,248,.7),0 0 110px 40px rgba(14,165,233,.4),0 0 190px 70px rgba(1,56,97,.18); }
}
@keyframes twc-spin { to { transform:rotate(360deg); } }

/* Input bar */
.twc-input-bar { display:flex;align-items:flex-end;gap:10px;padding:12px 16px;padding-bottom:max(16px, env(safe-area-inset-bottom));border-top:1px solid var(--border);background:var(--surface);flex-shrink:0; }
.twc-textarea { flex:1;border:1px solid var(--border);border-radius:14px;padding:11px 14px;font-size:14px;font-family:inherit;resize:none;line-height:1.5;background:var(--bg);color:var(--text);max-height:280px;overflow-y:auto;transition:border-color .15s;box-sizing:border-box; }
.twc-textarea:focus { outline:none;border-color:var(--primary-light);box-shadow:0 0 0 3px rgba(14,165,233,.1); }
.twc-send-btn { width:42px;height:42px;border-radius:50%;background:var(--primary);color:#fff;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:16px;flex-shrink:0;transition:background .15s,transform .1s;margin-bottom:1px; }
.twc-send-btn:hover  { background:#0369a1; }
.twc-send-btn:active { transform:scale(.92); }
.twc-send-btn:disabled { opacity:.5;cursor:not-allowed; }
.twc-mic-btn { width:42px;height:42px;border-radius:50%;background:transparent;color:var(--text-muted);border:2px solid var(--border);cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:16px;flex-shrink:0;transition:all .15s;margin-bottom:1px; }
.twc-mic-btn:hover { border-color:var(--primary-light);color:var(--primary); }
.twc-mic-active { background:var(--danger,#ef4444) !important;border-color:var(--danger,#ef4444) !important;color:#fff !important;animation:mic-pulse .8s ease-in-out infinite; }
@keyframes mic-pulse { 0%,100%{box-shadow:0 0 0 0 rgba(239,68,68,.4)} 50%{box-shadow:0 0 0 8px rgba(239,68,68,0)} }

/* Chat bubbles */
.twc-msg-wrap      { display:flex;flex-direction:column;gap:4px;max-width:80%; }
.twc-msg-wrap-user { align-self:flex-end;align-items:flex-end; }
.twc-msg-wrap-bot  { align-self:flex-start;align-items:flex-start; }
.twc-msg-meta      { display:flex;align-items:center;gap:5px;padding:0 4px; }
.twc-msg-wrap-user .twc-msg-meta { flex-direction:row-reverse; }
.twc-msg-name   { font-size:11px;font-weight:600;color:var(--text);letter-spacing:.01em; }
.twc-msg-time   { font-size:10px;color:var(--text-muted); }
.twc-msg-avatar { width:18px;height:18px;border-radius:50%;background:var(--primary-light);color:#fff;display:inline-flex;align-items:center;justify-content:center;font-size:9px;flex-shrink:0; }
.twc-msg { padding:10px 14px;border-radius:18px;font-size:14px;line-height:1.5;word-break:break-word; }
.twc-msg-user    { background:var(--primary);color:#fff;border-top-right-radius:4px; }
.twc-msg-bot     { background:var(--surface);color:var(--text);border-top-left-radius:4px;box-shadow:0 1px 3px rgba(0,0,0,.08); }
.twc-msg-error   { background:#fef2f2;color:#dc2626;border:1px solid #fecaca;border-top-left-radius:4px; }
.twc-msg-success { background:#f0fdf4;color:#16a34a;border:1px solid #bbf7d0;border-top-left-radius:4px; }
/* Loading dots */
.twc-msg-loading { display:flex;gap:5px;align-items:center;padding:12px 16px; }
.twc-msg-loading span { width:7px;height:7px;border-radius:50%;background:var(--text-muted);animation:twc-dots 1.2s ease-in-out infinite; }
.twc-msg-loading span:nth-child(2) { animation-delay:.2s; }
.twc-msg-loading span:nth-child(3) { animation-delay:.4s; }
@keyframes twc-dots { 0%,80%,100% { transform:scale(.7);opacity:.5; } 40% { transform:scale(1);opacity:1; } }

/* Action chips */
.twc-action-chips { align-self:flex-start;display:flex;flex-direction:column;gap:8px;max-width:90%; }
.twc-chip { background:var(--surface);border:1px solid var(--border);border-radius:20px;padding:7px 14px;font-size:13px;color:var(--text);cursor:default;text-align:left;line-height:1.35; }
.twc-confirm-inline { margin-top:4px;padding:10px 18px;font-size:14px;align-self:flex-start; }

/* ── Confirm modal ───────────────────────────────────────── */
.tw-modal-backdrop { position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:200;display:flex;align-items:flex-end;justify-content:center;padding:0; }
.tw-modal { background:#fff;width:100%;max-width:600px;border-radius:20px 20px 0 0;padding:20px;max-height:88vh;overflow-y:auto;animation:tw-slide-up .25s ease; }
@keyframes tw-slide-up { from { transform:translateY(100%); } to { transform:translateY(0); } }
.tw-modal-header { display:flex;align-items:center;justify-content:space-between;margin-bottom:14px;font-weight:700;font-size:15px;color:var(--primary); }
.tw-modal-close { background:none;border:none;font-size:22px;cursor:pointer;color:var(--text-muted);line-height:1; }
.tw-understood { font-size:13px;color:var(--text-muted);background:var(--bg);border-radius:8px;padding:10px 12px;margin-bottom:14px;font-style:italic; }
.tw-action-item { display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--border);border-radius:10px;margin-bottom:8px;cursor:pointer;transition:border-color .15s;background:#fff; }
.tw-action-item:has(input:checked) { border-color:var(--primary-light);background:#f0f9ff; }
.tw-action-check { width:18px;height:18px;flex-shrink:0;accent-color:var(--primary);cursor:pointer; }
.tw-action-icon { width:32px;height:32px;border-radius:8px;background:var(--primary);color:#fff;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:13px; }
.tw-action-label { font-size:13px;color:var(--text);flex:1;line-height:1.35; }
.tw-action-sub { display:block;font-size:11px;color:var(--text-muted);margin-top:2px; }
.tw-modal-footer { display:flex;gap:10px;margin-top:16px;padding-top:14px;border-top:1px solid var(--border); }
.tw-modal-footer .btn { flex:1;padding:13px;font-size:14px; }

/* Desktop modal centered */
.app-layout .tw-modal-backdrop { align-items:center; }
.app-layout .tw-modal { border-radius:14px;max-width:520px;max-height:80vh; }

/* ── Toast ───────────────────────────────────────────────── */
.tw-toast { position:fixed;bottom:90px;left:50%;transform:translateX(-50%) translateY(20px);background:#1e293b;color:#fff;padding:10px 20px;border-radius:30px;font-size:13px;font-weight:500;white-space:nowrap;z-index:300;opacity:0;transition:opacity .25s,transform .25s;pointer-events:none; }
.tw-toast.tw-toast-success { background:#16a34a; }
.tw-toast.tw-toast-error   { background:#dc2626; }
.tw-toast.tw-toast-show { opacity:1;transform:translateX(-50%) translateY(0); }
