:root {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #1f2937;
    background: #f3f4f6;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
}

a {
    color: inherit;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border-bottom: 1px solid #ddd;
}

.app-nav {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
}

.app-main {
    width: min(1100px, 100%);
    margin: 0 auto;
    padding: 1rem;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.login-card {
    width: min(420px, 100%);
}

label {
    display: block;
    margin-top: 1rem;
    margin-bottom: .35rem;
    font-weight: 600;
}

input, select, textarea, button {
    width: 100%;
    font: inherit;
}

input, select, textarea {
    padding: .8rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}

button, .button {
    display: inline-block;
    margin-top: 1rem;
    padding: .85rem 1rem;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    background: #111827;
    color: #fff;
}

.flash-error {
    padding: .75rem;
    background: #fee2e2;
    border-radius: 8px;
    color: #991b1b;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.stat strong {
    display: block;
    margin-top: .4rem;
    font-size: 2rem;
}

@media (max-width: 640px) {
    .app-header {
        align-items: flex-start;
        flex-direction: column;
    }
}


.user-caption{margin-top:.2rem;color:#64748b;font-size:.9rem}.page-heading{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:1rem}.page-heading h1{margin-bottom:.25rem}.page-heading p{margin-top:0;color:#64748b}.flash-success{padding:.75rem;margin-bottom:1rem;background:#dcfce7;border-radius:8px;color:#166534}.flash-error{margin-bottom:1rem}.table-scroll{overflow-x:auto}table{width:100%;border-collapse:collapse}th,td{padding:.8rem;border-bottom:1px solid #e5e7eb;text-align:left;vertical-align:middle}th{font-size:.85rem;color:#64748b}td small{display:block;margin-top:.25rem;color:#64748b}.actions{white-space:nowrap}.inline-form{display:inline}.inline-form button{width:auto}.link-button{margin-top:0;padding:0;background:transparent;color:inherit;text-decoration:underline}.button{width:auto}.button-secondary{background:#e5e7eb;color:#111827}.button-danger{background:#b91c1c}.badge{display:inline-block;padding:.25rem .55rem;border-radius:999px;font-size:.8rem;font-weight:700}.badge-active{background:#dcfce7;color:#166534}.badge-inactive{background:#e5e7eb;color:#475569}.form-card{max-width:760px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.checkbox-row{display:flex;align-items:center;gap:.65rem;margin-top:1.25rem}.checkbox-row input{width:auto}.form-actions{display:flex;justify-content:flex-end;gap:.75rem;margin-top:1.5rem}.password-section{margin-top:1.5rem;padding-top:1rem;border-top:1px solid #e5e7eb}.password-section h2{font-size:1.1rem;margin-bottom:.25rem}.password-section p,.hint{color:#64748b}@media(max-width:640px){.page-heading{align-items:stretch;flex-direction:column}.form-grid{grid-template-columns:1fr;gap:0}.form-actions{flex-direction:column-reverse}.form-actions .button,.form-actions button{width:100%}}


.filter-bar {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
}
.filter-bar label { margin-top: 0; }
.filter-action button { width: auto; min-width: 110px; }
.page-subnav { margin: 0 0 1rem; }
.page-subnav a { font-weight: 600; }
.card-subsection {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}
.card-subsection h2 { margin-bottom: .25rem; font-size: 1.1rem; }
.card-subsection p { color: #64748b; }
textarea { resize: vertical; }

@media (max-width: 800px) {
    .filter-bar { grid-template-columns: 1fr 1fr; }
    .filter-bar > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
    .filter-bar { grid-template-columns: 1fr; }
    .filter-bar > div:first-child { grid-column: auto; }
    .filter-action button { width: 100%; }
}


/* V4 — Plans interactifs */
.map-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.map-card {
    overflow: hidden;
}

.map-thumb-link {
    display: block;
    margin: -1rem -1rem 1rem;
    background: #e5e7eb;
}

.map-thumb {
    display: block;
    width: 100%;
    height: 220px;
    object-fit: contain;
}

.map-card-body {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.map-card-body h2 {
    margin: 0 0 .3rem;
    font-size: 1.15rem;
}

.map-card-body p {
    margin: 0;
    color: #64748b;
}

.map-card-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.map-edit-preview {
    display: block;
    width: 100%;
    max-height: 360px;
    object-fit: contain;
    margin-bottom: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.map-editor-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.map-editor-panel {
    position: sticky;
    top: 1rem;
}

.map-editor-panel h2,
.map-legend-card h2 {
    margin-top: 0;
    font-size: 1.15rem;
}

.map-editor-panel p {
    color: #64748b;
}

.map-position-actions {
    display: grid;
    gap: .65rem;
    margin-top: 1rem;
}

.map-position-actions button {
    margin-top: 0;
}

.map-canvas-card {
    min-width: 0;
}

.map-canvas-help {
    margin-bottom: .75rem;
    color: #475569;
}

.map-canvas-scroll {
    width: 100%;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
}

.map-canvas {
    position: relative;
    width: 100%;
    line-height: 0;
}

.map-canvas > img {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
    cursor: crosshair;
}


.map-editor-layout[data-can-edit="0"] .map-canvas > img {
    cursor: default;
}

.map-marker {
    position: absolute;
    z-index: 2;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--map-marker-size, 30px);
    min-height: var(--map-marker-size, 30px);
    width: auto;
    margin: 0;
    padding:
        2px
        var(--map-marker-padding-x, 5px);
    border: var(--map-marker-border, 2px) solid #fff;
    border-radius: 999px;
    box-shadow: 0 1px 4px rgba(0,0,0,.3);
    background: #111827;
    color: #fff;
    font-size: var(--map-marker-font-size, 11px);
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.map-marker:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.map-marker-preview {
    z-index: 3;
    pointer-events: none;
    background: #2563eb;
}

.map-legend-card {
    margin-top: 1rem;
}

.map-legend-list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.map-legend-list span {
    padding: .45rem .65rem;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #f8fafc;
}

@media (max-width: 820px) {
    .map-editor-layout {
        grid-template-columns: 1fr;
    }

    .map-editor-panel {
        position: static;
    }
}

@media (max-width: 640px) {
    .map-thumb {
        height: 180px;
    }

    .map-card-body {
        flex-direction: column;
    }

    .map-card-actions .button,
    .map-card-actions form,
    .map-card-actions form button {
        width: 100%;
    }
}


/* V4.1 — Zoom et grand affichage du plan */
.map-canvas-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: .75rem;
}

.map-canvas-toolbar .map-canvas-help {
    margin-bottom: 0;
}

.map-zoom-controls {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
}

.map-tool-button {
    width: auto;
    min-width: 46px;
    margin-top: 0;
    padding: .6rem .8rem;
}

.map-canvas-scroll {
    max-height: 72vh;
    overscroll-behavior: contain;
}

.map-canvas {
    min-width: 100%;
    transform-origin: top left;
}

.map-canvas-card:fullscreen {
    padding: 1rem;
    background: #fff;
    overflow: auto;
}

.map-canvas-card:fullscreen .map-canvas-scroll {
    max-height: calc(100vh - 95px);
}

.map-canvas-card.map-canvas-expanded {
    position: relative;
    width: calc(100vw - 2rem);
    max-width: none;
    margin-left: calc((100vw - min(1100px, 100vw)) / -2 + 1rem);
}

@media (max-width: 640px) {
    .map-canvas-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .map-zoom-controls {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr 2fr;
    }

    .map-tool-button {
        width: 100%;
    }

    .map-canvas-scroll {
        max-height: 68vh;
    }
}


/* V4.2 — Pastilles adaptatives */
.map-marker-preview {
    outline: 2px solid rgba(255, 255, 255, .85);
    outline-offset: 1px;
}

@media (max-width: 640px) {
    .map-marker {
        box-shadow: 0 1px 3px rgba(0,0,0,.28);
    }
}


/* V4.3 — Vue générale en petits points */
.map-markers-dots .map-marker:not(.map-marker-preview) {
    min-width: 8px;
    min-height: 8px;
    width: 8px;
    height: 8px;
    padding: 0;
    border-width: 1px;
    font-size: 0;
    line-height: 0;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,.35);
}

.map-markers-dots .map-marker:not(.map-marker-preview)::after {
    content: "";
}

.map-markers-dots .map-marker-selected:not(.map-marker-preview) {
    width: 12px;
    height: 12px;
    min-width: 12px;
    min-height: 12px;
    outline: 2px solid rgba(255,255,255,.95);
    outline-offset: 1px;
    z-index: 4;
}

.map-markers-labels .map-marker:not(.map-marker-preview) {
    min-width: 26px;
    min-height: 26px;
}

.map-markers-dots .map-marker-preview {
    min-width: 18px;
    min-height: 18px;
    width: auto;
    height: auto;
    padding: 2px 4px;
    font-size: 9px;
    z-index: 5;
}

@media (hover: hover) and (pointer: fine) {
    .map-markers-dots .map-marker:not(.map-marker-preview):hover {
        width: auto;
        min-width: 24px;
        height: 24px;
        min-height: 24px;
        padding: 2px 5px;
        font-size: 10px;
        line-height: 1;
        overflow: visible;
        z-index: 6;
    }
}


/* V4.4 — Marqueurs ultra-compacts : aucun libellé sur le plan */
.map-canvas button.map-marker,
.map-canvas span.map-marker {
    box-sizing: border-box !important;
    display: block !important;
    width: 6px !important;
    min-width: 6px !important;
    max-width: 6px !important;
    height: 6px !important;
    min-height: 6px !important;
    max-height: 6px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #fff !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    font-size: 0 !important;
    line-height: 0 !important;
    text-indent: -9999px;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: 0 1px 2px rgba(0,0,0,.4);
}

/* Le point sélectionné est un peu plus gros et clignote. */
.map-canvas button.map-marker.map-marker-selected,
.map-canvas span.map-marker.map-marker-selected,
.map-canvas .map-marker-preview {
    width: 10px !important;
    min-width: 10px !important;
    max-width: 10px !important;
    height: 10px !important;
    min-height: 10px !important;
    max-height: 10px !important;
    padding: 0 !important;
    border-width: 2px !important;
    font-size: 0 !important;
    text-indent: -9999px;
    z-index: 6;
    animation: gestionmenage-map-pulse 1s ease-in-out infinite;
}

@keyframes gestionmenage-map-pulse {
    0%, 100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: .25;
        transform: translate(-50%, -50%) scale(1.45);
    }
}

/* On supprime l'ancien grossissement au survol : le plan reste dégagé. */
@media (hover: hover) and (pointer: fine) {
    .map-markers-dots .map-marker:not(.map-marker-preview):hover,
    .map-markers-labels .map-marker:not(.map-marker-preview):hover {
        width: 6px !important;
        min-width: 6px !important;
        max-width: 6px !important;
        height: 6px !important;
        min-height: 6px !important;
        max-height: 6px !important;
        padding: 0 !important;
        font-size: 0 !important;
        line-height: 0 !important;
        overflow: hidden !important;
    }

    .map-canvas .map-marker.map-marker-selected:hover {
        width: 10px !important;
        min-width: 10px !important;
        max-width: 10px !important;
        height: 10px !important;
        min-height: 10px !important;
        max-height: 10px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .map-canvas button.map-marker.map-marker-selected,
    .map-canvas span.map-marker.map-marker-selected,
    .map-canvas .map-marker-preview {
        animation: none;
        outline: 2px solid rgba(255,255,255,.95);
        outline-offset: 2px;
    }
}


/* V5 — Jobs de ménage */
.workflow-stats {
    margin-bottom: 1rem;
}

.workflow-stats .stat {
    text-decoration: none;
}

.job-filter-bar,
.date-only-filter {
    display: flex;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.job-filter-bar > div,
.date-only-filter > div {
    min-width: 180px;
}

.job-filter-bar label,
.date-only-filter label {
    margin-top: 0;
}

.job-filter-bar button,
.date-only-filter button {
    width: auto;
}

.assignment-toolbar {
    display: flex;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.assignment-toolbar > div {
    min-width: 240px;
    flex: 1;
}

.assignment-toolbar label {
    margin-top: 0;
}

.assignment-toolbar button {
    width: auto;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: .25rem .6rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 800;
    white-space: nowrap;
}

.status-pending {
    background: #f1f5f9;
    color: #334155;
}

.status-in_progress {
    background: #fef3c7;
    color: #92400e;
}

.status-cleaned {
    background: #dbeafe;
    color: #1e40af;
}

.status-rework {
    background: #fee2e2;
    color: #991b1b;
}

.status-validated {
    background: #dcfce7;
    color: #166534;
}

.status-cancelled {
    background: #e5e7eb;
    color: #64748b;
}

.priority-urgent {
    font-weight: 900;
}

.priority-high {
    font-weight: 700;
}

.priority-low,
.text-muted {
    color: #64748b;
}

.mobil-selection-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
}

.compact-checkbox {
    margin-top: 0;
}

.mobil-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: .65rem;
    margin-top: .75rem;
}

.mobil-select-card {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    padding: .75rem;
    margin: 0;
    border: 1px solid #dbe2ea;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}

.mobil-select-card input {
    width: auto;
    margin-top: .2rem;
}

.mobil-select-card strong,
.mobil-select-card small,
.mobil-select-card em {
    display: block;
}

.mobil-select-card small {
    margin-top: .15rem;
    color: #64748b;
}

.mobil-select-card em {
    margin-top: .25rem;
    color: #991b1b;
    font-size: .8rem;
}

.mobil-select-card.is-disabled {
    opacity: .55;
    cursor: not-allowed;
}

.my-jobs-grid,
.checks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.job-mobile-card,
.check-card {
    border-left: 5px solid #cbd5e1;
}

.status-border-pending {
    border-left-color: #64748b;
}

.status-border-in_progress {
    border-left-color: #d97706;
}

.status-border-cleaned {
    border-left-color: #2563eb;
}

.status-border-rework {
    border-left-color: #dc2626;
}

.status-border-validated {
    border-left-color: #16a34a;
}

.job-mobile-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
}

.job-mobil-number {
    display: block;
    font-size: 1.25rem;
    font-weight: 900;
}

.job-priority-line {
    margin-top: .75rem;
}

.job-note {
    padding: .75rem;
    border-radius: 8px;
    background: #f8fafc;
}

.job-card-actions,
.job-detail-actions {
    display: flex;
    gap: .65rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.job-card-actions form,
.job-detail-actions form {
    flex: 1;
}

.job-card-actions button,
.job-detail-actions button {
    width: 100%;
    min-height: 48px;
    margin-top: 0;
}

.job-action-primary {
    font-weight: 900;
}

.validate-button {
    background: #166534;
}

.rework-box {
    margin-top: .75rem;
    padding-top: .75rem;
    border-top: 1px solid #e5e7eb;
}

.rework-box summary {
    cursor: pointer;
    font-weight: 700;
}

.rework-box button {
    width: 100%;
}

.job-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, .8fr);
    gap: 1rem;
}

.detail-list {
    margin: 0;
}

.detail-list > div {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: .75rem;
    padding: .6rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.detail-list dt {
    color: #64748b;
}

.detail-list dd {
    margin: 0;
    font-weight: 700;
}

.job-history {
    padding-left: 1.2rem;
}

.job-history li {
    margin-bottom: 1rem;
}

.job-history li > div {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    font-size: .9rem;
}

.job-history li > div span {
    color: #64748b;
}

.job-history p {
    margin: .25rem 0;
}

.job-history blockquote {
    margin: .5rem 0 0;
    padding: .5rem .75rem;
    border-left: 3px solid #cbd5e1;
    background: #f8fafc;
}

@media (max-width: 760px) {
    .job-detail-grid {
        grid-template-columns: 1fr;
    }

    .job-filter-bar,
    .date-only-filter,
    .assignment-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .job-filter-bar > div,
    .date-only-filter > div,
    .assignment-toolbar > div {
        width: 100%;
        min-width: 0;
    }

    .job-filter-bar button,
    .date-only-filter button,
    .assignment-toolbar button {
        width: 100%;
    }

    .my-jobs-grid,
    .checks-grid {
        grid-template-columns: 1fr;
    }

    .job-card-actions {
        flex-direction: column;
    }

    .job-card-actions .button,
    .job-card-actions form {
        width: 100%;
    }
}


/* V5.1 — identité visuelle + liens vers le plan */
.brand-block {
    display: flex;
    align-items: center;
    gap: .85rem;
}

.brand-logo {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid #dbe2ea;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    background: #fff;
}

.brand-title {
    display: block;
    font-size: 1.15rem;
}

.guest-brand-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .85rem;
    padding: 1rem 1rem 0;
}

.guest-brand-logo {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid #dbe2ea;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.guest-brand-title {
    font-weight: 900;
    font-size: 1.25rem;
}

.actions-stack {
    white-space: normal;
}

.actions-stack .button {
    margin: 0 0 .45rem 0;
}

.actions-stack .button:last-child {
    margin-bottom: 0;
}

.map-focused-notice {
    margin-bottom: 1rem;
}

@media (max-width: 640px) {
    .brand-block {
        align-items: flex-start;
    }

    .brand-logo {
        width: 48px;
        height: 48px;
    }

    .guest-brand-wrap {
        padding-top: .75rem;
    }
}


/* V5.2 — Dashboard interactif */
.dashboard-stats {
    margin-bottom: 1.25rem;
}

.dashboard-stat-link {
    position: relative;
    display: block;
    text-decoration: none;
    cursor: pointer;
    transition:
        transform .12s ease,
        border-color .12s ease,
        box-shadow .12s ease;
    border: 2px solid transparent;
}

.dashboard-stat-link small {
    display: block;
    margin-top: .4rem;
    color: #64748b;
    font-size: .78rem;
}

.dashboard-stat-link.is-selected {
    border-color: #111827;
}

@media (hover: hover) and (pointer: fine) {
    .dashboard-stat-link:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 14px rgba(0,0,0,.1);
    }
}

.dashboard-stat-link:focus-visible {
    outline: 3px solid #94a3b8;
    outline-offset: 3px;
}

.dashboard-list-section {
    scroll-margin-top: 1rem;
}

.dashboard-list-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .75rem;
}

