.oiso-page {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 10px 10px 80px;
    box-sizing: border-box;
}

.oiso-top {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.oiso-header {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.oiso-title-block {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 0;
}

.oiso-logo {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 10px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.oiso-logo-image {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.oiso-title-block h1 {
    margin: 0;
    font-size: 1.75rem;
    color: #222;
    text-align: center;
}

.oiso-status-card {
    background: #f7f7f7;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 18px;
}

.oiso-status-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid #ebebeb;
}

.oiso-status-row:last-child {
    border-bottom: none;
}

.oiso-status-label {
    color: #666;
    font-size: 0.95rem;
}

.oiso-status-value {
    font-weight: 600;
    color: #222;
    text-align: right;
    word-break: break-word;
}

.oiso-status-value.is-ok {
    color: #1b6b3a;
}

.oiso-status-value.is-ko {
    color: #a12828;
}

.oiso-status-value.is-wait {
    color: #8a6d1b;
}

.oiso-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.oiso-btn {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.oiso-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.oiso-btn-primary {
    background: #2c5f8a;
    color: #fff;
}

.oiso-btn-primary:hover:not(:disabled) {
    background: #244e72;
}

.oiso-btn-secondary {
    background: #fff;
    border-color: #c8c8c8;
    color: #333;
}

.oiso-btn-secondary:hover:not(:disabled) {
    background: #f3f3f3;
}

.oiso-btn-ghost {
    background: transparent;
    border-color: #d0d0d0;
    color: #555;
}

/* Annuler : rouge, toujours visible */
.oiso-form-actions .oiso-dialog-cancel,
.oiso-btn.oiso-dialog-cancel {
    background: #c0392b !important;
    color: #fff !important;
    border: 1px solid #a93226 !important;
}
.oiso-form-actions .oiso-dialog-cancel:hover:not(:disabled),
.oiso-btn.oiso-dialog-cancel:hover:not(:disabled) {
    background: #a93226 !important;
    border-color: #922b21 !important;
}

.oiso-progress {
    margin: 0 0 16px;
    padding: 12px 14px;
    background: #eef5fb;
    border: 1px solid #c9ddf0;
    border-radius: 8px;
}

.oiso-wait-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(18, 28, 40, 0.55);
    padding: 20px;
}
.oiso-wait-overlay[hidden] {
    display: none !important;
}
.oiso-wait-card {
    width: min(380px, 100%);
    background: #fff;
    border-radius: 12px;
    padding: 28px 24px 22px;
    text-align: center;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
}
.oiso-wait-card .oiso-progress-bar {
    margin: 0 auto 16px;
    max-width: 220px;
}
.oiso-wait-card p {
    margin: 0;
    color: #1e3a54;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
}
.oiso-wait-hint {
    margin-top: 10px !important;
    font-size: 0.9rem !important;
    font-weight: 400 !important;
    color: #5a6f82 !important;
}

.oiso-progress p {
    margin: 10px 0 0;
    color: #2c5f8a;
    font-size: 0.95rem;
}

.oiso-progress-bar {
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, #2c5f8a 0%, #7eb0d8 50%, #2c5f8a 100%);
    background-size: 200% 100%;
    animation: oiso-slide 1.2s linear infinite;
}

@keyframes oiso-slide {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.oiso-alert {
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 14px;
    line-height: 1.4;
}

.oiso-alert code {
    font-size: 0.9em;
}

.oiso-alert-warn {
    background: #fff8e6;
    border: 1px solid #f0d990;
    color: #6b5200;
}

.oiso-alert-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.oiso-alert-ok {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.oiso-next {
    margin-top: 22px;
    padding-top: 4px;
}

.oiso-placeholder {
    padding: 28px 16px;
    text-align: center;
    color: #777;
    background: #fafafa;
    border: 1px dashed #ccc;
    border-radius: 8px;
    margin-top: 12px;
}

/* ——— Critères de recherche ——— */
.oiso-criteres {
    border: 1px solid #9bb6d4;
    border-radius: 8px;
    overflow: hidden;
    background: #eef2f7;
    margin-bottom: 14px;
}

.oiso-criteres-head {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #2c5f8a;
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
}

.oiso-criteres-foot {
    grid-column: 1 / -1;
    padding-top: 4px;
}

.oiso-search-btn {
    appearance: none;
    width: 100%;
    box-sizing: border-box;
    min-height: 42px;
    padding: 9px 12px;
    border: 0;
    border-radius: 6px;
    background: #2c5f8a;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    font-size: 0.95rem;
}

.oiso-search-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.oiso-search-btn:hover:not(:disabled) {
    background: #244e72;
}

.oiso-criteres-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
    padding: 12px;
}

.oiso-crit-field {
    display: grid;
    gap: 4px;
    font-size: 0.82rem;
    color: #2c5f8a;
    font-weight: 700;
}

.oiso-crit-field.oiso-crit-full {
    grid-column: 1 / -1;
}

.oiso-crit-field input,
.oiso-crit-field select {
    font: inherit;
    font-weight: 500;
    color: #222;
    padding: 9px 10px;
    border: 1px solid #c5d0de;
    border-radius: 6px;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}

.oiso-crit-field input[readonly] {
    background: #f3f5f8;
    color: #555;
}

/* ——— Bandeau liste : téléphone = titre puis + ; PC = + centré ——— */
.oiso-liste-banner {
    display: grid;
    grid-template-columns: minmax(0, max-content) auto minmax(0, 1fr);
    align-items: center;
    column-gap: 8px;
    padding: 8px 12px;
    background: #2c5f8a;
    color: #fff;
    border-radius: 8px;
    margin-bottom: 12px;
}

.oiso-liste-title-wrap {
    grid-column: 1;
    justify-self: start;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.oiso-liste-title {
    font-weight: 700;
    font-size: 0.95rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.oiso-view-toggle {
    display: none;
    appearance: none;
    margin: 0;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    white-space: nowrap;
}

.oiso-view-toggle:hover {
    background: rgba(255, 255, 255, 0.28);
}

.oiso-liste-add {
    grid-column: 2;
    justify-self: start;
    appearance: none;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 64px;
    height: 40px;
    padding: 0 !important;
    margin: 0 0 0 12px;
    border: 0;
    border-radius: 8px;
    background: #3d7ab0;
    color: #fff;
    font-size: 0;
    line-height: 0;
    text-align: center;
    cursor: pointer;
    box-sizing: border-box;
}

.oiso-liste-add-icon {
    display: block;
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
    margin: 0;
    pointer-events: none;
}

.oiso-liste-add:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.oiso-liste-count {
    grid-column: 3;
    justify-self: end;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    margin-right: 6px;
    border-radius: 8px;
    background: #e8edf5;
    color: #2c5f8a;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.oiso-liste-count[hidden] {
    visibility: hidden; /* garde la colonne droite → + reste au centre */
    display: inline-flex !important;
    pointer-events: none;
}

/* ——— Cards style OISO mobile ——— */
.oiso-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.oiso-card {
    background: #fff;
    border: 1px solid #c5d4ee;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(16, 42, 117, 0.08);
    overflow: hidden;
}

.oiso-card-head {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: #2c5f8a;
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
}

.oiso-card-date {
    font-size: 0.8rem;
}

.oiso-card-heure {
    font-size: 0.8rem;
    text-align: center;
}

.oiso-card-decl {
    font-size: 0.8rem;
    text-align: right;
    opacity: 0.9;
}

.oiso-card-body {
    display: grid;
    gap: 0;
    padding: 0;
    font-size: 0.8rem;
}

.oiso-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-bottom: 1px solid #eef2f8;
    padding: 6px 12px;
}

/* Type court → Agent démarre plus à gauche, nom sur une ligne */
.oiso-card-grid-type {
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 14px;
}

.oiso-card-grid-lieu {
    grid-template-columns: minmax(0, 1fr) max-content;
    column-gap: 10px;
}

/* Mobile : ville sous le lieu */
.oiso-card-grid-lieu .oiso-card-ville {
    grid-column: 1 / -1;
}

@media (min-width: 701px) {
    .oiso-card-grid-lieu {
        grid-template-columns: minmax(0, 1.4fr) max-content minmax(0, 1fr);
        column-gap: 12px;
        align-items: baseline;
    }

    .oiso-card-grid-lieu .oiso-card-ville {
        grid-column: auto;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .oiso-card-grid-lieu .oiso-card-cp {
        white-space: nowrap;
    }
}

.oiso-card-grid:last-of-type {
    border-bottom: none;
}

.oiso-card-cell {
    min-width: 0;
    font-size: 0.8rem;
    line-height: 1.35;
    padding-right: 6px;
}

.oiso-card-grid-type .oiso-card-cell:last-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.oiso-card-lieu {
    display: flex;
    align-items: baseline;
    min-width: 0;
    gap: 6px;
}

.oiso-card-lieu .oiso-card-label {
    flex-shrink: 0;
    margin-right: 2px;
}

.oiso-card-lieu-trunc {
    appearance: none;
    border: 0;
    background: none;
    padding: 0;
    margin: 0;
    font: inherit;
    font-weight: 600;
    color: #111;
    text-align: left;
    cursor: pointer;
    min-width: 0;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}

.oiso-card-lieu-trunc:hover,
.oiso-card-lieu-trunc:focus {
    color: #2c5f8a;
}

.oiso-lieu-pop {
    position: fixed;
    z-index: 1200;
    max-width: min(320px, calc(100vw - 24px));
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #c5d4ee;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(16, 42, 117, 0.18);
    color: #111;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.35;
    word-break: break-word;
}

.oiso-lieu-pop[hidden] {
    display: none !important;
}

.oiso-card-cell.oiso-card-span {
    grid-column: 1 / -1;
}

.oiso-card-label {
    color: #2c5f8a;
    font-weight: 700;
}

.oiso-card-value {
    color: #111;
    font-weight: 600;
    word-break: break-word;
}

.oiso-card-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    background: #f6f8fc;
    border-top: 1px solid #eef2f8;
}

.oiso-act {
    appearance: none;
    border: 0;
    border-right: 1px solid #eef2f8;
    background: transparent;
    padding: 5px 4px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    color: #3d4f7a;
    font-size: 0.72rem;
    font-weight: 700;
}

.oiso-act:last-child {
    border-right: 0;
}

.oiso-act svg {
    display: block;
}

.oiso-act-view {
    color: #2c5f8a;
}

.oiso-act-copy {
    color: #5a6578;
}

.oiso-act-delete {
    color: #c62828;
}

.oiso-act-print {
    color: #222;
}

.oiso-act:hover {
    background: #eef3fa;
}

@media (max-width: 600px) {
    .oiso-criteres-body {
        grid-template-columns: 1fr;
    }
}

.oiso-dialog {
    border: 1px solid #c5d4ee;
    border-radius: 14px;
    padding: 0;
    max-width: min(920px, calc(100vw - 28px));
    width: min(920px, calc(100vw - 28px));
    /* Laisse de la place pour la barre Android (triangle / rond / carré) */
    max-height: calc(100vh - 72px - env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 72px - env(safe-area-inset-bottom, 0px));
    margin: auto;
    margin-bottom: calc(48px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    box-shadow: 0 12px 40px rgba(16, 42, 117, 0.2);
    overflow: hidden;
}

.oiso-dialog::backdrop {
    background: rgba(16, 42, 117, 0.4);
}

.oiso-agent-picker {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: stretch;
    min-width: 0;
    width: 100%;
}

.oiso-agent-picker input {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
    cursor: pointer;
    background: #f8fafc;
}

.oiso-agent-pick-btn,
.oiso-agent-picker .oiso-agent-pick-btn {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: 7.5rem;
    white-space: nowrap;
    padding: 8px 10px;
    font-size: 0.85rem;
}

.oiso-agent-dialog {
    max-width: min(520px, calc(100vw - 28px));
    width: min(520px, calc(100vw - 28px));
    z-index: 1100;
}

.oiso-agent-form {
    max-height: calc(100dvh - 72px - env(safe-area-inset-bottom, 0px));
}

.oiso-agent-toolbar {
    display: flex;
    gap: 8px;
    padding: 12px 16px 8px;
    flex-shrink: 0;
}

.oiso-agent-toolbar input[type="search"] {
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid #c5d0de;
    border-radius: 8px;
    font: inherit;
}

.oiso-agent-status {
    margin: 0 16px 8px;
    font-size: 0.85rem;
    color: #2c5f8a;
}

.oiso-agent-list {
    flex: 1 1 auto;
    min-height: 180px;
    max-height: min(50vh, 420px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 8px 8px;
    overscroll-behavior: contain;
}

.oiso-agent-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    text-align: left;
    border: 0;
    border-bottom: 1px solid #eef2f8;
    background: #fff;
    padding: 10px 12px;
    cursor: pointer;
    font: inherit;
    color: #222;
    border-radius: 8px;
}

.oiso-agent-item:hover,
.oiso-agent-item:focus {
    background: #eef5fb;
    outline: none;
}

.oiso-agent-item.is-selected {
    background: #d9eaf8;
}

.oiso-agent-item-name {
    font-weight: 700;
    color: #2c5f8a;
}

.oiso-agent-item-tel {
    font-size: 0.85rem;
    color: #555;
}

.oiso-agent-empty {
    padding: 24px 12px;
    text-align: center;
    color: #777;
    font-size: 0.9rem;
}

.oiso-form {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 72px - env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 72px - env(safe-area-inset-bottom, 0px));
    min-height: 0;
}

.oiso-form-head {
    flex-shrink: 0;
    padding: 14px 16px 12px;
    background: #2c5f8a;
    color: #fff;
}

.oiso-form-head h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.oiso-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px 8px;
    /* Padding bas : laisse voir marque / nb / classe / portée au-dessus des boutons */
    padding: 10px 12px 72px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #9bb4cc transparent;
    overscroll-behavior: contain;
}

.oiso-form-grid::-webkit-scrollbar {
    width: 6px;
}
.oiso-form-grid::-webkit-scrollbar-thumb {
    background: #9bb4cc;
    border-radius: 4px;
}

.oiso-fg-instrument {
    grid-column: 1 / -1;
    display: grid;
    /* Marque | Nombre | Classe sur une ligne, Portée à droite ou dessous */
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 0.85fr) minmax(0, 1fr);
    gap: 6px 8px;
    padding-bottom: 4px;
    margin-bottom: 0;
    scroll-margin-bottom: 24px;
}
@media (max-width: 560px) {
    .oiso-fg-instrument {
        /* Marque | Nombre | Classe — Portée en dessous pleine largeur */
        grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 0.9fr);
    }
    .oiso-fg-instrument .oiso-fg:nth-child(4) {
        grid-column: 1 / -1;
    }
}

.oiso-form label,
.oiso-fg {
    display: grid;
    gap: 4px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #2c5f8a;
    min-width: 0;
}

/* display:grid ci-dessus écrase sinon l’attribut HTML hidden */
.oiso-form label[hidden],
.oiso-fg[hidden],
#oisoMotifWrap[hidden],
#oisoMethodeWrap[hidden],
#oisoActionsCopy[hidden],
#oisoActionsEdit[hidden] {
    display: none !important;
}

.oiso-form input,
.oiso-form textarea,
.oiso-form select,
.oiso-fg input,
.oiso-fg textarea,
.oiso-fg select {
    padding: 8px 10px;
    border: 1px solid #c5d0de;
    border-radius: 8px;
    font: inherit;
    font-weight: 500;
    color: #222;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}

.oiso-form-foot {
    flex-shrink: 0;
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #eef2f8;
    background: #f6f8fc;
}

.oiso-form-actions,
#oisoActionsEdit:not([hidden]),
#oisoActionsCopy:not([hidden]) {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 6px;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
}

.oiso-form-actions .oiso-btn,
#oisoActionsEdit:not([hidden]) > button,
#oisoActionsCopy:not([hidden]) > button {
    flex: 1 1 0% !important;
    -webkit-flex: 1 1 0% !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: none !important;
    box-sizing: border-box !important;
    white-space: normal;
    text-align: center;
    line-height: 1.25;
    padding: 9px 6px;
    font-size: 0.78rem;
}

