/* ============================================
   PERENNE ASSURANCE - Design System (Navy / Bordeaux)
   Charte issue du handoff Claude Design
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    /* Marque */
    --navy: #1E2D5C;
    --navy-700: #243670;
    --navy-500: #3E5586;
    --navy-300: #8FA1C5;
    --navy-200: #B9C4DD;
    --navy-100: #DCE2EE;
    --navy-50: #EEF1F8;
    --bordeaux: #9b1e1a;
    --bordeaux-700: #8E1E23;
    --bordeaux-50: #FBECED;

    /* Texte */
    --ink: #0F1626;
    --ink-2: #2A3146;
    --mute: #5A6478;
    --mute-2: #8A93A6;

    /* Surfaces & bordures */
    --bg-page: #F6F7FB;
    --bg-card: #FFFFFF;
    --bg-table-head: #FBFBFE;
    --border: #E5E8F0;
    --border-row: #EEF0F6;

    /* Alias retro-compatibilité (anciennes classes du projet) */
    --primary-900: var(--ink);
    --primary-800: var(--ink-2);
    --primary-700: var(--mute);
    --primary-200: var(--border);
    --primary-100: #F1F5F9;
    --primary-50: var(--navy-50);
    --accent-blue: var(--navy);
    --color-success: #10B981;
    --accent-amber: #D97706;
}

/* --- Typography --- */
body {
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    font-size: 0.875rem;
    color: var(--ink);
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
}

.font-display { font-family: 'Newsreader', Georgia, serif; font-weight: 500; letter-spacing: -0.01em; }
.font-mono    { font-family: 'JetBrains Mono', ui-monospace, monospace; }

h1, h2, h3, h4 {
    font-family: 'Newsreader', Georgia, serif;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--ink);
}

h1 { font-size: 1.875rem; }