.dashboard-list-heading h2 {
    margin: 0 0 .25rem;
}

.dashboard-list-heading p {
    margin: 0;
    color: #64748b;
}

@media (max-width: 640px) {
    .dashboard-list-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-list-heading .button {
        width: 100%;
    }
}


/* V5.3 — Clôture de journée */
.page-heading-actions {
    display: flex;
    gap: .65rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.page-heading-actions .button {
    margin-top: 0;
}

.close-day-grid {
    display: grid;
    grid-template-columns: minmax(300px, .9fr) minmax(0, 1.1fr);
    gap: 1rem;
}

.close-day-summary h2,
.close-day-grid h2 {
    margin-top: 0;
}

.close-day-counts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}

.close-day-counts > div,
.close-day-status-list > div {
    padding: .8rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f8fafc;
}

.close-day-counts span,
.close-day-status-list span {
    display: block;
    color: #64748b;
}

.close-day-counts strong {
    display: block;
    margin-top: .25rem;
    font-size: 2rem;
}

.close-day-total {
    margin: 1rem 0;
}

.close-day-total > strong {
    font-size: 1.25rem;
}

.close-day-warning {
    padding: .85rem;
    margin: 1rem 0;
    border-radius: 10px;
    background: #fef3c7;
    color: #92400e;
}

.close-day-button {
    background: #7c2d12;
}

.close-day-status-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .65rem;
    margin-bottom: 1rem;
}

.close-day-status-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.close-day-status-list strong {
    font-size: 1.15rem;
}

@media (max-width: 760px) {
    .page-heading-actions {
        justify-content: stretch;
        flex-direction: column;
    }

    .page-heading-actions .button {
        width: 100%;
    }

    .close-day-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {
    .close-day-counts,
    .close-day-status-list {
        grid-template-columns: 1fr;
    }
}


/* V5.4 — Historique / Archives */
.archive-summary {
    margin-bottom: 1rem;
}

.archive-filters {
    display: grid;
    grid-template-columns:
        minmax(145px, .8fr)
        minmax(145px, .8fr)
        minmax(180px, 1.2fr)
        minmax(180px, 1fr)
        minmax(145px, .8fr)
        auto;
    gap: .75rem;
    align-items: end;
    margin-bottom: 1rem;
}

.archive-filters label {
    margin-top: 0;
}

.archive-filter-action {
    display: flex;
    gap: .5rem;
    align-items: center;
}

.archive-filter-action button,
.archive-filter-action .button {
    width: auto;
    margin-top: 0;
    white-space: nowrap;
}

.archive-result-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: .5rem 0;
    color: #64748b;
}

.archive-result-heading p {
    margin: 0;
}

.archive-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.archive-pagination .button {
    margin-top: 0;
}

@media (max-width: 1050px) {
    .archive-filters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .archive-filter-action {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .archive-filters {
        grid-template-columns: 1fr;
    }

    .archive-filter-action {
        grid-column: auto;
        align-items: stretch;
        flex-direction: column;
    }

    .archive-filter-action button,
    .archive-filter-action .button {
        width: 100%;
    }

    .archive-pagination {
        flex-wrap: wrap;
    }
}


/* V5.5 — Import CSV + compteur d'utilisation */
.import-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.import-layout h2,
.import-history h2,
.usage-heading h2 {
    margin-top: 0;
}

.csv-example {
    overflow-x: auto;
    margin: 1rem 0;
    padding: .85rem;
    border-radius: 10px;
    background: #0f172a;
    color: #f8fafc;
    line-height: 1.7;
}

.csv-example code {
    color: inherit;
}

.simple-list {
    padding-left: 1.25rem;
}

.simple-list li {
    margin-bottom: .55rem;
}

.import-history {
    margin-top: 1rem;
}

.import-preview-stats {
    margin-bottom: 1rem;
}

.import-row-ok {
    background: rgba(220, 252, 231, .25);
}

.import-row-error {
    background: rgba(254, 226, 226, .35);
}

.import-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    margin-top: 1rem;
}

.import-confirm-actions form {
    margin: 0;
}

.import-confirm-actions button {
    width: auto;
    margin-top: 0;
}

.usage-section {
    margin-bottom: 1.25rem;
}

.usage-heading {
    margin-bottom: .65rem;
}

.usage-heading h2 {
    margin-bottom: .2rem;
    font-size: 1.1rem;
}

.usage-heading p {
    margin: 0;
    color: #64748b;
    font-size: .9rem;
}

.usage-stats {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.usage-stats .stat strong {
    font-size: 1.7rem;
}

@media (max-width: 760px) {
    .import-layout {
        grid-template-columns: 1fr;
    }

    .import-confirm-actions {
        flex-direction: column-reverse;
    }

    .import-confirm-actions form,
    .import-confirm-actions button {
        width: 100%;
    }
}


/* V5.6 — Changement de mot de passe utilisateur */
.account-password-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, .42fr);
    gap: 1rem;
    align-items: start;
}