.oiso-form-actions-copy .oiso-btn,
.oiso-form-actions-copy .oiso-btn-primary,
.oiso-form-actions-copy .oiso-btn-secondary,
.oiso-form-actions-copy .oiso-dialog-cancel,
#oisoActionsCopy:not([hidden]) > button {
    min-height: 42px;
    padding: 8px 4px;
    font-size: 0.72rem;
    white-space: normal;
    overflow: hidden;
    word-break: break-word;
    hyphens: auto;
}

.oiso-form-actions-copy .oiso-btn:not(.oiso-dialog-cancel),
.oiso-form-actions-copy .oiso-btn-primary,
.oiso-form-actions-copy .oiso-btn-secondary {
    background: #2c5f8a !important;
    color: #fff !important;
    border: 1px solid #2c5f8a !important;
}

.oiso-form-actions-copy .oiso-btn:not(.oiso-dialog-cancel):hover:not(:disabled) {
    background: #244e72 !important;
    border-color: #244e72 !important;
}

/* Mobile : marge autour du cadre + espace barre Android */
@media (max-width: 700px) {
    .oiso-dialog {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
        max-height: calc(100vh - 88px - env(safe-area-inset-bottom, 0px));
        max-height: calc(100dvh - 88px - env(safe-area-inset-bottom, 0px));
        margin: 12px auto calc(56px + env(safe-area-inset-bottom, 0px));
        border-radius: 14px;
    }

    .oiso-form {
        max-height: calc(100vh - 88px - env(safe-area-inset-bottom, 0px));
        max-height: calc(100dvh - 88px - env(safe-area-inset-bottom, 0px));
    }

    .oiso-form-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px 8px;
        padding: 10px 10px 64px;
    }

    .oiso-fg-wide,
    .oiso-fg-type,
    .oiso-fg-agent {
        grid-column: 1 / -1;
    }

    /* Agent : le nom doit rester lisible, « Choisir » compact */
    .oiso-agent-picker {
        flex-wrap: nowrap;
    }
    .oiso-agent-picker input {
        flex: 1 1 65% !important;
        min-width: 9rem !important;
    }
    .oiso-agent-pick-btn,
    .oiso-agent-picker .oiso-agent-pick-btn,
    .oiso-form-actions .oiso-agent-pick-btn {
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: 5.5rem;
        padding: 8px 8px;
        font-size: 0.8rem;
    }

    /* Boutons copie toujours bleus aussi en mobile (Annuler reste rouge) */
    .oiso-form-actions-copy .oiso-btn:not(.oiso-dialog-cancel),
    #oisoActionsCopy:not([hidden]) > button:not(.oiso-dialog-cancel) {
        background: #2c5f8a !important;
        color: #fff !important;
        border-color: #2c5f8a !important;
        flex: 1 1 0% !important;
        width: 0 !important;
    }
}