.label-text, .label-text-alt {
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* --- DaisyUI 5 Theme Override (navy primaire / bordeaux accent) --- */
[data-theme="perenne"] {
    color-scheme: light;

    /* Surfaces */
    --color-base-100: #FFFFFF;
    --color-base-200: #F6F7FB;  /* bg-page */
    --color-base-300: #EEF0F6;  /* border-row */
    --color-base-content: #0F1626;  /* ink */

    /* Primaire - navy */
    --color-primary: #1E2D5C;
    --color-primary-content: #FFFFFF;

    /* Secondaire - navy-500 */
    --color-secondary: #3E5586;
    --color-secondary-content: #FFFFFF;

    /* Accent - vert (boutons Ajouter / Enregistrer) */
    --color-accent: #1d8787;
    --color-accent-content: #FFFFFF;

    /* Neutre - ink-2 */
    --color-neutral: #2A3146;
    --color-neutral-content: #FFFFFF;

    /* Statuts sémantiques */
    --color-info: #1E2D5C;     /* navy */
    --color-info-content: #FFFFFF;
    --color-success: #10B981;  /* vert */
    --color-success-content: #FFFFFF;
    --color-warning: #B45309;
    --color-warning-content: #FFFFFF;
    --color-error: #9b1e1a;    /* bordeaux */
    --color-error-content: #FFFFFF;

    /* Rayons & styles */
    --radius-selector: 1.9rem;
    --radius-field: 0.5rem;
    --radius-box: 1rem;
    --size-selector: 0.25rem;
    --size-field: 0.25rem;
    --border: 1px;
    --depth: 1;
    --noise: 0;
}

/* --- Cards --- */
.card {
    border-radius: 12px;
    border: 1px solid var(--primary-200);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.tox-promotion-link {
  display: none !important;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

/* --- Form Inputs --- */
.form-input, select.select, .input, .textarea {
    font-size: 0.875rem;
    background: var(--primary-50);
    border: 1px solid #c5c5c5;
    width: 100%;
    padding: 0.53rem 1rem;
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    height: auto;
}

div.tox-tinymce {
  width: 100% !important;
}

.form-input:focus, .input:focus, .textarea:focus, select.select:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(32, 47, 88, 0.10);
    outline: none;
}

.form-input {
    min-height: 40px;
}

/* --- Buttons --- */
.btn-accent-blue {
    background: var(--navy);
    color: #fff;
    border: none;
    transition: all 0.2s ease;
}

.btn-accent-blue:hover {
    background: var(--navy-700);
    transform: translateY(-1px);
}

.btn-secondary-outline {
    background: #fff;
    color: var(--primary-900);
    border: 1px solid var(--primary-200);
    transition: all 0.2s ease;
}

.btn-secondary-outline:hover {
    border-color: var(--primary-700);
    background: var(--primary-50);
}

/* --- Breadcrumb --- */
.breadcrumbs ul li + li::before {
    color: var(--accent-amber);
    opacity: 0.5;
}

/* --- btn-neutral override (navy) --- */
.btn-neutral {
    background-color: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

.btn-neutral:hover {
    background-color: var(--navy-700);
    border-color: var(--navy-700);
    color: #fff;
}

/* --- Active link --- */
a.active {
    color: var(--accent-blue);
}

/* --- Fieldset --- */
fieldset.fieldset {
    padding: 0;
}

legend.fieldset-legend {
    padding: 0;
}

/* --- Tom Select --- */
div.ts-wrapper .ts-control {
    padding: 9px 8px 10px 8px;
    font-size: 0.875rem;
    background: var(--primary-50);
    border: 1px solid #c5c5c5;
    border-radius: 8px;
}

/* --- Formulaire de fiche prospect (.fiche-form) : labels au-dessus, champs uniformes --- */
/* Utilisé sur la page de création/édition et dans la modale de prospection */
.fiche-form .champ > label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #2A3146;
    margin-bottom: 6px;
    letter-spacing: .01em;
}
.fiche-form .champ input:not([type="checkbox"]):not([type="hidden"]),
.fiche-form .champ select,
.fiche-form .champ textarea {
    width: 100%;
    height: 38px;
    box-sizing: border-box;
    margin-top: 0 !important;
    border: 1px solid #E5E8F0;
    border-radius: 8px;
    background: #fff;
    padding: 8px 12px;
    font-size: 13px;
    color: #0F1626;
}
.fiche-form .champ textarea { height: auto; min-height: 76px; }
.fiche-form .champ select[multiple] { height: auto; min-height: 38px; }
.fiche-form .champ input:focus,
.fiche-form .champ select:focus,
.fiche-form .champ textarea:focus {
    outline: none;
    border-color: #8FA1C5;
    box-shadow: 0 0 0 3px rgba(30, 45, 92, .08);
}
/* Tom Select : même gabarit que les inputs, item centré verticalement.
   NB : les selects Tom Select ne reçoivent plus les classes DaisyUI `select select-bordered`
   (exclues côté JS dans utils.js), donc le wrapper n'a aucun style DaisyUI à neutraliser. */
.fiche-form .champ .ts-wrapper { margin-top: 0 !important; width: 100%; }
.fiche-form .champ .ts-wrapper .ts-control {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid #E5E8F0;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
}
/* L'input interne de Tom Select (recherche/autogrow) ne doit pas hériter du gabarit
   des inputs classiques (.fiche-form .champ input) : sinon width:100% + height + bordure
   le forcent en pleine largeur, l'item sélectionné passe sur 2 lignes et se fait rogner */
.fiche-form .champ .ts-wrapper .ts-control > input {
    width: auto;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}
/* Focus : halo discret comme les inputs, et neutralisation de l'outline focus-visible
   de DaisyUI (outline ink + offset) qui crée un double cadre foncé sur le contrôle Tom Select */
.fiche-form .champ .ts-wrapper.focus .ts-control {
    border-color: #8FA1C5;
    box-shadow: 0 0 0 3px rgba(30, 45, 92, .08);
}
.fiche-form .champ .ts-wrapper .ts-control,
.fiche-form .champ .ts-wrapper .ts-control input:focus,
.fiche-form .champ .ts-wrapper .ts-control input:focus-visible {
    outline: none !important;
}
.fiche-form .errorlist {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    color: #8E1E23;
    font-size: 11.5px;
}
.fiche-form .aide { font-size: 11px; color: #8A93A6; margin-top: 4px; }

/* --- Join items (pagination) --- */
.join-item.btn.btn-primary {
    border-color: var(--primary-200);
    background: #fff;
    color: var(--primary-900);
}

.join-item.btn.btn-primary.btn-active,
.join-item.btn.btn-primary:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #fff;
}

/* --- Top navigation (desktop) --- */
.topnav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.topnav-item:hover {
    color: var(--accent-blue);
    background: rgba(0, 171, 171, 0.06);
}

.topnav-item.active {
    color: var(--accent-blue);
    background: rgba(0, 82, 176, 0.08);
    box-shadow: inset 0 -2px 0 var(--accent-blue);
}

/* --- Mobile navigation --- */
.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #4b5563;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.mobile-nav-item:hover {
    color: var(--accent-blue);
    background: rgba(0, 171, 171, 0.06);
}

.mobile-nav-item.active {
    color: var(--accent-blue);
    background: rgba(0, 82, 176, 0.08);
    border-left: 3px solid var(--accent-blue);
}

/* --- PDF Viewer (preserved) --- */
#pdf-controls {
    background: rgba(0, 0, 0, 0.8);
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    color: white;
}