.account-password-card {
    max-width: none;
}

.account-password-card h2,
.account-security-note h2 {
    margin-top: 0;
}

.password-requirements {
    display: grid;
    gap: .3rem;
    margin-top: 1rem;
    padding: .85rem;
    border-radius: 10px;
    background: #f8fafc;
    color: #475569;
    font-size: .9rem;
}

.account-security-note {
    position: sticky;
    top: 1rem;
}

.account-security-note p:last-child {
    margin-bottom: 0;
}

@media (max-width: 760px) {
    .account-password-layout {
        grid-template-columns: 1fr;
    }

    .account-security-note {
        position: static;
    }
}


/* V5.7 — Menu du header sous forme de boutons */
.app-nav {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.app-nav > a,
.app-nav .link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-height: 38px;
    margin: 0;
    padding: .55rem .8rem;
    border: 1px solid #d1d5db;
    border-radius: 9px;
    background: #f8fafc;
    color: #1f2937;
    font-weight: 700;
    font-size: .9rem;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition:
        background .12s ease,
        border-color .12s ease,
        transform .12s ease,
        box-shadow .12s ease;
}

.app-nav > a:hover,
.app-nav .link-button:hover {
    background: #e5e7eb;
    border-color: #cbd5e1;
    text-decoration: none;
}

.app-nav > a:focus-visible,
.app-nav .link-button:focus-visible {
    outline: 3px solid #94a3b8;
    outline-offset: 2px;
}

.app-nav .inline-form {
    display: inline-flex;
    margin: 0;
}

.app-nav .inline-form .link-button {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.app-nav .inline-form .link-button:hover {
    background: #ffedd5;
    border-color: #fdba74;
}

@media (hover: hover) and (pointer: fine) {
    .app-nav > a:hover,
    .app-nav .link-button:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 6px rgba(0,0,0,.08);
    }
}

@media (max-width: 640px) {
    .app-nav {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .5rem;
    }

    .app-nav > a,
    .app-nav .inline-form,
    .app-nav .link-button {
        width: 100%;
    }

    .app-nav .link-button {
        min-height: 42px;
    }
}

@media (max-width: 390px) {
    .app-nav {
        grid-template-columns: 1fr;
    }
}


/* V5.8 — Import CSV des mobil-homes */
.mobil-import-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.mobil-import-layout h2 {
    margin-top: 0;
}

.csv-columns {
    margin: 0;
}

.csv-columns > div {
    display: grid;
    grid-template-columns: 105px 1fr;
    gap: .75rem;
    padding: .55rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.csv-columns > div:last-child {
    border-bottom: 0;
}

.csv-columns dt {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 800;
}

.csv-columns dd {
    margin: 0;
    color: #64748b;
}

.mobil-import-note-row td {
    padding-top: .25rem;
    background: #f8fafc;
    color: #64748b;
}

@media (max-width: 760px) {
    .mobil-import-layout {
        grid-template-columns: 1fr;
    }

    .csv-columns > div {
        grid-template-columns: 90px 1fr;
    }
}


/* V5.16 — Dashboard mobile compact
 * Le CSS critique du menu mobile est volontairement dans layouts/app.php.
 */
@media (max-width: 640px) {
    .dashboard-stats,
    .usage-stats {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: .45rem !important;
    }

    .dashboard-stats .stat,
    .usage-stats .stat {
        min-height: 0 !important;
        padding: .5rem .6rem !important;
        border-radius: 9px;
    }

    .dashboard-stats .stat span,
    .usage-stats .stat span {
        font-size: .72rem !important;
        line-height: 1.15;
    }

    .dashboard-stats .stat strong,
    .usage-stats .stat strong {
        display: block;
        margin-top: .15rem !important;
        font-size: 1.15rem !important;
        line-height: 1.05;
    }

    .dashboard-stats .stat small {
        display: block;
        margin-top: .15rem !important;
        font-size: .64rem !important;
        line-height: 1.1;
    }

    .dashboard-stat-link {
        min-height: 0 !important;
        text-decoration: none !important;
    }

    .usage-section {
        margin-bottom: .8rem;
    }

    .usage-heading {
        margin-bottom: .4rem;
    }

    .usage-heading h2 {
        margin-bottom: .1rem;
        font-size: .98rem;
    }

    .usage-heading p {
        margin: 0;
        font-size: .7rem;
        line-height: 1.25;
    }
}

@media (max-width: 390px) {
    .dashboard-stats,
    .usage-stats {
        gap: .4rem !important;
    }

    .dashboard-stats .stat,
    .usage-stats .stat {
        padding: .45rem .5rem !important;
    }

    .dashboard-stats .stat strong,
    .usage-stats .stat strong {
        font-size: 1.05rem !important;
    }
}


/* V5.17 — Statistiques détaillées du site */
.usage-details { margin-top: .9rem; }
.usage-details-summary {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: .8rem 1rem; border: 1px solid #dbe2ea; border-radius: 10px;
    background: #fff; cursor: pointer; list-style: none;
}
.usage-details-summary::-webkit-details-marker { display: none; }
.usage-details-summary span:first-child { display: grid; gap: .1rem; }
.usage-details-summary strong { font-size: .95rem; }
.usage-details-summary small { color: #64748b; font-size: .76rem; }
.usage-details-action {
    flex: 0 0 auto; padding: .35rem .55rem; border-radius: 7px;
    background: #f1f5f9; color: #334155; font-size: .76rem; font-weight: 800;
}
.usage-details[open] .usage-details-action { font-size: 0; }
.usage-details[open] .usage-details-action::before { content: "Masquer"; font-size: .76rem; }
.usage-details-content { margin-top: .75rem; }
.usage-detail-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; }
.usage-detail-kpi { padding: .75rem .85rem; }
.usage-detail-kpi span { display: block; color: #64748b; font-size: .78rem; }
.usage-detail-kpi strong { display: block; margin-top: .2rem; font-size: 1.35rem; }
.usage-peak-card {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    margin-top: .7rem; padding: .8rem .9rem;
}
.usage-peak-card > div:first-child span { display: block; color: #64748b; font-size: .76rem; }
.usage-peak-card > div:first-child strong { display: block; margin-top: .15rem; font-size: 1rem; }
.usage-peak-numbers { display: flex; flex-wrap: wrap; gap: .5rem .9rem; font-size: .8rem; }
.usage-detail-grid {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .9fr);
    gap: .7rem; margin-top: .7rem;
}
.usage-chart-card, .usage-users-card { padding: .85rem; }
.usage-detail-heading { margin-bottom: .7rem; }
.usage-detail-heading h3 { margin: 0 0 .1rem; font-size: .95rem; }
.usage-detail-heading p { margin: 0; color: #64748b; font-size: .74rem; }
.usage-day-list { display: grid; gap: .34rem; }
.usage-day-row {
    display: grid; grid-template-columns: 42px minmax(80px, 1fr) 42px 48px;
    align-items: center; gap: .45rem; min-height: 22px; font-size: .72rem;
}
.usage-day-date { font-weight: 700; }
.usage-day-bar { height: 7px; overflow: hidden; border-radius: 99px; background: #e2e8f0; }
.usage-day-bar-fill { display: block; width: var(--usage-width); height: 100%; border-radius: inherit; background: #64748b; }
.usage-day-visits, .usage-day-pages { text-align: right; white-space: nowrap; color: #475569; }
.usage-users-table th, .usage-users-table td { padding: .45rem .5rem; font-size: .74rem; }
.usage-users-table td strong, .usage-users-table td small { display: block; }
.usage-users-table td small { margin-top: .08rem; color: #64748b; font-size: .66rem; }
.usage-details-note { margin: .7rem 0 0; color: #64748b; font-size: .7rem; }

@media (min-width: 641px) {
    .usage-details > .usage-details-summary { display: none !important; }
    .usage-details:not([open]) > .usage-details-content { display: block !important; }
}

@media (max-width: 640px) {
    .usage-details { margin-top: .6rem; }
    .usage-details-summary { padding: .62rem .7rem; }
    .usage-details-summary strong { font-size: .82rem; }
    .usage-details-summary small { font-size: .66rem; }
    .usage-detail-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
    .usage-detail-kpi { padding: .5rem .6rem; }
    .usage-detail-kpi span { font-size: .67rem; }
    .usage-detail-kpi strong { margin-top: .1rem; font-size: 1.05rem; }
    .usage-peak-card { display: grid; gap: .45rem; padding: .6rem .7rem; }
    .usage-peak-numbers { gap: .35rem .65rem; font-size: .7rem; }
    .usage-detail-grid { grid-template-columns: 1fr; gap: .55rem; margin-top: .55rem; }
    .usage-chart-card, .usage-users-card { padding: .65rem; }
    .usage-day-row { grid-template-columns: 36px minmax(60px, 1fr) 38px 42px; gap: .3rem; font-size: .66rem; }
    .usage-users-table th, .usage-users-table td { padding: .4rem; font-size: .68rem; }
}


/* V5.18 — Gestion fine des droits utilisateur */
.user-edit-card {
    max-width: 980px;
}

.permission-editor {
    margin-top: 1.5rem;
    padding-top: 1.2rem;
    border-top: 1px solid #e5e7eb;
}

.permission-editor-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .75rem;
}

.permission-editor-heading h2,
.permission-editor-readonly h2 {
    margin: 0 0 .2rem;
    font-size: 1.12rem;
}

.permission-editor-heading p,
.permission-editor-readonly p {
    margin: 0;
    color: #64748b;
    font-size: .84rem;
}

.permission-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .35rem;
}

.permission-state {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: .2rem .45rem;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 800;
}

.permission-state-inherit {
    background: #e2e8f0;
    color: #475569;
}

.permission-state-allow {
    background: #dcfce7;
    color: #166534;
}

.permission-state-deny {
    background: #fee2e2;
    color: #991b1b;
}

.permission-help-card {
    display: grid;
    gap: .15rem;
    margin-bottom: .75rem;
    padding: .65rem .75rem;
    border: 1px solid #bae6fd;
    border-radius: 9px;
    background: #f0f9ff;
    color: #334155;
    font-size: .78rem;
}

.permission-group {
    margin-top: .55rem;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}

.permission-group > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .7rem .8rem;
    background: #f8fafc;
    cursor: pointer;
    list-style: none;
}

.permission-group > summary::-webkit-details-marker {
    display: none;
}

.permission-group > summary > span:first-child {
    display: grid;
    gap: .1rem;
}

.permission-group > summary strong {
    font-size: .88rem;
}

.permission-group > summary small {
    color: #64748b;
    font-size: .7rem;
}

.permission-group-count {
    flex: 0 0 auto;
    color: #64748b;
    font-size: .7rem;
    font-weight: 700;
}

.permission-list {
    display: grid;
}

.permission-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    align-items: center;
    gap: .8rem;
    padding: .65rem .8rem;
    border-top: 1px solid #eef2f7;
}

.permission-row.is-sensitive {
    background: #fffbeb;
}

.permission-info {
    min-width: 0;
}

.permission-info > div:first-child {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .4rem;
}

.permission-info > div:first-child > strong {
    font-size: .82rem;
}

.permission-info code {
    display: block;
    margin-top: .12rem;
    color: #64748b;
    font-size: .68rem;
}

.permission-info small {
    display: block;
    margin-top: .22rem;
    color: #64748b;
    font-size: .68rem;
}

.permission-sensitive-badge {
    display: inline-flex;
    padding: .12rem .35rem;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: .62rem;
    font-weight: 800;
}

.permission-control select {
    width: 100%;
    margin: 0;
    padding: .5rem .55rem;
    font-size: .76rem;
}

.text-allowed {
    color: #166534;
}

.text-denied {
    color: #991b1b;
}

.permission-self-warning {
    margin: .75rem 0 0;
    padding: .6rem .7rem;
    border-radius: 8px;
    background: #fff7ed;
    color: #9a3412;
    font-size: .76rem;
}

.permission-editor-readonly {
    padding: .8rem;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #f8fafc;
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 640px) {
    .permission-editor-heading {
        display: grid;
        gap: .55rem;
    }

    .permission-legend {
        justify-content: flex-start;
    }

    .permission-group > summary {
        padding: .6rem .65rem;
    }

    .permission-row {
        grid-template-columns: 1fr;
        gap: .45rem;
        padding: .6rem .65rem;
    }

    .permission-control select {
        min-height: 40px;
    }
}


/* V5.19 — Plan ciblé : un seul mobil-home visible */
.map-focused-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.map-show-all-button {
    flex: 0 0 auto;
    margin: 0;
    text-decoration: none;
}

.map-editor-layout[data-focused-mode="1"]
.map-marker:not(.map-marker-selected):not(.map-marker-preview) {
    display: none !important;
}

@media (max-width: 640px) {
    .map-focused-notice {
        display: grid;
        gap: .5rem;
    }

    .map-show-all-button {
        width: 100%;
    }
}


/* V5.20 — Édition des jobs par le responsable */
.job-edit-form {
    max-width: 860px;
}

.job-edit-warning {
    display: grid;
    gap: .15rem;
    margin-bottom: 1rem;
    padding: .7rem .8rem;
    border: 1px solid #bae6fd;
    border-radius: 9px;
    background: #f0f9ff;
    color: #334155;
    font-size: .8rem;
}

.job-edit-warning strong {
    color: #0c4a6e;
}

.job-edit-readonly {
    display: grid;
    gap: .15rem;
    margin: .8rem 0;
    padding: .7rem .8rem;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #f8fafc;
}

.job-edit-readonly > span {
    color: #64748b;
    font-size: .76rem;
}

.job-edit-readonly > strong {
    font-size: .9rem;
}

.job-edit-readonly > small {
    color: #64748b;
    font-size: .7rem;
}

@media (max-width: 640px) {
    .job-edit-form {
        padding: .75rem;
    }

    .job-edit-form .form-grid {
        grid-template-columns: 1fr;
    }
}


/* V5.21 — Page Statistiques & activité */
.activity-page-heading,
.activity-section-heading,
.usage-heading-with-action {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.activity-filters {
    margin-bottom: .8rem;
    padding: .8rem;
}

.activity-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .65rem;
}

.activity-filter-grid label {
    display: block;
    margin-bottom: .2rem;
    font-size: .74rem;
    font-weight: 700;
}

.activity-filter-grid input,
.activity-filter-grid select {
    width: 100%;
    margin: 0;
}

.activity-filter-actions {
    margin-top: .7rem;
}

.activity-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .55rem;
    margin-bottom: 1rem;
}

.activity-summary-card {
    padding: .65rem .75rem;
}

.activity-summary-card span {
    display: block;
    color: #64748b;
    font-size: .72rem;
}

.activity-summary-card strong {
    display: block;
    margin-top: .15rem;
    font-size: 1.35rem;
}

.activity-section {
    margin-top: 1.15rem;
}

.activity-section-heading {
    margin-bottom: .5rem;
}

.activity-section-heading h2 {
    margin: 0 0 .1rem;
    font-size: 1.08rem;
}

.activity-section-heading p {
    margin: 0;
    color: #64748b;
    font-size: .76rem;
}

.activity-people-table td strong,
.activity-people-table td small {
    display: block;
}

.activity-people-table td small {
    color: #64748b;
    font-size: .68rem;
}

.activity-daily-table .is-empty-day {
    opacity: .52;
}

.activity-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem;
}

.activity-action-card {
    padding: .8rem;
}

.activity-action-card h3 {
    margin: 0 0 .6rem;
    font-size: .94rem;
}

.activity-action-list {
    display: grid;
    gap: .35rem;
}

.activity-action-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .7rem;
    padding: .45rem .55rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.activity-action-list span {
    display: grid;
    gap: .05rem;
    min-width: 0;
}

.activity-action-list strong {
    font-size: .76rem;
}

.activity-action-list small {
    color: #64748b;
    font-size: .62rem;
}

.activity-action-list b {
    flex: 0 0 auto;
    font-size: .9rem;
}

.activity-timeline {
    display: grid;
    gap: .45rem;
}

.activity-event {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) 170px;
    align-items: start;
    gap: .75rem;
    padding: .7rem .8rem;
}

.activity-event-time {
    display: grid;
    gap: .05rem;
}

.activity-event-time strong {
    font-size: .76rem;
}

.activity-event-time span {
    color: #64748b;
    font-size: .7rem;
}

.activity-event-topline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .4rem;
}