@media (max-width: 420px) {
    .oiso-form-grid {
        grid-template-columns: 1fr;
    }
    /* Même en très étroit : marque | nb | classe restent côte à côte */
    .oiso-fg-instrument {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.95fr) minmax(0, 0.85fr);
    }
    .oiso-fg-instrument .oiso-fg:nth-child(4) {
        grid-column: 1 / -1;
    }
}

/* PC : plusieurs colonnes, peu/pas besoin d’ascenseur */
@media (min-width: 901px) {
    .oiso-view-toggle {
        display: inline-flex;
        align-items: center;
    }

    .oiso-page.is-list {
        max-width: 1440px;
    }
}

@media (min-width: 701px) {
    .oiso-dialog {
        width: min(920px, calc(100vw - 48px));
        max-width: min(920px, calc(100vw - 48px));
        max-height: calc(100vh - 48px);
        max-height: calc(100dvh - 48px);
        margin-bottom: auto;
    }

    .oiso-form {
        max-height: calc(100vh - 48px);
        max-height: calc(100dvh - 48px);
    }

    .oiso-form-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px 10px;
        padding: 12px 14px 20px;
        overflow: visible;
    }

    .oiso-fg-type {
        grid-column: span 2;
    }

    .oiso-fg-agent {
        grid-column: span 2;
    }

    .oiso-fg-wide {
        grid-column: 1 / -1;
    }

    /* PC : CP | Ville | Tél lieu | (vide) puis Correspondant | Tél fixe | Tél portable */
    .oiso-fg-corr {
        grid-column: 1;
    }

    .oiso-fg-motif,
    .oiso-fg-methode {
        grid-column: span 2;
    }

    /* PC : 4 boutons exactement la même largeur */
    #oisoActionsCopy:not([hidden]) {
        display: flex !important;
        flex-wrap: nowrap !important;
    }
    #oisoActionsCopy:not([hidden]) > button {
        flex: 1 1 0% !important;
        width: 0 !important;
        max-width: none !important;
        min-width: 0 !important;
    }

    /* PC : + au centre du bandeau, plus large ; compteur à droite un peu rentré */
    .oiso-liste-banner {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        padding: 10px 20px 10px 16px;
        column-gap: 16px;
    }
    .oiso-liste-add {
        justify-self: center;
        width: 110px;
        height: 42px;
        margin-left: 0;
        padding: 0 !important;
    }
    .oiso-liste-add-icon {
        width: 26px;
        height: 26px;
    }
    .oiso-liste-count {
        min-width: 44px;
        height: 40px;
        margin-right: 14px;
    }
}