#pdf-controls button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

#pdf-controls button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

#pdf-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#pdf-viewer-container {
    overflow: hidden;
    background: #525252;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 2000px;
}

#book-container {
    display: flex;
    gap: 20px;
    position: relative;
    transition: transform 0.6s ease-in-out;
}

.page-wrapper {
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    background: white;
}

.page-canvas {
    display: block;
}

@keyframes pageFlipLeft {
    0% { transform: rotateY(0deg); z-index: 2; }
    50% { transform: rotateY(-90deg); z-index: 2; }
    100% { transform: rotateY(-180deg); z-index: 1; }
}

@keyframes pageFlipRight {
    0% { transform: rotateY(-180deg); z-index: 1; }
    50% { transform: rotateY(-90deg); z-index: 2; }
    100% { transform: rotateY(0deg); z-index: 2; }
}

.flipping-left {
    animation: pageFlipLeft 0.8s ease-in-out;
    transform-origin: left center;
}

.flipping-right {
    animation: pageFlipRight 0.8s ease-in-out;
    transform-origin: right center;
}

/* --- Navbar Dropdowns --- */
.navbar-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    min-width: 240px;
    background: #fff;
    border: 1px solid var(--primary-200);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 50;
    overflow: hidden;
}

.navbar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--primary-700);
    transition: all 0.15s ease;
}

.navbar-dropdown-item:hover {
    color: var(--accent-blue);
    background: rgba(0, 171, 171, 0.06);
}

.navbar-dropdown-item.disabled {
    color: #9ca3af;
    cursor: not-allowed;
    pointer-events: none;
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    color: #fff;
    background: #ef4444;
    border-radius: 9999px;
    border: 2px solid #fff;
}

/* --- Reglage Sidebar Layout --- */
.reglage-layout {
    display: flex;
    min-height: 0;
    flex: 1;
    position: relative;
}

.reglage-sidebar {
    width: 250px;
    min-width: 250px;
    background: #fff;
    border-right: 1px solid var(--primary-200);
    padding: 1rem 0;
    overflow-y: auto;
    transition: width 0.2s ease, min-width 0.2s ease;
}

.reglage-sidebar-toggle {
    display: none;
}

.reglage-backdrop {
    display: none;
}

.reglage-sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.reglage-sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary-700);
    text-decoration: none;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    white-space: nowrap;
}

.reglage-sidebar-item:hover {
    background: var(--primary-100);
    color: var(--primary-900);
}

.reglage-sidebar-item.active {
    color: var(--accent-blue);
    background: rgba(0, 171, 171, 0.06);
    border-left-color: var(--accent-blue);
    font-weight: 600;
}

.reglage-sidebar-item.disabled {
    color: #cbd5e1;
    cursor: not-allowed;
    pointer-events: none;
}

.reglage-content {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
}