.activity-event-topline > strong {
    font-size: .82rem;
}

.activity-source-chip {
    display: inline-flex;
    padding: .15rem .38rem;
    border-radius: 999px;
    font-size: .61rem;
    font-weight: 800;
}

.activity-source-job {
    background: #dbeafe;
    color: #1e40af;
}

.activity-source-audit {
    background: #fef3c7;
    color: #92400e;
}

.activity-source-visit {
    background: #dcfce7;
    color: #166534;
}

.activity-event-subject {
    margin-top: .2rem;
    font-size: .76rem;
    font-weight: 700;
}

.activity-event-body p {
    margin: .18rem 0 0;
    color: #475569;
    font-size: .7rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.activity-event-user {
    display: grid;
    gap: .05rem;
    text-align: right;
}

.activity-event-user strong {
    font-size: .74rem;
}

.activity-event-user small {
    color: #64748b;
    font-size: .65rem;
}

.activity-data-note {
    margin-top: .7rem;
    padding: .65rem .75rem;
    border: 1px solid #bae6fd;
    border-radius: 9px;
    background: #f0f9ff;
    color: #334155;
    font-size: .72rem;
    line-height: 1.35;
}

.usage-full-report-button {
    flex: 0 0 auto;
}

@media (max-width: 900px) {
    .activity-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .activity-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .activity-event {
        grid-template-columns: 82px minmax(0, 1fr);
    }

    .activity-event-user {
        grid-column: 2;
        text-align: left;
    }
}

@media (max-width: 640px) {
    .activity-page-heading,
    .activity-section-heading,
    .usage-heading-with-action {
        display: grid;
        gap: .45rem;
    }

    .activity-filter-grid {
        grid-template-columns: 1fr 1fr;
        gap: .45rem;
    }

    .activity-filter-grid > div:nth-child(3),
    .activity-filter-grid > div:nth-child(4) {
        grid-column: 1 / -1;
    }

    .activity-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .4rem;
    }

    .activity-summary-card {
        padding: .5rem .6rem;
    }

    .activity-summary-card span {
        font-size: .66rem;
    }

    .activity-summary-card strong {
        font-size: 1.08rem;
    }

    .activity-action-grid {
        grid-template-columns: 1fr;
    }

    .activity-event {
        grid-template-columns: 70px minmax(0, 1fr);
        gap: .5rem;
        padding: .6rem;
    }

    .activity-event-user {
        grid-column: 2;
    }

    .usage-full-report-button {
        width: fit-content;
    }
}


/* V5.22 — En-tête figé + export statistiques */
.app-header {
    position: sticky;
    top: 0;
    z-index: 2000;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
}

.activity-export-button {
    text-decoration: none;
}

.activity-export-hint {
    margin: .45rem 0 0;
    color: #64748b;
    font-size: .68rem;
}

@media (max-width: 640px) {
    .activity-filter-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: .4rem;
    }

    .activity-filter-actions > * {
        width: 100%;
        margin: 0;
        justify-content: center;
    }

    .activity-filter-actions > button {
        grid-column: 1 / -1;
    }

    .activity-export-hint {
        font-size: .64rem;
        line-height: 1.3;
    }
}


/* V5.23 — Performances ménage */
.activity-performance-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .5rem;
    margin-bottom: .65rem;
}

.activity-performance-kpis .card {
    padding: .6rem .7rem;
}

.activity-performance-kpis span {
    display: block;
    color: #64748b;
    font-size: .68rem;
}

.activity-performance-kpis strong {
    display: block;
    margin-top: .12rem;
    font-size: 1.08rem;
}

.activity-performance-table td strong,
.activity-performance-table td small {
    display: block;
}

.activity-performance-table td small {
    margin-top: .08rem;
    color: #64748b;
    font-size: .62rem;
}

.activity-performance-note {
    margin-top: .55rem;
}

@media (max-width: 900px) {
    .activity-performance-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .activity-performance-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .4rem;
    }

    .activity-performance-kpis .card {
        padding: .5rem .55rem;
    }

    .activity-performance-kpis strong {
        font-size: .98rem;
    }
}


/* V5.24 — Statistiques métier avancées */
.activity-advanced-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .5rem;
    margin-bottom: .7rem;
}

.activity-advanced-kpis .card {
    padding: .62rem .7rem;
}

.activity-advanced-kpis span,
.activity-comparison-item > span {
    display: block;
    color: #64748b;
    font-size: .68rem;
}

.activity-advanced-kpis strong {
    display: block;
    margin-top: .12rem;
    font-size: 1.08rem;
}

.activity-advanced-kpis small {
    display: block;
    margin-top: .08rem;
    color: #64748b;
    font-size: .62rem;
}

.activity-comparison-card,
.activity-breakdown-card,
.activity-peak-card {
    padding: .8rem;
}

.activity-detail-heading {
    margin-bottom: .65rem;
}

.activity-detail-heading h3 {
    margin: 0 0 .1rem;
    font-size: .94rem;
}

.activity-detail-heading p {
    margin: 0;
    color: #64748b;
    font-size: .71rem;
}

.activity-comparison-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .5rem;
}

.activity-comparison-item {
    padding: .58rem .65rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.activity-comparison-item strong {
    display: block;
    margin-top: .12rem;
    font-size: 1rem;
}

.activity-comparison-item small {
    display: block;
    margin-top: .12rem;
    color: #64748b;
    font-size: .62rem;
    line-height: 1.25;
}

.activity-advanced-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem;
    margin-top: .7rem;
}

.activity-breakdown-table td strong,
.activity-breakdown-table td small {
    display: block;
}

.activity-breakdown-table td small {
    margin-top: .06rem;
    color: #64748b;
    font-size: .61rem;
}

.activity-peak-bars {
    display: grid;
    gap: .38rem;
}

.activity-peak-row {
    display: grid;
    grid-template-columns: 82px minmax(70px, 1fr) 32px;
    align-items: center;
    gap: .45rem;
    font-size: .69rem;
}

.activity-peak-row > span {
    white-space: nowrap;
}

.activity-peak-row > strong {
    text-align: right;
}

.activity-peak-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.activity-peak-track i {
    display: block;
    width: var(--bar-width);
    height: 100%;
    border-radius: inherit;
    background: #64748b;
}

.activity-hour-bars {
    max-height: 310px;
    overflow-y: auto;
    padding-right: .2rem;
}

