:root {
    --bg-main: #eef2ff;
    --bg-side: #0f172a;
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-soft: #e0e7ff;
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --card: #ffffff;
    --border: #dbe4ff;
    --shadow: 0 16px 35px rgba(30, 41, 59, 0.12);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

html {
    overflow-x: hidden;
}

body {
    background: var(--bg-main);
    color: #0f172a;
    min-height: 100vh;
    overflow-x: hidden;
}

body.page-login {
    background: #070b14;
    color: #e2e8f0;
    font-family: "Inter", system-ui, -apple-system, sans-serif;
}

.login-page.login-page--storix {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 18px;
    isolation: isolate;
}

.storix-login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-color: #0f172a;
    background-image:
        linear-gradient(105deg, rgba(7, 11, 20, 0.82) 0%, rgba(30, 27, 75, 0.5) 42%, rgba(7, 11, 20, 0.88) 100%),
        url("https://images.unsplash.com/photo-1601584115197-04ecc0da31d7?auto=format&fit=crop&w=2000&q=80");
    background-size: cover;
    background-position: center;
    transform: scale(1.02);
}

.storix-login-video {
    position: fixed;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.55;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .storix-login-video {
        display: none;
    }
}

.storix-login-overlay {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
        linear-gradient(120deg, rgba(7, 11, 20, 0.75) 0%, rgba(15, 23, 42, 0.55) 45%, rgba(30, 27, 75, 0.5) 100%),
        radial-gradient(ellipse 90% 70% at 70% 30%, rgba(79, 70, 229, 0.22), transparent 50%);
}

.storix-login-center {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

.storix-login-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    padding: 36px 32px 32px;
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.storix-login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
}

.storix-brand-logo {
    max-width: min(320px, 100%);
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.brand-logo-panel {
    background: #ffffff;
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.brand-logo-panel--sidebar {
    padding: 10px 12px;
}

.sidebar-brand-logo {
    display: block;
    width: 100%;
    max-width: 200px;
    height: auto;
    object-fit: contain;
}

.sidebar-brand {
    margin-bottom: 4px;
}

.sidebar-brand-tagline {
    margin: 8px 0 0;
    font-size: 11px;
    line-height: 1.35;
    color: rgba(226, 232, 240, 0.72);
}

.storix-logo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    width: 36px;
    height: 36px;
}

.storix-logo span {
    display: block;
    border-radius: 5px;
    background: linear-gradient(145deg, #7c3aed, #4f46e5);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.45);
}

.storix-brand-name {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #f8fafc;
}

.storix-login-title {
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.2;
    color: #f8fafc;
    margin-bottom: 10px;
}

.storix-login-subtitle {
    font-size: 0.92rem;
    line-height: 1.55;
    color: rgba(226, 232, 240, 0.78);
    margin-bottom: 22px;
}

.storix-social-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.storix-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.storix-btn--social {
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.06);
    color: #f1f5f9;
}

.storix-btn--social:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.32);
}

.storix-btn--social:disabled {
    opacity: 0.72;
    cursor: not-allowed;
}

.storix-icon-svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.storix-icon-svg--apple {
    width: 18px;
    height: 18px;
}

.storix-or {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(148, 163, 184, 0.95);
    margin: 16px 0 14px;
}

.storix-alert {
    background: rgba(254, 202, 202, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: #fecaca;
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 0.88rem;
    margin-bottom: 14px;
}

.storix-login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.storix-field {
    display: flex;
    align-items: stretch;
    gap: 0;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(2, 6, 23, 0.35);
    overflow: hidden;
    cursor: text;
}

.storix-field:focus-within {
    border-color: rgba(129, 140, 248, 0.65);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22);
}

.storix-field-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    flex-shrink: 0;
    color: rgba(148, 163, 184, 0.95);
    background: rgba(15, 23, 42, 0.5);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.storix-field-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px 14px 11px;
    gap: 2px;
    min-width: 0;
}

.storix-field-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(148, 163, 184, 0.9);
}

.storix-field input {
    border: none;
    background: transparent;
    color: #f8fafc;
    font-size: 0.95rem;
    font-family: inherit;
    width: 100%;
    outline: none;
    padding: 0;
}

.storix-field input::placeholder {
    color: rgba(148, 163, 184, 0.55);
}

.storix-btn--primary {
    margin-top: 6px;
    border: none;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 45%, #4338ca 100%);
    color: #fff;
    font-weight: 700;
    padding: 14px 16px;
    box-shadow: 0 14px 36px rgba(79, 70, 229, 0.42);
}

.storix-btn--primary:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.storix-btn--primary:active {
    transform: translateY(0);
}

.storix-login-footer {
    margin-top: 22px;
    font-size: 0.82rem;
    line-height: 1.5;
    color: rgba(203, 213, 225, 0.88);
    text-align: center;
}

.storix-footer-muted {
    display: block;
    margin-top: 6px;
    color: rgba(148, 163, 184, 0.85);
    font-size: 0.78rem;
}

@media (max-width: 480px) {
    .storix-login-card {
        padding: 28px 22px 26px;
    }

    .storix-login-title {
        font-size: 1.4rem;
    }
}

.logout {
    border: none;
    border-radius: 12px;
    background: linear-gradient(130deg, var(--primary), var(--primary-dark));
    color: white;
    font-weight: 700;
    letter-spacing: 0.2px;
    padding: 12px 14px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.22);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.logout:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.28);
    filter: saturate(1.08);
}

.logout:active {
    transform: translateY(0);
}

.alert {
    background: #fee2e2;
    color: #b91c1c;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
}

.sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
    color: var(--text-light);
    padding: 20px 18px 22px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 100vh;
    min-width: 0;
    overflow-x: hidden;
}

.sidebar h2 {
    font-size: 22px;
    letter-spacing: 0.4px;
}

.caption {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 4px;
    letter-spacing: 1.2px;
}

.sidebar nav {
    margin-top: 14px;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    padding-right: 4px;
}

.sidebar nav a {
    color: #e2e8f0;
    text-decoration: none;
    padding: 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    border: 1px solid transparent;
}

.sidebar nav a span {
    font-size: 11px;
    color: #c7d2fe;
    background: rgba(79, 70, 229, 0.25);
    border-radius: 999px;
    padding: 3px 7px;
}

.sidebar nav a span.sidebar-nav-badge {
    color: #fff;
    background: #4f46e5;
    font-weight: 800;
    padding: 3px 8px;
}

.sidebar nav a.active,
.sidebar nav a:hover {
    background: rgba(79, 70, 229, 0.24);
    border-color: rgba(199, 210, 254, 0.22);
}

.content {
    padding: clamp(16px, 2.5vw, 30px);
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

.topbar {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px 16px;
    align-items: start;
    background: #fff;
    padding: 20px 22px;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    min-width: 0;
    max-width: 100%;
}

.topbar-actions-wrap {
    position: static;
    grid-column: 2;
    grid-row: 1;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 100%;
}

.topbar > div:not(.topbar-actions-wrap):not(.dashboard-search-wrap):not(.menu-search-wrap) {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
}

.topbar .dashboard-search-wrap,
.topbar .menu-search-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    max-width: 100%;
}

