:root {
    --navy: #111d35;
    --navy-soft: #1c2b49;
    --blue: #246bfd;
    --bg: #f4f7fb;
    --text: #172033;
    --muted: #718096;
    --line: #e7ebf2;
    --white: #fff;
    /* Header + filtres centrés (pas pleine largeur) ; tableau reste large */
    --app-chrome-width: 420px;
    --app-sidebar-width: 248px;
    --app-content-width: 1400px;
    --app-layout-width: 1648px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }

.guest-body {
    display: grid;
    place-items: center;
    padding: 32px;
    background:
        radial-gradient(circle at 15% 20%, rgba(36, 107, 253, .22), transparent 30%),
        linear-gradient(135deg, #0d1830, #17294b);
}

.guest-shell { width: min(100%, 1040px); }
.login-card {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    min-height: 610px;
    overflow: hidden;
    border-radius: 26px;
    background: var(--white);
    box-shadow: 0 28px 80px rgba(0, 0, 0, .28);
}

.login-visual {
    display: flex;
    align-items: flex-end;
    padding: 58px;
    color: white;
    background:
        linear-gradient(160deg, rgba(20, 45, 89, .2), rgba(8, 23, 50, .94)),
        radial-gradient(circle at 70% 20%, #2c72ff 0, #17386f 35%, #101d37 75%);
}
.login-visual-content { max-width: 430px; }
.eyebrow { display: block; margin-bottom: 12px; color: #6f9cff; font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.login-visual h1 { margin: 0 0 18px; font-size: clamp(36px, 4vw, 54px); line-height: 1.05; letter-spacing: -.04em; }
.login-visual p { max-width: 390px; margin: 0; color: #c8d5eb; font-size: 17px; line-height: 1.65; }
.login-form-panel { display: flex; flex-direction: column; justify-content: center; padding: 68px; }
.login-heading { display: flex; align-items: center; gap: 16px; margin-bottom: 42px; }
.brand-mark {
    display: grid;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 13px;
    color: white;
    background: linear-gradient(135deg, #377cff, #1756d8);
    box-shadow: 0 8px 18px rgba(36, 107, 253, .3);
    font-weight: 900;
}
.login-heading h2 { margin: 0 0 5px; font-size: 28px; }
.login-heading p, .form-note { margin: 0; color: var(--muted); }
.form { display: grid; gap: 22px; }
.form label { display: grid; gap: 8px; color: #3a465d; font-size: 13px; font-weight: 700; }
.form input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #dce2eb;
    border-radius: 11px;
    outline: none;
    color: var(--text);
    background: #fbfcfe;
}
.form input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(36, 107, 253, .1); }
.button { padding: 11px 18px; border: 0; border-radius: 10px; cursor: pointer; font-weight: 750; }
.button-primary { color: white; background: var(--blue); box-shadow: 0 9px 20px rgba(36, 107, 253, .22); }
.button-secondary { color: #334155; background: #eef2f7; }
.button-block { width: 100%; margin-top: 6px; padding: 15px; }
.form-note { margin-top: 26px; font-size: 12px; text-align: center; }
.alert { margin-bottom: 22px; padding: 13px 15px; border-radius: 10px; font-size: 14px; }
.alert-error { color: #9f2736; border: 1px solid #f4c9d0; background: #fff0f2; }
.alert-success { color: #126b4d; border: 1px solid #bce8d8; background: #ebfaf5; }

.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; width: 100%; }
.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    height: 100vh;
    flex-direction: column;
    padding: 28px 18px 20px;
    color: #d9e2f2;
    background: var(--navy);
    overflow: hidden;
}
.brand {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    gap: 13px;
    padding: 0 9px 24px;
    color: white;
    font-size: 18px;
    font-weight: 850;
    text-decoration: none;
}
.brand-logo {
    display: block;
    height: 44px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}
.login-logo {
    display: block;
    height: 52px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
}
.nav {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .22) transparent;
}
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav::-webkit-scrollbar-thumb { border-radius: 3px; background: rgba(255, 255, 255, .22); }
.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    padding: 13px 14px;
    border-radius: 10px;
    color: #aebbd0;
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
    flex-shrink: 0;
}
.nav-link.active { color: white; background: var(--navy-soft); }
.nav-icon { display: grid; width: 24px; place-items: center; font-size: 19px; }
.nav-group {
    flex-shrink: 0;
}
.nav-group > summary.nav-link-toggle {
    list-style: none;
    cursor: pointer;
}
.nav-group > summary.nav-link-toggle::-webkit-details-marker {
    display: none;
}
.nav-link-toggle .nav-label {
    flex: 1;
    min-width: 0;
}
.nav-caret {
    margin-left: auto;
    font-size: 11px;
    opacity: .75;
    transition: transform .15s ease;
}
.nav-group[open] > summary .nav-caret {
    transform: rotate(180deg);
}
.nav-group.is-active > summary,
.nav-group[open] > summary {
    color: white;
    background: var(--navy-soft);
}
.nav-submenu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 0 8px 10px;
}
.nav-sublink {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: #aebbd0;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.nav-sublink:hover,
.nav-sublink.active {
    color: white;
    background: rgba(255, 255, 255, .08);
}
.nav-sublink .nav-icon {
    width: 18px;
    font-size: 12px;
}
.sidebar-user { display: flex; flex-shrink: 0; align-items: center; gap: 11px; padding: 17px 10px 2px; border-top: 1px solid rgba(255, 255, 255, .09); }
.avatar { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; color: white; background: #335b9f; font-weight: 800; }
.sidebar-user strong, .sidebar-user small { display: block; }
.sidebar-user strong { max-width: 145px; overflow: hidden; color: white; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user small { margin-top: 3px; color: #91a1bc; font-size: 11px; }
.page { min-width: 0; }
.topbar {
    display: flex;
    height: 78px;
    align-items: center;
    justify-content: space-between;
    padding: 0 34px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .9);
}
.topbar small, .topbar strong { display: block; }
.topbar small { margin-bottom: 3px; color: var(--muted); font-size: 11px; }
.topbar strong { font-size: 15px; }
.content { max-width: none; margin: 0; padding: 34px; box-sizing: border-box; }
.dashboard-top {
    display: flex;
    align-items: flex-start;
    gap: 22px;
    margin: 0 0 22px;
    flex-wrap: wrap;
}
.dashboard-top .search-panel {
    margin: 0;
    flex: 0 1 min(100%, 760px);
    max-width: min(100%, 760px);
}
.dashboard-top .kpi-grid {
    margin: 0;
    flex: 0 1 var(--app-chrome-width, 420px);
}
.kpi-grid {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin: 0 0 22px;
    max-width: var(--app-chrome-width, 420px);
    width: 100%;
}
.kpi-card {
    position: relative;
    display: flex;
    min-height: 108px;
    align-items: center;
    gap: 14px;
    overflow: hidden;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: white;
    box-shadow: 0 7px 22px rgba(24, 40, 72, .04);
    width: 100%;
    max-width: var(--app-chrome-width, 420px);
    box-sizing: border-box;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}
a.kpi-card:hover {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
    box-shadow: 0 8px 24px rgba(24, 40, 72, .08);
}
a.kpi-card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.kpi-card::before { position: absolute; top: 0; right: 0; left: 0; height: 3px; content: ""; background: var(--accent); }
.kpi-icon { display: grid; width: 46px; height: 46px; flex: 0 0 46px; place-items: center; border-radius: 13px; color: var(--accent); background: var(--accent-soft); font-size: 20px; font-weight: 900; }
.kpi-card small, .kpi-card strong { display: block; }
.kpi-card small { margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.kpi-card strong { font-size: 28px; letter-spacing: -.03em; }
.accent-blue { --accent: #246bfd; --accent-soft: #eaf1ff; }
.accent-violet { --accent: #7559e8; --accent-soft: #f0edff; }
.accent-green { --accent: #19a974; --accent-soft: #e8f8f2; }
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: 0 7px 22px rgba(24, 40, 72, .04); }

/* Panneau « Recherche et Filtres » du tableau de bord */
.search-panel {
    margin: 0 0 22px;
    max-width: min(100%, 760px);
    width: 100%;
    box-sizing: border-box;
    background: #444444;
    border-color: #555;
    color: #fff;
}
.search-panel-header {
    padding: 16px 22px;
    border-bottom: 1px solid #555;
}
.search-panel-header h2 {
    margin: 0;
    font-size: 16px;
    color: #fff;
}
.search-form { padding: 18px 22px 22px; }
.search-form-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 12px 18px;
    max-width: 100%;
    width: 100%;
}
.search-form-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.search-form .form-group { display: flex; flex-direction: column; gap: 5px; }
.search-form .form-group[hidden] { display: none !important; }
.search-form .form-group label {
    color: #fff;
    font-size: 15px;
    font-weight: 800;
}
.search-form .form-group input[type="text"],
.search-form .form-group input[type="datetime-local"],
.search-form .form-group select {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #444;
    border-radius: 8px;
    outline: none;
    color: #fff;
    background: #1a1a1a;
    font-size: 13px;
}
.search-form .form-group input::placeholder {
    color: #aaa;
}
.search-form .form-group input:focus,
.search-form .form-group select:focus {
    border-color: #888;
}
.search-form .form-group-inline { flex-direction: row; align-items: center; gap: 8px; }
.search-form .form-group-inline label { margin: 0; color: #fff; }
.date-input-with-now { display: flex; align-items: center; gap: 8px; }
.date-input-with-now input { flex: 1; }
.btn-now {
    padding: 8px 10px;
    border: 1px solid #555;
    border-radius: 8px;
    background: #222;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.btn-now:hover { background: #333; }
.search-form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    max-width: 100%;
    width: 100%;
}
.btn-search {
    padding: 11px 22px;
    border: 0;
    border-radius: 9px;
    background: #e67e22;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .02em;
    cursor: pointer;
}
.btn-search:hover { filter: brightness(1.08); background: #d35400; }
.btn-reset {
    padding: 11px 18px;
    border: 1px solid #dce2eb;
    border-radius: 9px;
    background: #fff;
    color: #3a465d;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}
.btn-reset:hover { background: #f1f3f7; }

/* Recherche rapide + compteur de rÃ©sultats */
.quick-search-container { position: relative; display: flex; align-items: center; margin: 18px 22px 0; }
.quick-search-icon { position: absolute; left: 12px; color: #666; pointer-events: none; }
.quick-search-input {
    width: 100%;
    padding: 10px 38px 10px 36px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}
.quick-search-input:focus { border-color: var(--blue); }
.quick-search-clear {
    position: absolute;
    right: 8px;
    padding: 4px;
    border: 0;
    background: transparent;
    color: #666;
    cursor: pointer;
}
.results-header { padding: 14px 22px 4px; }
.results-header h2 { margin: 0; font-size: 16px; }
.page-header { display: flex; justify-content: space-between; margin-bottom: 24px; }
.page-header .eyebrow { margin: 0 0 8px; }
.page-header h1 { margin: 0 0 7px; font-size: 27px; }
.page-header p { margin: 0; color: var(--muted); }
.profile-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; font-size: 17px; }
.badge { padding: 5px 9px; border-radius: 999px; color: #2756a8; background: #ebf2ff; font-size: 11px; font-weight: 750; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding: 22px; }
.form-stack { display: grid; gap: 18px; padding: 22px; }
.form-grid label, .form-stack label { display: grid; gap: 7px; color: #3a465d; font-size: 12px; font-weight: 700; }
.form-grid input, .form-grid select, .form-stack input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #dce2eb;
    border-radius: 9px;
    outline: none;
    color: var(--text);
    background: #fbfcfe;
}
.form-grid input:focus, .form-grid select:focus, .form-stack input:focus { border-color: var(--blue); }
.form-grid input:disabled { color: #7b8495; background: #f1f3f7; }
.form-actions { grid-column: 1 / -1; }
.form-grid .button, .form-stack .button { color: white; background: var(--blue); }
.validation-panel .validation-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.validation-panel label { display: grid; gap: 7px; color: #3a465d; font-size: 12px; font-weight: 700; }
.validation-panel input, .validation-panel select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dce2eb;
    border-radius: 8px;
    background: #fbfcfe;
}
.validation-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }

/* Compte rendu commercial (modal détail fiche) */
.compte-rendu-section .compte-rendu-form { display: grid; gap: 12px; }
.compte-rendu-section .form-group { display: grid; gap: 6px; }
.compte-rendu-section label { color: #1f2a3d; font-size: 13px; font-weight: 700; }
.compte-rendu-section .form-control {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 11px;
    border: 1px solid #dce2eb;
    border-radius: 8px;
    background: #fff;
    font: inherit;
}
.compte-rendu-pending-item {
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid #f0d78c;
    border-radius: 8px;
    background: #fff8e1;
}
.compte-rendu-pending-comment { margin-top: 8px; }
.compte-rendu-pending-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.compte-rendu-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.compte-rendu-feedback { color: #126b4d; font-size: 13px; font-weight: 700; }
.compte-rendu-feedback.is-error { color: #9f2736; }

/* Changer l'état de la fiche — même largeur que État actuel, champs centrés */
.etat-change-section {
    width: 100%;
    max-width: 760px;
    margin: 16px auto 0;
    box-sizing: border-box;
    padding: 0;
    background: #3a3a3a;
    border: 1px solid #4a4d52;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.etat-change-section > .section-title {
    margin: 0;
    padding: 14px 20px;
    background: #332e2e;
    color: #fff;
    border-bottom: 1px solid #4a4d52;
    font-size: 21px;
    font-weight: 700;
}
.etat-change-section .etat-change-form {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 18px 20px;
    background: #3a3a3a;
    color: #fff;
    justify-items: center;
}
.etat-change-section .form-group { display: grid; gap: 6px; justify-items: start; }
.etat-change-section .ce-etat-select-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
    max-width: 452px;
}
.etat-change-section .ce-etat-select-row > label {
    flex: 0 0 auto;
    margin: 0;
    white-space: nowrap;
}
.etat-change-section .ce-etat-select-row > .form-control,
.etat-change-section .ce-etat-select-row > select.form-control {
    flex: 0 0 240px;
    width: 240px;
    max-width: 240px;
}
.etat-change-section .ce-etat-select-row .ce-blocked-msg {
    flex: 1 1 100%;
    text-align: center;
}
.etat-change-section .histo-confirmateurs-picker {
    width: 100%;
    max-width: 452px;
}
.etat-change-section label,
.etat-change-section .ce-rdv-table td:first-child,
.etat-change-section .ce-rdv-table td:first-child label {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}
.etat-change-section .form-control,
.etat-change-section select.form-control,
.etat-change-section input.form-control,
.etat-change-section textarea.form-control {
    width: 240px;
    max-width: 240px;
    min-width: 0;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #dce2eb;
    border-radius: 6px;
    background: #fff;
    color: #111;
    font: inherit;
    font-size: 13px;
}
.etat-change-section select.form-control option,
.etat-change-section select.form-control optgroup {
    color: #111;
    background: #fff;
}
.etat-change-section textarea.form-control {
    width: 240px;
    max-width: 100%;
    min-height: 88px;
}
.etat-change-section .ce-subform,
.etat-change-section .confirmation-form,
.etat-change-section .etat-form {
    margin-top: 4px;
    display: grid;
    gap: 10px;
    padding: 0;
    background: transparent;
    color: #fff;
    justify-items: center;
    width: 100%;
}
.etat-change-section .ce-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.etat-change-section .ce-blocked-msg { margin: 8px 0 0; color: #ccc; font-size: 0.9em; }
.etat-change-section .ce-link-btn {
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: #4fc3f7;
    cursor: pointer;
    padding: 0;
    font-size: 13px;
    font-weight: 600;
}
.etat-change-section .ce-inline-row {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 240px;
    max-width: 240px;
}
.etat-change-section .ce-inline-row .form-control {
    flex: 1;
    width: auto;
    min-width: 0;
    max-width: none;
}
.etat-change-section .ce-inline-row .button {
    flex-shrink: 0;
    padding: 6px 10px;
}
.etat-change-section .confirmation-form .rdv-form-table,
.etat-change-section .ce-rdv-table {
    width: auto;
    margin: 0 auto;
    border-collapse: separate;
    border-spacing: 0 8px;
}
.etat-change-section .ce-rdv-table td {
    border: none !important;
    border-bottom: none !important;
    padding: 0;
    vertical-align: middle;
    background: transparent;
    color: #fff;
}
.etat-change-section .ce-rdv-table td:first-child {
    width: 200px;
    min-width: 200px;
    max-width: 220px;
    padding-right: 12px;
    white-space: normal;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
}
.etat-change-section .ce-rdv-table td:last-child {
    width: 240px;
}
.etat-change-section .ce-rdv-table .form-control:not(textarea) {
    width: 240px !important;
    max-width: 240px !important;
    min-width: 200px;
}
.etat-change-section .ce-rdv-table textarea.form-control {
    width: 240px !important;
    max-width: 240px !important;
}
.etat-change-section .ce-rdv-table td[colspan="2"] {
    width: auto;
    padding-top: 2px;
    text-align: left;
}
.etat-change-section .ce-form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}
.etat-change-section .ce-form-row .form-group {
    flex: 0 0 auto;
}
.etat-change-section .ce-subtitle {
    margin: 0 0 4px;
    font-size: 15px;
    color: #fff;
    text-align: center;
}
.etat-change-section .ce-conf-toggle-row {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 452px;
    margin-bottom: 4px;
}
.etat-change-section .ce-conf-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    min-width: 36px;
    min-height: 32px;
    background: #2d2d2d;
    border: 1px solid #555;
    border-radius: 4px;
    color: #fff;
}
.etat-change-section .ce-conf-toggle-btn:hover {
    background: #444;
}
.etat-change-section .ce-conf-toggle-btn svg { display: block; color: #fff; }
.etat-change-section .ce-histo-extra { margin-top: 10px; display: grid; gap: 6px; }
.etat-change-section .compte-rendu-feedback { color: #8fd6b5; }
.etat-change-section .compte-rendu-feedback.is-error { color: #ff8a80; }
.etat-change-section .etat-form > .form-group {
    width: 100%;
    max-width: 452px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.etat-change-section .etat-form > .form-group > label {
    flex: 0 0 200px;
    max-width: 200px;
    margin: 0;
}
.etat-change-section .etat-form > .form-group > .form-control {
    flex: 0 0 240px;
}
@media (max-width: 700px) {
    .etat-change-section,
    .etat-actuel-card { max-width: 100%; }
    .etat-change-section .ce-etat-select-row {
        flex-direction: column;
        align-items: stretch;
        max-width: 100%;
    }
    .etat-change-section .ce-etat-select-row > .form-control,
    .etat-change-section .ce-etat-select-row > select.form-control,
    .etat-change-section .form-control,
    .etat-change-section select.form-control,
    .etat-change-section input.form-control,
    .etat-change-section textarea.form-control,
    .etat-change-section .ce-rdv-table .form-control:not(textarea),
    .etat-change-section .ce-rdv-table textarea.form-control,
    .etat-change-section .ce-inline-row {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }
    .etat-change-section .etat-form > .form-group {
        max-width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
    .etat-change-section .etat-form > .form-group > label {
        flex: none;
        max-width: none;
    }
    .etat-change-section .ce-rdv-table,
    .etat-change-section .ce-rdv-table tbody,
    .etat-change-section .ce-rdv-table tr,
    .etat-change-section .ce-rdv-table td {
        display: block;
        width: 100% !important;
        max-width: 100% !important;
    }
    .etat-change-section .ce-rdv-table td:first-child {
        padding: 8px 0 2px;
    }
}

.compte-rendu-early-verification {
    margin-bottom: 8px;
    padding: 14px 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #fff;
    color: #000;
}

/* Demande de décalage — même mise en forme que Changer l'état */
.decalage-section {
    width: 100%;
    max-width: 760px;
    margin: 16px auto 0;
    box-sizing: border-box;
    padding: 0;
    background: #3a3a3a;
    border: 1px solid #4a4d52;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.decalage-section-title {
    margin: 0 !important;
    padding: 14px 20px !important;
    background: #332e2e !important;
    color: #fff !important;
    border-bottom: 1px solid #4a4d52;
    font-size: 21px !important;
    font-weight: 700;
    text-align: center;
}
.decalage-section .decalage-new-form,
.decalage-section .decalage-rdv-historique,
.decalage-section .decalage-pending-box,
.decalage-section .decalage-already-created {
    border: none;
    border-top: 1px solid #4a4d52;
    padding: 18px 20px;
    background: #3a3a3a;
    color: #fff;
}
.decalage-section .decalage-new-form {
    display: grid;
    gap: 14px;
    justify-items: center;
}
.decalage-section .form-group {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
    max-width: 452px;
    margin: 0;
}
.decalage-section .form-group > label {
    flex: 0 0 200px;
    max-width: 200px;
    margin: 0;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
}
.decalage-section .form-control,
.decalage-section select.form-control,
.decalage-section textarea.form-control {
    flex: 0 0 240px;
    width: 240px;
    max-width: 240px;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #dce2eb;
    border-radius: 6px;
    background: #fff;
    color: #111;
    font: inherit;
    font-size: 13px;
}
.decalage-section select.form-control option {
    color: #111;
    background: #fff;
}
.decalage-section textarea.form-control {
    min-height: 88px;
}
.decalage-section .form-group > .decalage-readonly-value {
    flex: 0 0 240px;
    width: 240px;
    max-width: 240px;
    box-sizing: border-box;
}
.decalage-section .form-group > .decalage-warning-text {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    text-align: center;
}
.decalage-section .decalage-optional {
    color: #c5c9ce;
    font-weight: 600;
    font-size: 12px;
}
.decalage-section .decalage-rdv-historique h3,
.decalage-section .decalage-pending-box h3 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    text-align: center;
}
.decalage-section .decalage-rdv-historique-table {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    border-collapse: collapse;
    font-size: 12px;
    background: #fff;
    color: #111;
    border-radius: 6px;
    overflow: hidden;
}
.decalage-section .decalage-rdv-historique-table th,
.decalage-section .decalage-rdv-historique-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    color: #111;
    background: #fff;
}
.decalage-section .decalage-rdv-historique-table th {
    background: #f3f4f6;
    font-weight: 700;
}
.decalage-section .decalage-pending-box {
    display: grid;
    gap: 12px;
    justify-items: center;
}
.decalage-section .decalage-pending-item {
    width: 100%;
    max-width: 520px;
    background: #fff8e1;
    padding: 12px 14px;
    border-radius: 6px;
    border: 1px solid #f59e0b;
    display: grid;
    gap: 6px;
    font-size: 12px;
    color: #111;
    box-sizing: border-box;
}
.decalage-section .decalage-pending-item strong { color: #111; }
.decalage-section .decalage-pending-message { font-style: italic; color: #555; }
.decalage-section .decalage-pending-actions { margin-top: 8px; }
.decalage-section .decalage-pending-help {
    margin: 0;
    max-width: 520px;
    font-size: 12px;
    color: #fbbf24;
    font-style: italic;
    text-align: center;
}
.decalage-section .decalage-already-created {
    text-align: center;
}
.decalage-section .decalage-already-created p {
    margin: 0 0 12px;
    color: #fff;
}
.decalage-section .decalage-date-preview {
    width: 100%;
    max-width: 452px;
    background: #e8f5e9;
    padding: 12px 14px;
    border-radius: 6px;
    border: 2px solid #4caf50;
    box-sizing: border-box;
    color: #111;
}
.decalage-section .decalage-date-preview strong { color: #111; }
.decalage-section .decalage-date-preview span {
    display: block;
    margin-top: 5px;
    font-size: 14px;
    font-weight: 800;
    color: #2e7d32;
}
.decalage-section .decalage-date-originale {
    margin-top: 8px;
    font-size: 12px;
    color: #555;
    font-style: italic;
}
.decalage-section .decalage-readonly-value {
    background: #2d2d2d;
    border: 1px solid #555;
    color: #fff;
    padding: 10px;
    border-radius: 6px;
    font-weight: 700;
}
.decalage-section .decalage-warning-text {
    color: #ff8a80;
    font-style: italic;
    font-size: 12px;
}
.decalage-section .decalage-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
    width: 100%;
}
.decalage-section .decalage-feedback { color: #8fd6b5; font-size: 13px; font-weight: 700; }
.decalage-section .decalage-feedback.is-error { color: #ff8a80; }
@media (max-width: 700px) {
    .decalage-section { max-width: 100%; }
    .decalage-section .form-group {
        flex-direction: column;
        align-items: stretch;
        max-width: 100%;
    }
    .decalage-section .form-group > label {
        flex: none;
        max-width: none;
    }
    .decalage-section .form-control,
    .decalage-section select.form-control,
    .decalage-section textarea.form-control,
    .decalage-section .form-group > .decalage-readonly-value,
    .decalage-section .form-group > .decalage-warning-text,
    .decalage-section .decalage-date-preview,
    .decalage-section .decalage-pending-item {
        width: 100%;
        max-width: 100%;
        flex: 1 1 auto;
    }
}

.early-cr-verification-title { margin: 0 0 8px; font-weight: 800; color: #000; }
.early-cr-verification-message { margin: 0 0 12px; line-height: 1.45; color: #000; }
.early-cr-code-display {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: .35em;
    color: #000;
}
.early-cr-input-group { margin-bottom: 8px; }
.early-cr-code-input {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: .2em;
}
.early-cr-verification-error { margin: 0 0 10px; color: #c62828; font-weight: 700; }
.early-cr-actions { margin-top: 4px; }

.btn-cancel { padding: 10px 14px; border: 0; border-radius: 8px; color: #7f1d1d; background: #fee2e2; cursor: pointer; font-weight: 700; }
.notif-badge {
    display: inline-grid;
    min-width: 18px;
    height: 18px;
    place-items: center;
    margin-left: 6px;
    padding: 0 5px;
    border-radius: 999px;
    color: white;
    background: #ef4444;
    font-size: 10px;
    font-weight: 800;
}
.notif-badge.is-blinking,
.notif-is-blinking .notif-badge {
    animation: notif-badge-blink 0.55s ease-in-out infinite;
}
@keyframes notif-badge-blink {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.18); opacity: 0.55; }
}
.notif-toast-host {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 12000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(360px, calc(100vw - 24px));
    pointer-events: none;
}
.notif-toast {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #0f172a;
    text-decoration: none;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
    animation: notif-toast-in 0.22s ease-out;
}
.notif-toast strong {
    font-size: 13px;
    font-weight: 800;
    color: #1d4ed8;
}
.notif-toast span {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    color: #334155;
}
.notif-toast.is-leaving {
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
@keyframes notif-toast-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 720px) {
    .notif-toast-host {
        top: auto;
        bottom: 16px;
        right: 12px;
        left: 12px;
        max-width: none;
    }
}
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-link { color: #334155; font-size: 13px; font-weight: 700; }
.topbar-notif-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    font: inherit;
}
.notif-dropdown {
    position: relative;
}
.notif-dropdown-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 13000;
    width: min(360px, calc(100vw - 24px));
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
    overflow: hidden;
}
.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}
.notif-dropdown-header strong {
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
}
.notif-dropdown-mark-all {
    border: 0;
    background: transparent;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}
.notif-dropdown-mark-all:hover { text-decoration: underline; }
.notif-dropdown-list {
    max-height: 320px;
    overflow-y: auto;
}
.notif-dropdown-empty {
    margin: 0;
    padding: 18px 14px;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}
.notif-dropdown-item {
    display: block;
    padding: 12px 14px;
    border-bottom: 1px solid #eef2f7;
    text-decoration: none;
    color: inherit;
}
.notif-dropdown-item.is-unread {
    background: #eff6ff;
}
.notif-dropdown-item.is-unread .notif-dropdown-item-msg {
    color: #0f172a;
    font-weight: 700;
}
.notif-dropdown-item.is-read .notif-dropdown-item-msg {
    color: #64748b;
    font-weight: 500;
}
.notif-dropdown-item:hover {
    background: #f8fafc;
}
.notif-dropdown-item.is-unread:hover {
    background: #dbeafe;
}
.notif-dropdown-item-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}
.notif-dropdown-item-type {
    font-size: 12px;
    font-weight: 800;
    color: #1d4ed8;
}
.notif-dropdown-item time {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
}
.notif-dropdown-item-msg {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    color: #334155;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.notif-dropdown-footer {
    display: block;
    padding: 12px 14px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    font-size: 12px;
    font-weight: 800;
    color: #1d4ed8;
    text-decoration: none;
    background: #f8fafc;
}
.notif-dropdown-footer:hover { text-decoration: underline; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
    padding: 12px 12px;
    border-bottom: 2px solid #8b95a5;
    border-right: 1px solid #b8c0cc;
    text-align: left;
    font-size: 15px;
    font-weight: 700;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
    vertical-align: top;
}
th:last-child,
td:last-child {
    border-right: 0;
}
th {
    color: #3a4557;
    background: #fff;
    border-bottom: 2px solid #8b95a5;
    border-right: 1px solid #b8c0cc;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
td { color: #1f2a3d; }
td strong { color: #1f2a3d; text-transform: uppercase; font-weight: 800; }
.fiche-row td { border-bottom: 2px solid #8b95a5; }
.fiches-table th,
.fiches-table td,
.fiche-list-table th,
.fiche-list-table td {
    font-size: 13.5px;
    font-weight: 700;
    border-bottom: 2px solid #8b95a5;
    border-right: 1px solid #b8c0cc;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: none;
    line-break: auto;
    vertical-align: top;
    text-align: left !important;
    padding: 6px 3px;
    margin: 0;
}
.aff-table th,
.aff-table td,
.rv-table th,
.rv-table td,
.val-table th,
.val-table td,
.dec-table th,
.dec-table td,
.ap-table th,
.ap-table td,
.mg-table th,
.mg-table td,
.ast-table th,
.ast-table td,
.cr-table th,
.cr-table td,
.tab-table:not(.planning-table) th,
.tab-table:not(.planning-table) td {
    text-align: left !important;
}
.fiches-table th:last-child,
.fiches-table td:last-child,
.fiche-list-table th:last-child,
.fiche-list-table td:last-child {
    border-right: 0;
}
.fiches-table th,
.fiche-list-table th {
    font-size: 12px;
    font-weight: 800;
    border-bottom: 2px solid #555;
    background: #444444;
    color: #fff;
}
.fiches-table thead th,
.dashboard-page .fiches-table th {
    background: #444444;
    color: #fff;
    border-bottom-color: #555;
    border-right-color: #666;
}
.fiches-table th.sortable-header {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.fiches-table th.sortable-header:hover {
    background: #555555;
}
.fiches-table .sort-indicator {
    opacity: .75;
    font-size: 10px;
    font-weight: 700;
}
.fiches-table .valide-header-sigle,
.aff-table .valide-header-sigle,
.rv-table .valide-header-sigle,
.fiche-list-table .valide-header-sigle {
    color: #000;
    font-size: 20px;
    font-weight: 900;
}
/* Colonnes d’actions / boutons : garder sur une ligne */
.fiches-table td.col-actions,
.fiche-list-table td.col-actions,
.fiches-table td.col-pdf,
.fiche-list-table td.col-pdf,
.fiches-table td.col-valide,
.fiche-list-table td.col-valide,
.fiches-table td.col-produit,
.fiche-list-table td.col-produit,
.fiches-table td:has(.btn-view),
.fiche-list-table td:has(.btn-view),
.fiches-table td:has(.btn-pdf-icon),
.fiche-list-table td:has(.btn-pdf-icon) {
    white-space: nowrap;
}

.fiches-table .col-nom,
.fiche-list-table .col-nom {
    min-width: 128px;
    width: 9%;
}
.fiches-table .col-prenom,
.fiche-list-table .col-prenom {
    min-width: 110px;
    width: 8%;
}
.fiches-table .col-tel,
.fiche-list-table .col-tel {
    min-width: 118px;
    width: 118px;
    max-width: 118px;
}
.fiches-table .col-centre,
.fiche-list-table .col-centre,
.aff-table .col-centre,
.rv-table .col-centre {
    min-width: 130px !important;
    width: 12% !important;
    max-width: none !important;
    white-space: normal !important;
    overflow-wrap: break-word;
    word-break: normal;
    line-height: 1.25;
    padding-left: 2px !important;
    padding-right: 2px !important;
}
.fiches-table .col-produit,
.fiche-list-table .col-produit {
    width: 48px;
    min-width: 44px;
    max-width: 52px;
    padding-left: 6px;
    padding-right: 6px;
    text-align: left;
}
.fiches-table .col-produit .produit-badge,
.fiche-list-table .col-produit .fiche-product {
    min-width: 0;
    max-width: 100%;
    padding: 4px 5px;
    letter-spacing: 0;
}
.fiches-table .col-valide,
.fiche-list-table .col-valide,
.aff-table .col-valide,
.rv-table .col-valide,
.fiches-table .valide-cell,
.fiche-list-table .fiche-valid {
    width: 42px;
    min-width: 36px;
    max-width: 48px;
    padding-left: 4px;
    padding-right: 4px;
    text-align: center !important;
}
.fiches-table th.col-valide,
.fiche-list-table th.col-valide,
.aff-table th.col-valide,
.rv-table th.col-valide,
.fiches-table td.col-valide,
.fiche-list-table td.col-valide,
.aff-table td.col-valide,
.rv-table td.col-valide {
    text-align: center !important;
}
.fiches-table .col-actions,
.fiche-list-table .col-actions,
.fiches-table .actions-cell {
    width: 100px;
    min-width: 88px;
    max-width: 140px;
    padding-left: 6px;
    padding-right: 6px;
    text-align: left;
}
.fiches-table .actions-cell .fiche-indicators {
    margin-bottom: 6px;
}
.fiches-table .col-pdf,
.fiche-list-table .col-pdf,
.fiches-table .pdf-cell,
.fiche-list-table .pdf-cell {
    width: 44px;
    min-width: 40px;
    max-width: 48px;
    padding-left: 4px;
    padding-right: 4px;
    text-align: left;
}
.etat-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 4px;
    color: #fff;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.produit-badge {
    display: inline-block;
    min-width: 34px;
    padding: 5px 8px;
    border-radius: 4px;
    color: #fff;
    font-size: 10.5px;
    font-weight: 800;
    text-align: center;
}
.actions-cell { text-align: left; }
.valide-cell {
    text-align: center !important;
}
.valide-check {
    color: #000 !important;
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    display: inline-block;
}
.valide-header-sigle {
    display: inline-block;
    color: #000;
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
}
.fiches-table td.col-valide .valide-check,
.fiche-list-table td.col-valide .valide-check,
.aff-table td.col-valide .valide-check,
.rv-table td.col-valide .valide-check,
.fiche-list-table td.fiche-valid {
    color: #000 !important;
    font-size: 22px;
    font-weight: 900;
}
.col-check,
.fiche-row-check-cell {
    width: 36px;
    min-width: 36px;
    max-width: 40px;
    text-align: center;
    vertical-align: middle;
}
.fiche-row-check {
    width: 15px;
    height: 15px;
    margin: 0;
    cursor: pointer;
    accent-color: #335b9f;
}

.col-decalage,
.decalage-cell {
    min-width: 160px;
    max-width: 280px;
    white-space: normal !important;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    vertical-align: top;
}
.decalage-cell-text {
    display: inline-block;
}
.decalage-cell.is-attente .decalage-cell-text {
    color: #b45309;
}
.decalage-cell.is-accepte .decalage-cell-text {
    color: #166534;
}
.decalage-cell.is-refuse .decalage-cell-text {
    color: #991b1b;
}
.valide-empty { color: #9aa4b2; }
.fiche-indicators {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin: 0 auto 4px;
}
.fiche-indicators:empty { display: none; margin: 0; }
.fiche-indicators--inline { margin: 0; }
.indicator {
    display: inline-block;
    padding: 3px 4.8px;
    border-radius: 3px;
    font-weight: 800;
    font-size: 8.5px;
    white-space: nowrap;
    line-height: 1.2;
}
/* Couleur R2 = état « Honoré à suivre » (inline via FicheIndicators::honoreASuivreColor). */
.indicator.r2 {
    background: #f7a219;
    color: #111;
}
.indicator.rf,
.indicator.an { background: #ff0000; color: #fff; }
.indicator.sig {
    background: #16a34a;
    color: #fff;
}
.indicator.indicator-etat,
.indicator.indicator-r2 {
    border: 1px solid rgba(0, 0, 0, .15);
}
.indicator.rs {
    background: #60a5fa;
    color: #fff !important;
    border: 1px solid #60a5fa;
}
.fiches-table .col-cs,
.fiches-table .col-r2,
.fiches-table .col-rf,
.fiches-table td.col-cs,
.fiches-table td.col-r2,
.fiches-table td.col-rf {
    width: 42px;
    min-width: 42px;
    max-width: 56px;
    text-align: left;
    vertical-align: middle;
    padding-left: 4px;
    padding-right: 4px;
}
.fiches-table .indicator-cell {
    text-align: left;
}
.indicator-sigle {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    font-size: 16px;
    line-height: 1;
}
.sigle-cs { filter: grayscale(0); }
.sigle-r2 { font-size: 15px; }
.btn-detail {
    display: inline-grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 0;
    border-radius: 6px;
    background: var(--blue);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(36, 107, 253, .28);
}
.btn-detail:hover { filter: brightness(1.08); }
.pdf-cell { text-align: left; vertical-align: middle; }
.btn-pdf-icon {
    display: inline-grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 6px;
    text-decoration: none;
    background: #fef2f2;
    border: 1px solid #fecaca;
    transition: filter .15s ease, background .15s ease;
}
.btn-pdf-icon:hover { filter: brightness(0.97); background: #fee2e2; }
.pdf-logo {
    display: block;
    width: 18px;
    height: 18px;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.empty { padding: 34px; color: var(--muted); text-align: center; }

/* Modal dÃ©tail fiche */
body.fiche-modal-open { overflow: hidden; }
.fiche-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(13, 24, 48, .55);
    overflow: hidden;
}
.fiche-modal-overlay[hidden] { display: none; }
.fiche-modal {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(100%, 980px);
    max-height: min(82dvh, calc(100svh - 48px));
    min-height: 0;
    overflow: hidden;
    border: 8px solid #3498db;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}
.fiche-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 2;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, .18);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
}
.fiche-modal-banner {
    flex: 0 0 auto;
    padding: 16px 24px;
    background: var(--navy);
    color: #fff;
    font-size: 15px;
    font-weight: 850;
    letter-spacing: .12em;
}
.fiche-modal-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.fiche-modal-body {
    padding: 20px;
}

/* Mobile : modal dimensionnÃ© sur la zone visible (pinch-zoom), overlay plein Ã©cran */
body.fiche-modal-open--viewport-sync {
    overflow: auto !important;
    touch-action: pan-x pan-y pinch-zoom !important;
}

body.fiche-modal-open--viewport-sync .fiche-modal-overlay {
    /* overlay reste inset:0 â€” seul le modal est repositionnÃ©/redimensionnÃ© en JS */
    touch-action: pan-x pan-y pinch-zoom !important;
}

.fiche-modal.fiche-modal--viewport-sync {
    width: var(--fiche-modal-width-px, 88%) !important;
    max-width: var(--fiche-modal-width-px, 88%) !important;
    max-height: var(--fiche-modal-height-px, 82%) !important;
}

html.viewport-zoomed body.fiche-modal-open .fiche-modal-overlay {
    z-index: 3000;
}

/* En-tÃªte du dÃ©tail (badge produit + titre + pill Ã©tat) â€” comme FicheDetail */
.fiche-detail-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}
.fiche-detail-header-title { display: flex; align-items: center; gap: 12px; }
.fiche-detail-header h1 { margin: 0; color: #2c3e50; font-size: 21px; }
.fiche-type-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 800;
}
.fiche-detail-etat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .12);
}

/* Sections type FicheDetail : titre sombre centrÃ© + tableau label/valeur gris */
.fiche-section {
    margin-bottom: 18px;
    padding: 16px;
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
}
.section-title {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 14px;
    padding: 11px 14px;
    border-bottom: 2px solid #9cbfc8;
    border-radius: 4px;
    background-color: #332e2e;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    text-align: center;
}
.historique-priority-title {
    margin-bottom: 10px;
    letter-spacing: .02em;
    text-transform: none;
}
.historique-priority-commercial {
    font-weight: 800;
}
.fiche-details-table { width: 100%; border-collapse: collapse; white-space: normal; }
.fiche-details-table tr { border-bottom: 1px solid #8a8a8a; background-color: #ebebeb; }
.fiche-details-table tr:last-child { border-bottom: 0; }
/* Pas de grille dense type tableau fiches dans le modal détail */
.fiche-modal table:not(.planning-table) th,
.fiche-modal table:not(.planning-table) td {
    border-right: 0;
    border-bottom: 1px solid #d1d5db;
}
.fiche-modal .fiche-details-table th,
.fiche-modal .fiche-details-table td,
.fiche-details-table th,
.fiche-details-table td {
    border-right: 0;
    border-bottom: 0;
}
.fiche-details-table .field-label {
    width: 34%;
    padding: 10px 12px;
    border: 0;
    color: #000;
    font-size: 13px;
    font-weight: 600;
    text-transform: none;
    vertical-align: top;
}
.fiche-details-table .field-value {
    padding: 10px 12px;
    border: 0;
    color: #1c2331;
    font-size: 13px;
    word-break: break-word;
}
.fiche-details-table .field-actions {
    width: 44px;
    padding: 10px 12px;
    text-align: right;
    vertical-align: top;
}

/* Modification rapide des champs */
.field-edit-btn {
    padding: 3px 8px;
    border: 1px solid #b8bcc4;
    border-radius: 5px;
    background: #fff;
    color: #1c2331;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
}
.field-edit-btn:hover { background: #eef1f6; border-color: #8a8f99; }
.field-edit-btn-inline {
    margin-left: 8px;
    vertical-align: middle;
    background: rgba(255, 255, 255, .9);
}
.field-edit-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.field-edit-input {
    min-width: 140px;
    max-width: 100%;
    padding: 5px 8px;
    border: 1px solid #8a8f99;
    border-radius: 5px;
    font-size: 13px;
}
textarea.field-edit-input { min-width: 220px; resize: vertical; }
.field-edit-save, .field-edit-cancel {
    padding: 4px 9px;
    border: 0;
    border-radius: 5px;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    color: #fff;
}
.field-edit-save { background: #16a34a; }
.field-edit-cancel { background: #b91c1c; }
.field-edit-save:disabled, .field-edit-cancel:disabled { opacity: .55; cursor: default; }
.field-edit-feedback { font-size: 12px; color: #6b7280; }
.field-edit-feedback.error { color: #b91c1c; }
.etat-actuel-badge-wrap { display: inline-block; }

/* Carte « État actuel » : même largeur utile que changement d'état */
.etat-actuel-card {
    width: 100%;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    padding: 18px;
    border: 6px solid #000;
    border-radius: 8px;
    background-color: #3a3a3a;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 6px rgba(0, 0, 0, .1);
}
.etat-actuel-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 14px;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .2);
}
.etat-actuel-badge-header { margin-bottom: 4px; }
.etat-actuel-cr { margin-right: 4px; }
.etat-actuel-sous-badge {
    padding: 3px 10px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .25);
    font-size: 12px;
    font-weight: 800;
    text-transform: none;
}
.etat-actuel-badge-date {
    margin-left: auto;
    font-size: 14px;
    font-weight: 800;
    text-transform: none;
    letter-spacing: 0;
}
.etat-actuel-details { margin-top: 4px; font-size: 13px; line-height: 1.45; }
.etat-actuel-details-title {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 800;
    color: #fff;
}
.etat-actuel-details-list { display: flex; flex-direction: column; gap: 10px; }
.etat-actuel-detail-row { color: #fff; font-weight: 700; word-break: break-word; }
.etat-actuel-detail-row--full .etat-detail-val { display: block; margin-top: 4px; white-space: pre-wrap; }
.etat-detail-val--commercial { color: #93c5fd; font-weight: 800; }
.etat-detail-val--confirmateur { color: #fca5a5; font-weight: 800; }
.etat-detail-label--rdv-seul {
    color: #ef4444 !important;
    font-weight: 800;
}
.etat-detail-val--rdv {
    display: inline-block;
    padding: 2px 8px;
    border: 4px solid #15803d;
    border-radius: 6px;
    background: #f0fdf4;
    color: #15803d;
    font-weight: 800;
}
.etat-actuel-lines { display: flex; flex-direction: column; gap: 9px; font-size: 13.5px; line-height: 1.45; }
.etat-actuel-date-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 5px;
    background-color: #4a4a4a;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
}
.etat-actuel-validation-badge {
    display: inline-block;
    margin-top: 14px;
    padding: 8px 14px;
    border: 2px solid #16a34a;
    border-radius: 6px;
    background-color: #4a4a4a;
    color: #fff;
    font-size: 13.5px;
    font-weight: 700;
}
.etat-actuel-detail-row--rdv-seul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.etat-actuel-rdv-seul-text {
    display: inline;
}
.etat-actuel-absence-modifier-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #fff;
    color: #111;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12.5px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.etat-actuel-absence-modifier-btn.is-open .etat-actuel-absence-chevron {
    transform: rotate(180deg);
    display: inline-block;
}
.etat-actuel-absence-modifier-btn:disabled {
    opacity: .55;
    cursor: wait;
}
.etat-actuel-absence-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 14px;
}
.etat-actuel-absence-modifier {
    position: relative;
    display: inline-block;
}
.etat-actuel-absence-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    background: #c84a4a;
    color: #fff;
    border: 1px solid #b03d3d;
    border-radius: 4px;
    font-weight: 700;
    font-size: 13.5px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}
.etat-actuel-absence-btn:hover {
    background: #b83f3f;
}
.etat-actuel-absence-btn.is-open .etat-actuel-absence-chevron {
    transform: rotate(180deg);
    display: inline-block;
}
.etat-actuel-absence-btn:disabled {
    opacity: .55;
    cursor: wait;
}
.etat-actuel-absence-icon {
    font-size: 14px;
    line-height: 1;
}
.etat-actuel-absence-chevron {
    font-size: 11px;
    line-height: 1;
    opacity: .95;
}
.etat-actuel-absence-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 20;
    min-width: 260px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .14);
    overflow: hidden;
}
.etat-actuel-absence-menu button {
    display: block;
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #e5e7eb;
    color: #111827;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
}
.etat-actuel-absence-menu button:last-child {
    border-bottom: 0;
}
.etat-actuel-absence-menu button:hover {
    background: #f3f4f6;
}
.etat-actuel-absence-menu button.is-selected {
    background: #fef2f2;
    color: #991b1b;
}
.etat-actuel-absence-feedback {
    display: inline-block;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}
.etat-actuel-absence-feedback.is-error {
    color: #fecaca;
}
.etat-actuel-validation-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
}
.etat-actuel-validation-wrap .etat-actuel-validation-badge {
    margin-top: 0;
}
.etat-actuel-validation-modifier {
    position: relative;
    display: inline-block;
}
.etat-actuel-modifier-validation-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #fff;
    color: #111;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.etat-actuel-validation-rdv-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: #16a34a;
    color: #fff;
    border: 1px solid #fff;
    border-radius: 6px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.etat-actuel-validation-rdv-btn .etat-actuel-validation-check {
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
}
.etat-actuel-validation-chevron {
    font-size: 12px;
    line-height: 1;
    opacity: .95;
}
.etat-actuel-validation-rdv-btn.is-open .etat-actuel-validation-chevron,
.etat-actuel-modifier-validation-btn.is-open .etat-actuel-validation-chevron {
    transform: rotate(180deg);
    display: inline-block;
}
.etat-actuel-modifier-validation-btn:disabled,
.etat-actuel-validation-rdv-btn:disabled {
    opacity: .55;
    cursor: wait;
}
.etat-actuel-validation-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 20;
    min-width: 220px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .14);
    overflow: hidden;
}
.etat-actuel-validation-menu button {
    display: block;
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #e5e7eb;
    color: #111827;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.etat-actuel-validation-menu button:last-child {
    border-bottom: 0;
}
.etat-actuel-validation-menu button:hover {
    background: #f3f4f6;
}
.etat-actuel-validation-feedback {
    display: inline-block;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}
.etat-actuel-validation-feedback.is-error {
    color: #fecaca;
}
.etat-actuel-date-rdv-block {
    width: 100%;
    line-height: 1.45;
}
.etat-actuel-date-rdv-badge {
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 6px 12px !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    white-space: nowrap;
}
.etat-actuel-rdv-time-input {
    font-size: 16px;
    font-weight: 800;
    font-family: inherit;
    color: #15803d;
    background: #fff;
    border: 1px solid #15803d;
    border-radius: 4px;
    padding: 2px 6px;
}
.etat-actuel-rdv-time-save {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #15803d;
    background: #dcfce7;
    color: #15803d;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
}
.etat-actuel-rdv-time-save:disabled {
    opacity: .45;
    cursor: not-allowed;
}
.etat-actuel-rdv-avant {
    display: inline-block;
    margin-left: 6px;
    padding: 3px 8px;
    border-radius: 4px;
    background: #faf0ff;
    color: #6b21a8;
    font-size: 12px;
    font-weight: 800;
}
.etat-actuel-rdv-time-feedback {
    display: inline-block;
    margin-left: 8px;
    font-size: 12px;
    font-weight: 700;
}
.etat-actuel-rdv-time-feedback.is-error { color: #fecaca; }
.etat-actuel-rdv-histo-wrap {
    margin-top: 10px;
    width: 100%;
}
.etat-actuel-rdv-histo-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid #fff;
    color: #fff;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.etat-actuel-rdv-heure-historique {
    margin-top: 8px;
    background: #fff;
    color: #1f2937;
    border-radius: 6px;
    padding: 8px;
    border: 1px solid #d1d5db;
    max-width: 720px;
}
.etat-actuel-rdv-heure-historique-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    color: #1f2937;
}
.etat-actuel-rdv-heure-historique-table th,
.etat-actuel-rdv-heure-historique-table td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}
.etat-actuel-rdv-heure-historique-table th {
    background: #f3f4f6;
    color: #111827;
}

/* Barre d'onglets du dÃ©tail fiche (Fiches / Modifica / Affectation / Planning / SMS / PDF) */
.fiche-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--line);
}
.fiche-tab {
    padding: 9px 16px;
    border: 1px solid #d5dbe4;
    border-radius: 6px 6px 0 0;
    background: #eef1f5;
    color: #4a5568;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.fiche-tab:hover { background: #e2e8f0; }
.fiche-tab.active {
    border-color: var(--navy);
    background: var(--navy);
    color: #fff;
}

/* Tableaux des onglets Modifica / SMS / Affectation / Planning */
.tab-table-wrap { overflow-x: auto; }
.tab-table { width: 100%; border-collapse: collapse; white-space: normal; }
.tab-table th {
    padding: 9px 11px;
    border: 1px solid #c9ced6;
    background: #332e2e;
    color: #fff;
    font-size: 11px;
    text-transform: uppercase;
    text-align: left;
}
.tab-table td {
    padding: 8px 11px;
    border: 1px solid #c9ced6;
    background: #f7f8fa;
    color: #2a3345;
    font-size: 12.5px;
    vertical-align: top;
}
.tab-table tr:nth-child(even) td { background: #eef0f4; }
.sms-message { max-width: 380px; white-space: pre-wrap; word-break: break-word; }
.sms-send-section .sms-form { display: grid; gap: 12px; max-width: 640px; }
.sms-send-section .form-group { display: grid; gap: 6px; }
.sms-send-section label { color: #1f2a3d; font-size: 13px; font-weight: 700; }
.sms-send-section .form-control {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font: inherit;
}
.sms-tel-preview { margin-top: 4px; font-size: 12px; color: #64748b; }
.sms-form-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn-send-sms { min-width: 140px; }
.sms-feedback { font-size: 13px; font-weight: 700; color: #126b4d; }
.sms-feedback.is-error { color: #9f2736; }

/* Onglet Affectation */
.affectation-current { margin: 0 0 6px; color: #333; font-size: 14px; }
.affectation-help { margin: 0 0 16px; color: #666; font-size: 13px; }
.affectation-form { display: flex; flex-direction: column; gap: 10px; max-width: 400px; }
.affectation-form label { color: #3a465d; font-size: 13px; font-weight: 700; }
.affectation-form select {
    padding: 10px 12px;
    border: 1px solid #d5dbe4;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
}
.btn-save {
    padding: 11px 18px;
    border: 0;
    border-radius: 8px;
    background: #27ae60;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.btn-save:disabled { opacity: .6; cursor: wait; }
.affectation-feedback { font-size: 13px; font-weight: 700; }
.affectation-feedback.ok { color: #1e8e4e; }
.affectation-feedback.ko { color: #c0392b; }

/* Onglet Planning */
.planning-tab.is-loading { opacity: .55; pointer-events: none; }
.planning-tab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e0e0e0;
}
.planning-tab-header h2 { margin: 0; color: #668994; font-size: 18px; }
.planning-tab-header h2 small { color: #6b7280; font-size: 12px; font-weight: 500; }
.planning-week-navigation { display: flex; align-items: center; gap: 10px; }
.planning-week-navigation strong { color: #303a4d; font-size: 13px; white-space: nowrap; }
.planning-nav-btn {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 0;
    border-radius: 6px;
    background: var(--navy);
    color: #fff;
    font-size: 23px;
    line-height: 1;
    cursor: pointer;
}
.planning-day-header { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.planning-day-header > span {
    font-size: 10px;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
    word-break: break-word;
}
.planning-day-controls {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px 3px;
    border-radius: 5px;
    background: #fff;
}
.planning-day-toggle-closed {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: rgba(255, 255, 255, .92);
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
}
.planning-day-toggle-closed.is-closed {
    background: #fee2e2;
}
.planning-table th.is-day-closed {
    background: #334155;
}
.planning-day-input {
    width: 28px;
    height: 22px;
    padding: 0 2px;
    border: 1px solid #cbd2dc;
    border-radius: 3px;
    font-size: 16px !important;
    line-height: 1.1;
    text-align: center;
    touch-action: manipulation;
}
.planning-day-save,
.planning-slot-save {
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: #4caf50;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
    flex-shrink: 0;
}
/* Grille planning fiche : tenir dans la largeur du modal sans scroll horizontal */
.fiche-modal .tab-table-wrap:has(.planning-table),
.fiche-modal .planning-table-wrap {
    overflow-x: hidden;
}
.fiche-modal .planning-table {
    width: 100%;
    min-width: 0 !important;
    max-width: 100%;
    table-layout: fixed;
}
.fiche-modal .planning-table th,
.fiche-modal .planning-table td {
    padding: 4px 3px;
    border-right: 1px solid #d1d5db;
    border-bottom: 1px solid #d1d5db;
}
.fiche-modal .planning-table th:first-child,
.fiche-modal .planning-table td.planning-slot-name {
    width: 56px;
    min-width: 56px;
    max-width: 60px;
    padding-left: 3px;
    padding-right: 3px;
}
.fiche-modal .planning-table th:not(:first-child),
.fiche-modal .planning-table td.planning-edit-cell {
    width: auto;
    min-width: 0;
    max-width: none;
}
.planning-edit-cell {
    position: relative;
    height: auto;
    min-height: 58px;
    min-width: 0;
    max-width: none;
    width: auto;
    padding: 4px 3px !important;
    vertical-align: middle !important;
    background: #f8fafc !important;
}
.fiche-modal .planning-edit-cell {
    min-height: 52px;
    padding: 3px 2px !important;
}
.planning-edit-cell.is-open,
.planning-edit-cell.is-partial,
.planning-edit-cell.is-full,
.planning-edit-cell.is-unset { background: #f8fafc !important; }
.planning-edit-cell.is-closed,
.planning-cell-closed { background: #f1f5f9 !important; color: #7f1d1d !important; }
.planning-cell-main {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    min-height: 20px;
}
.planning-capacity {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    background: #e2e8f0;
    color: #111827;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.2;
}
.planning-edit-cell.is-open .planning-capacity {
    background: #8bc34a;
    color: #fff;
}
.planning-edit-cell.is-partial .planning-capacity {
    background: #ec971f;
    color: #fff;
}
.planning-edit-cell.is-full .planning-capacity {
    background: #ff0000;
    color: #fff;
}
.fiche-modal .planning-capacity {
    font-size: 13px;
    font-weight: 900;
    padding: 2px 7px;
}
.planning-cell-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
}
.planning-slot-alert {
    position: static;
    display: block;
    margin-top: 3px;
    max-width: 100%;
    padding: 1px 4px;
    overflow: hidden;
    border-radius: 3px;
    background: #ffeb3b;
    color: #333;
    font-size: 8.5px;
    font-weight: 700;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-align: center;
}
.planning-slot-name {
    font-weight: 700;
    font-size: 9.5px;
    line-height: 1.2;
    white-space: normal;
    word-break: break-word;
}
.planning-cell-toolbar {
    display: none;
}
.planning-ratio,
.planning-ratio-wrap,
.availability-r2-star {
    display: none;
}
.planning-closed-label {
    display: block;
    margin: 0;
    color: #7f1d1d;
    font-size: 10px;
    font-weight: 800;
    text-align: center;
    letter-spacing: .02em;
}
.planning-toggle-closed {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: rgba(255, 255, 255, .92);
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
}
.planning-toggle-closed.is-closed { background: #fee2e2; }
.planning-availability-controls {
    position: static;
    left: auto;
    bottom: auto;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 2px;
    transform: none;
}
.planning-slot-input {
    width: 28px;
    height: 22px;
    padding: 0 2px;
    border: 1px solid #cbd2dc;
    border-radius: 3px;
    background: #fff;
    font-size: 16px !important;
    line-height: 1.1;
    text-align: center;
    touch-action: manipulation;
}
.planning-rdv {
    margin-bottom: 5px;
    padding: 5px 7px;
    border-left: 3px solid #00cc00;
    border-radius: 4px;
    background: #fff;
    font-size: 11.5px;
    font-weight: 600;
}
.planning-rdv small { display: block; color: #718096; font-weight: 500; }
.planning-feedback { min-height: 18px; margin: 10px 0 0; font-size: 12px; font-weight: 700; }
.planning-feedback.ok { color: #1e8e4e; }
.planning-feedback.ko { color: #c0392b; }
.planning-legend { margin: 12px 0 0; color: #718096; font-size: 12px; }

/* Onglet PDF */
.btn-pdf {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 6px;
    background: #e74c3c;
    color: #fff !important;
    font-size: 13.5px;
    font-weight: 700;
}
.pdf-preview {
    margin-top: 18px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
}
.pdf-preview h3 { margin: 0 0 10px; color: #2c3e50; font-size: 14px; }
.pdf-preview p { margin: 0 0 6px; color: #444; font-size: 13px; }

/* Historique des Ã©tats : barre cliquable + liste repliÃ©e */
.historique-title-bar {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 15px;
    border: 1px solid #000;
    border-radius: 6px;
    margin: 0 0 15px;
    background-color: #000;
    color: #fff;
    font-size: 14.5px;
    font-weight: 700;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}
.historique-title-bar:hover { background-color: #1a1a1a; }
.historique-toggle-icon {
    flex: 0 0 auto;
    font-size: 12px;
    transition: transform .15s ease;
}
.historique-title-bar.is-open .historique-toggle-icon {
    transform: rotate(180deg);
}
.historique-list[hidden] { display: none !important; }
.historique-list { display: flex; flex-direction: column; gap: 12px; }
.historique-item {
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, .25);
    border-radius: 8px;
    background-color: #3a3a3a;
    box-shadow: 0 4px 6px rgba(0, 0, 0, .1);
}
.historique-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 14px;
    font-weight: 700;
}
.historique-etat { font-size: 14px; text-transform: uppercase; }
.historique-sous-etat {
    padding: 3px 9px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .22);
    font-size: 12px;
    font-weight: 700;
}
.historique-date { margin-left: auto; font-size: 12.5px; }
.historique-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}
.historique-detail-row {
    width: 100%;
    line-height: 1.45;
    color: #fff;
}
.historique-detail-row strong { color: #fff; font-weight: 800; }
.historique-detail-row--full .etat-detail-val {
    display: block;
    margin-top: 4px;
    white-space: pre-wrap;
}

@media (max-width: 1100px) {
    .profile-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .guest-body { padding: 16px; }
    .login-card { grid-template-columns: 1fr; min-height: auto; }
    .login-visual { display: none; }
    .login-form-panel { padding: 44px 28px; }
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; padding: 15px 18px; flex-direction: row; align-items: center; }
    .sidebar .brand { padding: 0; }
    .sidebar .nav, .sidebar-user { display: none; }
    .topbar { height: 68px; padding: 0 18px; }
    .content { padding: 24px 18px; }
    .form-grid { grid-template-columns: 1fr; }
}

/* App : scroll page entiÃ¨re (tableau liÃ© Ã  la page, pas de scroll interne sÃ©parÃ©) */
html.dashboard-page.dashboard-page--extranet-scroll,
body.dashboard-page.dashboard-page--extranet-scroll {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
    height: auto;
    min-height: 100%;
    overscroll-behavior: auto !important;
    touch-action: pan-x pan-y pinch-zoom !important;
    -webkit-overflow-scrolling: touch;
}

@supports (-webkit-touch-callout: none) {
    html.dashboard-page.dashboard-page--extranet-scroll,
    body.dashboard-page.dashboard-page--extranet-scroll {
        min-height: -webkit-fill-available;
    }
}

/* Desktop : layout fluide */
body.dashboard-page--extranet-scroll .app-shell,
body.dashboard-page--extranet-scroll .page,
body.dashboard-page--extranet-scroll .content {
    min-width: 0 !important;
    max-width: none !important;
    width: auto !important;
    overflow: visible !important;
    overscroll-behavior: auto !important;
    touch-action: pan-x pan-y pinch-zoom !important;
}

body.dashboard-page--extranet-scroll .app-shell {
    width: 100% !important;
}

body.dashboard-page--extranet-scroll .content {
    margin: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

body.dashboard-page--extranet-scroll .panel:not(.search-panel),
body.dashboard-page--extranet-scroll .fiche-results-panel,
body.dashboard-page--extranet-scroll .planning-results {
    overflow: visible !important;
    max-width: none !important;
}

/* Pas de scroll séparé sur le tableau : la page entière scroll */
body.dashboard-page--extranet-scroll .table-wrap,
body.dashboard-page--extranet-scroll .fiche-table-wrap,
body.dashboard-page--extranet-scroll .planning-table-wrap,
body.dashboard-page--extranet-scroll .aff-table-wrap,
body.dashboard-page--extranet-scroll .aff-grid-wrap,
body.dashboard-page--extranet-scroll .rv-table-wrap {
    overflow: visible !important;
    width: auto !important;
    max-width: none !important;
}

body.dashboard-page--extranet-scroll .fiches-table,
body.dashboard-page--extranet-scroll .fiche-list-table {
    min-width: var(--app-content-width, 1400px) !important;
    width: max-content !important;
    max-width: none !important;
    table-layout: auto !important;
}

body.dashboard-page--extranet-scroll .rv-table {
    min-width: var(--app-content-width, 1400px) !important;
    width: max-content !important;
    max-width: none !important;
    table-layout: auto !important;
}

body.dashboard-page--extranet-scroll .aff-table,
body.dashboard-page--extranet-scroll .aff-grid {
    min-width: var(--app-content-width, 1400px) !important;
    width: max-content !important;
    max-width: none !important;
    table-layout: auto !important;
}

/*
 * PC : barre horizontale FIXÉE en bas de l’écran (toujours visible),
 * pas en bas du document (qui n’apparaît qu’après scroll vertical).
 */
html.dashboard-page.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport),
body.dashboard-page.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) {
    overflow-x: auto !important;
    overflow-y: auto !important;
    /* masquer la barre native du document (remplacée par .app-page-hscroll) */
    scrollbar-width: thin;
}

/* Un seul scroll horizontal (html) : évite désync molette H / barre fixe */
body.dashboard-page.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) {
    overflow-x: visible !important;
}

/* Cacher uniquement la barre horizontale native WebKit du document */
html.dashboard-page.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport)::-webkit-scrollbar:horizontal,
body.dashboard-page.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport)::-webkit-scrollbar:horizontal {
    height: 0 !important;
}

body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport).has-page-hscroll {
    padding-bottom: 16px !important;
}

.app-page-hscroll {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    height: 16px;
    overflow-x: scroll;
    overflow-y: hidden;
    background: #e2e8f0;
    box-shadow: 0 -1px 0 #cbd5e1;
    scrollbar-width: auto;
    scrollbar-color: #64748b #e2e8f0;
}

body.has-page-hscroll .app-page-hscroll {
    display: block;
}

.app-page-hscroll-spacer {
    height: 1px;
    pointer-events: none;
}

.app-page-hscroll::-webkit-scrollbar {
    height: 14px;
}
.app-page-hscroll::-webkit-scrollbar-track {
    background: #e2e8f0;
}
.app-page-hscroll::-webkit-scrollbar-thumb {
    background: #64748b;
    border-radius: 7px;
    border: 2px solid #e2e8f0;
}
.app-page-hscroll::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .app-shell {
    display: grid !important;
    grid-template-columns: var(--app-sidebar-width, 248px) minmax(var(--app-content-width, 1400px), max-content) !important;
    width: max-content !important;
    min-width: calc(var(--app-sidebar-width, 248px) + var(--app-content-width, 1400px)) !important;
    max-width: none !important;
    overflow: visible !important;
}

body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .page,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .content {
    min-width: var(--app-content-width, 1400px) !important;
    width: max-content !important;
    max-width: none !important;
    box-sizing: border-box !important;
    overflow: visible !important;
}

body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .panel:not(.search-panel),
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiche-results-panel,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .planning-results,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .aff-list,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .aff-grid-wrap,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .rv-table-panel,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .rv-page,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .dec-page,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .val-page,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .ap-page,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .mg-page,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .ast-page,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .pa-page,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .planning-page {
    max-width: none !important;
    width: max-content !important;
    min-width: var(--app-content-width, 1400px) !important;
    box-sizing: border-box !important;
    overflow: visible !important;
}

body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .table-wrap,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiche-table-wrap,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .planning-table-wrap,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .aff-table-wrap,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .aff-grid-wrap,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .ast-table-scroll,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .ast-kpi-table-wrap,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .pa-table-wrap:not(.pa-table-wrap--compact),
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .mg-table-wrap,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .rv-table-wrap {
    overflow: visible !important;
    width: max-content !important;
    max-width: none !important;
    min-width: var(--app-content-width, 1400px) !important;
}

/* Planning hebdo compact : ne pas forcer 1400px */
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .pa-table-wrap--compact {
    overflow: visible !important;
    width: max-content !important;
    max-width: none !important;
    min-width: 0 !important;
}

/* Conteneurs panel qui clippaient le scroll page */
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .panel,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiche-results-panel,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .aff-list,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .dec-page,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .val-page,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .ap-page,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .mg-page,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .ast-page {
    overflow: visible !important;
    max-width: none !important;
}

body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiches-table,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiche-list-table,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .aff-table,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .rv-table,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .val-table,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .dec-table,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .ap-table,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .mg-table,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .ast-table {
    min-width: var(--app-content-width, 1400px) !important;
    width: max-content !important;
    max-width: none !important;
    table-layout: auto !important;
}

body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiches-table th,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiches-table td,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiche-list-table th,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiche-list-table td,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .aff-table th,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .aff-table td,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .rv-table th,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .rv-table td,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .val-table th,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .val-table td,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .dec-table th,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .dec-table td,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .ap-table th,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .ap-table td,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .mg-table th,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .mg-table td,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .ast-table th,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .ast-table td {
    /* Ne pas forcer le wrap ni min-width:0 (ça écrasait les largeurs de colonnes) */
    min-width: unset;
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

/* Centre : wrap autorisé sans rétrécir la colonne */
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiches-table th.col-centre,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiches-table td.col-centre,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiche-list-table th.col-centre,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiche-list-table td.col-centre,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .aff-table th.col-centre,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .aff-table td.col-centre,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .rv-table th.col-centre,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .rv-table td.col-centre {
    white-space: normal !important;
    overflow-wrap: break-word !important;
}

/* Grilles planning : largeur réelle + scroll page */
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .aff-grid,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .pa-grid,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .planning-results .planning-table {
    min-width: var(--app-content-width, 1100px) !important;
    width: max-content !important;
    max-width: none !important;
    table-layout: auto !important;
}

/*
 * Colonnes date : largeur fixe + alignement gauche.
 */
.fiches-table th.col-date,
.fiches-table td.col-date,
.fiche-list-table th.col-date,
.fiche-list-table td.col-date,
.aff-table th.col-date,
.aff-table td.col-date,
.rv-table th.col-date,
.rv-table td.col-date,
.val-table th.col-date,
.val-table td.col-date,
.dec-table th.col-date,
.dec-table td.col-date,
.ap-table th.col-date,
.ap-table td.col-date,
.mg-table th.col-date,
.mg-table td.col-date,
.ast-table th.col-date,
.ast-table td.col-date,
body.dashboard-page--extranet-scroll .fiches-table th.col-date,
body.dashboard-page--extranet-scroll .fiches-table td.col-date,
body.dashboard-page--extranet-scroll .fiche-list-table th.col-date,
body.dashboard-page--extranet-scroll .fiche-list-table td.col-date,
body.dashboard-page--extranet-scroll .aff-table th.col-date,
body.dashboard-page--extranet-scroll .aff-table td.col-date,
body.dashboard-page--extranet-scroll .rv-table th.col-date,
body.dashboard-page--extranet-scroll .rv-table td.col-date,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiches-table th.col-date,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiches-table td.col-date,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiche-list-table th.col-date,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiche-list-table td.col-date,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .aff-table th.col-date,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .aff-table td.col-date,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .rv-table th.col-date,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .rv-table td.col-date,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .val-table th.col-date,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .val-table td.col-date,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .dec-table th.col-date,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .dec-table td.col-date,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .ap-table th.col-date,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .ap-table td.col-date,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .mg-table th.col-date,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .mg-table td.col-date,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .ast-table th.col-date,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .ast-table td.col-date,
/* fallback cellules date ISO sans classe */
.fiches-table td[data-sort-value^="20"],
.fiche-list-table td[data-sort-value^="20"],
.aff-table td[data-sort-value^="20"],
.rv-table td[data-sort-value^="20"],
.val-table td[data-sort-value^="20"],
.dec-table td[data-sort-value^="20"],
.ap-table td[data-sort-value^="20"],
.mg-table td[data-sort-value^="20"],
.ast-table td[data-sort-value^="20"] {
    white-space: nowrap !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
    text-align: left !important;
    min-width: 118px !important;
    width: 118px !important;
    max-width: 118px !important;
    box-sizing: border-box !important;
    font-size: 12.5px;
    padding-left: 2px !important;
    padding-right: 2px !important;
    margin: 0 !important;
}

body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiches-table .col-centre,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiche-list-table .col-centre,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .aff-table .col-centre,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .rv-table .col-centre {
    min-width: 130px !important;
    max-width: none !important;
}

/*
 * Mobile tactile + sidebar : layout = sidebar + contenu.
 * .page/.content = largeur contenu seulement (pas le total, sinon double comptage).
 */
html.dashboard-page--touch-forced-viewport.dashboard-page--extranet-scroll,
html.dashboard-page--touch-forced-viewport body.dashboard-page--extranet-scroll {
    width: var(--app-layout-width, 1648px) !important;
    min-width: var(--app-layout-width, 1648px) !important;
    max-width: var(--app-layout-width, 1648px) !important;
}

html.dashboard-page--touch-forced-viewport body.dashboard-page--extranet-scroll .app-shell {
    display: grid !important;
    grid-template-columns: var(--app-sidebar-width, 248px) minmax(0, 1fr) !important;
    width: var(--app-layout-width, 1648px) !important;
    min-width: var(--app-layout-width, 1648px) !important;
    max-width: var(--app-layout-width, 1648px) !important;
    overflow: visible !important;
}

html.dashboard-page--touch-forced-viewport body.dashboard-page--extranet-scroll .page,
html.dashboard-page--touch-forced-viewport body.dashboard-page--extranet-scroll .content {
    width: var(--app-content-width, 1400px) !important;
    min-width: var(--app-content-width, 1400px) !important;
    max-width: var(--app-content-width, 1400px) !important;
    box-sizing: border-box !important;
    overflow: visible !important;
}

html.dashboard-page--touch-forced-viewport body.dashboard-page--extranet-scroll .panel:not(.search-panel),
html.dashboard-page--touch-forced-viewport body.dashboard-page--extranet-scroll .fiche-results-panel,
html.dashboard-page--touch-forced-viewport body.dashboard-page--extranet-scroll .planning-results {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
    overflow: visible !important;
}

@media (max-width: 760px) {
    body.dashboard-page--table-desktop-view:not(.has-mobile-topnav) .app-shell {
        grid-template-columns: 248px 1fr !important;
    }
    body.dashboard-page--table-desktop-view:not(.has-mobile-topnav) .sidebar {
        position: sticky !important;
        top: 0 !important;
        height: 100vh !important;
        padding: 28px 18px 20px !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }
    body.dashboard-page--table-desktop-view:not(.has-mobile-topnav) .sidebar .brand {
        padding: 0 9px 30px !important;
    }
    body.dashboard-page--table-desktop-view:not(.has-mobile-topnav) .sidebar .nav {
        display: flex !important;
        flex-direction: column !important;
    }
    body.dashboard-page--table-desktop-view:not(.has-mobile-topnav) .sidebar-user {
        display: flex !important;
        flex-direction: row !important;
    }
}

body.dashboard-page--table-desktop-view .fiches-table th,
body.dashboard-page--table-desktop-view .fiches-table td,
body.dashboard-page--table-desktop-view .fiche-list-table th,
body.dashboard-page--table-desktop-view .fiche-list-table td {
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: none;
    vertical-align: top;
}

body.dashboard-page--table-desktop-view .fiche-modal .planning-table {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
}

body.dashboard-page--table-desktop-view .fiche-modal .planning-table th,
body.dashboard-page--table-desktop-view .fiche-modal .planning-table td {
    white-space: normal;
}

body.dashboard-page--table-desktop-view .fiche-modal .planning-table th:first-child,
body.dashboard-page--table-desktop-view .fiche-modal .planning-table td.planning-slot-name {
    width: 56px !important;
    min-width: 56px !important;
    max-width: 60px !important;
    white-space: normal !important;
}

body.dashboard-page--table-desktop-view .fiche-modal .planning-table th:not(:first-child),
body.dashboard-page--table-desktop-view .fiche-modal .planning-table td.planning-edit-cell {
    min-width: 0 !important;
    width: auto;
}

body.dashboard-page--table-desktop-view:not(.dashboard-page--touch-forced-viewport):not(.has-mobile-topnav) .search-form-columns {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    align-items: start !important;
    max-width: 100% !important;
    width: 100% !important;
}

body.dashboard-page--table-desktop-view.dashboard-page--touch-forced-viewport .search-form-columns,
body.dashboard-page--table-desktop-view.has-mobile-topnav .search-form-columns {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    grid-template-columns: none !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* Dashboard : filtres / header chrome centrés, largeur limitée */
html.dashboard-page--touch-forced-viewport body.dashboard-page .search-form,
body.dashboard-page--touch-forced-viewport .search-form,
html.has-mobile-topnav .search-form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
}

html.dashboard-page--touch-forced-viewport body.dashboard-page .search-form-columns,
body.dashboard-page--touch-forced-viewport .search-form-columns,
html.has-mobile-topnav .search-form-columns {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    grid-template-columns: none !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 12px !important;
}

html.dashboard-page--touch-forced-viewport body.dashboard-page .search-form-col,
body.dashboard-page--touch-forced-viewport .search-form-col,
html.has-mobile-topnav .search-form-col {
    width: 100%;
    max-width: 100%;
}

html.dashboard-page--touch-forced-viewport body.dashboard-page .search-form .form-group,
body.dashboard-page--touch-forced-viewport .search-form .form-group,
html.has-mobile-topnav .search-form .form-group {
    width: 100%;
}

html.dashboard-page--touch-forced-viewport body.dashboard-page .search-form .form-group input[type="text"],
html.dashboard-page--touch-forced-viewport body.dashboard-page .search-form .form-group input[type="datetime-local"],
html.dashboard-page--touch-forced-viewport body.dashboard-page .search-form .form-group select,
body.dashboard-page--touch-forced-viewport .search-form .form-group input[type="text"],
body.dashboard-page--touch-forced-viewport .search-form .form-group input[type="datetime-local"],
body.dashboard-page--touch-forced-viewport .search-form .form-group select,
html.has-mobile-topnav .search-form .form-group input[type="text"],
html.has-mobile-topnav .search-form .form-group input[type="datetime-local"],
html.has-mobile-topnav .search-form .form-group select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

html.dashboard-page--touch-forced-viewport body.dashboard-page .search-form .date-input-with-now,
body.dashboard-page--touch-forced-viewport .search-form .date-input-with-now,
html.has-mobile-topnav .search-form .date-input-with-now {
    width: 100%;
    max-width: 100%;
}

html.dashboard-page--touch-forced-viewport body.dashboard-page .search-form-actions,
body.dashboard-page--touch-forced-viewport .search-form-actions,
html.has-mobile-topnav .search-form-actions {
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
}

/* Header / KPI / filtres : largeur limitée sur tactile / topnav mobile */
html.dashboard-page--touch-forced-viewport body.dashboard-page--extranet-scroll .search-panel,
html.has-mobile-topnav body.dashboard-page--extranet-scroll .search-panel,
body.dashboard-page--touch-forced-viewport.dashboard-page--extranet-scroll .search-panel,
body.has-mobile-topnav.dashboard-page--extranet-scroll .search-panel,
html.dashboard-page--touch-forced-viewport .search-panel,
html.has-mobile-topnav .search-panel,
body.dashboard-page--touch-forced-viewport .search-panel,
body.has-mobile-topnav .search-panel {
    max-width: var(--app-chrome-width, 420px) !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}

/* PC : panneau filtres assez large pour 2 colonnes */
body.dashboard-page:not(.dashboard-page--touch-forced-viewport):not(.has-mobile-topnav) .panel.search-panel {
    max-width: min(100%, 760px) !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

html.dashboard-page--touch-forced-viewport .dashboard-top,
html.has-mobile-topnav .dashboard-top,
body.dashboard-page--touch-forced-viewport .dashboard-top,
body.has-mobile-topnav .dashboard-top {
    flex-direction: column !important;
    align-items: stretch !important;
    max-width: var(--app-chrome-width, 420px) !important;
    width: 100% !important;
}

html.dashboard-page--touch-forced-viewport .kpi-grid,
html.has-mobile-topnav .kpi-grid,
body.dashboard-page--touch-forced-viewport .kpi-grid,
body.has-mobile-topnav .kpi-grid {
    max-width: var(--app-chrome-width, 420px) !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Affectation : filtres / actions en colonne étroite (comme search-panel dashboard) */
html.dashboard-page--touch-forced-viewport .aff-header,
html.dashboard-page--touch-forced-viewport .aff-filters,
html.dashboard-page--touch-forced-viewport .aff-actions,
html.dashboard-page--touch-forced-viewport .aff-dep-header,
html.dashboard-page--touch-forced-viewport .aff-dep-controls,
body.dashboard-page--touch-forced-viewport .aff-header,
body.dashboard-page--touch-forced-viewport .aff-filters,
body.dashboard-page--touch-forced-viewport .aff-actions,
body.dashboard-page--touch-forced-viewport .aff-dep-header,
body.dashboard-page--touch-forced-viewport .aff-dep-controls {
    max-width: var(--app-chrome-width, 420px) !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}

html.dashboard-page--touch-forced-viewport .aff-actions,
body.dashboard-page--touch-forced-viewport .aff-actions,
html.dashboard-page--touch-forced-viewport .aff-dep-controls,
body.dashboard-page--touch-forced-viewport .aff-dep-controls,
html.dashboard-page--touch-forced-viewport .aff-list-head,
body.dashboard-page--touch-forced-viewport .aff-list-head {
    flex-wrap: wrap !important;
    align-items: stretch !important;
}

html.dashboard-page--touch-forced-viewport .aff-actions label,
body.dashboard-page--touch-forced-viewport .aff-actions label {
    min-width: 0 !important;
    width: 100% !important;
}

html.dashboard-page--touch-forced-viewport .aff-dep-content,
body.dashboard-page--touch-forced-viewport .aff-dep-content {
    grid-template-columns: minmax(700px, 1fr) 250px !important;
    width: max-content !important;
    max-width: none !important;
}


/* ========== Menu haut mobile (iOS / Android uniquement) ========== */
.mobile-topnav {
    display: none;
}

html.dashboard-page--touch-forced-viewport .mobile-topnav,
body.dashboard-page--touch-forced-viewport .mobile-topnav {
    display: none !important;
}

html.has-mobile-topnav .mobile-topnav,
body.has-mobile-topnav .mobile-topnav {
    display: block !important;
    position: sticky;
    top: 0;
    z-index: 300;
    width: min(100%, var(--app-chrome-width, 420px)) !important;
    min-width: 0 !important;
    max-width: var(--app-chrome-width, 420px) !important;
    margin-left: 20px !important;
    margin-right: auto !important;
    box-sizing: border-box;
    overflow: visible !important;
    background: #2c2c2c;
    color: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .4);
}

/* Menu latéral gauche rétabli sur mobile (viewport desktop forcé) */
html.dashboard-page--touch-forced-viewport .sidebar,
body.dashboard-page--touch-forced-viewport .sidebar {
    display: flex !important;
    position: sticky !important;
    top: 0 !important;
    width: var(--app-sidebar-width, 248px) !important;
    min-width: var(--app-sidebar-width, 248px) !important;
    max-width: var(--app-sidebar-width, 248px) !important;
    height: 100vh !important;
    padding: 28px 18px 20px !important;
    margin: 0 !important;
    flex-direction: column !important;
    align-items: stretch !important;
    overflow: hidden !important;
    visibility: visible !important;
    /* Ne pas capturer le pan horizontal de la page */
    touch-action: pan-x pan-y pinch-zoom !important;
}

html.dashboard-page--touch-forced-viewport .sidebar .nav,
body.dashboard-page--touch-forced-viewport .sidebar .nav {
    display: flex !important;
    flex-direction: column !important;
    touch-action: pan-x pan-y pinch-zoom !important;
}

html.dashboard-page--touch-forced-viewport .sidebar-user,
body.dashboard-page--touch-forced-viewport .sidebar-user {
    display: flex !important;
    flex-direction: row !important;
}

html.dashboard-page--touch-forced-viewport .sidebar .brand,
body.dashboard-page--touch-forced-viewport .sidebar .brand {
    padding: 0 9px 24px !important;
}

html.has-mobile-topnav .sidebar,
body.has-mobile-topnav .sidebar {
    display: none !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
}

html.dashboard-page--touch-forced-viewport .app-shell,
body.dashboard-page--touch-forced-viewport .app-shell {
    display: grid !important;
    grid-template-columns: var(--app-sidebar-width, 248px) minmax(0, 1fr) !important;
    width: var(--app-layout-width, 1648px) !important;
    min-width: var(--app-layout-width, 1648px) !important;
    max-width: var(--app-layout-width, 1648px) !important;
    overflow: visible !important;
    touch-action: pan-x pan-y pinch-zoom !important;
}

html.has-mobile-topnav .app-shell,
body.has-mobile-topnav .app-shell {
    display: block !important;
    grid-template-columns: none !important;
    width: var(--app-layout-width, 1400px) !important;
    min-width: var(--app-layout-width, 1400px) !important;
    max-width: var(--app-layout-width, 1400px) !important;
}

html.has-mobile-topnav .page .topbar,
body.has-mobile-topnav .page .topbar {
    display: none !important;
}

html.dashboard-page--touch-forced-viewport .page .topbar,
body.dashboard-page--touch-forced-viewport .page .topbar {
    display: flex !important;
}

html.dashboard-page--touch-forced-viewport .page,
body.dashboard-page--touch-forced-viewport .page {
    width: var(--app-content-width, 1400px) !important;
    min-width: var(--app-content-width, 1400px) !important;
    max-width: var(--app-content-width, 1400px) !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    touch-action: pan-x pan-y pinch-zoom !important;
}

html.dashboard-page--touch-forced-viewport .content,
body.dashboard-page--touch-forced-viewport .content {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 16px 20px 28px !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    touch-action: pan-x pan-y pinch-zoom !important;
}

html.has-mobile-topnav .page,
body.has-mobile-topnav .page,
html.has-mobile-topnav .content,
body.has-mobile-topnav .content {
    width: var(--app-layout-width, 1400px) !important;
    min-width: var(--app-layout-width, 1400px) !important;
    max-width: var(--app-layout-width, 1400px) !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

html.has-mobile-topnav .content,
body.has-mobile-topnav .content {
    padding: 16px 20px 28px !important;
}

.mobile-topnav-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 18px;
    background: #000;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

.mobile-topnav-welcome-text {
    min-width: 0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-topnav-welcome strong { color: #fff; letter-spacing: .03em; }

.mobile-topnav-clock {
    flex-shrink: 0;
    color: #cfcfcf;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.mobile-topnav-welcome-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    position: relative;
    overflow: visible;
}

.mobile-topnav-notif {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: #c0392b;
    color: #fff;
    font-weight: 900;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}

.mobile-topnav-notif .notif-badge {
    position: absolute;
    top: -5px;
    right: -7px;
}

.mobile-topnav-welcome-actions .notif-dropdown-panel {
    right: 0;
    left: auto;
    top: calc(100% + 8px);
    width: min(320px, calc(100vw - 16px));
}

.mobile-topnav-logout { margin: 0; }
.mobile-topnav-logout button {
    border: 0;
    background: transparent;
    color: #eee;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px 0;
}

.mobile-topnav-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 12px;
    min-height: 56px;
    background: #333;
    border-top: 1px solid #1f1f1f;
    overflow: visible;
    position: relative;
    z-index: 301;
}

.mobile-topnav-brand {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 8px 10px 8px 4px;
}

.mobile-topnav-brand img {
    display: block;
    height: 40px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
}

.mobile-topnav-burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-left: auto;
    border: 0;
    border-radius: 8px;
    background: #1f1f1f;
    color: #fff;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mobile-topnav-burger:hover,
.mobile-topnav-burger.is-open {
    background: #246bfd;
}

.mobile-topnav-burger-lines {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 22px;
}

.mobile-topnav-burger-lines span {
    display: block;
    height: 2px;
    width: 100%;
    background: #fff;
    border-radius: 2px;
    transition: transform .2s ease, opacity .2s ease;
}

.mobile-topnav-burger.is-open .mobile-topnav-burger-lines span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.mobile-topnav-burger.is-open .mobile-topnav-burger-lines span:nth-child(2) {
    opacity: 0;
}
.mobile-topnav-burger.is-open .mobile-topnav-burger-lines span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Panneau menu : fermé par défaut, s’ouvre vers le bas */
.mobile-topnav-panel {
    display: none;
    background: #1a1a1a;
    border-top: 1px solid #111;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .45);
}

.mobile-topnav.is-menu-open .mobile-topnav-panel,
.mobile-topnav-panel:not([hidden]) {
    display: block;
}

.mobile-topnav-panel[hidden] {
    display: none !important;
}

.mobile-topnav-menu {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    max-width: 420px;
    padding: 6px 0 10px;
    overflow: visible;
}

.mobile-topnav-item {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
}

.mobile-topnav-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    height: auto;
    min-height: 48px;
    padding: 12px 18px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    text-align: left;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mobile-topnav-item.is-active > .mobile-topnav-link,
.mobile-topnav-item.is-open > .mobile-topnav-link,
.mobile-topnav-link:hover {
    background: #2a2a2a;
}

.mobile-topnav-icon {
    display: inline-grid;
    width: 22px;
    place-items: center;
    font-size: 15px;
    line-height: 1;
}

.mobile-topnav-label {
    line-height: 1.2;
    flex: 1;
}

.mobile-topnav-caret {
    font-size: 11px;
    opacity: .75;
    margin-left: auto;
}

.mobile-topnav-item.is-open .mobile-topnav-caret {
    transform: rotate(180deg);
}

.mobile-topnav-submenu {
    position: static;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    max-width: none;
    padding: 0 0 6px;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: #111;
    box-shadow: none;
}

.mobile-topnav-submenu.is-fixed {
    position: static;
}

.mobile-topnav-submenu[hidden] { display: none !important; }

.mobile-topnav-sublink {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 18px 11px 42px;
    color: #f0f0f0;
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;
}

.mobile-topnav-sublink:hover,
.mobile-topnav-sublink.is-active {
    background: #246bfd;
    color: #fff;
}

/* Après pinch-zoom iOS : autoriser pan horizontal de la page entière */
html.viewport-zoomed.dashboard-page.dashboard-page--extranet-scroll,
html.viewport-zoomed body.dashboard-page.dashboard-page--extranet-scroll,
body.viewport-zoomed.dashboard-page.dashboard-page--extranet-scroll {
    overflow: auto !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
    touch-action: pan-x pan-y pinch-zoom !important;
    min-width: var(--app-layout-width, 1400px) !important;
    /* auto (pas de largeur figée) : laisse Safari panner le visual viewport */
    width: auto !important;
    max-width: none !important;
}

/* Dashboard / listes fiches : largeur réelle du tableau (comme React), pas d’étirement 100% */
html.viewport-zoomed.dashboard-page--extranet-scroll .fiches-table,
html.viewport-zoomed body.dashboard-page--extranet-scroll .fiches-table,
html.viewport-zoomed.dashboard-page--extranet-scroll .fiche-list-table,
html.viewport-zoomed body.dashboard-page--extranet-scroll .fiche-list-table,
html.viewport-zoomed.dashboard-page--extranet-scroll .rv-table,
html.viewport-zoomed body.dashboard-page--extranet-scroll .rv-table,
html.viewport-zoomed.dashboard-page--extranet-scroll .aff-table,
html.viewport-zoomed body.dashboard-page--extranet-scroll .aff-table {
    min-width: var(--app-content-width, 1400px) !important;
    width: max-content !important;
    max-width: none !important;
    touch-action: pan-x pan-y pinch-zoom !important;
}

/* Autres grilles : garder compat, sauf override .aff-dep ailleurs */
html.viewport-zoomed.dashboard-page--extranet-scroll .aff-grid,
html.viewport-zoomed body.dashboard-page--extranet-scroll .aff-grid {
    min-width: var(--app-content-width, 1400px) !important;
    width: max-content !important;
    max-width: none !important;
}

/*
 * Zoom dashboard : prioriser le pan sur les cellules / boutons / cases
 * (évite que Safari traite chaque geste comme un tap sur élément dense).
 */
html.viewport-zoomed .table-wrap,
html.viewport-zoomed .fiche-table-wrap,
html.viewport-zoomed .rv-table-wrap,
html.viewport-zoomed .aff-table-wrap,
html.viewport-zoomed .fiches-table,
html.viewport-zoomed .fiche-list-table,
html.viewport-zoomed .rv-table,
html.viewport-zoomed .aff-table,
html.viewport-zoomed .fiches-table th,
html.viewport-zoomed .fiches-table td,
html.viewport-zoomed .fiche-list-table th,
html.viewport-zoomed .fiche-list-table td,
html.viewport-zoomed .rv-table th,
html.viewport-zoomed .rv-table td,
html.viewport-zoomed .aff-table th,
html.viewport-zoomed .aff-table td,
html.viewport-zoomed .fiches-table a,
html.viewport-zoomed .fiches-table button,
html.viewport-zoomed .fiches-table input,
html.viewport-zoomed .fiche-list-table a,
html.viewport-zoomed .fiche-list-table button,
html.viewport-zoomed .fiche-list-table input,
html.viewport-zoomed .rv-table a,
html.viewport-zoomed .rv-table button,
html.viewport-zoomed .rv-table input,
html.viewport-zoomed .aff-table a,
html.viewport-zoomed .aff-table button,
html.viewport-zoomed .aff-table input {
    touch-action: pan-x pan-y pinch-zoom !important;
}

/* Zoom : pas de sticky / scroll interne qui bloquent le pan horizontal iOS */
html.viewport-zoomed .mobile-topnav,
body.viewport-zoomed .mobile-topnav {
    position: relative !important;
}

html.viewport-zoomed .sidebar,
body.viewport-zoomed .sidebar {
    position: relative !important;
}

html.viewport-zoomed .mobile-topnav-menu,
body.viewport-zoomed .mobile-topnav-menu,
html.viewport-zoomed .table-wrap,
body.viewport-zoomed .table-wrap,
html.viewport-zoomed .fiche-table-wrap,
body.viewport-zoomed .fiche-table-wrap,
html.viewport-zoomed .rv-table-wrap,
body.viewport-zoomed .rv-table-wrap,
html.viewport-zoomed .aff-table-wrap,
body.viewport-zoomed .aff-table-wrap,
html.viewport-zoomed .aff-grid-wrap,
body.viewport-zoomed .aff-grid-wrap {
    overflow: visible !important;
}

html.viewport-zoomed .app-shell,
html.viewport-zoomed .page,
html.viewport-zoomed .content,
html.viewport-zoomed .panel,
html.viewport-zoomed .fiche-results-panel,
html.viewport-zoomed .rv-page,
html.viewport-zoomed .rv-table-panel,
html.viewport-zoomed .aff-admin,
html.viewport-zoomed .aff-list,
body.viewport-zoomed .app-shell,
body.viewport-zoomed .page,
body.viewport-zoomed .content,
body.viewport-zoomed .panel,
body.viewport-zoomed .fiche-results-panel,
body.viewport-zoomed .rv-page,
body.viewport-zoomed .rv-table-panel,
body.viewport-zoomed .aff-admin,
body.viewport-zoomed .aff-list {
    overflow: visible !important;
    touch-action: pan-x pan-y pinch-zoom !important;
}

/*
 * Largeurs colonnes (table-layout:fixed) : col + th/td + max-width
 * pour empêcher dates/tél d’absorber l’espace libre → Centre.
 */
.fiches-table col.col-date,
.fiche-list-table col.col-date,
.aff-table col.col-date,
.rv-table col.col-date,
.fiches-table th.col-date,
.fiches-table td.col-date,
.fiche-list-table th.col-date,
.fiche-list-table td.col-date,
.aff-table th.col-date,
.aff-table td.col-date,
.rv-table th.col-date,
.rv-table td.col-date,
.val-table th.col-date,
.val-table td.col-date,
.dec-table th.col-date,
.dec-table td.col-date {
    width: 118px !important;
    max-width: 118px !important;
    min-width: 118px !important;
}

.fiches-table col.col-tel,
.fiche-list-table col.col-tel,
.aff-table col.col-tel,
.rv-table col.col-tel,
.fiches-table th.col-tel,
.fiches-table td.col-tel,
.fiche-list-table th.col-tel,
.fiche-list-table td.col-tel,
.aff-table th.col-tel,
.aff-table td.col-tel,
.rv-table th.col-tel,
.rv-table td.col-tel,
.val-table th.col-tel,
.val-table td.col-tel {
    width: 118px !important;
    max-width: 118px !important;
    min-width: 118px !important;
    white-space: nowrap !important;
    overflow: visible;
    text-overflow: clip;
}

.fiches-table col.col-centre,
.fiche-list-table col.col-centre,
.aff-table col.col-centre,
.rv-table col.col-centre,
.fiches-table th.col-centre,
.fiches-table td.col-centre,
.fiche-list-table th.col-centre,
.fiche-list-table td.col-centre,
.aff-table th.col-centre,
.aff-table td.col-centre,
.rv-table th.col-centre,
.rv-table td.col-centre {
    width: 12% !important;
    min-width: 130px !important;
    max-width: none !important;
}

body.dashboard-page--extranet-scroll .fiches-table col.col-date,
body.dashboard-page--extranet-scroll .fiches-table th.col-date,
body.dashboard-page--extranet-scroll .fiches-table td.col-date,
body.dashboard-page--extranet-scroll .aff-table col.col-date,
body.dashboard-page--extranet-scroll .aff-table th.col-date,
body.dashboard-page--extranet-scroll .aff-table td.col-date,
body.dashboard-page--extranet-scroll .rv-table col.col-date,
body.dashboard-page--extranet-scroll .rv-table th.col-date,
body.dashboard-page--extranet-scroll .rv-table td.col-date,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiches-table col.col-date,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiches-table th.col-date,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiches-table td.col-date,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .aff-table col.col-date,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .aff-table th.col-date,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .aff-table td.col-date,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .rv-table col.col-date,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .rv-table th.col-date,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .rv-table td.col-date {
    width: 118px !important;
    max-width: 118px !important;
    min-width: 118px !important;
}

body.dashboard-page--extranet-scroll .fiches-table col.col-tel,
body.dashboard-page--extranet-scroll .fiches-table th.col-tel,
body.dashboard-page--extranet-scroll .fiches-table td.col-tel,
body.dashboard-page--extranet-scroll .aff-table col.col-tel,
body.dashboard-page--extranet-scroll .aff-table th.col-tel,
body.dashboard-page--extranet-scroll .aff-table td.col-tel,
body.dashboard-page--extranet-scroll .rv-table col.col-tel,
body.dashboard-page--extranet-scroll .rv-table th.col-tel,
body.dashboard-page--extranet-scroll .rv-table td.col-tel,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiches-table col.col-tel,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiches-table th.col-tel,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiches-table td.col-tel,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .aff-table col.col-tel,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .aff-table th.col-tel,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .aff-table td.col-tel,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .rv-table col.col-tel,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .rv-table th.col-tel,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .rv-table td.col-tel {
    width: 118px !important;
    max-width: 118px !important;
    min-width: 118px !important;
}

body.dashboard-page--extranet-scroll .fiches-table col.col-centre,
body.dashboard-page--extranet-scroll .fiches-table th.col-centre,
body.dashboard-page--extranet-scroll .fiches-table td.col-centre,
body.dashboard-page--extranet-scroll .aff-table col.col-centre,
body.dashboard-page--extranet-scroll .aff-table th.col-centre,
body.dashboard-page--extranet-scroll .aff-table td.col-centre,
body.dashboard-page--extranet-scroll .rv-table col.col-centre,
body.dashboard-page--extranet-scroll .rv-table th.col-centre,
body.dashboard-page--extranet-scroll .rv-table td.col-centre,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiches-table col.col-centre,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiches-table th.col-centre,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiches-table td.col-centre,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .aff-table col.col-centre,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .aff-table th.col-centre,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .aff-table td.col-centre,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .rv-table col.col-centre,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .rv-table th.col-centre,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .rv-table td.col-centre {
    width: 12% !important;
    min-width: 130px !important;
    max-width: none !important;
}

/* CP / Commercial / Confirmateur : jamais de retour à la ligne */
.fiches-table col.col-cp,
.fiches-table th.col-cp,
.fiches-table td.col-cp,
.fiche-list-table th.col-cp,
.fiche-list-table td.col-cp,
.aff-table col.col-cp,
.aff-table th.col-cp,
.aff-table td.col-cp,
.rv-table col.col-cp,
.rv-table th.col-cp,
.rv-table td.col-cp,
.val-table th.col-cp,
.val-table td.col-cp,
.planning-table th.col-cp,
.planning-table td.col-cp,
.fiches-table col.col-commercial,
.fiches-table th.col-commercial,
.fiches-table td.col-commercial,
.fiche-list-table th.col-commercial,
.fiche-list-table td.col-commercial,
.aff-table col.col-commercial,
.aff-table th.col-commercial,
.aff-table td.col-commercial,
.rv-table col.col-commercial,
.rv-table th.col-commercial,
.rv-table td.col-commercial,
.planning-table th.col-commercial,
.planning-table td.col-commercial,
.fiches-table col.col-conf,
.fiches-table th.col-conf,
.fiches-table td.col-conf,
.fiche-list-table th.col-conf,
.fiche-list-table td.col-conf,
.aff-table col.col-conf,
.aff-table th.col-conf,
.aff-table td.col-conf,
.rv-table col.col-conf,
.rv-table th.col-conf,
.rv-table td.col-conf,
.val-table th.col-conf,
.val-table td.col-conf,
.ast-table th.col-cp,
.ast-table td.col-cp,
.ast-table th.col-commercial,
.ast-table td.col-commercial,
.ast-table th.col-conf,
.ast-table td.col-conf,
body.dashboard-page--extranet-scroll .fiches-table th.col-cp,
body.dashboard-page--extranet-scroll .fiches-table td.col-cp,
body.dashboard-page--extranet-scroll .fiches-table th.col-commercial,
body.dashboard-page--extranet-scroll .fiches-table td.col-commercial,
body.dashboard-page--extranet-scroll .fiches-table th.col-conf,
body.dashboard-page--extranet-scroll .fiches-table td.col-conf,
body.dashboard-page--extranet-scroll .aff-table th.col-cp,
body.dashboard-page--extranet-scroll .aff-table td.col-cp,
body.dashboard-page--extranet-scroll .aff-table th.col-commercial,
body.dashboard-page--extranet-scroll .aff-table td.col-commercial,
body.dashboard-page--extranet-scroll .aff-table th.col-conf,
body.dashboard-page--extranet-scroll .aff-table td.col-conf,
body.dashboard-page--extranet-scroll .rv-table th.col-cp,
body.dashboard-page--extranet-scroll .rv-table td.col-cp,
body.dashboard-page--extranet-scroll .rv-table th.col-commercial,
body.dashboard-page--extranet-scroll .rv-table td.col-commercial,
body.dashboard-page--extranet-scroll .rv-table th.col-conf,
body.dashboard-page--extranet-scroll .rv-table td.col-conf,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiches-table th.col-cp,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiches-table td.col-cp,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiches-table th.col-commercial,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiches-table td.col-commercial,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiches-table th.col-conf,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiches-table td.col-conf,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .aff-table th.col-cp,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .aff-table td.col-cp,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .aff-table th.col-commercial,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .aff-table td.col-commercial,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .aff-table th.col-conf,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .aff-table td.col-conf,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .rv-table th.col-cp,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .rv-table td.col-cp,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .rv-table th.col-commercial,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .rv-table td.col-commercial,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .rv-table th.col-conf,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .rv-table td.col-conf,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiches-table th.col-cp.sortable-header,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiches-table th.col-commercial.sortable-header,
body.dashboard-page--extranet-scroll:not(.dashboard-page--touch-forced-viewport) .fiches-table th.col-conf.sortable-header {
    white-space: nowrap !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
}