@media (max-width: 1000px) {
    .activity-advanced-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .activity-comparison-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .activity-advanced-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .activity-advanced-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .4rem;
    }

    .activity-advanced-kpis .card {
        padding: .5rem .55rem;
    }

    .activity-advanced-kpis strong {
        font-size: .98rem;
    }

    .activity-comparison-grid {
        grid-template-columns: 1fr 1fr;
        gap: .4rem;
    }

    .activity-comparison-item {
        padding: .5rem .55rem;
    }

    .activity-peak-row {
        grid-template-columns: 70px minmax(50px, 1fr) 28px;
        gap: .35rem;
        font-size: .64rem;
    }
}


/* V5.25 — Centre de notifications */
.app-header-actions-v525 {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex: 0 0 auto;
}

.notification-header-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #f8fafc;
    color: #1f2937;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.notification-header-button.has-unread {
    border-color: #f59e0b;
    background: #fffbeb;
}

.notification-bell {
    font-size: 1.15rem;
    line-height: 1;
}

.notification-header-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 21px;
    height: 21px;
    padding: 0 .3rem;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: .62rem;
    font-weight: 900;
    line-height: 1;
}

.notification-page-heading form,
.notification-actions form {
    margin: 0;
}

.notification-page-heading form button {
    margin: 0;
}

.notification-summary {
    display: flex;
    gap: 2rem;
    margin-bottom: .8rem;
    padding: .7rem .85rem;
}

.notification-summary > div {
    display: grid;
    gap: .08rem;
}

.notification-summary span {
    color: #64748b;
    font-size: .7rem;
}

.notification-summary strong {
    font-size: 1.2rem;
}

.notification-list {
    display: grid;
    gap: .55rem;
}

.notification-card {
    position: relative;
    display: grid;
    grid-template-columns: 7px minmax(0, 1fr) auto;
    align-items: center;
    gap: .8rem;
    padding: .75rem .8rem;
    overflow: hidden;
}

.notification-card.is-read {
    opacity: .72;
}

.notification-card.is-unread {
    box-shadow: 0 3px 12px rgba(15, 23, 42, .1);
}

.notification-indicator {
    align-self: stretch;
    width: 7px;
    min-height: 52px;
    border-radius: 99px;
    background: #64748b;
}

.notification-danger .notification-indicator {
    background: #dc2626;
}

.notification-warning .notification-indicator {
    background: #f59e0b;
}

.notification-info .notification-indicator {
    background: #2563eb;
}

.notification-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .4rem;
}

.notification-title-row > strong {
    font-size: .88rem;
}

.notification-content p {
    margin: .2rem 0 0;
    color: #475569;
    font-size: .73rem;
    line-height: 1.35;
}

.notification-unread-badge,
.notification-read-badge {
    display: inline-flex;
    padding: .13rem .35rem;
    border-radius: 999px;
    font-size: .59rem;
    font-weight: 900;
}

.notification-unread-badge {
    background: #fee2e2;
    color: #991b1b;
}

.notification-read-badge {
    background: #e2e8f0;
    color: #475569;
}

.notification-actions {
    display: flex;
    align-items: center;
    gap: .35rem;
}

.notification-actions button {
    width: auto;
    min-width: 76px;
    margin: 0;
    padding: .5rem .65rem;
    font-size: .7rem;
}

.notification-empty {
    text-align: center;
}

.notification-empty p {
    margin-bottom: 0;
    color: #64748b;
    font-size: .8rem;
}

.notification-explanation {
    margin-top: .8rem;
}

@media (min-width: 641px) {
    .app-header-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .8rem;
        flex: 0 0 auto;
    }
}

@media (max-width: 640px) {
    .app-header-actions-v525 {
        gap: .35rem;
    }

    .notification-header-button {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }

    .notification-card {
        grid-template-columns: 6px minmax(0, 1fr);
        gap: .6rem;
        padding: .65rem;
    }

    .notification-actions {
        grid-column: 2;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .35rem;
    }

    .notification-actions form,
    .notification-actions button {
        width: 100%;
    }

    .notification-summary {
        gap: 1.2rem;
    }

    .notification-page-heading {
        display: grid;
        gap: .45rem;
    }

    .notification-page-heading form,
    .notification-page-heading form button {
        width: 100%;
    }
}


/* V5.26 — Préférences de notifications */
.notification-summary {
    flex-wrap: wrap;
}

.notification-preferences {
    margin-bottom: .8rem;
    padding: .8rem;
    scroll-margin-top: 92px;
}

.notification-preferences-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .8rem;
    margin-bottom: .7rem;
}

.notification-preferences-heading h2 {
    margin: 0 0 .12rem;
    font-size: 1rem;
}

.notification-preferences-heading p {
    margin: 0;
    color: #64748b;
    font-size: .72rem;
    line-height: 1.35;
}

.notification-preferences-heading form {
    flex: 0 0 auto;
    margin: 0;
}

.notification-preferences-heading button {
    margin: 0;
}

.notification-preference-form {
    margin: 0;
}

.notification-master-switch,
.notification-preference-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    cursor: pointer;
}

.notification-master-switch {
    padding: .65rem .7rem;
    border: 1px solid #bae6fd;
    border-radius: 9px;
    background: #f0f9ff;
}

.notification-master-switch > span,
.notification-preference-row > span,
.notification-arrival-setting label {
    display: grid;
    gap: .08rem;
}

.notification-master-switch strong,
.notification-preference-row strong,
.notification-arrival-setting strong {
    font-size: .78rem;
}

.notification-master-switch small,
.notification-preference-row small,
.notification-arrival-setting small {
    color: #64748b;
    font-size: .65rem;
    line-height: 1.3;
}

.notification-master-switch input,
.notification-preference-row input {
    flex: 0 0 auto;
    width: 21px;
    height: 21px;
    margin: 0;
}

.notification-preference-list {
    display: grid;
    gap: .35rem;
    margin-top: .55rem;
}

.notification-preference-row {
    padding: .55rem .65rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.notification-arrival-setting {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, 210px);
    align-items: center;
    gap: .7rem;
    margin-top: .55rem;
    padding: .55rem .65rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.notification-arrival-setting select {
    width: 100%;
    margin: 0;
}

.notification-no-preferences {
    margin-top: .55rem;
    padding: .6rem .7rem;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: #64748b;
    font-size: .72rem;
}

.notification-preference-actions {
    margin-top: .65rem;
}

.notification-paused {
    border-color: #cbd5e1;
    background: #f8fafc;
}

@media (max-width: 640px) {
    .notification-preferences {
        padding: .65rem;
        scroll-margin-top: 78px;
    }

    .notification-preferences-heading {
        display: grid;
        gap: .5rem;
    }

    .notification-preferences-heading form,
    .notification-preferences-heading button {
        width: 100%;
    }

    .notification-master-switch,
    .notification-preference-row {
        gap: .55rem;
    }

    .notification-arrival-setting {
        grid-template-columns: 1fr;
        gap: .4rem;
    }

    .notification-preference-actions button {
        width: 100%;
    }
}


/* V5.27 — Linge & consommables */
.supply-page-heading,
.supply-heading-actions,
.supply-card-top,
.supply-items-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
}

.supply-heading-actions {
    flex-wrap: wrap;
}

.supply-filters,
.supply-my-date {
    margin-bottom: .7rem;
    padding: .7rem;
}

.supply-filter-grid {
    display: grid;
    grid-template-columns: 150px 180px minmax(180px, 1fr) auto;
    align-items: end;
    gap: .55rem;
}

.supply-filter-grid input,
.supply-filter-grid select,
.supply-filter-grid button {
    width: 100%;
    margin: 0;
}

.supply-filter-submit button {
    min-height: 42px;
}

.supply-my-date {
    display: grid;
    grid-template-columns: auto 180px auto;
    align-items: end;
    gap: .5rem;
    max-width: 520px;
}

.supply-task-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .55rem;
}

.supply-task-card {
    display: grid;
    gap: .26rem;
    padding: .7rem;
    color: inherit;
    text-decoration: none;
    border-left: 5px solid #94a3b8;
}

.supply-task-card:hover {
    text-decoration: none;
}