.topbar-notify-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 720px) {
    .topbar {
        grid-template-columns: 1fr;
    }

    .topbar-actions-wrap {
        grid-column: 1;
        grid-row: 1;
        justify-content: flex-start;
    }

    .topbar > div:not(.topbar-actions-wrap):not(.dashboard-search-wrap):not(.menu-search-wrap) {
        grid-row: 2;
    }

    .topbar .dashboard-search-wrap,
    .topbar .menu-search-wrap {
        grid-row: 3;
    }
}

.topbar-wa-actions,
.topbar-tg-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-wa-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    box-shadow: 0 4px 14px rgba(18, 140, 126, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.topbar-wa-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(18, 140, 126, 0.42);
}

.topbar-wa-btn--out {
    background: linear-gradient(135deg, #128c7e 0%, #075e54 100%);
    box-shadow: 0 4px 14px rgba(7, 94, 84, 0.32);
}

.topbar-wa-btn--out:hover {
    box-shadow: 0 6px 18px rgba(7, 94, 84, 0.4);
}

.topbar-wa-btn:focus-visible {
    outline: 3px solid #bbf7d0;
    outline-offset: 2px;
}

.topbar-wa-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    border: 2px solid #fff;
}

.topbar-wa-badge--muted {
    background: #64748b;
}

.topbar-tg-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #2aabee 0%, #229ed9 100%);
    box-shadow: 0 4px 14px rgba(34, 158, 217, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.topbar-tg-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(34, 158, 217, 0.42);
}

.topbar-tg-btn--out {
    background: linear-gradient(135deg, #229ed9 0%, #1a7fb8 100%);
    box-shadow: 0 4px 14px rgba(26, 127, 184, 0.32);
}

.topbar-tg-btn--out:hover {
    box-shadow: 0 6px 18px rgba(26, 127, 184, 0.4);
}

.topbar-tg-btn:focus-visible {
    outline: 3px solid #bae6fd;
    outline-offset: 2px;
}

.topbar-tg-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    border: 2px solid #fff;
}

.topbar-tg-badge--muted {
    background: #64748b;
}

.dashboard-tg-dialog {
    border: none;
    border-radius: 18px;
    padding: 0;
    max-width: min(960px, calc(100vw - 24px));
    width: 100%;
    max-height: min(90vh, 920px);
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
    z-index: 10050;
    background: transparent;
}

.dashboard-tg-dialog:not([open]):not(.is-open) {
    display: none;
}

.dashboard-tg-dialog.is-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
}

.dashboard-tg-dialog::backdrop {
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
}

.dashboard-tg-dialog-panel {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
}

.dashboard-tg-dialog-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 22px;
    background: linear-gradient(135deg, #2aabee 0%, #229ed9 100%);
    color: #fff;
}

.dashboard-tg-dialog-titles {
    flex: 1;
}

.dashboard-tg-dialog-title {
    margin: 0;
    font-size: 18px;
}

.dashboard-tg-dialog-sub {
    margin: 4px 0 0;
    font-size: 13px;
    opacity: 0.9;
}

.dashboard-tg-dialog-close {
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.dashboard-tg-dialog-body {
    padding: 16px 22px 22px;
    max-height: 70vh;
    overflow: auto;
}

.dashboard-tg-svg--sm svg {
    width: 28px;
    height: 28px;
}

.wa-messenger-top.tg-messenger-top {
    background: linear-gradient(135deg, #2aabee 0%, #229ed9 100%);
}

.topbar-logout-form {
    margin: 0;
}

.logout-topbar {
    white-space: nowrap;
    padding: 10px 16px;
    font-size: 14px;
}

.topbar h1 {
    font-size: clamp(1.25rem, 2.5vw, 26px);
    overflow-wrap: anywhere;
}

.topbar p {
    color: #64748b;
    margin-top: 4px;
    overflow-wrap: anywhere;
}

.dashboard-search-wrap {
    margin-top: 18px;
}

.menu-search-wrap {
    margin-top: 18px;
}

.topbar-centered-search .menu-search-wrap {
    width: 100%;
    max-width: 760px;
    margin: 18px auto 0;
}

.dashboard-search-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.dashboard-search-field {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
    border: 1px solid #c7d2fe;
    border-radius: 14px;
    padding: 0 14px;
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.08);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.dashboard-search-field:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.16);
    transform: translateY(-1px);
}

.dashboard-search-icon {
    font-size: 16px;
    opacity: 0.8;
}

#dashboard-search {
    width: 100%;
    border: none;
    background: transparent;
    color: #0f172a;
    font-size: 15px;
    padding: 14px 0;
    outline: none;
}

#dashboard-search::placeholder {
    color: #94a3b8;
}

#menu-search {
    -webkit-appearance: none;
    appearance: none;
}

#menu-search::-webkit-search-decoration,
#menu-search::-webkit-search-cancel-button,
#menu-search::-webkit-search-results-button,
#menu-search::-webkit-search-results-decoration {
    display: none;
}

.dashboard-no-result {
    display: none;
    margin-top: 14px;
    color: #596277;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.dashboard-intro {
    margin-top: 18px;
    margin-bottom: 0;
    padding: 14px 18px;
    font-size: 14px;
    line-height: 1.55;
    color: #475569;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    max-width: 900px;
}

.dashboard-intro strong {
    color: #312e81;
}

.dashboard-intel {
    margin-top: 22px;
    padding: 18px 20px 20px;
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 16px;
    box-shadow: var(--shadow, 0 8px 24px rgba(15, 23, 42, 0.06));
}

.dashboard-intel-header {
    margin-bottom: 14px;
}

.dashboard-intel-title {
    margin: 0 0 6px;
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
}

.dashboard-intel-lead {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #64748b;
    max-width: 52rem;
}