/* --- Reglage Sidebar Responsive (< lg / 1024px) --- */
@media (max-width: 1023px) {
    /* Toggle button visible */
    .reglage-sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 0.5rem 0;
        margin-bottom: 0.25rem;
        background: none;
        border: none;
        border-bottom: 1px solid var(--primary-200);
        color: var(--primary-700);
        font-size: 1rem;
        cursor: pointer;
        transition: color 0.15s ease;
    }

    .reglage-sidebar-toggle:hover {
        color: var(--accent-blue);
    }

    /* Collapsed: icons only */
    .reglage-sidebar {
        width: 56px;
        min-width: 56px;
        padding: 0.5rem 0;
        z-index: 30;
    }

    .reglage-sidebar-item {
        justify-content: center;
        padding: 0.625rem 0;
        border-left: none;
        gap: 0;
    }

    .reglage-sidebar-item.active {
        border-left: none;
        background: rgba(0, 171, 171, 0.06);
    }

    .reglage-sidebar-label {
        display: none;
    }

    /* Expanded: full sidebar as overlay */
    .reglage-sidebar.expanded {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        width: 250px;
        min-width: 250px;
        z-index: 40;
        box-shadow: 4px 0 16px rgba(0, 0, 0, 0.1);
    }

    .reglage-sidebar.expanded .reglage-sidebar-item {
        justify-content: flex-start;
        padding: 0.625rem 1.25rem;
        gap: 0.75rem;
        border-left: 3px solid transparent;
    }

    .reglage-sidebar.expanded .reglage-sidebar-item.active {
        border-left-color: var(--accent-blue);
    }

    .reglage-sidebar.expanded .reglage-sidebar-label {
        display: inline;
    }

    /* Backdrop */
    .reglage-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.3);
        z-index: 35;
    }
}

/* ============================================================
   COMPOSANTS CHARTE PERENNE (handoff Claude Design)
   ============================================================ */

/* --- App shell (sidebar navy + colonne principale) --- */
.app-shell { display: flex; height: 100vh; overflow: hidden; }
.app-main  { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }

/* --- Sidebar --- */
.sidebar {
    width: 248px; flex-shrink: 0;
    background: var(--navy);
    color: rgba(255, 255, 255, 0.85);
    display: flex; flex-direction: column;
    padding: 16px 0;
}
.sidebar-logo {
    padding: 0 20px 20px; display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: inherit;
}
.sidebar-search {
    margin: 0 12px 12px; padding: 7px 10px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    display: flex; align-items: center; gap: 8px;
    font-size: 12.5px; color: rgba(255, 255, 255, 0.55);
    cursor: pointer; width: calc(100% - 24px);
}
.sidebar-search:hover { background: rgba(255, 255, 255, 0.11); }
.sidebar-search kbd {
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    padding: 1px 5px; background: rgba(255, 255, 255, 0.08);
    border-radius: 3px; color: rgba(255, 255, 255, 0.6);
}
.sidebar-section {
    padding: 10px 20px 4px; font-size: 10.5px; font-weight: 600;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: rgba(255, 255, 255, 0.42);
}
.sidebar-nav { flex: 1; overflow-y: auto; }