.supply-priority-urgent { border-left-color: #dc2626; }
.supply-priority-high { border-left-color: #f59e0b; }
.supply-priority-normal { border-left-color: #2563eb; }
.supply-priority-low { border-left-color: #94a3b8; }

.supply-card-top strong {
    font-size: .9rem;
}

.supply-card-type {
    font-size: .76rem;
    font-weight: 700;
}

.supply-task-card small {
    color: #64748b;
    font-size: .66rem;
}

.supply-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .18rem .42rem;
    border-radius: 999px;
    font-size: .62rem;
    font-weight: 800;
    white-space: nowrap;
}

.supply-status-pending { background: #e2e8f0; color: #334155; }
.supply-status-in_progress { background: #dbeafe; color: #1e40af; }
.supply-status-completed { background: #dcfce7; color: #166534; }
.supply-status-cancelled { background: #fee2e2; color: #991b1b; }

.supply-empty {
    color: #64748b;
    text-align: center;
}

.supply-task-form,
.supply-catalog-form {
    max-width: 920px;
}

.supply-items-heading {
    margin: 1rem 0 .5rem;
}

.supply-items-heading h2 {
    margin: 0;
    font-size: .98rem;
}

.supply-items-heading input {
    width: min(320px, 100%);
    margin: 0;
}

.supply-item-entry-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .4rem;
}

.supply-item-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 90px;
    align-items: center;
    gap: .5rem;
    padding: .5rem .6rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.supply-item-entry.is-inactive {
    opacity: .65;
}

.supply-item-entry span,
.supply-show-items span {
    display: grid;
    gap: .05rem;
}

.supply-item-entry strong,
.supply-show-items strong {
    font-size: .76rem;
}

.supply-item-entry small,
.supply-show-items small {
    color: #64748b;
    font-size: .61rem;
}

.supply-item-entry input {
    width: 100%;
    margin: 0;
    text-align: right;
}

.supply-show-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: .7rem;
}

.supply-show-grid h2,
.supply-actions-panel h2,
.supply-history h2 {
    margin-top: 0;
    font-size: .98rem;
}

.supply-show-items {
    display: grid;
    gap: .35rem;
}

.supply-show-items > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    padding: .45rem .55rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.supply-show-items b {
    flex: 0 0 auto;
    font-size: .78rem;
}

.supply-note {
    margin-top: .7rem;
    padding-top: .6rem;
    border-top: 1px solid #e2e8f0;
}

.supply-note p {
    margin: .2rem 0 0;
    font-size: .76rem;
}

.supply-actions-panel,
.supply-history {
    margin-top: .7rem;
}

.supply-assign-form {
    display: grid;
    grid-template-columns: minmax(180px, 340px) auto;
    gap: .45rem;
    align-items: center;
}

.supply-assign-form select,
.supply-assign-form button,
.supply-workflow-actions button,
.supply-cancel-form input {
    margin: 0;
}

.supply-workflow-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-top: .55rem;
}

.supply-workflow-actions form {
    margin: 0;
}

.supply-cancel-form {
    display: flex;
    gap: .35rem;
}

.supply-history-row {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: .15rem .6rem;
    padding: .4rem 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: .7rem;
}

.supply-history-row:last-child {
    border-bottom: 0;
}

.supply-history-row small {
    grid-column: 2;
    color: #64748b;
}

.supply-table-note {
    display: block;
    margin-top: .08rem;
    color: #64748b;
    font-size: .62rem;
}

.supply-active-field {
    display: flex;
    align-items: end;
    padding-bottom: .4rem;
}

@media (max-width: 900px) {
    .supply-task-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .supply-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .supply-filter-submit {
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    .supply-page-heading,
    .supply-items-heading {
        display: grid;
        align-items: stretch;
    }

    .supply-heading-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .supply-heading-actions > * {
        width: 100%;
        justify-content: center;
    }

    .supply-filter-grid {
        grid-template-columns: 1fr 1fr;
        gap: .4rem;
    }

    .supply-filter-grid > div:nth-child(3),
    .supply-filter-submit {
        grid-column: 1 / -1;
    }

    .supply-my-date {
        grid-template-columns: 1fr 1fr;
        max-width: none;
    }

    .supply-my-date label {
        grid-column: 1 / -1;
    }

    .supply-task-grid,
    .supply-item-entry-grid,
    .supply-show-grid {
        grid-template-columns: 1fr;
    }

    .supply-items-heading input {
        width: 100%;
    }

    .supply-assign-form {
        grid-template-columns: 1fr;
    }

    .supply-workflow-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .supply-workflow-actions form,
    .supply-workflow-actions button,
    .supply-cancel-form,
    .supply-cancel-form input {
        width: 100%;
    }

    .supply-cancel-form {
        display: grid;
    }
}


/* V5.28 — Stocks */
.stock-page-heading,
.stock-heading-actions,
.maintenance-page-heading,
.maintenance-heading-actions,
.maintenance-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
}

.stock-heading-actions,
.maintenance-heading-actions {
    flex-wrap: wrap;
}

.stock-filters,
.stock-location-form {
    margin-bottom: .7rem;
    padding: .7rem;
}

.stock-filter-grid {
    display: grid;
    grid-template-columns: 220px minmax(180px, 1fr) auto auto;
    align-items: end;
    gap: .5rem;
}

.stock-filter-grid input,
.stock-filter-grid select,
.stock-filter-grid button {
    width: 100%;
    margin: 0;
}

.stock-low-filter {
    display: flex;
    align-items: center;
    gap: .35rem;
    min-height: 42px;
    margin: 0;
    font-size: .72rem;
}

.stock-low-filter input {
    width: auto;
}

.stock-summary-grid,
.maintenance-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .45rem;
    margin-bottom: .7rem;
}

.stock-summary-grid .card,
.maintenance-summary-grid .card {
    padding: .55rem .65rem;
}

.stock-summary-grid span,
.maintenance-summary-grid span {
    display: block;
    color: #64748b;
    font-size: .67rem;
}

.stock-summary-grid strong,
.maintenance-summary-grid strong {
    display: block;
    margin-top: .08rem;
    font-size: 1.05rem;
}

.stock-table td strong,
.stock-table td small {
    display: block;
}

.stock-table td small {
    color: #64748b;
    font-size: .62rem;
}

.stock-row-low {
    background: #fff7ed;
}

.stock-alert-chip,
.stock-ok-chip {
    display: inline-flex;
    padding: .15rem .36rem;
    border-radius: 999px;
    font-size: .61rem;
    font-weight: 800;
}

.stock-alert-chip {
    background: #fee2e2;
    color: #991b1b;
}

.stock-ok-chip {
    background: #dcfce7;
    color: #166534;
}

.stock-row-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .3rem;
}

.stock-row-actions form {
    display: flex;
    align-items: center;
    gap: .25rem;
    margin: 0;
}

.stock-row-actions a,
.stock-row-actions button {
    width: auto;
    margin: 0;
    white-space: nowrap;
}

.stock-threshold-input {
    width: 82px !important;
    margin: 0 !important;
}

.stock-movement-form {
    max-width: 780px;
}

.stock-form-note {
    margin-top: .7rem;
}

.stock-delta-positive {
    color: #166534;
    font-weight: 800;
}

.stock-delta-negative {
    color: #991b1b;
    font-weight: 800;
}

.stock-movement-filters {
    grid-template-columns: repeat(2, minmax(180px, 1fr)) auto;
}

.stock-location-form {
    max-width: 760px;
}

/* V5.28 — Maintenance */
.maintenance-filters {
    margin-bottom: .7rem;
    padding: .7rem;
}

.maintenance-filter-grid {
    display: grid;
    grid-template-columns: 160px 160px minmax(180px, 1fr) auto auto;
    align-items: end;
    gap: .45rem;
}

.maintenance-filter-grid input,
.maintenance-filter-grid select,
.maintenance-filter-grid button {
    width: 100%;
    margin: 0;
}

.maintenance-blocking-filter {
    display: flex;
    align-items: center;
    gap: .3rem;
    min-height: 42px;
    margin: 0;
    font-size: .7rem;
}

.maintenance-blocking-filter input {
    width: auto;
}

.maintenance-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .55rem;
}

.maintenance-card {
    display: grid;
    gap: .22rem;
    padding: .7rem;
    border-left: 5px solid #94a3b8;
    color: inherit;
    text-decoration: none;
}

.maintenance-severity-urgent { border-left-color: #dc2626; }
.maintenance-severity-high { border-left-color: #f59e0b; }
.maintenance-severity-normal { border-left-color: #2563eb; }
.maintenance-severity-low { border-left-color: #94a3b8; }

.maintenance-card-title {
    font-size: .78rem;
    font-weight: 750;
}

.maintenance-card small {
    color: #64748b;
    font-size: .64rem;
}

.maintenance-status {
    display: inline-flex;
    padding: .17rem .4rem;
    border-radius: 999px;
    font-size: .61rem;
    font-weight: 850;
    white-space: nowrap;
}

.maintenance-status-open { background: #fee2e2; color: #991b1b; }
.maintenance-status-in_progress { background: #dbeafe; color: #1e40af; }
.maintenance-status-resolved { background: #dcfce7; color: #166534; }
.maintenance-status-closed { background: #e2e8f0; color: #334155; }
.maintenance-status-cancelled { background: #f1f5f9; color: #64748b; }

.maintenance-empty {
    text-align: center;
    color: #64748b;
}

.maintenance-form {
    max-width: 860px;
}

.maintenance-blocking-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .7rem;
    margin-top: .65rem;
    padding: .6rem .7rem;
    border: 1px solid #fecaca;
    border-radius: 9px;
    background: #fef2f2;
}

.maintenance-blocking-switch span {
    display: grid;
    gap: .05rem;
}

.maintenance-blocking-switch strong {
    font-size: .78rem;
}

.maintenance-blocking-switch small {
    color: #64748b;
    font-size: .64rem;
}

.maintenance-blocking-switch input {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin: 0;
}

.maintenance-blocking-banner {
    margin-bottom: .7rem;
    padding: .65rem .75rem;
    border: 1px solid #fca5a5;
    border-radius: 9px;
    background: #fef2f2;
    color: #991b1b;
    font-size: .76rem;
}

.maintenance-show-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: .7rem;
}

.maintenance-show-grid h2,
.maintenance-actions-panel h2,
.maintenance-history h2 {
    margin-top: 0;
    font-size: .98rem;
}

.maintenance-description {
    margin: 0;
    font-size: .77rem;
    line-height: 1.45;
}

.maintenance-actions-panel,
.maintenance-history {
    margin-top: .7rem;
}

.maintenance-assign-form {
    display: grid;
    grid-template-columns: minmax(180px, 340px) auto;
    gap: .4rem;
}

.maintenance-assign-form select,
.maintenance-assign-form button {
    margin: 0;
}

.maintenance-workflow-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .4rem;
    margin-top: .55rem;
}

.maintenance-workflow-actions form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .3rem;
    margin: 0;
}

.maintenance-workflow-actions input,
.maintenance-workflow-actions button {
    width: 100%;
    margin: 0;
}

.maintenance-history-row {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: .12rem .55rem;
    padding: .4rem 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: .7rem;
}

.maintenance-history-row small {
    grid-column: 2;
    color: #64748b;
}

@media (max-width: 900px) {
    .stock-filter-grid,
    .maintenance-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stock-filter-grid > button,
    .maintenance-filter-grid > button {
        grid-column: 1 / -1;
    }

    .maintenance-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .stock-page-heading,
    .maintenance-page-heading {
        display: grid;
        align-items: stretch;
    }

    .stock-heading-actions,
    .maintenance-heading-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stock-heading-actions > *,
    .maintenance-heading-actions > * {
        width: 100%;
        justify-content: center;
    }

    .stock-filter-grid,
    .maintenance-filter-grid {
        grid-template-columns: 1fr 1fr;
        gap: .35rem;
    }

    .stock-filter-grid > div:nth-child(2),
    .maintenance-filter-grid > div:nth-child(3),
    .maintenance-filter-grid > button {
        grid-column: 1 / -1;
    }

    .stock-summary-grid,
    .maintenance-summary-grid {
        gap: .35rem;
    }

    .stock-summary-grid .card,
    .maintenance-summary-grid .card {
        padding: .45rem .5rem;
    }

    .stock-row-actions {
        min-width: 210px;
    }

    .stock-movement-filters {
        grid-template-columns: 1fr;
    }

    .stock-movement-filters > button {
        grid-column: auto;
    }

    .maintenance-grid,
    .maintenance-show-grid {
        grid-template-columns: 1fr;
    }

    .maintenance-assign-form,
    .maintenance-workflow-actions,
    .maintenance-workflow-actions form {
        grid-template-columns: 1fr;
    }
}

/* V5.29 — Imports CSV linge & consommables */
.supply-import-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem;
    margin-bottom: .7rem;
}

.supply-import-card {
    padding: .8rem;
}

.supply-import-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .6rem;
    margin-bottom: .6rem;
}

.supply-import-card-heading h2,
.supply-import-rules h2 {
    margin: 0 0 .12rem;
    font-size: .98rem;
}

.supply-import-card-heading p {
    margin: 0;
    color: #64748b;
    font-size: .7rem;
}

.supply-import-example {
    margin-bottom: .55rem;
    overflow-x: auto;
}

.supply-import-card form {
    margin-top: .65rem;
}

.supply-import-card input[type="file"] {
    width: 100%;
}

.supply-import-rules {
    margin-bottom: .7rem;
    padding: .8rem;
}

.supply-import-rules-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .45rem;
}

.supply-import-rules-grid > div {
    padding: .55rem .6rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.supply-import-rules-grid strong {
    display: block;
    font-size: .74rem;
}

.supply-import-rules-grid p {
    margin: .12rem 0 0;
    color: #64748b;
    font-size: .66rem;
    line-height: 1.35;
}

.supply-import-items-preview {
    display: flex;
    flex-wrap: wrap;
    gap: .2rem;
    min-width: 180px;
}

.supply-import-items-preview span {
    display: inline-flex;
    padding: .12rem .3rem;
    border-radius: 999px;
    background: #e2e8f0;
    font-size: .6rem;
    white-space: nowrap;
}

.supply-import-note-row td {
    padding-top: .15rem;
    color: #64748b;
}

@media (max-width: 760px) {
    .supply-import-grid,
    .supply-import-rules-grid {
        grid-template-columns: 1fr;
    }

    .supply-import-card-heading {
        display: grid;
    }

    .supply-import-card-heading > a {
        width: 100%;
        justify-content: center;
    }
}

/* V5.30 — Gestion des rôles métiers */
.role-page-heading,
.user-page-heading-v530,
.role-permission-heading,
.user-heading-actions-v530,
.role-template-buttons,
.role-permission-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .55rem;
}

.user-heading-actions-v530,
.role-template-buttons,
.role-permission-tools {
    flex-wrap: wrap;
}

.role-template-shortcuts {
    display: grid;
    gap: .55rem;
    margin-bottom: .7rem;
    padding: .7rem;
}

.role-template-shortcuts > div:first-child {
    display: grid;
    gap: .08rem;
}

.role-template-shortcuts small,
.role-system-label {
    color: #64748b;
    font-size: .64rem;
}

.role-template-buttons {
    justify-content: flex-start;
}

.role-template-buttons .button {
    width: auto;
    margin: 0;
}

.role-form-card {
    max-width: 1050px;
}

.role-permission-editor {
    margin-top: 1rem;
    padding-top: .75rem;
    border-top: 1px solid #e2e8f0;
}

.role-permission-heading {
    align-items: flex-start;
    margin-bottom: .55rem;
}

.role-permission-heading h2 {
    margin: 0 0 .08rem;
    font-size: 1rem;
}

.role-permission-heading p {
    margin: 0;
    color: #64748b;
    font-size: .7rem;
    line-height: 1.35;
}

.role-permission-tools {
    flex: 0 0 auto;
}

.role-permission-tools .button {
    width: auto;
    margin: 0;
    padding: .42rem .55rem;
    font-size: .66rem;
}

.role-permission-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .35rem;
    padding: .5rem;
}

.role-permission-row {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    gap: .45rem;
    padding: .45rem .5rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    cursor: pointer;
}

.role-permission-row.is-sensitive {
    border-color: #fdba74;
    background: #fff7ed;
}

.role-permission-row > input {
    width: 20px;
    height: 20px;
    margin: 0;
}

.role-permission-info {
    display: grid;
    gap: .06rem;
    min-width: 0;
}

.role-permission-info > span {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .3rem;
}

.role-permission-info strong {
    font-size: .72rem;
}

.role-permission-info code {
    overflow-wrap: anywhere;
    color: #64748b;
    font-size: .61rem;
}

.role-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .45rem;
    margin-bottom: .7rem;
}

.role-meta-grid .card {
    padding: .55rem .65rem;
}

.role-meta-grid span {
    display: block;
    color: #64748b;
    font-size: .66rem;
}

.role-meta-grid strong {
    display: block;
    margin-top: .08rem;
    font-size: .95rem;
}

.role-system-note,
.role-self-note {
    margin-top: .7rem;
}

@media (max-width: 760px) {
    .role-permission-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .role-page-heading,
    .user-page-heading-v530,
    .role-permission-heading {
        display: grid;
        align-items: stretch;
    }

    .user-heading-actions-v530,
    .role-template-buttons,
    .role-permission-tools {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .user-heading-actions-v530 > *,
    .role-template-buttons > *,
    .role-permission-tools > * {
        width: 100%;
        justify-content: center;
    }

    .role-meta-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .35rem;
    }

    .role-meta-grid .card {
        padding: .45rem .5rem;
    }

    .role-meta-grid strong {
        font-size: .82rem;
    }
}
\n\n/* V5.31 — Politique de mot de passe */\n.security-settings-card {\n    max-width: 700px;\n}\n\n.security-settings-card input[type="number"] {\n    max-width: 180px;\n}\n\n.security-role-shortcut-v531 {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: .7rem;\n    margin-bottom: .7rem;\n    padding: .7rem .8rem;\n}\n\n.security-role-shortcut-v531 > div {\n    display: grid;\n    gap: .08rem;\n}\n\n.security-role-shortcut-v531 small {\n    color: #64748b;\n    font-size: .68rem;\n}\n\n@media (max-width: 640px) {\n    .security-role-shortcut-v531 {\n        display: grid;\n    }\n\n    .security-role-shortcut-v531 .button {\n        width: 100%;\n        justify-content: center;\n    }\n}\n

/* V5.32 — mise à jour identité visuelle */
:root {
    --gm-brand-primary: #25a9c6;
    --gm-brand-primary-dark: #0f6f86;
    --gm-brand-accent: #f1c84b;
    --gm-brand-bg: #f7fafb;
}

body {
    background: var(--gm-brand-bg);
}

.app-header {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
    border-bottom: 1px solid #d7e5ea;
    box-shadow: 0 1px 0 rgba(15, 111, 134, .04);
}

.brand-logo,
.guest-brand-logo {
    border-radius: 50%;
    border: 2px solid rgba(37, 169, 198, .25);
    box-shadow: 0 6px 18px rgba(37, 169, 198, .16);
    background: #fff;
}

.brand-title,
.guest-brand-title {
    color: #0f3140;
    letter-spacing: .01em;
}

.brand-subtitle,
.guest-brand-subtitle {
    display: block;
    margin-top: .12rem;
    color: var(--gm-brand-primary-dark);
    font-size: .78rem;
    font-weight: 700;
}

.guest-brand-wrap {
    gap: 1rem;
}

.login-wrap {
    background: radial-gradient(circle at top, rgba(37, 169, 198, .08), transparent 40%);
}

button, .button {
    background: var(--gm-brand-primary-dark);
}

button:hover, .button:hover {
    filter: brightness(1.04);
}

.button-secondary {
    background: #eaf4f7;
    color: #0f3140;
    border: 1px solid #d4e6eb;
}

.mobile-menu-toggle-v516 {
    border-color: #cfe4ea !important;
    background: #f4fafc !important;
    color: #0f3140 !important;
}

.notification-header-button.has-unread {
    border-color: rgba(37, 169, 198, .25);
    background: #edf9fc;
}

@media (max-width: 640px) {
    .brand-subtitle,
    .guest-brand-subtitle {
        font-size: .72rem;
    }
}

/* V5.33 — Branding administrable */
:root {
    --gm-card-bg: #ffffff;
    --gm-header-bg: #ffffff;
    --gm-header-text: #0f3140;
    --gm-button-bg: #0f6f86;
    --gm-button-text: #ffffff;
}

body {
    background: var(--gm-brand-bg, #f7fafb);
}

.card {
    background: var(--gm-card-bg, #ffffff);
}

.app-header {
    background: var(--gm-header-bg, #ffffff);
    border-bottom-color: color-mix(in srgb, var(--gm-brand-primary, #25a9c6) 20%, #d7e5ea);
}

.brand-title,
.guest-brand-title {
    color: var(--gm-header-text, #0f3140);
}

.brand-subtitle,
.guest-brand-subtitle {
    color: var(--gm-brand-primary-dark, #0f6f86);
}

button,
.button {
    background: var(--gm-button-bg, #0f6f86);
    color: var(--gm-button-text, #ffffff);
}

.button-secondary {
    background: color-mix(in srgb, var(--gm-brand-primary, #25a9c6) 10%, #ffffff);
    color: var(--gm-header-text, #0f3140);
    border-color: color-mix(in srgb, var(--gm-brand-primary, #25a9c6) 22%, #d4e6eb);
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid color-mix(in srgb, var(--gm-brand-primary, #25a9c6) 35%, transparent);
    border-color: var(--gm-brand-primary, #25a9c6);
}

.notification-header-button.has-unread {
    border-color: color-mix(in srgb, var(--gm-brand-primary, #25a9c6) 30%, #d1d5db);
    background: color-mix(in srgb, var(--gm-brand-primary, #25a9c6) 10%, #ffffff);
}

.settings-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin: 0 0 1rem;
}

.settings-subnav .button {
    margin: 0;
}

.branding-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, .7fr);
    align-items: start;
    gap: 1rem;
}

.branding-form {
    min-width: 0;
}

.branding-section + .branding-section {
    margin-top: 1.4rem;
    padding-top: 1.1rem;
    border-top: 1px solid #e2e8f0;
}

.branding-section h2 {
    margin: 0 0 .35rem;
    font-size: 1.05rem;
}

.branding-upload-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .6rem;
    margin-top: .8rem;
}

.branding-upload-card {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: .65rem;
    align-items: start;
    padding: .65rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: color-mix(in srgb, var(--gm-card-bg, #fff) 88%, var(--gm-brand-bg, #f7fafb));
}

.branding-current-image {
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    overflow: hidden;
    border: 1px solid #dbe2ea;
    border-radius: 12px;
    background: #fff;
}

.branding-current-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.branding-current-favicon {
    width: 64px;
    height: 64px;
    border-radius: 14px;
}

.branding-upload-card label {
    margin-top: 0;
}

.branding-upload-card input[type="file"] {
    padding: .55rem;
    font-size: .72rem;
}

.branding-upload-card small {
    display: block;
    margin-top: .25rem;
    color: #64748b;
    font-size: .65rem;
}

.branding-reset-image {
    margin-top: .45rem !important;
    font-size: .68rem;
}

.branding-color-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .45rem;
    margin-top: .7rem;
}

.branding-color-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    margin: 0;
    padding: .55rem .65rem;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: color-mix(in srgb, var(--gm-card-bg, #fff) 90%, var(--gm-brand-bg, #f7fafb));
}

.branding-color-field > span:first-child {
    display: grid;
    gap: .08rem;
    min-width: 0;
}

.branding-color-field strong {
    font-size: .76rem;
}

.branding-color-field small {
    color: #64748b;
    font-size: .61rem;
    line-height: 1.25;
}

.branding-color-control {
    display: grid;
    justify-items: center;
    gap: .18rem;
    flex: 0 0 auto;
}

.branding-color-control input[type="color"] {
    width: 52px;
    height: 38px;
    margin: 0;
    padding: 2px;
    border-radius: 7px;
    cursor: pointer;
}

.branding-color-control code {
    font-size: .58rem;
    color: #475569;
}

.branding-form-actions {
    margin-top: 1rem;
}

.branding-preview-wrap {
    position: sticky;
    top: 96px;
    display: grid;
    gap: .7rem;
}

.branding-preview {
    padding: .7rem;
    border: 1px solid #dbe2ea;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(15, 23, 42, .08);
}

.branding-preview-title {
    margin-bottom: .45rem;
    color: #64748b;
    font-size: .66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.branding-preview-browser {
    overflow: hidden;
    border: 1px solid #dbe2ea;
    border-radius: 10px;
    background: var(--preview-bg);
}

.branding-preview-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem;
    background: var(--preview-header);
    color: var(--preview-header-text);
    border-bottom: 3px solid var(--preview-primary);
}

.branding-preview-header img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 50%;
    background: #fff;
    border: 2px solid color-mix(in srgb, var(--preview-primary) 35%, #ffffff);
}

.branding-preview-header > div {
    display: grid;
    min-width: 0;
}

.branding-preview-header strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .8rem;
}

.branding-preview-header small {
    color: var(--preview-secondary);
    font-size: .61rem;
    font-weight: 700;
}

.branding-preview-content {
    padding: .75rem;
    background: var(--preview-bg);
}

.branding-preview-card {
    position: relative;
    overflow: hidden;
    padding: .65rem;
    border-radius: 9px;
    background: var(--preview-card);
    box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
}

.branding-preview-card > strong {
    display: block;
    font-size: .75rem;
}

.branding-preview-card p {
    margin: .25rem 0 .55rem;
    color: #64748b;
    font-size: .62rem;
    line-height: 1.3;
}

.branding-preview-card button {
    width: auto;
    margin: 0;
    padding: .45rem .6rem;
    background: var(--preview-button);
    color: var(--preview-button-text);
    font-size: .62rem;
}

.branding-preview-accent {
    position: absolute;
    top: 0;
    right: 0;
    width: 34px;
    height: 6px;
    background: var(--preview-accent);
}

.branding-reset-card {
    padding: .75rem;
}

.branding-reset-card strong {
    font-size: .8rem;
}

.branding-reset-card p {
    margin: .25rem 0 .55rem;
    color: #64748b;
    font-size: .67rem;
    line-height: 1.35;
}

.branding-reset-card button {
    width: 100%;
    margin: 0;
}

@media (max-width: 900px) {
    .branding-layout {
        grid-template-columns: 1fr;
    }

    .branding-preview-wrap {
        position: static;
        grid-row: 1;
    }
}

@media (max-width: 640px) {
    .settings-subnav {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .settings-subnav .button {
        width: 100%;
        text-align: center;
    }

    .branding-upload-grid,
    .branding-color-grid {
        grid-template-columns: 1fr;
    }

    .branding-upload-card {
        grid-template-columns: 70px minmax(0, 1fr);
    }

    .branding-current-image {
        width: 70px;
        height: 70px;
    }

    .branding-current-favicon {
        width: 58px;
        height: 58px;
    }

    .branding-color-field {
        padding: .5rem .55rem;
    }
}

/* Conserver les actions destructives indépendantes du branding. */
.button-danger,
button.button-danger {
    background: #b91c1c;
    color: #ffffff;
}

.app-header {
    color: var(--gm-header-text, #0f3140);
}


/* V5.34 — Notifications compactes : préférences repliables */
.notification-preferences-collapsible {
    padding: 0;
    overflow: hidden;
}

.notification-preferences-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .7rem;
    padding: .62rem .75rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
    background: var(--gm-card-bg, #fff);
}

.notification-preferences-summary::-webkit-details-marker {
    display: none;
}

.notification-preferences-summary::marker {
    display: none;
    content: '';
}

.notification-preferences-summary:hover {
    background: rgba(37, 169, 198, .05);
}

.notification-preferences-summary-title {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    min-width: 0;
}

.notification-preferences-summary-title strong {
    font-size: .78rem;
    color: var(--gm-header-text, #0f3140);
}

.notification-preferences-summary-state {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 29px;
    padding: .18rem .48rem;
    border: 1px solid rgba(37, 169, 198, .22);
    border-radius: 999px;
    background: rgba(37, 169, 198, .07);
    color: var(--gm-brand-primary-dark, #0f6f86);
    font-size: .64rem;
    font-weight: 800;
}

.notification-preferences-state-open {
    display: none;
}

.notification-preferences-collapsible[open] .notification-preferences-state-closed {
    display: none;
}

.notification-preferences-collapsible[open] .notification-preferences-state-open {
    display: inline;
}

.notification-preferences-body {
    padding: .72rem .8rem .8rem;
    border-top: 1px solid #e2e8f0;
}

.notification-preferences-collapsible[open] .notification-preferences-summary {
    background: rgba(37, 169, 198, .045);
}

@media (max-width: 640px) {
    .notification-preferences-summary {
        padding: .54rem .62rem;
    }

    .notification-preferences-summary-title strong {
        font-size: .74rem;
    }

    .notification-preferences-summary-state {
        min-height: 27px;
        padding: .14rem .42rem;
        font-size: .6rem;
    }

    .notification-preferences-body {
        padding: .62rem;
    }
}


/* V5.35 — création de jobs : recherche/sélection + accès import CSV */
.mobil-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .55rem;
    align-items: stretch;
}

.mobil-search-row .button {
    width: auto;
    min-width: 120px;
    margin-top: 0;
}

.mobil-search-help,
.mobil-selection-count {
    display: block;
    margin-top: .35rem;
    color: #64748b;
    font-size: .82rem;
}

.mobil-selection-header h2 {
    margin-bottom: 0;
}

.mobil-select-card.is-selected {
    border-color: var(--gm-brand-primary, #25a9c6);
    box-shadow: 0 0 0 2px rgba(37, 169, 198, .12);
    background: #f4fbfd;
}

.mobil-select-card.mobil-select-flash {
    animation: gmMobilSelectedFlash .9s ease;
}

@keyframes gmMobilSelectedFlash {
    0%, 100% { transform: scale(1); }
    45% { transform: scale(1.018); }
}

@media (max-width: 640px) {
    .mobil-search-row {
        grid-template-columns: 1fr;
    }

    .mobil-search-row .button {
        width: 100%;
    }
}

/* V5.36 — import CSV des stocks */
.stock-import-help,
.stock-import-form,
.stock-import-recent,
.stock-import-preview {
    margin-bottom: 1rem;
}

.stock-import-help h2,
.stock-import-form h2,
.stock-import-recent h2 {
    margin-top: 0;
}

.stock-import-help code {
    padding: .08rem .28rem;
    border-radius: 5px;
    background: #eef4f6;
    font-size: .9em;
}

.stock-import-row-error {
    background: #fff1f2;
}

.stock-import-errors {
    margin: 0;
    padding-left: 1.15rem;
    color: #991b1b;
}

.stock-import-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    margin-top: 1rem;
}

.stock-import-confirm-actions form {
    margin: 0;
}

.stock-import-confirm-actions button {
    width: auto;
    margin-top: 0;
}

@media (max-width: 640px) {
    .stock-import-confirm-actions {
        flex-direction: column-reverse;
    }

    .stock-import-confirm-actions form,
    .stock-import-confirm-actions button {
        width: 100%;
    }
}


/* V5.37 — Affectation rapide des jobs */
.assignment-toolbar-intro {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: .25rem;
}

.assignment-toolbar-intro strong {
    font-size: 1rem;
    color: var(--gm-header-text, #0f3140);
}

.assignment-toolbar-intro small {
    color: #64748b;
    line-height: 1.35;
}

#selectedJobsCount {
    display: inline-block;
    margin-left: .35rem;
    font-weight: 800;
    color: var(--gm-brand-primary-dark, #0f6f86);
}

.job-inline-assignment {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid #cfe4ea;
    border-radius: 10px;
    background: #f7fbfc;
    scroll-margin-top: 90px;
}

.job-inline-assignment-head {
    margin-bottom: .75rem;
}

.job-inline-assignment-head strong,
.job-inline-assignment-head small {
    display: block;
}

.job-inline-assignment-head small {
    margin-top: .2rem;
    color: #64748b;
}

.job-inline-assignment-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: .75rem;
    align-items: end;
}

.job-inline-assignment-form label {
    margin-top: 0;
}

.job-inline-assignment-form button {
    width: auto;
    margin-top: 0;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .job-inline-assignment-form {
        grid-template-columns: 1fr;
    }

    .job-inline-assignment-form button {
        width: 100%;
    }
}

/* V5.38 — Autocomplétion des mobil-homes à la création des jobs */
.mobil-autocomplete-wrap {
    position: relative;
}

.mobil-autocomplete-results {
    position: absolute;
    z-index: 80;
    top: calc(100% - 1.25rem);
    left: 0;
    right: 0;
    max-height: 340px;
    overflow-y: auto;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: var(--gm-card-bg, #fff);
    box-shadow: 0 14px 30px rgba(15, 23, 42, .16);
}

.mobil-autocomplete-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    margin: 0;
    padding: .7rem .8rem;
    border: 0;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 0;
    background: #fff;
    color: #1f2937;
    text-align: left;
}

.mobil-autocomplete-option:last-of-type {
    border-bottom: 0;
}

.mobil-autocomplete-option:not(:disabled):hover,
.mobil-autocomplete-option.is-active {
    background: #eef8fb;
    color: #0f3140;
}

.mobil-autocomplete-option.is-selected {
    background: #f0fdf4;
}

.mobil-autocomplete-option.is-disabled {
    background: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
}

.mobil-autocomplete-main {
    min-width: 0;
}

.mobil-autocomplete-main strong,
.mobil-autocomplete-main small {
    display: block;
}

.mobil-autocomplete-main small {
    margin-top: .15rem;
    color: #64748b;
    font-size: .78rem;
}

.mobil-autocomplete-status {
    flex: 0 0 auto;
    font-size: .78rem;
    font-weight: 800;
    color: var(--gm-brand-primary-dark, #0f6f86);
}

.mobil-autocomplete-option.is-disabled .mobil-autocomplete-status {
    color: #94a3b8;
}

.mobil-autocomplete-empty,
.mobil-autocomplete-more {
    padding: .75rem .8rem;
    color: #64748b;
    font-size: .82rem;
}

.mobil-autocomplete-more {
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
}

.mobil-selected-list {
    display: grid;
    gap: .55rem;
    margin-bottom: 1rem;
}

.mobil-selected-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .65rem .75rem;
    border: 1px solid #cfe4ea;
    border-radius: 9px;
    background: #f7fbfc;
}

.mobil-selected-item strong,
.mobil-selected-item small {
    display: block;
}

.mobil-selected-item small {
    margin-top: .12rem;
    color: #64748b;
}

.mobil-selected-remove {
    width: auto;
    margin: 0;
    padding: .45rem .65rem;
    background: #eaf4f7;
    color: #0f3140;
    border: 1px solid #cfe4ea;
}

.mobil-selected-empty {
    margin: 0;
    padding: .8rem;
    border: 1px dashed #cbd5e1;
    border-radius: 9px;
    color: #64748b;
    background: #f8fafc;
}

.mobil-advanced-selection {
    margin-top: .75rem;
    margin-bottom: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}

.mobil-advanced-selection > summary {
    padding: .8rem .9rem;
    cursor: pointer;
    font-weight: 800;
    color: var(--gm-header-text, #0f3140);
}

.mobil-advanced-selection[open] > summary {
    border-bottom: 1px solid #e2e8f0;
}

.mobil-advanced-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem .9rem 0;
}

.mobil-advanced-toolbar p {
    margin: 0;
    color: #64748b;
    font-size: .85rem;
}

.mobil-advanced-selection .mobil-selection-grid {
    padding: .9rem;
}

@media (max-width: 640px) {
    .mobil-autocomplete-results {
        max-height: 290px;
    }

    .mobil-selected-item {
        align-items: stretch;
        flex-direction: column;
    }

    .mobil-selected-remove {
        width: 100%;
    }

    .mobil-advanced-toolbar {
        align-items: stretch;
        flex-direction: column;
    }
}


/* V5.38.2 — barre d’actions Stocks responsive sans overflow */
.stock-page-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: .65rem;
}

.stock-heading-actions {
    display: grid;
    grid-template-columns: repeat(4, max-content);
    justify-content: start;
    align-items: center;
    gap: .5rem;
    flex-wrap: initial;
    max-width: 100%;
    overflow: visible;
}

.stock-heading-actions .button {
    width: auto;
    min-width: 0;
    margin-top: 0;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .stock-heading-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .stock-heading-actions .button {
        width: 100%;
        text-align: center;
        white-space: normal;
    }
}


/* V5.39 — PWA installable */
.pwa-install-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-height: 38px;
    margin: 0;
    padding: .55rem .75rem;
    border: 1px solid var(--gm-brand-primary, #25a9c6);
    border-radius: 9px;
    background: var(--gm-header-bg, #ffffff);
    color: var(--gm-header-text, #0f3140);
    font-size: .8rem;
    font-weight: 800;
    white-space: nowrap;
}

.pwa-install-button[hidden] {
    display: none !important;
}

.pwa-guest-install {
    display: flex;
    justify-content: center;
    padding: .65rem 1rem 0;
}

.pwa-standalone .pwa-install-button {
    display: none !important;
}

@media (max-width: 640px) {
    .app-header-actions-v525 .pwa-install-button {
        min-height: 36px;
        padding: .45rem .55rem;
        font-size: .72rem;
    }
}