.dashboard-intel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.dashboard-insight {
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-insight:hover {
    border-color: #c7d2fe;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.08);
}

.dashboard-insight-title {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
}

.dashboard-insight-detail {
    margin: 0 0 12px;
    font-size: 0.82rem;
    line-height: 1.5;
    color: #475569;
}

.dashboard-insight-link {
    font-size: 0.82rem;
    font-weight: 600;
    color: #4f46e5;
    text-decoration: none;
}

.dashboard-insight-link:hover {
    text-decoration: underline;
}

.dashboard-insight--danger {
    border-color: rgba(220, 38, 38, 0.35);
    background: linear-gradient(135deg, #fef2f2 0%, #fff 55%);
}

.dashboard-insight--danger .dashboard-insight-title {
    color: #991b1b;
}

.dashboard-insight--warning {
    border-color: rgba(234, 179, 8, 0.45);
    background: linear-gradient(135deg, #fffbeb 0%, #fff 55%);
}

.dashboard-insight--warning .dashboard-insight-title {
    color: #a16207;
}

.dashboard-insight--info {
    border-color: rgba(59, 130, 246, 0.35);
    background: linear-gradient(135deg, #eff6ff 0%, #fff 55%);
}

.dashboard-insight--info .dashboard-insight-title {
    color: #1d4ed8;
}

.dashboard-insight--success {
    border-color: rgba(22, 163, 74, 0.35);
    background: linear-gradient(135deg, #f0fdf4 0%, #fff 55%);
}

.dashboard-insight--success .dashboard-insight-title {
    color: #166534;
}

/* Accordeon « Activites recentes » (dashboard) */
.dashboard-activities-details {
    border-radius: inherit;
}

.dashboard-activities-summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.dashboard-activities-summary::-webkit-details-marker {
    display: none;
}

.dashboard-activities-summary-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.dashboard-activities-summary h2 {
    margin: 0;
    font-size: 18px;
}

.dashboard-activities-chevron {
    display: inline-block;
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: rotate(-45deg);
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-top: -2px;
}

.dashboard-activities-details[open] .dashboard-activities-chevron {
    transform: rotate(45deg);
    margin-top: 2px;
}

/* Dock WhatsApp : mentions -> popups (dialog) */
.dashboard-wa-mentions-dock {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 22px;
}

.dashboard-wa-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 10px 20px 10px 12px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    text-align: left;
    color: #fff;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    box-shadow: 0 10px 28px rgba(18, 140, 126, 0.38);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-wa-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 34px rgba(18, 140, 126, 0.45);
}

.dashboard-wa-chip:focus-visible {
    outline: 3px solid #bbf7d0;
    outline-offset: 2px;
}

.dashboard-wa-chip--out {
    background: linear-gradient(135deg, #128c7e 0%, #075e54 100%);
    box-shadow: 0 10px 28px rgba(7, 94, 84, 0.35);
}

.dashboard-wa-chip--out:hover {
    box-shadow: 0 14px 34px rgba(7, 94, 84, 0.42);
}

.dashboard-wa-svg {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-wa-svg--sm {
    width: 44px;
    height: 44px;
}

.dashboard-wa-chip-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.dashboard-wa-chip-title {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.dashboard-wa-chip-meta {
    font-size: 0.78rem;
    font-weight: 600;
    opacity: 0.92;
}

.dashboard-wa-badge {
    position: absolute;
    top: -4px;
    right: 2px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.dashboard-wa-badge--muted {
    background: #475569;
}

.dashboard-wa-badge-dot {
    margin: 0 2px;
    opacity: 0.85;
    font-weight: 600;
}

.dashboard-mentions-received-inline {
    margin-top: 22px;
    scroll-margin-top: 24px;
}

.mention-received-row--unread {
    background: #f0fdf4;
}

.mention-received-row--unread td:first-child {
    box-shadow: inset 3px 0 0 #25d366;
}

.dashboard-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10040;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
}

.dashboard-modal-backdrop[hidden] {
    display: none !important;
}

.dashboard-wa-dialog {
    border: none;
    border-radius: 18px;
    padding: 0;
    max-width: min(960px, calc(100vw - 24px));
    width: 100%;
    max-height: min(90vh, 920px);
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
    z-index: 10050;
}

.dashboard-wa-dialog:not([open]):not(.is-open) {
    display: none;
}

.dashboard-wa-dialog.is-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
}

.dashboard-wa-dialog::backdrop {
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
}

.dashboard-wa-dialog-panel {
    display: flex;
    flex-direction: column;
    max-height: min(90vh, 920px);
    background: #fff;
}

.dashboard-wa-dialog-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    flex-shrink: 0;
    background: linear-gradient(120deg, #075e54 0%, #128c7e 50%, #25d366 100%);
    color: #fff;
}

.dashboard-wa-dialog-titles {
    flex: 1;
    min-width: 0;
}

.dashboard-wa-dialog-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.25;
}

.dashboard-wa-dialog-sub {
    margin: 4px 0 0;
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.9;
}

.dashboard-wa-dialog-close {
    margin-left: auto;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.dashboard-wa-dialog-close:hover {
    background: rgba(255, 255, 255, 0.32);
}

.dashboard-wa-dialog-body {
    overflow: auto;
    padding: 0 0 16px;
    flex: 1;
    min-height: 0;
}

.dashboard-wa-dialog-body .table-wrap {
    margin: 0 16px;
}

.dashboard-wa-dialog-body .dashboard-empty-hint {
    margin: 16px 16px 0;
}

.dashboard-cards {
    margin-top: 20px;
    min-width: 0;
    max-width: 100%;
}

.dashboard-insights-card,
.dashboard-insights-list {
    min-width: 0;
    max-width: 100%;
}

.dashboard-insights-list {
    list-style: none;
    margin: 0;
    padding: 0 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dashboard-insights-list .dashboard-insight {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.dashboard-insights-list .dashboard-insight > div {
    min-width: 0;
    flex: 1 1 12rem;
}

.dashboard-empty-hint {
    padding: 22px 24px 26px;
}

.dashboard-empty-title {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
}

.dashboard-empty-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #64748b;
    max-width: 52rem;
}

.dashboard-empty-text strong {
    color: #334155;
}

.dashboard-code {
    display: inline-block;
    margin: 0 2px;
    padding: 2px 8px;
    font-size: 13px;
    font-weight: 700;
    font-family: ui-monospace, monospace;
    color: #1e3a8a;
    background: #e0e7ff;
    border-radius: 6px;
    border: 1px solid #c7d2fe;
}

.dashboard-empty-hint--compact {
    padding-top: 12px;
    padding-bottom: 20px;
}

.cards {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
    gap: 18px;
    min-width: 0;
    max-width: 100%;
}

.feature-grid {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.feature-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 16px;
}

.feature-card h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

.feature-card p {
    color: #64748b;
    font-size: 14px;
}

.card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #4338ca 0%, #6366f1 45%, #818cf8 100%);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 18px 32px rgba(67, 56, 202, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #ffffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card::before {
    content: "";
    position: absolute;
    top: -30px;
    right: -30px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 36px rgba(67, 56, 202, 0.35);
}

.card:nth-child(2n) {
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 50%, #5eead4 100%);
    box-shadow: 0 18px 32px rgba(15, 118, 110, 0.28);
}

.card:nth-child(2n):hover {
    box-shadow: 0 24px 36px rgba(15, 118, 110, 0.35);
}

.card:nth-child(3n) {
    background: linear-gradient(135deg, #b45309 0%, #f59e0b 52%, #fcd34d 100%);
    box-shadow: 0 18px 32px rgba(180, 83, 9, 0.26);
}

.card:nth-child(3n):hover {
    box-shadow: 0 24px 36px rgba(180, 83, 9, 0.34);
}

.card:nth-child(3n) span {
    color: #fffbeb;
}

.card p {
    color: rgba(255, 255, 255, 0.84);
    font-weight: 600;
    letter-spacing: 0.2px;
}

.card h3 {
    margin: 11px 0 9px;
    font-size: 30px;
    line-height: 1.1;
    color: #ffffff;
}

.card span {
    color: #ecfeff;
    font-size: 14px;
    font-weight: 700;
}

.form-card {
    margin-top: 24px;
    background: var(--card);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: none;
    border: 1px solid var(--border);
}

.split-page {
    margin-top: 24px;
    display: grid;
    grid-template-columns: minmax(520px, 1.6fr) minmax(300px, 0.7fr);
    gap: 18px;
    align-items: start;
}

.split-page .form-card {
    margin-top: 0;
}

.split-page-messenger {
    grid-template-columns: minmax(360px, 1.2fr) minmax(320px, 1fr);
    gap: 20px;
    align-items: stretch;
}

.compact-records {
    margin-top: 0;
    max-width: 560px;
    justify-self: end;
}

.compact-records .table-header {
    background: linear-gradient(135deg, #eef2ff 0%, #ffffff 45%, #f5f3ff 100%);
    border-bottom: 1px solid #dbe4ff;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

.compact-records .table-header h2 {
    font-size: 18px;
    letter-spacing: 0.2px;
    color: #312e81;
}

.compact-records .badge {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.28);
    font-size: 11px;
    letter-spacing: 0.2px;
}

.records-accordion {
    padding: 14px;
    display: grid;
    gap: 12px;
}

.record-item {
    --record-border: #d9e2ff;
    --record-bg: #f9fbff;
    --record-detail-bg: #ffffff;
    --record-accent: #334155;
    border: 1px solid var(--record-border);
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, var(--record-bg) 100%);
    box-shadow: 0 10px 22px rgba(30, 41, 59, 0.08);
    overflow: hidden;
    transition: border-color 0.35s ease, background 0.35s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.record-item summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
}

.record-item summary::-webkit-details-marker {
    display: none;
}

.record-main {
    font-weight: 700;
    color: var(--record-accent);
    transition: color 0.35s ease;
    font-size: 15px;
}

.record-sub {
    font-size: 13px;
    color: #3730a3;
    background: #e8edff;
    border-radius: 999px;
    padding: 5px 10px;
    white-space: nowrap;
    border: 1px solid #c7d2fe;
}

.record-details {
    border-top: 1px solid var(--record-border);
    background: var(--record-detail-bg);
    padding: 12px 16px 16px;
    transition: border-color 0.35s ease, background-color 0.35s ease;
}

.record-details p {
    margin-bottom: 8px;
    color: var(--record-accent);
    transition: color 0.35s ease;
}

.record-item.color-refresh {
    animation: recordColorReveal 0.55s ease both;
}

@keyframes recordColorReveal {
    0% {
        opacity: 0.7;
        transform: translateY(8px) scale(0.985);
        box-shadow: 0 6px 12px rgba(30, 41, 59, 0.08);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        box-shadow: 0 10px 22px rgba(30, 41, 59, 0.08);
    }
}

.record-details p:last-child {
    margin-bottom: 0;
}

.record-comment-form {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #c7d2fe;
}

.record-comment-thread {
    margin-top: 10px;
    margin-bottom: 10px;
}

.comment-bubble {
    margin: 4px 0 10px;
    padding: 9px 10px;
    border-radius: 10px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #312e81;
    white-space: pre-wrap;
}

.comment-bubble.reply {
    background: #ecfeff;
    border-color: #99f6e4;
    color: #0f766e;
}

.comment-author {
    margin: -4px 0 10px;
    font-size: 12px;
    color: #475569;
}

.comment-time {
    margin: -8px 0 10px;
    font-size: 11px;
    color: #64748b;
}

.is-hidden {
    display: none;
}

/* —— Messagerie Clients / Prospects (style chat) —— */
.table-card.compact-records.wa-messenger {
    max-width: none;
    width: 100%;
    justify-self: stretch;
    margin-top: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: min(78vh, 900px);
    background: linear-gradient(180deg, #f0f4f8 0%, #e8eef5 100%);
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 20px;
    box-shadow:
        0 2px 4px rgba(15, 23, 42, 0.04),
        0 20px 50px -18px rgba(15, 23, 42, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
    overflow: hidden;
}

.wa-messenger-top {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    background: linear-gradient(135deg, #075e54 0%, #128c7e 48%, #25d366 160%);
    color: #fff;
    position: relative;
}

.wa-messenger-top::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, transparent 45%);
    pointer-events: none;
}

.wa-messenger-top-left {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.wa-messenger-back {
    font-size: 18px;
    opacity: 0.75;
    font-weight: 600;
}

.wa-messenger-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.wa-messenger-sub {
    margin: 2px 0 0;
    font-size: 12px;
    opacity: 0.88;
}

.wa-messenger-count {
    position: relative;
    z-index: 1;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(6px);
}

.wa-messenger .wa-chat-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(7, 94, 84, 0.35) transparent;
}

.wa-messenger .wa-chat-list::-webkit-scrollbar {
    width: 6px;
}

.wa-messenger .wa-chat-list::-webkit-scrollbar-thumb {
    background: rgba(7, 94, 84, 0.28);
    border-radius: 999px;
}

.wa-messenger .record-item.wa-thread {
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #fff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    transition: box-shadow 0.25s ease, transform 0.2s ease, border-color 0.2s ease;
}

.wa-messenger .record-item.wa-thread:hover {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
    transform: translateY(-1px);
}

.wa-messenger .wa-thread-summary {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    list-style: none;
}

.wa-messenger .wa-thread[open] .wa-thread-summary {
    background: linear-gradient(180deg, rgba(37, 211, 102, 0.08) 0%, #fff 100%);
    border-bottom: 1px solid rgba(7, 94, 84, 0.12);
}

.wa-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(145deg, #25d366 0%, #128c7e 100%);
    box-shadow: 0 4px 12px rgba(18, 140, 126, 0.35);
    flex-shrink: 0;
}

.wa-avatar-lg {
    width: 52px;
    height: 52px;
    font-size: 16px;
}

.wa-thread-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wa-thread-name {
    font-weight: 700;
    font-size: 15px;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.wa-thread-preview {
    font-size: 13px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wa-thread-sub {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

.wa-thread-time {
    font-size: 11px;
    font-weight: 600;
    color: #25d366;
    white-space: nowrap;
    align-self: start;
    margin-top: 4px;
}

.wa-thread-panel {
    padding: 0;
    border-top: none;
    background: #fff;
}

.wa-thread-panel-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.wa-panel-name {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
}

.wa-panel-meta {
    margin: 4px 0 0;
    font-size: 12px;
    color: #64748b;
}

.wa-fiche-block {
    margin: 0 12px 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.wa-fiche-label {
    margin: 0 0 8px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #94a3b8;
}

.wa-fiche-line {
    margin: 0 0 6px;
    font-size: 12px;
    line-height: 1.45;
    color: #475569;
}

.wa-fiche-line:last-child {
    margin-bottom: 0;
}

.wa-messenger .wa-fiche-block p.wa-fiche-line {
    margin-bottom: 6px;
    color: #475569;
}

.wa-messenger .record-comment-form {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.wa-fiche-line span {
    font-weight: 700;
    color: #334155;
    margin-right: 6px;
}

.wa-chat-surface {
    margin: 0 8px 8px;
    padding: 14px 10px 16px;
    border-radius: 14px;
    min-height: 140px;
    max-height: 280px;
    overflow-y: auto;
    background-color: #e5ddd5;
    background-image:
        radial-gradient(circle at 18% 22%, rgba(0, 0, 0, 0.04) 0%, transparent 42%),
        radial-gradient(circle at 82% 78%, rgba(0, 0, 0, 0.035) 0%, transparent 40%),
        repeating-linear-gradient(
            -12deg,
            transparent,
            transparent 24px,
            rgba(255, 255, 255, 0.03) 24px,
            rgba(255, 255, 255, 0.03) 25px
        );
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.04);
}

.wa-msg-row {
    display: flex;
    margin-bottom: 10px;
}

.wa-msg-row:last-child {
    margin-bottom: 0;
}

.wa-msg-in {
    justify-content: flex-start;
}

.wa-msg-out {
    justify-content: flex-end;
}

.wa-msg {
    max-width: 88%;
}

.wa-messenger .wa-msg .comment-bubble {
    margin: 0;
    padding: 8px 11px 9px;
    border-radius: 10px 10px 10px 4px;
    border: none;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
    font-size: 14px;
    line-height: 1.45;
    color: #111b21;
    background: #fff;
}

.wa-messenger .wa-msg-out .comment-bubble.reply {
    border-radius: 10px 10px 4px 10px;
    background: #d9fdd3;
    color: #111b21;
    border: none;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
}

.wa-msg-foot {
    display: block;
    margin-top: 4px;
    padding: 0 2px 0 4px;
    font-size: 11px;
    color: #667781;
}

.wa-msg-foot-out {
    text-align: right;
    padding: 0 4px 0 2px;
}

.wa-msg-dot {
    margin: 0 3px;
    opacity: 0.6;
}

.wa-messenger .record-comment-thread {
    margin: 0;
}

.wa-composer {
    position: relative;
    margin: 0 12px 12px;
    padding: 12px 12px 14px;
    border-top: none;
    border-radius: 16px;
    background: linear-gradient(180deg, #f0f2f5 0%, #fff 35%);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.04);
}

.wa-composer .wa-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.wa-composer-field {
    border-radius: 12px !important;
    border: 1px solid rgba(15, 23, 42, 0.1) !important;
    background: #fff !important;
    min-height: 44px !important;
    margin-bottom: 8px !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.wa-composer-field:focus {
    border-color: #128c7e !important;
    box-shadow: 0 0 0 3px rgba(18, 140, 126, 0.2) !important;
}

.wa-composer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.wa-send-btn {
    border: none;
    border-radius: 999px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.wa-send-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
}

.wa-send-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.wa-messenger .record-action-row {
    margin: 0 12px 14px;
    padding-top: 4px;
    border-top: 1px dashed rgba(15, 23, 42, 0.1);
}

.wa-messenger .record-action-btn {
    border-radius: 999px;
    font-size: 12px;
    padding: 8px 12px;
}

.wa-messenger .table-action-btn {
    margin: 0 12px 14px;
    border-radius: 12px;
}

@media (max-width: 1100px) {
    .split-page-messenger {
        grid-template-columns: 1fr;
    }

    .table-card.compact-records.wa-messenger {
        min-height: 420px;
    }
}

.record-comment-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
}

.record-comment-form textarea {
    width: 100%;
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    padding: 10px 11px;
    background: #f8faff;
    color: #0f172a;
    resize: vertical;
    min-height: 78px;
    margin-bottom: 8px;
}

.record-comment-form textarea:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.16);
    background: #fff;
    outline: none;
}

.mention-menu {
    position: relative;
    z-index: 20;
    display: grid;
    gap: 4px;
    margin-top: -3px;
    margin-bottom: 8px;
    padding: 6px;
    border-radius: 10px;
    border: 1px solid #c7d2fe;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
    min-width: 0;
    max-width: 100%;
}

.mention-item {
    border: 1px solid transparent;
    border-radius: 8px;
    background: #eef2ff;
    color: #312e81;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    padding: 7px 9px;
    cursor: pointer;
    display: block;
    width: 100%;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mention-item:hover {
    background: #dbe4ff;
    border-color: #a5b4fc;
}

.comment-save-status {
    min-height: 16px;
    margin-top: 2px;
    font-size: 12px;
    font-weight: 700;
}

.comment-save-status.ok {
    color: #166534;
}

.comment-save-status.error {
    color: #be123c;
}

.record-action-row {
    margin-top: 10px;
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.record-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    background: #eef2ff;
    color: #312e81;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 11px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.record-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 14px rgba(79, 70, 229, 0.18);
}

.record-action-btn.edit-btn {
    background: #e0e7ff;
    border-color: #a5b4fc;
}

.record-action-btn.delete-btn {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #be123c;
}

.record-action-btn.delete-btn:hover {
    box-shadow: 0 8px 14px rgba(190, 24, 93, 0.2);
}

.no-records {
    color: #64748b;
    padding: 8px 4px;
}

@media (max-width: 1080px) {
    .split-page {
        grid-template-columns: 1fr;
    }
}

.crm-form p {
    margin-bottom: 16px;
}

.crm-form label {
    display: block;
    font-weight: 700;
    color: #334155;
    margin-bottom: 7px;
    font-size: 14px;
}

.crm-form input,
.crm-form select,
.crm-form textarea {
    width: 100%;
    border: 1px solid #c7d2fe;
    border-radius: 12px;
    padding: 12px 13px;
    background: #f8faff;
    color: #0f172a;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.crm-form input:focus,
.crm-form select:focus,
.crm-form textarea:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.16);
    background: #fff;
}

.crm-form textarea {
    min-height: 120px;
    resize: vertical;
}

.crm-form input::placeholder,
.crm-form textarea::placeholder {
    color: #94a3b8;
}

.crm-form button {
    border: none;
    border-radius: 12px;
    background: linear-gradient(130deg, var(--primary), var(--primary-dark));
    color: white;
    font-weight: 700;
    padding: 12px 14px;
    cursor: pointer;
    width: 100%;
    min-width: 0;
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.22);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.crm-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.28);
    filter: saturate(1.08);
}

.crm-form button:active {
    transform: translateY(0);
}

.crm-form-section-title {
    margin: 28px 0 14px;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.crm-form-section-title:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.crm-form-section-title--mvt {
    margin-top: 32px;
}

.crm-form-section-hint {
    margin: -6px 0 16px;
    font-size: 13px;
    color: #64748b;
}

.crm-form-footnote {
    margin: 16px 0 0;
    font-size: 13px;
}

.crm-form .stock-autre-field {
    display: none;
}

.crm-form .stock-autre-field.is-visible {
    display: block;
}

.crm-form-checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.crm-form-checkbox-row label {
    margin-bottom: 0;
}

.table-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.crm-form ul.errorlist {
    list-style: none;
    margin: 6px 0 8px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: #be123c;
    font-size: 13px;
}

.sidebar form {
    margin-top: auto;
    padding-top: 16px;
    flex-shrink: 0;
}

.table-card {
    margin-top: 24px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.table-header-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.badge {
    background: #e0e7ff;
    color: #3730a3;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
}

.badge-muted {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.dashboard-mention-actions-col,
.dashboard-activity-actions-col {
    width: 1%;
    white-space: nowrap;
    vertical-align: middle;
}

.dashboard-activity-actions-col .activity-icon-toolbar {
    min-width: 7.5rem;
}

.activity-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    line-height: 1;
    border-radius: 8px;
}

.activity-icon-btn .bi {
    font-size: 1rem;
}

.dashboard-activity-modals .modal-content {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
}

.activity-action-modal .modal-header {
    border-bottom-color: #eef2ff;
}

.activity-action-modal .modal-footer {
    border-top-color: #eef2ff;
}

.activity-action-modal {
    z-index: 10060;
}

.modal-backdrop {
    z-index: 10055;
}

.dashboard-mention-delete-form {
    margin: 0;
    display: inline-block;
}

.dashboard-mention-delete-btn {
    font-size: 12px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid #fecdd3;
    background: #fff1f2;
    color: #be123c;
    cursor: pointer;
}

.dashboard-mention-delete-btn:hover {
    background: #ffe4e6;
    border-color: #fda4af;
}

.table-wrap {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f8faff;
}

th,
td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid #eef2ff;
    white-space: nowrap;
}

tbody tr:hover {
    background: #fafbff;
}

.table-action-btn {
    display: inline-block;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    color: #312e81;
    background: var(--primary-soft);
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    padding: 8px 12px;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

button.table-action-btn {
    cursor: pointer;
}

.table-action-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-delete-btn {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #be123c;
}

.table-action-btn:hover {
    background: #c7d2fe;
    border-color: #a5b4fc;
    transform: translateY(-1px);
}

.sidebar-nav-badge {
    margin-left: auto;
    min-width: 22px;
    text-align: center;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    background: #4f46e5;
    border-radius: 999px;
    padding: 3px 8px;
    line-height: 1.2;
}

.sidebar-nav-badge.sidebar-nav-badge-warn {
    background: #b45309;
}

.sidebar-nav-badge.sidebar-nav-badge-tasks {
    background: #0d9488;
}

.crm-inline-relance-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.invoice-relance-panel .table-wrap td {
    white-space: normal;
    vertical-align: top;
}

.crm-list-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 16px;
}

.crm-inline-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.wa-thread-extras {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.kanban-column {
    background: var(--card);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

.kanban-column-title {
    font-size: 15px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    color: #312e81;
}

.kanban-column-inner {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.kanban-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
}

.kanban-card h3 {
    font-size: 15px;
    margin-bottom: 6px;
}

.kanban-move-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
}

.kanban-move-form .input-control {
    flex: 1;
    min-width: 120px;
}

.dashboard-mention-actions-col .table-action-group {
    flex-wrap: wrap;
    max-width: 280px;
    white-space: normal;
}

/* ——— Module Gestion (caisse hebdomadaire) ——— */
.gestion-page .gestion-alert {
    margin-bottom: 20px;
}

.gestion-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 1100px) {
    .gestion-layout {
        grid-template-columns: 1fr;
    }
}

.gestion-sidebar-title {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.gestion-week-list {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
}

.gestion-week-list li {
    margin-bottom: 8px;
}

.gestion-week-link {
    display: block;
    padding: 14px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: border-color 0.15s, background 0.15s;
}

.gestion-week-link strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}

.gestion-week-link span {
    display: block;
    font-size: 12px;
    color: #64748b;
}

.gestion-week-link.is-active,
.gestion-week-link:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1e40af;
}

.gestion-week-status {
    margin-top: 6px !important;
    font-weight: 600;
    color: #0369a1 !important;
}

.gestion-field,
.gestion-page .gestion-field {
    width: 100%;
    min-height: 48px;
    font-size: 15px;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #fff;
    box-sizing: border-box;
}

.gestion-page textarea.gestion-field {
    min-height: 100px;
    resize: vertical;
}

.gestion-field-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

.gestion-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px 24px;
}

.gestion-field-group--wide {
    grid-column: span 2;
}

.gestion-field-group--full {
    grid-column: 1 / -1;
}

@media (max-width: 900px) {
    .gestion-meta-grid {
        grid-template-columns: 1fr 1fr;
    }
    .gestion-field-group--wide {
        grid-column: span 2;
    }
}

@media (max-width: 600px) {
    .gestion-meta-grid {
        grid-template-columns: 1fr;
    }
    .gestion-field-group--wide {
        grid-column: span 1;
    }
}

.gestion-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px 28px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.gestion-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.gestion-card-header h2 {
    margin: 0;
    font-size: 18px;
    color: #0f172a;
}

.gestion-card-sub {
    margin: 6px 0 0;
    font-size: 13px;
    color: #64748b;
}

.gestion-badge {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 999px;
    white-space: nowrap;
}

.gestion-card--enc {
    border-top: 4px solid #10b981;
}

.gestion-card--dec {
    border-top: 4px solid #f97316;
}

.gestion-panels {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.gestion-table-wrap {
    overflow-x: auto;
    margin: 0 -4px;
}

.gestion-table {
    width: 100%;
    min-width: 720px;
    border-collapse: separate;
    border-spacing: 0;
}

.gestion-table thead th {
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    padding: 12px 14px;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.gestion-table tbody td {
    padding: 12px 14px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.gestion-table tbody tr:hover {
    background: #fafafa;
}

.gestion-table tfoot td {
    padding: 16px 14px;
    background: #f8fafc;
    font-size: 15px;
}

.gestion-tfoot-amount {
    text-align: right;
    font-size: 17px !important;
    font-weight: 800;
}

.gestion-tfoot-amount--pos {
    color: #059669;
}

.gestion-tfoot-amount--neg {
    color: #dc2626;
}

.gestion-autre-cell {
    min-width: 180px;
}

.gestion-autre-cell input {
    display: none;
}

.gestion-autre-cell.is-visible input {
    display: block;
}

.gestion-table-actions {
    width: 90px;
    text-align: center;
}

.gestion-check-delete {
    font-size: 12px;
    color: #b91c1c;
    cursor: pointer;
    white-space: nowrap;
}

.gestion-tresorerie-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 700px) {
    .gestion-tresorerie-row {
        grid-template-columns: 1fr;
    }
}

.gestion-card--treso {
    margin-bottom: 0;
    border-top: 4px solid #6366f1;
}

.gestion-card--treso h3 {
    margin: 0 0 6px;
    font-size: 17px;
    color: #0f172a;
}

.gestion-card--treso .gestion-field {
    font-size: 20px;
    font-weight: 600;
    min-height: 56px;
    margin-top: 12px;
}

.gestion-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

@media (max-width: 900px) {
    .gestion-kpi-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

.gestion-kpi {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 20px;
}

.gestion-kpi span {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 8px;
}

.gestion-kpi strong {
    font-size: 22px;
    color: #0f172a;
}

.gestion-kpi--pos {
    color: #059669;
}

.gestion-kpi--neg {
    color: #dc2626;
}

.gestion-kpi--highlight {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #93c5fd;
}

.gestion-kpi--highlight strong {
    color: #1d4ed8;
}

.gestion-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.12s, box-shadow 0.12s;
}

.gestion-btn--block {
    width: 100%;
}

.gestion-btn--primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.gestion-btn--primary:hover {
    transform: translateY(-1px);
}

.gestion-btn--lg {
    padding: 16px 32px;
    font-size: 16px;
}

.gestion-btn--danger {
    background: #fff;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.gestion-btn--secondary {
    background: #fff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.gestion-btn--secondary:hover {
    background: #eff6ff;
}

.gestion-btn--sm {
    padding: 8px 12px;
    font-size: 12px;
}

.gestion-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.gestion-card--historique {
    margin-bottom: 24px;
}

.gestion-table--historique {
    min-width: 980px;
}

.gestion-hist-meta {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

.gestion-amount-pos {
    color: #059669;
    font-weight: 600;
}

.gestion-amount-neg {
    color: #dc2626;
    font-weight: 600;
}

.gestion-hist-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-start;
    width: auto;
    min-width: 140px;
}

.gestion-table--historique tr.is-active-row {
    background: #eff6ff;
}

.gestion-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.gestion-delete-form {
    margin-top: 8px;
}

.gestion-card--empty {
    text-align: center;
    padding: 48px 32px;
}

.gestion-card--empty h2 {
    margin-bottom: 12px;
}

.gestion-stock-cell {
    display: none;
}

.gestion-stock-cell.is-visible {
    display: table-cell;
}

/* ——— Module Stock ——— */
.stock-kpi-row {
    margin-bottom: 24px;
}

.stock-forms-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
    align-items: start;
}

@media (max-width: 1100px) {
    .stock-forms-row {
        grid-template-columns: 1fr;
    }
}

.stock-form-card {
    padding-bottom: 8px;
}

.stock-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 20px;
    padding: 0 20px 8px;
}

.stock-form-grid--mvt {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 700px) {
    .stock-form-grid,
    .stock-form-grid--mvt {
        grid-template-columns: 1fr;
    }
}

.stock-field-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.stock-field-wrap--full {
    grid-column: 1 / -1;
}

.stock-field-wrap label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.stock-field-error {
    font-size: 12px;
    color: #dc2626;
}

.stock-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 20px 20px;
    border-top: 1px solid #e2e8f0;
    margin-top: 8px;
}

.stock-page .stock-field,
.stock-page .gestion-field,
.stock-page .input-control {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
}

.stock-page textarea.stock-field,
.stock-page textarea.input-control {
    min-height: 88px;
    resize: vertical;
}

.stock-delete-inline {
    display: inline;
    margin: 0;
}

.stock-card--articles {
    margin-bottom: 0;
}

.stock-row--alert {
    background: #fff7ed;
}

.stock-badge-alert {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #ffedd5;
    color: #c2410c;
}

.stock-badge-ok {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #dcfce7;
    color: #15803d;
}

.gestion-kpi--warn strong {
    color: #c2410c;
}

.gestion-badge--warn {
    background: #ffedd5;
    color: #c2410c;
}

.stock-card--alert {
    margin-bottom: 24px;
    border-color: #fdba74;
}

.stock-card--help {
    background: #f8fafc;
}

.stock-delete-form {
    margin-top: 12px;
}

/* ——— Module Bibliotheque ——— */
.bibliotheque-page {
    --bib-cream: #faf7f2;
    --bib-paper: #ffffff;
    --bib-ink: #1c1917;
    --bib-muted: #78716c;
    --bib-border: #e7e5e4;
    --bib-accent: #b45309;
    --bib-accent-soft: #fef3c7;
    --bib-violet: #6d28d9;
    --bib-violet-soft: #f5f3ff;
    --bib-teal: #0f766e;
    --bib-teal-soft: #ccfbf1;
    --bib-radius: 16px;
    --bib-shadow: 0 4px 24px rgba(28, 25, 23, 0.06), 0 1px 3px rgba(28, 25, 23, 0.04);
    --bib-shadow-lg: 0 20px 50px rgba(28, 25, 23, 0.1);
}

.bib-content {
    max-width: 1280px;
}

.bib-toasts {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.bib-toast {
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
}

.bib-toast--success {
    background: linear-gradient(90deg, #ecfdf5, #d1fae5);
    color: #047857;
    border: 1px solid #a7f3d0;
}

.bib-toast--error {
    background: linear-gradient(90deg, #fef2f2, #fee2e2);
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.bib-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    padding: 28px 36px;
    margin-bottom: 28px;
    border-radius: 20px;
    background:
        linear-gradient(135deg, #292524 0%, #44403c 40%, #57534e 100%);
    color: #fafaf9;
    box-shadow: var(--bib-shadow-lg);
    position: relative;
    overflow: hidden;
}

.bib-hero::before {
    content: "";
    position: absolute;
    right: -40px;
    top: -60px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.25) 0%, transparent 70%);
    pointer-events: none;
}

.bib-hero::after {
    content: "📖";
    position: absolute;
    right: 32px;
    bottom: 16px;
    font-size: 72px;
    opacity: 0.12;
    pointer-events: none;
}

.bib-hero-text {
    position: relative;
    z-index: 1;
}

.bib-hero-kicker {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #fbbf24;
    margin-bottom: 8px;
}

.bib-hero-title {
    margin: 0 0 8px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.bib-hero-desc {
    margin: 0;
    font-size: 15px;
    color: #d6d3d1;
    max-width: 480px;
    line-height: 1.5;
}

.bib-hero-stats {
    display: flex;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.bib-stat-chip {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 16px 24px;
    text-align: center;
    min-width: 100px;
}

.bib-stat-chip--accent {
    background: rgba(251, 191, 36, 0.2);
    border-color: rgba(251, 191, 36, 0.35);
}

.bib-stat-value {
    display: block;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
}

.bib-stat-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #d6d3d1;
    margin-top: 4px;
}

.bib-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 28px;
    align-items: start;
    margin-bottom: 32px;
}

@media (max-width: 1100px) {
    .bib-layout {
        grid-template-columns: 1fr;
    }
    .bib-side-col {
        order: -1;
    }
}

.bib-step-card {
    background: var(--bib-paper);
    border: 1px solid var(--bib-border);
    border-radius: var(--bib-radius);
    margin-bottom: 20px;
    box-shadow: var(--bib-shadow);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.bib-step-card:hover {
    box-shadow: 0 8px 30px rgba(28, 25, 23, 0.08);
}

.bib-step-card--book {
    border-left: 4px solid var(--bib-accent);
}

.bib-step-card--dates {
    border-left: 4px solid var(--bib-teal);
}

.bib-step-head {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 22px 28px;
    background: linear-gradient(180deg, #fafaf9 0%, #fff 100%);
    border-bottom: 1px solid var(--bib-border);
}

.bib-step-num {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--bib-violet) 0%, #5b21b6 100%);
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(109, 40, 217, 0.35);
}

.bib-step-num--book {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    box-shadow: 0 4px 12px rgba(180, 83, 9, 0.35);
}

.bib-step-num--dates {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.35);
}

.bib-step-head h3 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
    color: var(--bib-ink);
}

.bib-step-head p {
    margin: 0;
    font-size: 14px;
    color: var(--bib-muted);
}

.bib-step-body {
    padding: 24px 28px 28px;
}

.bib-grid {
    display: grid;
    gap: 20px 22px;
}

.bib-grid--2 {
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 640px) {
    .bib-grid--2 {
        grid-template-columns: 1fr;
    }
}

.bib-field-wrap--full {
    grid-column: 1 / -1;
}

.bib-field-wrap label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bib-muted);
    margin-bottom: 8px;
}

.bib-field,
.bibliotheque-page .bib-field,
.bibliotheque-page select.bib-field {
    width: 100%;
    min-height: 52px;
    font-size: 16px;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1.5px solid var(--bib-border);
    background: #fafaf9;
    color: var(--bib-ink);
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.bib-field:hover,
.bibliotheque-page .bib-field:hover {
    border-color: #d6d3d1;
}

.bib-field:focus,
.bibliotheque-page .bib-field:focus {
    outline: none;
    border-color: var(--bib-violet);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.12);
}

.bibliotheque-page textarea.bib-field {
    min-height: 100px;
    resize: vertical;
    line-height: 1.5;
}

.bib-error {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #dc2626;
    font-weight: 500;
}

.bib-error--block {
    margin-top: 10px;
}

.bib-catalog-pick {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bib-accent-soft);
    border-radius: 14px;
    border: 1px dashed #fcd34d;
}

.bib-catalog-pick label {
    color: #92400e !important;
}

.bib-hint {
    font-size: 13px;
    color: #a16207;
    margin: 10px 0 0;
}

.bib-book-preview {
    display: flex;
    gap: 20px;
    align-items: stretch;
    padding: 20px;
    background: linear-gradient(145deg, #faf7f2 0%, #f5f5f4 100%);
    border-radius: 14px;
    border: 1px solid var(--bib-border);
}

.bib-book-spine {
    width: 12px;
    flex-shrink: 0;
    border-radius: 4px 2px 2px 4px;
    background: linear-gradient(180deg, #b45309 0%, #78350f 100%);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
}

.bib-book-preview.is-filled .bib-book-spine {
    background: linear-gradient(180deg, #7c3aed 0%, #4c1d95 100%);
}

.bib-book-fields {
    flex: 1;
    min-width: 0;
}

.bib-conditions-card {
    background: linear-gradient(135deg, var(--bib-violet-soft) 0%, #ede9fe 100%);
    border: 1px solid #ddd6fe;
    border-radius: var(--bib-radius);
    padding: 22px 26px;
    margin-bottom: 24px;
}

.bib-conditions-label {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    cursor: pointer;
    margin: 0;
}

.bib-checkbox-box input {
    width: 22px;
    height: 22px;
    margin-top: 2px;
    accent-color: var(--bib-violet);
    cursor: pointer;
}

.bib-conditions-text {
    font-size: 15px;
    line-height: 1.55;
    color: #4c1d95;
    font-weight: 500;
}

.bib-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding-top: 8px;
}

.bib-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
}

.bib-btn--primary {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 50%, #5b21b6 100%);
    color: #fff;
    box-shadow: 0 6px 20px rgba(109, 40, 217, 0.4);
}

.bib-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(109, 40, 217, 0.45);
}

.bib-btn--ghost {
    background: #fff;
    color: #57534e;
    border: 1.5px solid var(--bib-border);
}

.bib-btn--ghost:hover {
    background: #fafaf9;
    border-color: #d6d3d1;
}

.bib-btn--catalog {
    width: 100%;
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(180, 83, 9, 0.35);
    margin-top: 8px;
}

.bib-btn--catalog:hover {
    transform: translateY(-1px);
}

.bib-catalog-card {
    position: sticky;
    top: 24px;
    background: var(--bib-paper);
    border-radius: var(--bib-radius);
    border: 1px solid var(--bib-border);
    box-shadow: var(--bib-shadow-lg);
    overflow: hidden;
}

.bib-catalog-card-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 24px;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-bottom: 1px solid #fde68a;
}

.bib-catalog-icon {
    font-size: 32px;
    line-height: 1;
}

.bib-catalog-card-head h3 {
    margin: 0 0 2px;
    font-size: 17px;
    color: #78350f;
}

.bib-catalog-card-head p {
    margin: 0;
    font-size: 13px;
    color: #a16207;
}

.bib-catalog-form {
    padding: 22px 24px 26px;
}

.bib-register {
    background: var(--bib-paper);
    border-radius: 20px;
    border: 1px solid var(--bib-border);
    box-shadow: var(--bib-shadow);
    overflow: hidden;
}

.bib-register-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 28px;
    background: linear-gradient(180deg, #fafaf9 0%, #fff 100%);
    border-bottom: 1px solid var(--bib-border);
}

.bib-register-head h2 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 700;
}

.bib-register-head p {
    margin: 0;
    font-size: 14px;
    color: var(--bib-muted);
}

.bib-register-badge {
    background: var(--bib-teal-soft);
    color: var(--bib-teal);
    font-size: 13px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 999px;
}

.bib-register-table-wrap {
    overflow-x: auto;
}

.bib-register-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.bib-register-table thead th {
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bib-muted);
    padding: 14px 20px;
    background: #fafaf9;
    border-bottom: 1px solid var(--bib-border);
}

.bib-register-table tbody td {
    padding: 18px 20px;
    vertical-align: middle;
    border-bottom: 1px solid #f5f5f4;
}

.bib-register-table tbody tr:hover {
    background: #fafaf9;
}

.bib-register-table tbody tr.is-late {
    background: #fef2f2;
}

.bib-register-table tbody tr.is-late:hover {
    background: #fee2e2;
}

.bib-user-cell {
    display: flex;
    align-items: center;
    gap: 14px;
}

.bib-user-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: linear-gradient(135deg, #e9d5ff 0%, #c4b5fd 100%);
    color: #5b21b6;
    font-weight: 800;
    font-size: 15px;
}

.bib-contact-line {
    display: block;
    line-height: 1.4;
}

.bib-contact-line + .bib-contact-line {
    font-size: 13px;
    color: var(--bib-muted);
}

.bib-book-title {
    display: block;
    margin-bottom: 2px;
}

.bib-pill {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.bib-pill--en_cours {
    background: #dbeafe;
    color: #1d4ed8;
}

.bib-pill--en_retard {
    background: #fee2e2;
    color: #b91c1c;
}

.bib-pill--rendu {
    background: #d1fae5;
    color: #047857;
}

.bib-row-actions {
    white-space: nowrap;
}

.bib-action-link {
    display: inline-block;
    padding: 8px 14px;
    margin: 2px 4px 2px 0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--bib-violet);
    background: var(--bib-violet-soft);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}

.bib-action-link:hover {
    background: #ede9fe;
}

.bib-action-link--success {
    color: #047857;
    background: #ecfdf5;
}

.bib-action-link--success:hover {
    background: #d1fae5;
}

.bib-inline-form {
    display: inline;
}

.bib-returned {
    font-size: 12px;
    color: var(--bib-muted);
}

.bib-empty-row {
    text-align: center;
    padding: 48px 20px !important;
    color: var(--bib-muted);
    font-size: 15px;
}