@media (max-width: 600px) {
    .oiso-criteres-body {
        grid-template-columns: 1fr;
    }

    .oiso-actions {
        flex-direction: column;
    }

    .oiso-btn {
        width: 100%;
    }

    .oiso-agent-pick-btn,
    .oiso-agent-picker .oiso-agent-pick-btn {
        width: auto !important;
        max-width: 5.5rem !important;
    }

    .oiso-status-row {
        flex-direction: column;
        gap: 2px;
    }

    .oiso-status-value {
        text-align: left;
    }

    /* Ne pas empiler les boutons du popup */
    #oisoActionsCopy:not([hidden]) > button,
    #oisoActionsEdit:not([hidden]) > button,
    .oiso-form-actions .oiso-btn {
        flex: 1 1 0% !important;
        width: 0 !important;
    }

    .oiso-form-actions-copy .oiso-btn:not(.oiso-dialog-cancel) {
        background: #2c5f8a !important;
        color: #fff !important;
    }
}

/* Listing PC — colonnes OISO, couleurs Corcym */
.oiso-table-wrap {
    display: none;
    overflow: auto;
    max-height: calc(100vh - 220px);
    max-height: calc(100dvh - 220px);
    border: 1px solid #d5e2ef;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(44, 95, 138, 0.08);
}