/* Items de navigation */
.sb-item {
    display: flex; align-items: center; gap: 11px; padding: 7px 20px;
    color: rgba(255, 255, 255, 0.78); cursor: pointer; user-select: none;
    position: relative; font-weight: 500; font-size: 13px; text-decoration: none;
}
.sb-item:hover { color: #fff; background: rgba(255, 255, 255, 0.04); }
.sb-item.active { color: #fff; background: rgba(255, 255, 255, 0.06); }
.sb-item.active::before {
    content: ""; position: absolute; left: 0; top: 6px; bottom: 6px;
    width: 3px; background: var(--bordeaux); border-radius: 0 2px 2px 0;
}
.sb-item-badge {
    background: var(--bordeaux); color: #fff; font-size: 10.5px;
    padding: 1px 7px; border-radius: 999px; font-weight: 600;
}
.sb-sub-item {
    display: flex; align-items: center; gap: 12px; padding: 6px 20px 6px 47px;
    color: rgba(255, 255, 255, 0.6); cursor: pointer; font-size: 12.5px;
    text-decoration: none; position: relative;
}
.sb-sub-item:hover { color: rgba(255, 255, 255, 0.9); }
.sb-sub-item.active { color: #fff; font-weight: 500; }
.sb-sub-dot {
    width: 5px; height: 5px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.3); position: absolute; left: 34px;
}
.sb-sub-item.active .sb-sub-dot { background: var(--bordeaux); }

/* --- Topbar --- */
.topbar {
    height: 58px; background: #fff; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; padding: 0 28px; gap: 16px; flex-shrink: 0;
}
.topbar-crumb { font-size: 12.5px; color: var(--mute); display: flex; align-items: center; gap: 8px; }
.topbar-crumb .sep { color: var(--mute-2); }
.topbar-crumb b { color: var(--ink); font-weight: 600; }

/* --- Boutons charte (complètent DaisyUI) --- */
.btn-soft { background: var(--navy-50); color: var(--navy); border-color: var(--navy-50); }
.btn-soft:hover { background: var(--navy-100); border-color: var(--navy-100); }
.btn-ghost { background: #fff; color: var(--ink-2); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-page); border-color: var(--border); }

.icon-btn {
    width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px; border: 1px solid var(--border);
    background: #fff; color: var(--mute); cursor: pointer; position: relative;
}
.icon-btn:hover { background: var(--bg-page); color: var(--ink); }

/* --- Pastilles de statut --- */
.pill {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11.5px; font-weight: 600; padding: 2px 8px;
    border-radius: 999px; white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-active    { color: #047857; background: #ECFDF5; }
.pill-pending   { color: #B45309; background: #FFFBEB; }
.pill-draft     { color: #475569; background: #F1F5F9; }
.pill-cancelled { color: var(--bordeaux-700); background: var(--bordeaux-50); }
.pill-renewal   { color: #6D28D9; background: #F5F3FF; }
.pill-navy      { color: var(--navy); background: var(--navy-50); }

/* --- Avatars à initiales --- */
.avatar-initials {
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; font-weight: 600; flex-shrink: 0;
    background: var(--navy-50); color: var(--navy-700);
    width: 32px; height: 32px; font-size: 12px;
}
.avatar-initials.bx { background: var(--bordeaux-50); color: var(--bordeaux-700); }

/* --- Switch on/off --- */
.switch {
    width: 36px; height: 20px; background: var(--border); border-radius: 999px;
    position: relative; cursor: pointer; flex-shrink: 0; transition: background 0.15s;
    border: none; padding: 0;
}
.switch::after {
    content: ""; position: absolute; top: 2px; left: 2px;
    width: 16px; height: 16px; background: #fff; border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: left 0.15s;
}
.switch.on { background: var(--navy); }
.switch.on::after { left: 18px; }

/* --- Chips de filtre --- */
.chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px;
    border: 1px solid var(--border); background: #fff; border-radius: 999px;
    font-size: 12px; color: var(--ink-2); cursor: pointer; text-decoration: none;
    transition: background-color 0.12s;
}
.chip:hover { background: var(--bg-page); }
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip-count {
    background: #F1F5F9; font-size: 10.5px; padding: 1px 6px;
    border-radius: 999px; color: var(--mute); font-weight: 600;
}
.chip.active .chip-count { background: rgba(255, 255, 255, 0.18); color: #fff; }

/* --- Tableau de données charte --- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl thead th {
    text-align: left; font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--mute); padding: 10px 14px;
    border-bottom: 1px solid var(--border); background: var(--bg-table-head);
}
.tbl tbody td {
    padding: 12px 14px; border-bottom: 1px solid var(--border-row);
    color: var(--ink-2); vertical-align: middle;
}
.tbl tbody tr:hover { background: var(--bg-table-head); }
.tbl tbody tr:last-child td { border-bottom: none; }

/* --- Onglets multi-étapes --- */
.tab-step-bar { display: flex; border-bottom: 1px solid var(--border); }
.tab {
    padding: 13px 16px; font-size: 13px; font-weight: 500; color: var(--mute);
    cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
    display: inline-flex; align-items: center; gap: 8px;
    background: transparent; border-top: none; border-left: none; border-right: none;
    font-family: inherit; white-space: nowrap; text-decoration: none;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--navy); border-bottom-color: var(--bordeaux); }
.tab-step {
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--border); color: var(--mute);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 600;
}
.tab.done .tab-step { background: #10B981; color: #fff; }
.tab.active .tab-step { background: var(--navy); color: #fff; }

/* --- Alpine x-cloak (évite le flash avant init) --- */
[x-cloak] { display: none !important; }

/* --- Indicateur de chargement HTMX --- */
.htmx-indicator { opacity: 0; transition: opacity 0.15s ease; }
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator { opacity: 1; }

/* --- Sidebar responsive (off-canvas < menu) --- */
@media (max-width: 999px) {
    /* La topbar reste au-dessus du drawer pour garder le burger cliquable (ouverture/fermeture) */
    .topbar { position: relative; z-index: 60; }
    .sidebar {
        position: fixed; top: 58px; left: 0; bottom: 0; z-index: 50;
        transform: translateX(-100%); transition: transform 0.2s ease;
    }
    .sidebar.is-open { transform: translateX(0); }
}