.oiso-page.is-list .oiso-table-wrap:not([hidden]) {
    display: block;
}

.oiso-page.is-list .oiso-cards {
    display: none !important;
}

.oiso-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.84rem;
}

.oiso-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 10px 10px;
    background: #2c5f8a;
    color: #fff;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
    border-bottom: 2px solid #eab256;
}

.oiso-table thead th.oiso-th-actions {
    cursor: default;
    text-align: right;
}

.oiso-table thead th.is-sorted {
    background: #24527a;
}

.oiso-table tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid #e6eef6;
    color: #1c2430;
    vertical-align: middle;
}

.oiso-table tbody tr:nth-child(even) {
    background: #f4f8fc;
}

.oiso-table tbody tr.is-annulee {
    background: #fdecee;
}

.oiso-table tbody tr.is-creee {
    background: #fff6e6;
}

.oiso-table tbody tr:hover {
    background: #e7f1fa;
}

.oiso-table tbody tr.is-annulee:hover {
    background: #f8e0e4;
}

.oiso-table tbody tr.is-creee:hover {
    background: #fdeccf;
}

.oiso-decl {
    display: inline-block;
    max-width: 11rem;
    padding: 2px 8px;
    border-radius: 999px;
    background: #e8edf5;
    color: #5c6b7a;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.3;
}

.oiso-table tr.is-annulee .oiso-decl {
    background: #f3c3cb;
    color: #8d2438;
}

.oiso-table tr.is-creee .oiso-decl {
    background: #f6ddb0;
    color: #7a4e00;
}

.oiso-td-societe {
    max-width: 220px;
}

.oiso-table .oiso-card-lieu-trunc {
    display: block;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.oiso-row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
}

.oiso-table .oiso-act {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: #e8f1fa;
    color: #2c5f8a;
    line-height: 0;
}

.oiso-table .oiso-act svg {
    display: block;
    width: 18px;
    height: 18px;
    margin: 0;
}

.oiso-table .oiso-act-delete {
    background: #fdecee;
    color: #a32020;
}

.oiso-table .oiso-act:hover {
    background: #d5e6f5;
}

.oiso-table .oiso-act-delete:hover {
    background: #f6d0d6;
}

.oiso-td-num {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: #2c5f8a;
}

.oiso-td-date,
.oiso-td-heure,
.oiso-td-cp {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
