:root {
    --primary-color: #b91c1c;
    --secondary-color: #111827;
    --accent-color: #2563eb;
    --background-color: #f5f6f8;
    --surface-color: #ffffff;
    --text-color: #1f2933;
    --muted-text-color: #6b7280;
    --border-color: #d8dde4;
    --success-color: #16803c;
    --warning-color: #9a6700;
    --danger-color: #b42318;
    --font-family: Arial, Helvetica, sans-serif;
    --base-font-size: 16px;
    --heading-font-weight: 700;
    --border-radius: 8px;
    --card-radius: 8px;
    --button-radius: 6px;
    --input-radius: 6px;
    --sidebar-width: 260px;
    --topbar-height: 72px;
    --content-max-width: none;
    --page-padding: 30px;
    --card-shadow: 0 12px 30px rgba(31, 41, 51, 0.08);
    --bg: var(--background-color);
    --panel: var(--surface-color);
    --text: var(--text-color);
    --muted: var(--muted-text-color);
    --line: var(--border-color);
    --brand: var(--primary-color);
    --brand-dark: var(--primary-color);
    --accent: var(--accent-color);
    --success: var(--success-color);
    --warning: var(--warning-color);
    --danger: var(--danger-color);
    --shadow: var(--card-shadow);
}

/* Pré-production : formulaires métier plus compacts sans refonte globale. */
.panel .form-grid.compact {
    gap: 10px;
    align-items: end;
}

.panel .form-grid.compact label {
    gap: 4px;
}

.panel .form-grid.compact input,
.panel .form-grid.compact select,
.panel .form-grid.compact textarea,
.filters-row input,
.filters-row select {
    min-height: 38px;
    padding: 8px 10px;
}

.panel .form-grid.compact textarea {
    min-height: 78px;
}

.panel .form-grid.compact small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.25;
}

.dossier-upload-form {
    align-items: center;
    padding-top: 10px;
}

.dossier-upload-form label {
    gap: 4px;
}

.timeline-item p {
    margin: 8px 0 0;
}

.collapsible-panel {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.collapsible-panel > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 11px 14px;
    color: var(--text);
    font-weight: 800;
    list-style: none;
    cursor: pointer;
}

.collapsible-panel > summary::-webkit-details-marker {
    display: none;
}

.collapsible-panel > summary::after {
    content: "+";
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #eef4ff;
    color: var(--accent);
    font-size: 17px;
    line-height: 1;
}

.collapsible-panel > summary:focus-visible {
    border-radius: 4px;
    outline: 3px solid rgba(37, 99, 235, .34);
    outline-offset: 2px;
}

.collapsible-panel[open] > summary {
    border-bottom: 1px solid var(--line);
}

.collapsible-panel[open] > summary::after {
    content: "-";
}

.collapsible-panel > form,
.collapsible-panel > .address-edit-grid,
.collapsible-panel > .filters-row,
.collapsible-panel > .form-grid {
    padding: 14px;
}

.report-room-sections {
    display: grid;
    gap: 10px;
}

.report-room-section > summary {
    gap: 12px;
}

.report-room-status {
    margin-left: auto;
    color: #52617a;
    font-size: 13px;
    font-weight: 700;
}

.report-room-section > summary::after {
    margin-left: 0;
}

.report-room-content {
    max-width: 96ch;
    padding: 16px 14px;
    color: #23344f;
    overflow-wrap: anywhere;
}

.report-room-content > :first-child {
    margin-top: 0;
}

.report-room-content > :last-child {
    margin-bottom: 0;
}

.report-room-editor-content {
    padding: 0 14px 14px;
}

.report-room-editor-content textarea {
    min-height: 132px;
}

.compact-collapsible {
    margin-top: 10px;
}

.compact-collapsible > summary {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 13px;
}

.archive-search {
    display: grid;
    gap: 10px;
}

.archive-search-main {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(180px, 1.4fr) auto auto;
    gap: 10px;
    align-items: end;
}

.reference-search-field {
    display: flex;
    align-items: stretch;
    min-width: 0;
    color: var(--text);
    font-weight: 700;
}

.reference-search-field > span {
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-right: 0;
    border-radius: var(--input-radius) 0 0 var(--input-radius);
    background: #f1f5f9;
    color: var(--muted);
    white-space: nowrap;
}

.reference-search-field input {
    min-width: 0;
    border-radius: 0 var(--input-radius) var(--input-radius) 0;
}

.reference-search-field:focus-within > span {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.reference-search-field:focus-within input {
    box-shadow: none;
}

.row-actions-detail,
.nested-actions-detail {
    position: relative;
}

.row-actions-detail > summary,
.nested-actions-detail > summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--button-radius);
    background: #fff;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    list-style: none;
    cursor: pointer;
}

.row-actions-detail > summary::-webkit-details-marker,
.nested-actions-detail > summary::-webkit-details-marker {
    display: none;
}

.row-actions-detail[open] > summary,
.nested-actions-detail[open] > summary {
    border-color: #bfd5ff;
    background: #f5f8ff;
    color: var(--accent);
}

.row-actions-detail > form,
.row-actions-detail > .mini-actions,
.row-actions-detail > .settings-checks,
.row-actions-detail > a,
.nested-actions-detail > form {
    margin-top: 8px;
}

.row-actions-detail .mini-actions,
.row-actions-detail .settings-checks {
    min-width: min(440px, 72vw);
}

.row-actions-detail .settings-checks {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.personalization-advanced {
    padding: 0;
}

.personalization-advanced > form {
    display: grid;
    gap: 12px;
}

.personalization-advanced .widget-header {
    margin-bottom: 0;
}

@media (max-width: 980px) {
    .panel .form-grid.compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .archive-search-main {
        grid-template-columns: 1fr 1fr;
    }
}

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

    .row-actions-detail .mini-actions,
    .row-actions-detail .settings-checks {
        min-width: 100%;
    }

    .agent-profile-summary,
    .account-review-summary {
        grid-template-columns: 1fr;
    }

    .account-review-summary dl {
        grid-template-columns: 1fr;
    }

    .account-status-actions,
    .account-status-actions .button,
    .agent-permissions-form .form-actions,
    .agent-permissions-form .form-actions .button {
        width: 100%;
    }
}

/* Parcours de prise en main guidee */
body.onboarding-open {
    overflow: hidden;
}

.onboarding-tour {
    --onboarding-accent: #16a34a;
    --onboarding-accent-bright: #22c55e;
    --onboarding-accent-dark: #166534;
    --onboarding-accent-soft: #f0fdf4;
    position: fixed;
    z-index: 2000;
    inset: 0;
    pointer-events: none;
}

.onboarding-tour[hidden],
.onboarding-tour [hidden] {
    display: none !important;
}

.onboarding-shade,
.onboarding-highlight,
.onboarding-popover {
    position: fixed;
}

.onboarding-shade {
    z-index: 2000;
    background: rgba(2, 12, 27, .68);
    pointer-events: auto;
}

.onboarding-highlight {
    z-index: 2001;
    border: 3px solid var(--onboarding-accent-bright);
    border-radius: 10px;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .34), 0 10px 32px rgba(2, 12, 27, .22);
    pointer-events: none;
}

.onboarding-popover {
    z-index: 2002;
    width: min(420px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow: auto;
    padding: 22px;
    border: 1px solid #d9e1ec;
    border-radius: 14px;
    background: #fff;
    color: #152238;
    box-shadow: 0 24px 70px rgba(2, 12, 27, .28);
    pointer-events: auto;
}

.onboarding-popover.is-centered {
    transform: translate(-50%, -50%);
}

.onboarding-popover:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 3px;
}

.onboarding-popover-top,
.onboarding-actions {
    display: flex;
    align-items: center;
}

.onboarding-popover-top {
    justify-content: space-between;
    gap: 16px;
}

.onboarding-counter {
    color: #526079;
    font-size: 13px;
    font-weight: 800;
}

.onboarding-close {
    display: inline-flex;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid #d9e1ec;
    border-radius: 50%;
    background: #fff;
    color: #152238;
    font: inherit;
    font-size: 25px;
    cursor: pointer;
}

.onboarding-close:hover {
    background: #f3f6fa;
}

.onboarding-close:focus-visible,
.onboarding-actions .button:focus-visible,
.onboarding-checklist-item .button:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
}

.onboarding-progress {
    height: 6px;
    margin: 14px 0 20px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8edf4;
}

.onboarding-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--onboarding-accent);
    transition: width .2s ease;
}

.onboarding-popover .eyebrow {
    margin: 0 0 8px;
    color: var(--onboarding-accent-dark);
}

.onboarding-popover h2 {
    margin: 0 0 10px;
    color: #061b3a;
    font-size: 24px;
    line-height: 1.2;
}

.onboarding-popover #onboarding-step-body {
    margin: 0;
    color: #3e4b61;
    line-height: 1.6;
}

.onboarding-action-hint {
    margin: 16px 0 0;
    padding: 11px 13px;
    border-left: 4px solid var(--onboarding-accent);
    border-radius: 6px;
    background: var(--onboarding-accent-soft);
    color: #14532d;
    font-weight: 700;
}

.onboarding-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 22px;
}

.onboarding-actions .button {
    min-height: 44px;
}

.onboarding-catalog {
    margin-top: 20px;
    padding: 22px;
}

.onboarding-catalog .eyebrow {
    margin: 0 0 5px;
}

.onboarding-checklist {
    display: grid;
    gap: 12px;
}

.onboarding-checklist-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 16px;
    border: 1px solid #dfe6ef;
    border-radius: 10px;
    background: #fff;
}

.onboarding-check {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border: 2px solid #a8b4c5;
    border-radius: 50%;
    color: #fff;
    font-weight: 900;
}

.onboarding-checklist-item.is-complete .onboarding-check {
    border-color: #147a48;
    background: #147a48;
}

.onboarding-checklist-item h3,
.onboarding-checklist-item p {
    margin: 0;
}

.onboarding-checklist-item p {
    margin-top: 4px;
    color: #536078;
}

.onboarding-checklist-item small {
    display: block;
    margin-top: 7px;
    color: #68758b;
    font-weight: 700;
}

.onboarding-admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, .8fr);
    gap: 20px;
}

.onboarding-step-list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.onboarding-step-row {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding: 13px;
    border: 1px solid #dfe6ef;
    border-radius: 8px;
}

.onboarding-step-row strong,
.onboarding-step-row small {
    display: block;
}

@media (max-width: 820px) {
    .onboarding-admin-grid {
        grid-template-columns: 1fr;
    }

    .onboarding-checklist-item {
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .onboarding-checklist-item .button {
        grid-column: 1 / -1;
        width: 100%;
    }
}

@media (max-width: 560px) {
    .onboarding-popover {
        top: auto !important;
        right: 10px;
        bottom: 10px;
        left: 10px !important;
        width: auto;
        max-height: min(68vh, 560px);
        transform: none !important;
        padding: 18px;
        border-radius: 14px;
    }

    .onboarding-actions .button {
        flex: 1 1 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .onboarding-progress span {
        transition: none;
    }
}

@media (forced-colors: active) {
    .onboarding-highlight,
    .onboarding-popover,
    .onboarding-close,
    .onboarding-check {
        border-color: CanvasText;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-family);
    font-size: var(--base-font-size);
    line-height: 1.5;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    background: var(--secondary-color);
    color: #fff;
    padding: 24px 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-weight: 700;
    margin-bottom: 34px;
}

.brand-text {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand:hover {
    text-decoration: none;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 8px;
    background: var(--brand);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
}

.brand-logo,
.login-logo {
    display: block;
    width: var(--logo-width-desktop, 46px);
    max-height: var(--logo-max-height, 64px);
    height: auto;
    object-fit: contain;
    margin: var(--logo-margin, 0);
}

.brand-logo {
    border-radius: 8px;
    background: #fff;
    padding: 4px;
}

.login-logo {
    padding: 0;
    border-radius: 0;
    background: transparent;
}

.range-field {
    align-content: start;
}

.range-field > span {
    color: var(--text);
    font-weight: 800;
}

.range-field input[type="range"] {
    min-height: 28px;
    padding: 0;
    accent-color: var(--primary-color);
}

.nav {
    display: grid;
    gap: 6px;
}

.nav a {
    color: #cbd5e1;
    padding: 11px 12px;
    border-radius: 6px;
}

.nav a.active,
.nav a:hover {
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    text-decoration: none;
}

.main {
    padding: var(--page-padding);
    min-width: 0;
    max-width: var(--content-max-width);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.topbar h1,
.login-panel h1 {
    margin: 0;
    font-size: 28px;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--card-radius);
    padding: 9px 12px;
}

.user-pill a {
    color: var(--primary-color);
    font-weight: 700;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stat-card,
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
}

.stat-card {
    padding: 18px;
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 14px;
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 32px;
}

.panel {
    padding: 20px;
    margin-bottom: 18px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.quick-admin {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.quick-admin h2,
.quick-admin p {
    margin: 0;
}

.quick-admin p:last-child {
    color: var(--muted);
    margin-top: 4px;
}

.panel-header h2,
.row-title h3 {
    margin: 0;
    font-size: 18px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

th,
td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
    line-height: 1.25;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

small,
.help-text,
.empty {
    color: var(--muted);
}

.empty {
    text-align: center;
    padding: 24px;
}

.actions {
    text-align: right;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 700;
}

.badge.muted {
    background: #eef0f3;
    color: #4b5563;
}

.badge.warning {
    background: #fff4cf;
    color: var(--warning);
}

.badge.success {
    background: #dcfce7;
    color: var(--success);
}

.badge.danger {
    background: #fee2e2;
    color: var(--danger);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 1px solid transparent;
    border-radius: var(--button-radius);
    padding: 9px 14px;
    font-weight: 700;
    cursor: pointer;
}

.button:hover {
    text-decoration: none;
}

.button.primary {
    background: var(--primary-color);
    color: #fff;
}

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

.button.secondary {
    background: #fff;
    border-color: var(--line);
    color: var(--text);
}

.button.danger {
    background: var(--danger);
    color: #fff;
}

.form,
.form-grid,
.inline-form {
    display: grid;
    gap: 14px;
}

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

.form-grid.compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.span-2 {
    grid-column: span 2;
}

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--input-radius);
    padding: 10px 11px;
    color: var(--text);
    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
    outline: none;
}

input[type="color"] {
    min-height: 46px;
    padding: 4px;
}

textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.inline-form {
    grid-template-columns: minmax(180px, 1fr) minmax(220px, 2fr) auto;
    align-items: end;
}

.alert {
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid transparent;
}

.alert-success {
    background: #ecfdf3;
    border-color: #b7efc5;
    color: var(--success);
}

.alert-danger {
    background: #fff1f0;
    border-color: #ffd0cc;
    color: var(--danger);
}

.alert-warning {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
    background: var(--login-background-color, var(--secondary-color));
}

.login-layout-left {
    place-items: center start;
}

.login-layout-right {
    place-items: center end;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(320px, var(--login-form-width, 460px)) minmax(260px, 380px);
    width: min(900px, 100%);
    min-height: 560px;
    background: var(--panel);
    border-radius: var(--login-card-radius);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
    overflow: hidden;
}

.login-shell.single {
    grid-template-columns: minmax(320px, 520px);
    width: min(var(--login-form-width, 560px), 100%);
}

.login-panel {
    padding: 42px;
    display: grid;
    align-content: center;
    gap: 18px;
    opacity: var(--login-panel-opacity, 1);
}

.login-aside {
    display: grid;
    align-content: end;
    gap: 10px;
    padding: 42px;
    background: #f8fafc;
    border-left: 1px solid var(--line);
}

.login-aside strong {
    color: var(--primary-color);
    font-size: 26px;
    line-height: 1.15;
}

.login-aside p,
.login-aside span {
    margin: 0;
    color: var(--muted);
}

.login-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    padding-top: 4px;
    color: var(--muted);
    font-size: 14px;
}

.help-link {
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 700;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.login-brand .brand-mark,
.login-logo {
    width: var(--logo-width-desktop, 58px);
}

.validation-list {
    display: grid;
    gap: 14px;
}

.validation-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}

.row-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.description {
    color: #374151;
}

.admin-comment {
    color: var(--danger);
    font-weight: 700;
}

.validation-actions {
    display: grid;
    gap: 10px;
}

.validation-actions div {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.app-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    justify-content: space-between;
    padding: 16px 4px 0;
    color: var(--muted);
    font-size: 13px;
}

.appearance-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: start;
}

.appearance-form {
    margin-bottom: 0;
}

.section-title {
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

.section-title:first-child {
    padding-top: 0;
    border-top: 0;
}

.section-title h2 {
    margin: 0;
    color: var(--text);
    font-size: 17px;
}

.logo-upload small {
    font-weight: 400;
}

.logo-preview {
    display: grid;
    place-items: center;
    width: 150px;
    height: 92px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.logo-preview img,
.preview-brand img {
    display: block;
    max-width: 120px;
    max-height: 64px;
    object-fit: contain;
}

.appearance-preview {
    position: sticky;
    top: 22px;
}

.preview-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.preview-brand {
    display: flex;
    gap: 12px;
    align-items: center;
}

.preview-brand div {
    display: grid;
}

.preview-brand span,
.preview-card p {
    color: var(--muted);
    font-size: 13px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.info-grid div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #f8fafc;
}

.info-grid span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.info-grid strong {
    display: block;
    margin-top: 6px;
}

.mini-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    gap: 8px;
    min-width: 440px;
}

.mini-actions .button,
.mini-actions input,
.mini-actions select {
    min-height: 36px;
    font-size: 13px;
}

.nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.nav-badge {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: var(--accent-color);
    color: #fff;
    font-size: 12px;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.tabs a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: var(--button-radius);
    background: var(--panel);
    color: var(--text);
    padding: 8px 11px;
    font-weight: 700;
}

.tabs a.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.tabs span {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
    font-size: 12px;
}

.maintenance-banner {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    padding: 10px 14px;
    margin-bottom: 16px;
    border-radius: var(--card-radius);
}

.table-density-compact td,
.table-density-compact th {
    padding: 8px 9px;
}

.table-density-comfortable td,
.table-density-comfortable th {
    padding: 17px 12px;
}

.personalization-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.personalization-card {
    display: grid;
    gap: 10px;
    min-height: 150px;
}

.personalization-card h2,
.personalization-card p {
    margin: 0;
}

.personalization-card p {
    color: var(--muted);
}

@media (max-width: 820px) {
    .brand-logo,
    .login-logo {
        width: var(--logo-width-tablet, 44px);
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        padding: 16px;
    }

    .brand {
        margin-bottom: 14px;
    }

    .nav {
        grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    }

    .main {
        padding: 18px;
    }

    .topbar,
    .panel-header,
    .user-pill,
    .quick-admin {
        align-items: flex-start;
        flex-direction: column;
    }

    .form-grid,
    .form-grid.compact,
    .inline-form,
    .validation-item,
    .appearance-grid,
    .login-shell,
    .mini-actions {
        grid-template-columns: 1fr;
    }

    .login-shell {
        min-height: auto;
    }

    .login-panel,
    .login-aside {
        padding: 28px;
    }

    .login-aside {
        border-left: 0;
        border-top: 1px solid var(--line);
    }

    .appearance-preview {
        position: static;
    }

    .span-2 {
        grid-column: span 1;
    }

    .form-actions,
    .validation-actions div {
        justify-content: stretch;
        flex-direction: column;
    }
}

@media (max-width: 520px) {
    .brand-logo,
    .login-logo {
        width: var(--logo-width-mobile, 42px);
    }
}

/* Direct Habitat 66 visual system */
body {
    background: #f6f8fc;
    color: #061b3a;
}

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width, 280px) minmax(0, 1fr);
    min-height: 100vh;
}

/* The mobile backdrop must never participate in the desktop app grid. */
.sidebar-backdrop,
.sidebar-close {
    display: none;
}

.app-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: hidden;
    padding: 30px 22px;
    background: linear-gradient(150deg, rgba(9, 46, 105, .96), rgba(2, 18, 46, 1)), #061b3a;
    color: #fff;
}

.sidebar-brand {
    display: flex !important;
    flex-direction: column !important;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 0;
    margin: 0 0 28px;
    gap: 8px;
    text-align: center;
}

.brand-logo-image {
    display: block;
    width: var(--logo-width-desktop, 208px);
    max-width: 100%;
    max-height: none;
    object-fit: contain;
}

.sidebar-logo-block {
    display: block;
    width: 100%;
}

.sidebar-logo-block .brand-logo-image,
.sidebar-logo-block .dh-brand {
    margin: 0 auto;
}

.sidebar-logo-block .brand-logo-image {
    width: min(var(--logo-width-desktop, 208px), calc(var(--sidebar-width, 280px) - 44px));
    max-width: calc(var(--sidebar-width, 280px) - 44px);
}

.sidebar-app-name {
    display: block;
    max-width: 100%;
    color: rgba(255, 255, 255, .92);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.login-page .login-hero-content {
    display: grid;
    justify-items: center;
    text-align: center;
}

.login-page .login-logo {
    width: var(--login-logo-width-desktop, 160px);
    max-width: min(82vw, 420px);
    max-height: 260px;
    margin: 0 auto;
    padding: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.login-page .brand-logo-image.login-logo {
    background-color: transparent !important;
}

@media (max-width: 820px) {
    .login-page .login-logo {
        width: var(--login-logo-width-tablet, 140px);
    }
}

@media (max-width: 520px) {
    .login-page .login-logo {
        width: var(--login-logo-width-mobile, 120px);
    }
}

.login-page .login-hero-title p {
    margin-left: auto;
    margin-right: auto;
}

.login-page .login-hero-title p::after {
    margin-left: auto;
    margin-right: auto;
}

.dh-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #fff;
}

.dh-house {
    position: relative;
    width: 48px;
    height: 54px;
    border: 5px solid #fff;
    border-top: 0;
    border-radius: 2px;
}

.dh-house::before {
    content: "";
    position: absolute;
    left: 3px;
    top: -18px;
    width: 32px;
    height: 32px;
    border-left: 5px solid #fff;
    border-top: 5px solid #fff;
    transform: rotate(45deg);
    border-radius: 2px;
}

.dh-house span {
    position: absolute;
    right: 8px;
    bottom: 7px;
    width: 5px;
    height: 22px;
    border-radius: 999px;
    background: #ff7a00;
}

.dh-brand-copy strong {
    display: block;
    font-size: 26px;
    line-height: .84;
}

.dh-brand-copy em {
    color: #ff7a00;
    font-style: normal;
}

.brand-subtitle {
    display: block;
    margin-top: 7px;
    font-size: 12px;
    color: rgba(255, 255, 255, .86);
}

.app-nav {
    position: relative;
    z-index: 2;
    display: grid;
    gap: 8px;
}

.app-nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 54px;
    padding: 0 14px;
    border-radius: 7px;
    color: rgba(255, 255, 255, .88);
    font-weight: 700;
}

.app-nav a::before {
    content: "";
    position: absolute;
    left: -22px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: transparent;
}

.app-nav a.active,
.app-nav a:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
    text-decoration: none;
}

.app-nav a.active::before {
    background: var(--active-menu-color, #ff7a00);
}

.icon {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
}

.nav-badge {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    margin-left: auto;
    border-radius: 999px;
    background: #ff7a00;
    color: #fff;
    font-size: 12px;
}

.sidebar-illustration {
    position: absolute;
    left: 28px;
    right: 0;
    bottom: 118px;
    height: 210px;
    opacity: .25;
    pointer-events: none;
}

.sidebar-illustration::before {
    content: "";
    position: absolute;
    left: 28px;
    bottom: 0;
    width: 140px;
    height: 112px;
    border: 2px solid rgba(255, 255, 255, .3);
    border-top: 0;
}

.sidebar-illustration::after {
    content: "";
    position: absolute;
    left: 10px;
    bottom: 112px;
    width: 178px;
    height: 88px;
    border-left: 2px solid rgba(255, 255, 255, .28);
    border-top: 2px solid rgba(255, 255, 255, .28);
    transform: skewY(-25deg);
}

.support-card {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    margin-top: auto;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .07);
}

.support-card strong,
.support-card a {
    display: block;
    color: #fff;
}

.support-icon {
    color: #8bd64f;
}

.support-button {
    grid-column: 1 / -1;
    display: inline-flex;
    justify-content: center;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: 6px;
    font-weight: 700;
}

.app-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
    padding: 0;
    background: #f8fafd;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    min-height: 76px;
    margin: 0;
    padding: 0 42px;
    border-bottom: 1px solid #dfe5ee;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(10px);
}

.topbar-title span {
    color: #061b3a;
    font-size: 18px;
    font-weight: 800;
}

.topbar-actions,
.topbar-help,
.notification-button,
.user-menu {
    display: flex;
    align-items: center;
}

.topbar-actions {
    gap: 20px;
    margin-left: auto;
}

.topbar-help {
    gap: 8px;
    color: #061b3a;
    font-weight: 700;
}

.topbar-separator {
    width: 1px;
    height: 28px;
    background: #d9e0eb;
}

.notification-button,
.sidebar-toggle,
.action-dots {
    border: 0;
    background: transparent;
    color: #061b3a;
    cursor: pointer;
}

.notification-button {
    position: relative;
    padding: 0;
}

.notification-button b {
    position: absolute;
    top: -9px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #ff7a00;
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
}

.user-menu {
    gap: 12px;
}

.user-avatar {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: #061b3a;
    color: #fff;
    font-weight: 800;
}

.user-copy strong,
.user-copy small {
    display: block;
}

.user-copy small {
    color: #657189;
}

.logout-link {
    border: 0;
    padding: 0;
    background: transparent;
    color: #061b3a;
    cursor: pointer;
    font-size: 0;
}

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

.notification-open-form .notification-item {
    width: 100%;
    border: 0;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.logout-link::after {
    content: "v";
    font-size: 15px;
}

.sidebar-toggle {
    display: none;
}

.page-header,
.dashboard-layout,
.dashboard-full,
.dashboard-secondary-grid,
.kpi-grid,
.admin-dashboard-layout,
.admin-tracking-page,
.agency-detail-header,
.agency-detail-tabs,
.agency-detail-grid,
.personalization-heading,
.personalization-workspace,
.table-card,
.security-banner,
.app-footer,
.app-main > .alert {
    margin-left: 42px;
    margin-right: 42px;
}

.page-header {
    margin-top: 34px;
    margin-bottom: 24px;
}

.page-header h1 {
    margin: 0 0 6px;
    color: #061b3a;
    font-size: 31px;
    line-height: 1.1;
}

.page-header p {
    margin: 0;
    color: #44516a;
}

.card,
.panel,
.stat-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
}

.dashboard-layout,
.admin-dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 24px;
    align-items: start;
}

.dashboard-secondary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-top: 22px;
    margin-bottom: 22px;
}

.dashboard-primary {
    min-width: 0;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.admin-kpi-grid {
    grid-template-columns: repeat(5, minmax(135px, 1fr));
}

.kpi-card {
    display: grid;
    grid-template-columns: 46px 1fr;
    align-items: center;
    gap: 6px 12px;
    min-height: 116px;
    padding: 18px;
}

.choice-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    border: 0;
    padding: 0;
    margin: 0;
}

.choice-row legend {
    width: 100%;
    color: #10224d;
    font-weight: 700;
}

.radio-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 14px;
    border: 1px solid #d8deea;
    border-radius: 8px;
    background: #fff;
    color: #10224d;
}

.kpi-icon {
    grid-row: span 3;
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 999px;
    color: #005eea;
    background: #eaf2ff;
}

.kpi-orange .kpi-icon {
    color: #ff7a00;
    background: #fff1df;
}

.kpi-green .kpi-icon {
    color: #2f9d52;
    background: #e8f7ed;
}

.kpi-title {
    font-weight: 800;
}

.kpi-card strong {
    color: #061b3a;
    font-size: 26px;
    line-height: 1;
}

.kpi-trend {
    color: #005eea;
    font-size: 13px;
}

.kpi-orange .kpi-trend {
    color: #ff7a00;
}

.kpi-green .kpi-trend {
    color: #2f9d52;
}

.table-card {
    margin-bottom: 18px;
    padding: 24px;
}

.panel-header h2,
.widget-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #061b3a;
    font-size: 18px;
}

.table-link,
.widget-header a {
    color: #005eea;
    font-weight: 800;
}

.data-table {
    min-width: 780px;
    table-layout: fixed;
}

.data-table th {
    color: #52617a;
    font-size: 12px;
    letter-spacing: 0;
}

.data-table td {
    color: #13264a;
    line-height: 1.25;
}

.table-density-compact .data-table th,
.table-density-compact .data-table td {
    padding-top: 8px;
    padding-bottom: 8px;
}

.table-density-comfortable .data-table th,
.table-density-comfortable .data-table td {
    padding-top: 18px;
    padding-bottom: 18px;
}

.table-alternate-rows .data-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.status-pill,
.priority-pill {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    min-height: 24px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.td-nowrap {
    display: inline-flex;
    max-width: 100%;
    white-space: nowrap;
}

.td-ellipsis {
    display: block;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.dashboard-full .data-table th,
.dashboard-full .data-table td,
.table-density-compact table th,
.table-density-compact table td {
    padding-top: 6px;
    padding-bottom: 6px;
}

.document-preview-list {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
}

.document-preview-thumb,
.document-preview-pdf,
.document-preview-file,
.document-preview-more {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    overflow: hidden;
    border: 1px solid #d8deea;
    border-radius: 7px;
    background: #f8fafc;
    color: #061b3a;
    font-size: 11px;
    font-weight: 800;
}

.document-preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.document-preview-pdf {
    background: #fff1df;
    color: #b45309;
}

.dossier-followup {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.dossier-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 18px;
}

.dossier-detail-summary {
    display: grid;
    gap: 16px;
}

.dossier-detail-summary h2 {
    margin: 0;
    color: #061b3a;
    font-size: 20px;
}

.dossier-detail-summary .details-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dossier-detail-summary .details-list div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.dossier-description {
    display: grid;
    gap: 6px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.dossier-description p {
    margin: 0;
    color: #334155;
    line-height: 1.45;
}

.dossier-status-form {
    align-content: start;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.dossier-document-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.dossier-document-card {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    min-height: 96px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.dossier-document-preview {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    overflow: hidden;
    border: 1px solid #d8deea;
    border-radius: 8px;
    background: #f1f5f9;
    color: #061b3a;
    font-weight: 900;
}

.dossier-document-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dossier-document-meta {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.dossier-document-meta strong,
.dossier-document-meta small,
.dossier-document-meta span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.dossier-document-meta strong {
    color: #061b3a;
    font-size: 14px;
}

.dossier-document-meta span {
    color: var(--muted);
    font-size: 12px;
}

.dossier-document-meta .button {
    min-height: 30px;
    padding: 6px 10px;
    font-size: 12px;
}

.dossier-document-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
    margin-top: 3px;
}

.dossier-upload-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.financial-documents-panel {
    display: grid;
    gap: 16px;
}

.financial-document-upload-form {
    display: grid;
    grid-template-columns: minmax(200px, .8fr) minmax(280px, 1.2fr) auto;
    gap: 14px;
    align-items: end;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.financial-document-upload-form small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.3;
}

.dossier-create-form input,
.dossier-create-form select {
    min-height: 40px;
    padding: 9px 11px;
}

.dossier-create-form textarea {
    min-height: 92px;
}

.status-warning,
.priority-danger {
    background: #fff0dc;
    color: #f97316;
}

.status-success,
.priority-success {
    background: #e6f6ec;
    color: #24864a;
}

.status-danger {
    background: #ffe4e4;
    color: #cf2e2e;
}

.status-muted,
.priority-info {
    background: #eef4ff;
    color: #1463d9;
}

.action-dots {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
}

.dashboard-side {
    display: grid;
    gap: 18px;
}

.widget-card {
    padding: 22px;
}

.widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.widget-header h2 {
    margin: 0;
}

.mini-row,
.activity-row,
.alert-line,
.backup-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #e5eaf2;
    color: #13264a;
}

.mini-row:last-child,
.activity-row:last-child,
.alert-line:last-child,
.backup-row:last-child {
    border-bottom: 0;
}

.mini-row span,
.mini-row small,
.activity-row span,
.activity-row small,
.backup-row span,
.backup-row small {
    display: block;
}

.mini-row small,
.activity-row small,
.backup-row small {
    color: #64748b;
}

.map-preview {
    display: grid;
    place-items: center;
    min-height: 120px;
    margin-top: 14px;
    border-radius: 8px;
    background: radial-gradient(circle at 70% 60%, #005eea 0 16%, transparent 17%), linear-gradient(135deg, #e8eef8, #dfe7f4);
    color: #fff;
    font-weight: 800;
}

.map-preview.large {
    min-height: 170px;
}

.security-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding: 18px 22px;
    border: 1px solid #cae8d1;
    border-radius: 8px;
    background: #f2fbf4;
    color: #184b2a;
}

.admin-bottom-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, .8fr);
    gap: 18px;
    margin-bottom: 18px;
}

.alert-line b {
    display: inline-grid;
    place-items: center;
    min-width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #fff0dc;
    color: #ff7a00;
}

.distribution-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 16px 0;
    text-align: center;
}

.distribution-grid strong,
.distribution-grid small {
    display: block;
}

.distribution-grid strong {
    color: #061b3a;
    font-size: 24px;
}

.distribution-bar {
    display: grid;
    grid-template-columns: 1.2fr 1.4fr 1fr .9fr;
    overflow: hidden;
    height: 10px;
    border-radius: 999px;
}

.distribution-bar i:nth-child(1) { background: #ff7a00; }
.distribution-bar i:nth-child(2) { background: #005eea; }
.distribution-bar i:nth-child(3) { background: #2f9d52; }
.distribution-bar i:nth-child(4) { background: #8b5cf6; }

.personalization-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 34px;
    margin-bottom: 24px;
}

.personalization-heading .page-header {
    margin: 0;
}

.personalization-actions {
    display: flex;
    gap: 12px;
}

.personalization-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(420px, .9fr);
    gap: 18px;
    align-items: start;
    margin-bottom: 20px;
}

.personalization-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 18px;
}

.admin-widget {
    display: grid;
    gap: 14px;
    padding: 22px;
}

.admin-widget p,
.preview-card p {
    margin: 0;
    color: #52617a;
}

.segmented {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.segmented span {
    display: grid;
    place-items: center;
    min-height: 40px;
    border: 1px solid #dce3ee;
    border-radius: 6px;
    background: #fff;
}

.segmented span.active {
    border-color: #ff7a00;
    box-shadow: inset 0 0 0 1px #ff7a00;
}

.segmented.text span {
    color: #061b3a;
    font-weight: 700;
}

.upload-drop {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 12px;
    align-items: center;
    padding: 20px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #fbfdff;
}

.upload-drop small {
    grid-column: 2;
}

.color-row {
    display: flex;
    gap: 14px;
}

.color-row span {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: var(--swatch);
}

.color-row span.active {
    outline: 3px solid rgba(255, 122, 0, .3);
    box-shadow: 0 0 0 2px #ff7a00;
}

.switch-line,
.tab-config {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #061b3a;
}

.tab-config {
    min-height: 34px;
    padding: 0 8px;
    border: 1px solid #e3e8f0;
    border-radius: 6px;
}

.switch {
    position: relative;
    width: 34px;
    height: 20px;
    border-radius: 999px;
    background: #aab4c5;
}

.switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: #fff;
}

.switch.on {
    background: #47a447;
}

.switch.on::after {
    left: 17px;
}

.preview-card {
    padding: 22px;
}

.mini-extranet-preview {
    display: grid;
    grid-template-columns: 210px 1fr;
    overflow: hidden;
    min-height: 520px;
    margin-top: 20px;
    border: 1px solid #dce3ee;
    border-radius: 8px;
    background: #fff;
}

.mini-sidebar {
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 28px 18px;
    background: linear-gradient(150deg, #092e69, #02122e);
    color: #fff;
}

.mini-sidebar .dh-brand-copy strong {
    font-size: 18px;
}

.mini-sidebar .dh-house {
    width: 34px;
    height: 38px;
    border-width: 3px;
}

.mini-sidebar .dh-house::before {
    left: 2px;
    top: -13px;
    width: 22px;
    height: 22px;
    border-width: 3px;
}

.mini-sidebar span:not(.dh-brand):not(.dh-house):not(.dh-brand-copy):not(.brand-subtitle) {
    padding: 10px;
    border-radius: 6px;
}

.mini-sidebar span.active {
    background: rgba(255, 255, 255, .12);
    border-left: 3px solid #ff7a00;
}

.mini-content {
    padding: 30px;
}

.mini-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.mini-kpis span {
    display: grid;
    place-items: center;
    height: 72px;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    color: #061b3a;
    font-size: 24px;
    font-weight: 800;
}

.mini-table {
    display: grid;
    gap: 12px;
    margin: 22px 0;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.import-row {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto auto;
    gap: 12px;
    margin-bottom: 12px;
}

.backup-list {
    display: grid;
}

.login-page {
    display: block;
    min-height: 100vh;
    padding: 0;
    background: #f7f8fb;
}

.login-split {
    display: grid;
    grid-template-columns: minmax(420px, 1fr) minmax(500px, 1fr);
    min-height: calc(100vh - 64px);
}

.login-hero {
    position: relative;
    overflow: hidden;
    padding: 42px 7vw 34px;
    background: linear-gradient(145deg, rgba(8, 41, 92, .94), rgba(2, 18, 46, .99)), #061b3a;
    color: #fff;
}

.login-hero-content {
    position: relative;
    z-index: 2;
    max-width: 620px;
}

.login-hero .dh-brand-copy strong {
    font-size: 32px;
}

.login-hero .dh-house {
    width: 56px;
    height: 64px;
    border-width: 6px;
}

.login-hero .dh-house::before {
    left: 5px;
    top: -25px;
    width: 34px;
    height: 34px;
    border-width: 6px;
}

.login-hero-title {
    margin-top: 42px;
}

.login-hero-title h1 {
    margin: 0;
    font-size: 46px;
    line-height: 1.05;
}

.login-hero-title p {
    max-width: 450px;
    margin: 16px 0 0;
    color: rgba(255, 255, 255, .9);
    font-size: 19px;
}

.login-hero-title p::after {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    margin-top: 14px;
    border-radius: 999px;
    background: #ff7a00;
}

.login-benefits {
    display: grid;
    gap: 16px;
    margin-top: 26px;
}

.login-benefits article {
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 14px;
    align-items: center;
}

.login-benefits .icon {
    width: 46px;
    height: 46px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
}

.login-benefits strong,
.login-benefits span {
    display: block;
}

.login-benefits span {
    color: rgba(255, 255, 255, .82);
    font-size: 15px;
}

.login-house-illustration {
    position: absolute;
    right: -20px;
    bottom: 18px;
    width: 48%;
    height: 45%;
    opacity: .18;
    border-left: 3px solid #fff;
    border-bottom: 3px solid #fff;
    transform: skewY(-22deg);
}

.login-form-area {
    display: grid;
    place-items: center;
    padding: 34px 52px;
}

.login-card {
    width: min(100%, 660px);
    padding: 34px 46px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 24px 70px rgba(15, 23, 42, .12);
}

.login-lock {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 999px;
    background: #f1f3f6;
    color: #061b3a;
}

.login-card h2,
.login-card p {
    text-align: center;
}

.login-card h2 {
    margin: 0 0 8px;
    font-size: 28px;
}

.login-card p {
    margin: 0 0 20px;
    color: #7a8498;
    font-size: 17px;
}

.input-icon {
    position: relative;
    display: block;
}

.input-icon .icon {
    position: absolute;
    left: 18px;
    top: 50%;
    width: 20px;
    height: 20px;
    transform: translateY(-50%);
    color: #8b95a7;
}

.input-icon input {
    min-height: 48px;
    padding-left: 54px;
    font-size: 17px;
}

.login-options {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.checkbox-label {
    display: flex;
    grid-auto-flow: column;
    align-items: center;
    gap: 10px;
    color: #061b3a;
}

.checkbox-label input {
    width: 20px;
    height: 20px;
}

.btn-primary,
.button.primary {
    background: var(--button-color, var(--primary-color, #061b3a));
    color: #fff;
}

.login-form .button {
    min-height: 52px;
    margin-top: 6px;
    font-size: 18px;
}

.login-security {
    margin: 18px 0 0;
}

.login-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    min-height: 64px;
    padding: 12px 18px;
    border-top: 1px solid #e3e8f0;
    background: #fff;
    color: #061b3a;
}

.login-footer span,
.login-footer a,
.footer-contact {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.app-footer {
    align-items: center;
    min-height: 78px;
    margin-top: auto;
    padding: 18px 0;
    border-top: 1px solid #e3e8f0;
    background: #fff;
}

.footer-links {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-links a,
.legal-footer a {
    color: var(--primary-color);
    font-weight: 700;
    text-decoration: none;
}

.footer-links a:hover,
.legal-footer a:hover {
    text-decoration: underline;
}

.legal-page {
    min-height: 100vh;
    background: #f5f6f8;
    color: var(--text);
}

.legal-modal-open {
    overflow: hidden;
}

.legal-modal[hidden] {
    display: none;
}

.legal-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 28px;
}

.legal-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 27, 58, 0.72);
    backdrop-filter: blur(7px);
}

.legal-modal-panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(920px, 100%);
    max-height: min(820px, calc(100vh - 56px));
    overflow: hidden;
    border: 1px solid rgba(227, 232, 240, 0.92);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 28px 70px rgba(6, 27, 58, 0.28);
    outline: none;
}

.legal-modal-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 26px 18px;
    border-bottom: 1px solid #e3e8f0;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.legal-modal-topbar h2 {
    margin: 4px 0 0;
    color: var(--primary-color);
    font-size: 24px;
    line-height: 1.15;
}

.legal-modal-close {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border: 1px solid #d8e0eb;
    border-radius: 50%;
    background: #fff;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.legal-modal-close:hover,
.legal-modal-close:focus-visible {
    border-color: var(--accent-color);
    box-shadow: 0 10px 26px rgba(6, 27, 58, 0.14);
    transform: translateY(-1px);
}

.legal-modal-body {
    overflow: auto;
    padding: 26px;
    background: #f5f7fb;
}

.legal-modal-loading {
    padding: 38px 20px;
    color: var(--muted);
    text-align: center;
    font-weight: 700;
}

.legal-modal-document {
    display: grid;
    gap: 18px;
}

.legal-modal-intro {
    padding: 20px;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    background: #fff;
}

.legal-modal-intro h3 {
    margin: 4px 0 8px;
    color: var(--primary-color);
    font-size: 26px;
    line-height: 1.16;
}

.legal-modal-intro p:last-child {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.legal-shell {
    width: min(1040px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0;
}

.legal-header,
.legal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.legal-brand {
    display: inline-flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.legal-hero {
    padding: 42px 0 26px;
}

.legal-hero h1 {
    margin: 0;
    color: var(--primary-color);
    font-size: 38px;
    line-height: 1.08;
}

.legal-hero p {
    max-width: 760px;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.6;
}

.legal-content {
    display: grid;
    gap: 16px;
}

.legal-content-modal {
    gap: 12px;
}

.legal-content-modal .legal-card {
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(6, 27, 58, 0.06);
}

.legal-content-modal .legal-card h2 {
    font-size: 18px;
}

.legal-card {
    padding: 24px;
    border: 1px solid #e3e8f0;
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--card-shadow);
}

.legal-card h2 {
    margin: 0 0 12px;
    color: var(--primary-color);
    font-size: 20px;
}

.legal-card p,
.legal-card li,
.legal-card dd {
    color: #31415a;
    line-height: 1.65;
}

.legal-card p {
    margin: 0 0 10px;
}

.legal-card p:last-child {
    margin-bottom: 0;
}

.legal-card ul {
    margin: 0;
    padding-left: 22px;
}

.legal-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.legal-list div {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 16px;
}

.legal-list dt {
    color: var(--muted);
    font-weight: 700;
}

.legal-list dd {
    margin: 0;
    font-weight: 600;
}

.muted-card {
    background: #f8fafc;
}

.legal-footer {
    margin-top: 24px;
    padding: 18px 0 0;
    border-top: 1px solid #e3e8f0;
    color: var(--muted);
    font-size: 14px;
}

.empty-state {
    padding: 24px;
    text-align: center;
}

.empty-state strong,
.empty-state p {
    display: block;
    margin: 0;
}

.empty-state p {
    color: #64748b;
}

.filters-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr)) auto;
    gap: 12px;
    margin-bottom: 18px;
}

.page-back-link {
    margin: -6px 0 18px;
}

.page-back-link a {
    color: var(--accent);
    font-weight: 700;
}

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

.agent-list-table {
    min-width: 620px;
}

.permission-summary {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.dh-address-tooltip {
    display: block;
    max-width: 100%;
    outline: none;
}

.dh-address-text {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dh-address-tooltip:focus .dh-address-text,
.dh-address-tooltip:hover .dh-address-text {
    overflow: visible;
    white-space: normal;
    word-break: break-word;
}

.agent-profile-summary,
.account-review-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: start;
}

.agent-profile-summary h2,
.account-review-summary h2 {
    margin: 0;
}

.agent-profile-summary p,
.account-review-summary p {
    margin-bottom: 0;
}

.agent-permissions-form {
    display: grid;
    gap: 16px;
}

.agent-request-form {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(420px, 1.1fr);
    gap: 18px;
    align-items: start;
}

.agent-request-block {
    min-width: 0;
    margin: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.agent-request-block legend {
    padding: 0 7px;
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
}

.agent-request-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.agent-request-fields input,
.agent-request-fields textarea {
    min-height: 42px;
}

.agent-request-fields textarea {
    min-height: 104px;
    resize: vertical;
}

.agent-request-message-field {
    grid-column: 1 / -1;
}

.agent-request-permissions > p {
    margin: 0 0 12px;
    line-height: 1.4;
}

.agent-request-permissions .settings-checks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.agent-request-permissions .checkbox-line {
    min-height: 46px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    line-height: 1.3;
}

.agent-request-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

@media (max-width: 980px) {
    .agent-request-form {
        grid-template-columns: 1fr;
    }

    .agent-request-actions {
        grid-column: auto;
    }
}

@media (max-width: 640px) {
    .agent-request-fields,
    .agent-request-permissions .settings-checks {
        grid-template-columns: 1fr;
    }

    .agent-request-message-field {
        grid-column: auto;
    }

    .agent-request-actions,
    .agent-request-actions .button {
        width: 100%;
    }
}

.agent-permissions-form .settings-checks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
    gap: 10px;
    padding: 0;
    border: 0;
}

.agent-permissions-form .checkbox-line {
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

/* Les permissions agence héritent des champs de formulaire à largeur 100 %.
 * Une case reste un contrôle compact ; toute la ligne label demeure la cible.
 */
.checkbox-line {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    cursor: pointer;
}

.checkbox-line input[type="checkbox"] {
    box-sizing: border-box;
    flex: 0 0 20px;
    width: 20px;
    min-width: 20px;
    height: 20px;
    min-height: 20px;
    margin: 0;
    padding: 0;
}

.checkbox-line input[type="checkbox"]:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .34);
    outline-offset: 3px;
}

.account-status-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.account-review-summary {
    grid-template-columns: minmax(0, 1fr) minmax(220px, auto);
}

.account-review-summary dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(110px, 1fr));
    gap: 10px;
    margin: 0;
}

.account-review-summary dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.account-review-summary dd {
    margin: 3px 0 0;
    font-weight: 700;
}

.account-request-message {
    grid-column: 1 / -1;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.document-type-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #eef4ff;
    color: #1463d9;
    font-size: 12px;
    font-weight: 800;
}

.type-devis,
.type-facture {
    background: #fff0dc;
    color: #f97316;
}

.type-compte_rendu,
.type-document_administratif {
    background: #eef4ff;
    color: #1463d9;
}

.type-photo {
    background: #e6f6ec;
    color: #24864a;
}

.actions-cell {
    display: grid;
    gap: 8px;
    min-width: 230px;
}

.actions-cell form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.related-helper {
    margin-top: 14px;
}

.related-helper p {
    margin: 8px 0 0;
}

.related-helper span {
    display: inline-flex;
    margin: 4px 6px 0 0;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef4ff;
    color: #1463d9;
}

.quick-personalization .admin-widget {
    align-content: start;
}

.quick-personalization .admin-widget label {
    color: #061b3a;
}

.quick-personalization input[type="range"] {
    accent-color: var(--accent-color, #ff7a00);
}

.js-personalisation-preview {
    --preview-primary: #061b3a;
    --preview-secondary: #08295c;
    --preview-accent: #ff7a00;
}

.js-personalisation-preview .mini-sidebar {
    width: 210px;
    transition: width .16s ease;
}

.js-preview-active-menu {
    border-left: 3px solid var(--preview-accent);
}

.js-preview-login-title {
    margin-bottom: 4px;
}

.js-preview-login-subtitle {
    margin-top: 0;
    color: #64748b;
}

.js-preview-table.density-compact span {
    padding: 3px 0;
    font-size: 12px;
}

.js-preview-table.density-comfortable span {
    padding: 10px 0;
}

.js-preview-table.alternate-rows span:nth-child(even) {
    background: #f6f8fc;
}

.public-help {
    min-height: 100vh;
    background: #f6f8fc;
}

.public-container,
.public-help .help-hero {
    width: min(1120px, calc(100% - 36px));
    margin: 28px auto;
}

.help-hero {
    padding: 32px;
    text-align: center;
}

.help-hero h1 {
    margin: 0 0 18px;
    color: #061b3a;
}

.help-search {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto;
    gap: 12px;
    max-width: 760px;
    margin: 0 auto 18px;
}

.help-search input {
    min-height: 52px;
}

.help-quick-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.help-quick-actions a {
    padding: 8px 12px;
    border-radius: 999px;
    background: #eef4ff;
    color: #1463d9;
    font-weight: 800;
}

.help-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 20px;
    margin-left: 42px;
    margin-right: 42px;
}

.help-categories,
.help-card {
    padding: 22px;
}

.help-categories {
    display: grid;
    align-content: start;
    gap: 8px;
}

.help-categories a {
    padding: 10px 12px;
    border-radius: 7px;
    color: #061b3a;
    font-weight: 800;
}

.help-categories a.active,
.help-categories a:hover {
    background: #eef4ff;
    color: #1463d9;
    text-decoration: none;
}

.help-results {
    display: grid;
    gap: 18px;
}

.help-article-row {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid #e5eaf2;
}

.help-article-row strong,
.help-article-row small {
    display: block;
}

.help-article-detail h1 {
    margin-top: 12px;
}

.help-content {
    color: #13264a;
    font-size: 17px;
    line-height: 1.7;
}

.help-footer-actions {
    margin-top: 24px;
}

.help-contact-card {
    display: grid;
    gap: 12px;
}

.support-thread {
    display: grid;
    gap: 14px;
}

.support-ticket-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.support-message {
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
}

.support-message.admin-reply {
    border-color: #cae8d1;
    background: #f2fbf4;
}

.support-message p {
    margin-bottom: 0;
}

.nav-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: calc(100% - 36px);
    margin: 18px 18px 7px;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, .62);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
    cursor: pointer;
}

.nav-chevron {
    font-size: 17px;
    line-height: 1;
    transition: transform .18s ease;
}

.nav-group.is-open .nav-chevron {
    transform: rotate(90deg);
}

.nav-group-items {
    display: grid;
    gap: 8px;
}

.app-nav.is-accordion-ready .nav-group:not(.is-open) .nav-group-items {
    display: none;
}

.app-nav.is-accordion-ready .nav-group-items {
    animation: sidebarGroupOpen .18s ease;
}

@keyframes sidebarGroupOpen {
    from {
        opacity: .4;
        transform: translateY(-3px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.entity-link {
    color: var(--link-color, #005eea);
    font-weight: 800;
}

.entity-link:hover {
    color: var(--accent-color, #ff7a00);
    text-decoration: none;
}

.admin-tracking-page {
    display: grid;
    gap: 22px;
    margin-bottom: 24px;
}

.tracking-table-card {
    margin-left: 0;
    margin-right: 0;
}

.tracking-widgets-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    gap: 18px;
    align-items: stretch;
}

.tracking-widgets-grid .widget-card {
    min-height: 260px;
}

.agency-detail-header {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    justify-content: space-between;
    margin-top: 34px;
    margin-bottom: 18px;
}

.agency-detail-header h1 {
    margin: 0 0 8px;
    color: #061b3a;
    font-size: 31px;
}

.agency-meta,
.agency-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.agency-meta {
    margin-top: 14px;
    color: #52617a;
}

.agency-actions {
    justify-content: flex-end;
    max-width: 560px;
}

.agency-detail-tabs {
    margin-bottom: 20px;
}

.agency-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}

.agency-info-card {
    padding: 22px;
}

.details-list {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 10px 18px;
    margin: 0;
}

.details-list dt {
    color: #64748b;
    font-weight: 800;
}

.details-list dd {
    margin: 0;
}

.interventions-overview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    margin: 0 42px 22px;
}

.intervention-map-card {
    padding: 22px;
}

.interventions-map {
    min-height: 390px;
    overflow: hidden;
    border: 1px solid #dfe5ee;
    border-radius: 8px;
    background: #edf2f8;
}

.map-note {
    margin: 12px 0 0;
    color: #52617a;
    font-size: 14px;
}

.intervention-filters {
    grid-template-columns: 1fr auto;
}

.address-edit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.address-edit-card {
    display: grid;
    gap: 12px;
    padding: 18px;
}

.address-edit-card h3 {
    margin: 0;
    color: #061b3a;
    font-size: 16px;
}

.notification-menu-wrap,
.action-menu {
    position: relative;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 16px);
    right: -18px;
    z-index: 50;
    width: min(380px, 88vw);
    overflow: hidden;
    border: 1px solid #dfe5ee;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 22px 48px rgba(15, 23, 42, .16);
}

.notification-dropdown-header,
.notification-all {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
}

.notification-dropdown-header {
    border-bottom: 1px solid #edf1f6;
}

.notification-dropdown-header button {
    border: 0;
    background: transparent;
    color: var(--link-color);
    font-weight: 800;
    cursor: pointer;
}

.notification-list {
    max-height: 330px;
    overflow: auto;
}

.notification-item {
    display: grid;
    gap: 4px;
    padding: 13px 16px;
    border-bottom: 1px solid #edf1f6;
    color: var(--text);
}

.notification-item.is-unread {
    background: #f5f8ff;
}

.notification-item span {
    font-weight: 800;
}

.notification-item small,
.notification-empty {
    color: var(--muted);
}

.notification-empty {
    padding: 18px 16px;
}

.notification-all {
    border-top: 1px solid #edf1f6;
    color: var(--link-color);
    font-weight: 800;
}

.notification-admin-list {
    display: grid;
    gap: 12px;
}

.notification-admin-item {
    display: flex;
    gap: 18px;
    align-items: center;
    justify-content: space-between;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
}

.notification-admin-item.is-unread {
    border-color: #bfd5ff;
    background: #f7faff;
}

.notification-admin-item h3 {
    margin: 8px 0 6px;
    color: #061b3a;
}

.notification-admin-item p {
    margin: 0 0 8px;
    color: #44516a;
}

.notification-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.action-menu {
    display: inline-flex;
}

.action-menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 40;
    min-width: 190px;
    overflow: hidden;
    border: 1px solid #dfe5ee;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 34px rgba(15, 23, 42, .14);
}

.action-menu-panel a,
.action-menu-panel button {
    display: block;
    width: 100%;
    padding: 11px 13px;
    border: 0;
    background: transparent;
    color: #061b3a;
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.action-menu-panel form {
    margin: 0;
}

.action-menu-panel a:hover,
.action-menu-panel button:hover {
    background: #f3f6fb;
    text-decoration: none;
}

.panel-actions,
.compact-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
}

.sector-card-wide {
    margin-top: 18px;
}

.osm-map {
    position: relative;
    min-height: 320px;
    overflow: hidden;
    border: 1px solid #dfe5ee;
    border-radius: 8px;
    background: #edf2f8;
}

.osm-map iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.osm-map span {
    position: absolute;
    left: 14px;
    bottom: 12px;
    padding: 7px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .92);
    color: #44516a;
    font-size: 12px;
}

.personalization-workspace {
    grid-template-columns: 1fr;
}

.personalization-controls {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.preview-card {
    width: 100%;
}

.mini-extranet-preview {
    min-height: 430px;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
}

.button.danger,
.btn-danger {
    background: var(--danger-color, #b42318);
    color: #fff;
}

/* Comptes rendus agence */
.reports-page {
    display: grid;
    gap: 20px;
    margin: 0 42px 34px;
}

.report-summary {
    display: grid;
    grid-template-columns: minmax(290px, 1.7fr) repeat(4, minmax(120px, .75fr));
    overflow: hidden;
}

.report-summary-intro {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    padding: 22px 24px;
    background: #f8fafc;
}

.report-summary-icon {
    display: inline-grid;
    flex: 0 0 48px;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    background: #eaf2ff;
    color: #005eea;
}

.report-summary-icon .icon {
    width: 23px;
    height: 23px;
}

.report-summary h2,
.report-toolbar h2,
.report-results h2,
.report-card h3,
.report-empty-state h3 {
    margin: 0;
    color: #061b3a;
}

.report-summary h2,
.report-toolbar h2,
.report-results h2 {
    font-size: 18px;
}

.report-summary-intro p,
.report-toolbar-heading p,
.report-results-header p,
.report-empty-state p {
    margin: 5px 0 0;
    color: #5b6780;
    line-height: 1.45;
}

.report-summary-intro p {
    max-width: 46ch;
    font-size: 14px;
}

.report-stat {
    display: grid;
    align-content: center;
    gap: 6px;
    min-width: 0;
    min-height: 112px;
    padding: 20px;
    border-left: 1px solid #e2e8f0;
}

.report-stat strong {
    color: #061b3a;
    font-size: 28px;
    line-height: 1;
}

.report-stat span {
    color: #52617a;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.report-toolbar {
    padding: 22px 24px 24px;
}

.report-toolbar-heading,
.report-results-header,
.report-card-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.report-toolbar-heading {
    margin-bottom: 18px;
}

.report-toolbar-heading p {
    font-size: 14px;
}

.report-documents-link {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 11px 0;
    color: #005eea;
    font-weight: 800;
}

.report-filter-grid {
    display: grid;
    grid-template-columns: minmax(240px, 2fr) minmax(180px, 1fr) minmax(145px, .75fr) minmax(145px, .75fr) auto;
    gap: 12px;
    align-items: end;
}

.report-filter-grid input,
.report-filter-grid select {
    min-height: 44px;
}

.report-filter-actions,
.report-card-actions {
    display: flex;
    gap: 9px;
}

.report-filter-actions .button,
.report-card-actions .button {
    min-height: 44px;
    white-space: nowrap;
}

.report-results {
    min-width: 0;
}

.report-results-header {
    align-items: end;
    padding: 2px 2px 12px;
}

.report-results-header p {
    font-size: 14px;
    font-weight: 700;
}

.report-results-hint {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.report-list {
    display: grid;
    gap: 12px;
}

.report-card {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    min-width: 0;
    padding: 18px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .045);
    transition: border-color .16s ease, box-shadow .16s ease;
}

.report-card:hover {
    border-color: #cbd7e8;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .075);
}

.report-file-mark {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 5px;
    width: 64px;
    min-height: 72px;
    border: 1px solid #cfe0ff;
    border-radius: 8px;
    background: #f1f6ff;
    color: #0b5fd7;
}

.report-file-mark .icon {
    width: 25px;
    height: 25px;
}

.report-file-mark span {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .04em;
}

.report-card-body {
    display: grid;
    gap: 10px;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.report-card-title-row > div {
    min-width: 0;
    max-width: 100%;
}

.report-card h3 {
    overflow: hidden;
    font-size: 17px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-filename {
    margin: 4px 0 0;
    overflow: hidden;
    color: #64748b;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-description {
    display: -webkit-box;
    max-width: 90ch;
    margin: 0;
    overflow: hidden;
    color: #40506b;
    font-size: 14px;
    line-height: 1.45;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.report-meta {
    display: grid;
    grid-template-columns: minmax(180px, 1.5fr) repeat(3, minmax(105px, .65fr));
    gap: 10px 18px;
}

.report-meta > span {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.report-meta strong {
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.3;
    text-transform: uppercase;
}

.report-meta > span > span,
.report-meta time,
.report-meta a {
    overflow: hidden;
    color: #172b4d;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-meta a {
    color: #005eea;
}

.report-card-actions {
    flex-direction: column;
    align-items: stretch;
    min-width: 118px;
}

.report-empty-state {
    display: grid;
    justify-items: center;
    min-height: 270px;
    padding: 52px 24px;
    text-align: center;
}

.report-empty-state > .icon {
    width: 38px;
    height: 38px;
    margin-bottom: 14px;
    color: #60718e;
}

.report-empty-state h3 {
    font-size: 18px;
}

.report-empty-state p {
    max-width: 52ch;
}

.report-empty-state .button {
    min-height: 44px;
    margin-top: 18px;
}

.report-error-state {
    border-color: #f0d2cd;
    background: #fffafa;
}

.admin-report-editor .panel-header {
    margin-bottom: 20px;
}

.admin-report-editor .panel-header p,
.table-card .panel-header p {
    margin: 5px 0 0;
}

.admin-report-form {
    align-items: start;
}

.admin-report-content-field {
    grid-column: 1 / -1;
}

.admin-report-content-field textarea {
    min-height: 250px;
    line-height: 1.55;
}

.admin-report-form-actions {
    grid-column: 1 / -1;
    flex-wrap: wrap;
}

.admin-report-filters {
    grid-template-columns: minmax(190px, 1fr) minmax(150px, .7fr) minmax(240px, 1.5fr) auto auto;
}

.admin-report-table {
    min-width: 980px;
    table-layout: auto;
}

.admin-report-table th:first-child {
    width: 22%;
}

.admin-report-table .actions-cell {
    min-width: 150px;
}

.admin-report-excerpt {
    display: block;
    max-width: 34ch;
    margin-top: 5px;
    overflow: hidden;
    color: #64748b;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.report-status-draft {
    background: #fff7e5;
    color: #8a5300;
}

.report-status-published {
    background: #eaf7ee;
    color: #176b35;
}

.report-status-archived {
    background: #edf1f6;
    color: #52617a;
}

.dossier-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0 42px 20px;
    padding: 3px 2px 7px;
    scrollbar-width: thin;
}

.dossier-tabs a {
    flex: 1 0 max-content;
    justify-content: center;
    min-height: 44px;
    padding: 10px 14px;
}

.dossier-tabs a:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .34);
    outline-offset: 3px;
}

.dossier-agency-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0 42px 20px;
    padding: 3px 2px 7px;
    scrollbar-width: thin;
}

.dossier-agency-tabs a {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 10px 14px;
}

.dossier-agency-tabs a:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .34);
    outline-offset: 3px;
}

.dossier-report-workspace {
    display: grid;
    gap: 18px;
    margin: 0 42px 34px;
}

.dossier-report-workspace .table-card {
    margin: 0;
}

.dossier-report-editor .panel-header,
.dossier-report-history .panel-header,
.dossier-published-reports .panel-header {
    align-items: flex-start;
}

.dossier-report-editor .eyebrow,
.dossier-published-reports .eyebrow,
.admin-report-entry .eyebrow {
    margin: 0 0 5px;
}

.dossier-report-context {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 20px;
}

.dossier-report-context div {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid #d9e3f0;
    border-radius: 8px;
    background: #f8fafc;
}

.dossier-report-context dt,
.dossier-published-report-header dt {
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.dossier-report-context dd,
.dossier-published-report-header dd {
    margin: 0;
    color: #172b4d;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.dossier-report-list,
.dossier-published-report-list {
    display: grid;
    gap: 12px;
}

.dossier-report-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    min-width: 0;
    padding: 18px;
    border: 1px solid #dfe6ef;
    border-radius: 8px;
    background: #fff;
}

.dossier-report-item-body {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.dossier-report-item-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.dossier-report-item h3,
.dossier-published-report h3,
.admin-report-entry h2 {
    margin: 0;
    color: #061b3a;
}

.dossier-report-item-heading p {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 13px;
}

.dossier-report-excerpt {
    max-width: 90ch;
    margin: 0;
    color: #40506b;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.dossier-report-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dossier-report-item-actions form {
    margin: 0;
}

.dossier-published-reports {
    margin: 0 42px 34px;
}

.dossier-published-report {
    overflow: hidden;
    border: 1px solid #dfe6ef;
    border-radius: 8px;
    background: #fff;
}

.dossier-published-report-header {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr);
    gap: 20px;
    align-items: end;
    padding: 20px 22px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.dossier-published-report h3 {
    margin-top: 9px;
    font-size: 20px;
    line-height: 1.3;
}

.dossier-published-report-header dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

.dossier-published-report-header dl div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.dossier-published-report-content {
    max-width: 96ch;
    padding: 24px 26px 30px;
    color: #23344f;
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.report-photo-upload-field {
    padding: 16px;
    border: 1px dashed #b8c7da;
    border-radius: 8px;
    background: #f8fafc;
}

.report-photo-manager {
    display: grid;
    gap: 14px;
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.report-photo-manager-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.report-photo-manager-heading h3,
.report-photo-manager-heading p {
    margin: 0;
}

.report-photo-manager-heading p {
    margin-top: 5px;
}

.report-photo-manager-heading > span {
    display: inline-flex;
    flex: 0 0 auto;
    min-height: 30px;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: #edf3fb;
    color: #25446f;
    font-size: 12px;
    font-weight: 800;
}

.report-photo-manager-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}

.report-photo-manager-card {
    overflow: hidden;
    border: 1px solid #dce4ee;
    border-radius: 8px;
    background: #fff;
}

.report-photo-manager-preview {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #edf2f7;
}

.report-photo-manager-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.report-photo-manager-actions {
    display: grid;
    gap: 9px;
    padding: 12px;
}

.report-photo-manager-actions form,
.report-photo-rename-form {
    margin: 0;
}

.report-photo-rename-form {
    display: grid;
    gap: 8px;
}

.report-photo-rename-form label {
    gap: 5px;
    font-size: 12px;
}

.report-photo-rename-form input {
    min-width: 0;
}

.report-photo-manager-actions .button {
    width: 100%;
}

.report-photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.report-photo {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    border: 1px solid #dce4ee;
    border-radius: 8px;
    background: #fff;
}

.report-photo a {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #edf2f7;
}

.report-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.report-photo figcaption {
    padding: 10px 11px;
    color: #23344f;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.report-photo-gallery-compact {
    grid-template-columns: repeat(auto-fill, minmax(110px, 150px));
    gap: 9px;
}

.report-photo-gallery-compact .report-photo figcaption {
    padding: 7px 8px;
    font-size: 11px;
}

.dossier-published-report-photos,
.report-detail-photos {
    display: grid;
    gap: 14px;
    padding: 24px 26px 30px;
    border-top: 1px solid #e2e8f0;
    background: #fbfcfe;
}

.dossier-published-report-photos h4,
.report-detail-photos h3 {
    margin: 0;
    color: #061b3a;
}

.dossier-agency-followup-summary .details-list {
    margin-bottom: 18px;
}

.admin-report-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.admin-report-entry-copy {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.admin-report-entry-copy p:last-child {
    max-width: 70ch;
    margin: 6px 0 0;
    color: #52617a;
    line-height: 1.5;
}

.admin-report-entry > .button {
    flex: 0 0 auto;
    min-height: 44px;
}

.report-detail-page {
    display: grid;
    gap: 16px;
    margin: 0 42px 34px;
}

.report-detail-back {
    justify-self: start;
    min-height: 44px;
    margin: 0;
    padding: 11px 0;
    color: #005eea;
    font-weight: 800;
}

.report-detail-card {
    overflow: hidden;
}

.report-detail-header {
    display: grid;
    gap: 22px;
    padding: 24px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.report-detail-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.report-detail-title h2 {
    margin: 8px 0 0;
    color: #061b3a;
    font-size: 24px;
    line-height: 1.25;
}

.report-detail-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
}

.report-detail-meta div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.report-detail-meta dt {
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.report-detail-meta dd {
    margin: 0;
    overflow: hidden;
    color: #172b4d;
    font-size: 14px;
    font-weight: 700;
    text-overflow: ellipsis;
}

.report-detail-meta a {
    color: #005eea;
}

.report-detail-content {
    max-width: 96ch;
    padding: 30px 32px 38px;
    color: #23344f;
    font-size: 15px;
    line-height: 1.75;
}

.report-documents-link:focus-visible,
.report-meta a:focus-visible,
.report-card-actions .button:focus-visible,
.report-filter-actions .button:focus-visible,
.report-detail-back:focus-visible,
.report-detail-meta a:focus-visible {
    border-radius: 4px;
    outline: 3px solid rgba(37, 99, 235, .34);
    outline-offset: 3px;
}

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

    .help-layout {
        margin-left: 22px;
        margin-right: 22px;
    }
}

@media (max-width: 1280px) {
    .dashboard-layout,
    .admin-dashboard-layout,
    .personalization-workspace {
        grid-template-columns: 1fr;
    }

    .dashboard-side,
    .tracking-widgets-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .interventions-overview {
        grid-template-columns: 1fr;
    }

    .dossier-detail-grid {
        grid-template-columns: 1fr;
    }

    .admin-kpi-grid,
    .kpi-grid {
        grid-template-columns: repeat(5, minmax(105px, 1fr));
    }

    .report-summary {
        grid-template-columns: repeat(4, minmax(120px, 1fr));
    }

    .report-summary-intro {
        grid-column: 1 / -1;
        border-bottom: 1px solid #e2e8f0;
    }

    .report-filter-grid {
        grid-template-columns: minmax(220px, 2fr) repeat(2, minmax(145px, 1fr));
    }

    .report-search-field {
        grid-column: span 2;
    }

    .report-filter-actions {
        justify-content: flex-end;
    }

    .report-card {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .report-card-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: flex-end;
        padding-top: 2px;
    }
}

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

    .app-sidebar {
        position: fixed;
        z-index: 30;
        width: min(320px, 86vw);
        transform: translateX(-102%);
        transition: transform .2s ease;
    }

    .sidebar-backdrop {
        position: fixed;
        z-index: 20;
        inset: 0;
        display: block;
        border: 0;
        background: rgba(2, 18, 46, .38);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
    }

    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        margin: 0 0 14px;
        border: 1px solid rgba(255, 255, 255, .35);
        border-radius: 6px;
        background: rgba(255, 255, 255, .08);
        color: #fff;
        font: inherit;
        font-weight: 700;
    }

    body.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: inline-flex;
    }

    .app-topbar {
        padding: 0 22px;
    }

    .topbar-help span,
    .user-copy {
        display: none;
    }

    .page-header,
    .dashboard-layout,
    .dashboard-full,
    .dashboard-secondary-grid,
    .kpi-grid,
    .admin-dashboard-layout,
    .admin-tracking-page,
    .agency-detail-header,
    .agency-detail-tabs,
    .agency-detail-grid,
    .personalization-heading,
    .personalization-workspace,
    .table-card,
    .security-banner,
    .app-footer,
    .app-main > .alert {
        margin-left: 22px;
        margin-right: 22px;
    }

    .login-split {
        grid-template-columns: 1fr;
    }

    .login-hero {
        min-height: auto;
        padding: 46px 34px;
    }

    .login-hero-title {
        margin-top: 44px;
    }

    .login-form-area {
        padding: 34px;
    }

    .login-footer {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

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

    .reports-page {
        margin-left: 22px;
        margin-right: 22px;
    }

    .report-detail-page {
        margin-left: 22px;
        margin-right: 22px;
    }

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

    .report-search-field {
        grid-column: 1 / -1;
    }

    .report-filter-actions {
        justify-content: flex-end;
    }
}

@media (max-width: 720px) {
    .kpi-grid,
    .admin-kpi-grid,
    .dashboard-secondary-grid,
    .dashboard-side,
    .tracking-widgets-grid,
    .agency-detail-grid,
    .personalization-controls,
    .admin-bottom-grid,
    .mini-extranet-preview,
    .import-row,
    .filters-row,
    .dossier-upload-form,
    .financial-document-upload-form {
        grid-template-columns: 1fr;
    }

    .dossier-document-card {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .dossier-document-preview {
        width: 64px;
        height: 64px;
    }

    .personalization-heading,
    .personalization-actions,
    .agency-detail-header,
    .agency-actions,
    .login-options {
        align-items: stretch;
        flex-direction: column;
    }

    .details-list {
        grid-template-columns: 1fr;
    }

    .dossier-detail-summary .details-list {
        grid-template-columns: 1fr;
    }

    .interventions-overview {
        margin-left: 22px;
        margin-right: 22px;
    }

    .login-card {
        padding: 34px 24px;
    }

    .legal-modal {
        padding: 12px;
        align-items: end;
    }

    .legal-modal-panel {
        max-height: calc(100vh - 24px);
        border-radius: 16px 16px 0 0;
    }

    .legal-modal-topbar,
    .legal-modal-body {
        padding: 18px;
    }

    .legal-modal-topbar h2,
    .legal-modal-intro h3 {
        font-size: 22px;
    }

    .legal-modal-close {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .login-hero-title h1 {
        font-size: 42px;
    }

    .page-header h1 {
        font-size: 26px;
    }

    .legal-shell {
        width: min(100% - 22px, 1040px);
        padding: 18px 0;
    }

    .legal-header,
    .legal-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .legal-hero {
        padding: 30px 0 20px;
    }

    .legal-hero h1 {
        font-size: 30px;
    }

    .legal-list div {
        grid-template-columns: 1fr;
        gap: 2px;
    }

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

    .report-summary-intro {
        grid-column: 1 / -1;
    }

    .report-stat:nth-child(even) {
        border-left: 0;
    }

    .report-stat {
        min-height: 96px;
        border-top: 1px solid #e2e8f0;
    }

    .report-toolbar-heading,
    .report-results-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .report-documents-link {
        padding-block: 5px;
    }

    .report-filter-grid {
        grid-template-columns: 1fr;
    }

    .report-search-field {
        grid-column: auto;
    }

    .report-filter-actions,
    .report-card-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

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

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

    .admin-report-filters {
        grid-template-columns: 1fr;
    }

    .admin-report-form,
    .admin-report-form.compact {
        grid-template-columns: 1fr;
    }

    .admin-report-form .span-2,
    .admin-report-content-field,
    .admin-report-form-actions {
        grid-column: auto;
    }

    .dossier-tabs,
    .dossier-agency-tabs,
    .dossier-report-workspace,
    .dossier-published-reports {
        margin-left: 22px;
        margin-right: 22px;
    }

    .dossier-report-item,
    .dossier-published-report-header {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .dossier-report-item-actions {
        justify-content: flex-start;
    }

    .admin-report-entry {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .agent-profile-summary,
    .account-review-summary {
        grid-template-columns: 1fr;
    }

    .account-review-summary dl {
        grid-template-columns: 1fr;
    }

    .account-status-actions,
    .account-status-actions .button,
    .agent-permissions-form .form-actions,
    .agent-permissions-form .form-actions .button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .reports-page {
        gap: 16px;
        margin-left: 14px;
        margin-right: 14px;
    }

    .report-detail-page {
        margin-left: 14px;
        margin-right: 14px;
    }

    .report-summary-intro,
    .report-toolbar {
        padding: 18px;
    }

    .report-summary-intro {
        align-items: flex-start;
    }

    .report-stat {
        padding: 16px;
    }

    .report-card {
        grid-template-columns: 50px minmax(0, 1fr);
        gap: 12px;
        padding: 14px;
    }

    .report-file-mark {
        width: 50px;
        min-height: 62px;
    }

    .report-card-title-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }

    .report-meta,
    .report-filter-actions,
    .report-card-actions {
        grid-template-columns: 1fr;
    }

    .report-detail-header,
    .report-detail-content {
        padding: 20px 18px;
    }

    .report-detail-title {
        align-items: flex-start;
    }

    .report-detail-title h2 {
        font-size: 21px;
    }

    .report-detail-meta {
        grid-template-columns: 1fr;
    }

    .dossier-tabs,
    .dossier-agency-tabs,
    .dossier-report-workspace,
    .dossier-published-reports {
        margin-left: 14px;
        margin-right: 14px;
    }

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

    .dossier-tabs a {
        justify-content: center;
    }

    .dossier-report-context,
    .dossier-published-report-header dl {
        grid-template-columns: 1fr;
    }

    .dossier-report-item,
    .dossier-published-report-header,
    .dossier-published-report-content,
    .dossier-published-report-photos,
    .report-detail-photos {
        padding: 18px;
    }

    .dossier-report-item-heading,
    .admin-report-entry-copy {
        align-items: flex-start;
        flex-direction: column;
    }

    .dossier-report-item-actions,
    .dossier-report-item-actions .button,
    .dossier-report-item-actions form,
    .dossier-report-item-actions form .button,
    .admin-report-entry > .button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .report-card {
        transition: none;
    }
}
.pdf-private-asset-preview {
    display: block;
    max-width: 220px;
    max-height: 120px;
    object-fit: contain;
    margin: .75rem 0;
}

/* Navigation interne réutilisable : les rubriques restent des URL autonomes. */
.tabs.section-tabs {
    max-width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 2px 2px 8px;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
}

.tabs.section-tabs a {
    flex: 0 0 auto;
    justify-content: center;
    min-height: 44px;
}

.tabs a:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .34);
    outline-offset: 3px;
}

.pdf-settings-page {
    min-width: 0;
    margin: 0 42px 34px;
}

.pdf-settings-page > .section-tabs {
    margin-bottom: 14px;
}

.pdf-settings-panel {
    min-width: 0;
    margin-bottom: 0;
}

.pdf-settings-panel .form-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pdf-private-assets-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.pdf-private-asset-card {
    display: flex;
    min-width: 0;
    min-height: 360px;
    flex-direction: column;
    padding: 20px;
}

.pdf-private-asset-card h3,
.pdf-private-asset-current p {
    margin-top: 0;
}

.pdf-private-asset-current {
    display: grid;
    grid-template-columns: minmax(120px, 220px) minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    margin: 8px 0 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--card-radius);
    background: #f8fafc;
}

.pdf-private-asset-current .pdf-private-asset-preview {
    width: 100%;
    margin: 0;
}

.pdf-private-asset-current p {
    overflow-wrap: anywhere;
}

.pdf-private-asset-remove {
    margin-bottom: 4px;
}

.pdf-private-asset-form {
    display: grid;
    gap: 14px;
    margin-top: auto;
    padding-top: 18px;
}

.pdf-private-asset-form label {
    min-width: 0;
}

.pdf-private-asset-form input {
    min-width: 0;
    max-width: 100%;
}

.pdf-private-asset-form input[type="file"] {
    min-height: 48px;
    padding: 9px;
    overflow: hidden;
    background: #fff;
}

.pdf-private-asset-form small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}

.pdf-private-asset-form .button {
    justify-self: start;
}

.pdf-private-asset-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pdf-private-asset-actions .button.is-disabled {
    pointer-events: none;
    opacity: .5;
}

@media (max-width: 980px) {
    .pdf-settings-page {
        margin-right: 22px;
        margin-left: 22px;
    }
}

@media (max-width: 820px) {
    .pdf-settings-panel .form-grid.compact,
    .pdf-private-assets-grid,
    .pdf-private-asset-current {
        grid-template-columns: 1fr;
    }

    .pdf-private-asset-card {
        min-height: 0;
    }
}

@media (max-width: 480px) {
    .pdf-settings-page {
        margin-right: 14px;
        margin-left: 14px;
    }

    .pdf-settings-page > .section-tabs {
        flex-wrap: wrap;
        overflow-x: visible;
    }

    .pdf-settings-panel,
    .pdf-private-asset-card {
        padding: 16px;
    }

    .pdf-private-asset-actions,
    .pdf-private-asset-form .button,
    .pdf-private-asset-actions .button,
    .pdf-private-asset-remove .button {
        width: 100%;
    }
}

/* Listes métier denses : une ligne lisible, le texte complet reste dans l’infobulle. */
.filters-row.archive-search {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
}

.archive-search-main {
    min-width: 0;
}

.compact-data-list {
    scrollbar-gutter: stable;
}

.compact-data-list table,
.compact-data-table {
    table-layout: fixed;
    font-size: 12px;
}

.compact-data-list table {
    min-width: 1120px;
}

.compact-data-table {
    min-width: 1140px;
}

.compact-data-table.archive-table {
    min-width: 1060px;
}

.intervention-list-table table {
    min-width: 1040px;
}

.compact-data-list th,
.compact-data-list td,
.compact-data-table th,
.compact-data-table td {
    height: 42px;
    padding: 5px 8px;
    white-space: nowrap;
}

.compact-data-list th,
.compact-data-table th {
    font-size: 11px;
}

.compact-cell {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

a.compact-cell {
    color: #005eea;
    font-weight: 750;
}

.compact-cell:focus-visible {
    border-radius: 3px;
    outline: 3px solid rgba(37, 99, 235, .34);
    outline-offset: 2px;
}

.compact-reference-title {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: 6px;
}

.compact-reference-title strong {
    flex: 0 0 auto;
}

.compact-reference-title span {
    min-width: 0;
    overflow: hidden;
    color: #52617a;
    font-weight: 600;
    text-overflow: ellipsis;
}

.archive-table col.archive-agency {
    width: 140px;
}

.archive-table col.archive-dossier {
    width: 190px;
}

.archive-table col.archive-address {
    width: 190px;
}

.archive-table col.archive-person {
    width: 105px;
}

.archive-table col.archive-agent {
    width: 140px;
}

.archive-table col.archive-status {
    width: 95px;
}

.archive-table col.archive-date {
    width: 95px;
}

.dossier-list-item.validation-item {
    display: block;
    min-width: 0;
    padding: 10px 12px;
}

.dossier-list-item .row-title {
    min-width: 0;
    gap: 8px;
}

.dossier-list-item .row-title h3 {
    min-width: 0;
    font-size: 14px;
    line-height: 1.25;
}

.dossier-list-item .row-title h3 a {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.dossier-list-item .status-pill,
.dossier-list-item .priority-pill {
    flex: 0 0 auto;
    min-height: 22px;
    padding: 1px 8px;
    font-size: 11px;
}

.dossier-list-meta,
.dossier-list-description {
    min-width: 0;
    margin: 4px 0 0;
    overflow: hidden;
    color: #52617a;
    font-size: 12px;
    line-height: 1.25;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.dossier-list-description {
    color: #374151;
}

/* Tableau de bord fusionné : dossiers d’abord, alertes techniques ensuite. */
.admin-tracking-page,
.tracking-table-card,
.monitoring-kpi-grid,
.monitoring-panels-grid {
    min-width: 0;
}

.admin-tracking-page {
    grid-template-columns: minmax(0, 1fr);
}

.admin-tracking-page > .monitoring-kpi-grid {
    margin: 0;
}

.tracking-filter {
    grid-template-columns: minmax(220px, 320px) auto auto;
    align-items: end;
    justify-content: start;
}

.compact-data-list .tracking-global-table {
    min-width: 1000px;
}

.tracking-global-table col.tracking-reference {
    width: 115px;
}

.tracking-global-table col.tracking-dossier {
    width: 170px;
}

.tracking-global-table col.tracking-agency {
    width: 150px;
}

.tracking-global-table col.tracking-nature {
    width: 105px;
}

.tracking-global-table col.tracking-address {
    width: 185px;
}

.tracking-global-table col.tracking-owner {
    width: 110px;
}

.tracking-global-table col.tracking-date {
    width: 105px;
}

.tracking-global-table col.tracking-status {
    width: 80px;
}

.monitoring-panels-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.monitoring-panel {
    min-width: 0;
    margin: 0;
}

.monitoring-panel .panel-header {
    align-items: flex-start;
}

.monitoring-panel .panel-header p {
    margin-top: 4px;
}

.monitoring-errors-panel {
    grid-column: 1 / -1;
}

.compact-data-list .monitoring-table {
    min-width: 460px;
}

.compact-data-list .application-error-table {
    min-width: 760px;
}

.monitoring-count,
.reminder-count-badge {
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    min-height: 22px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #edf2f8;
    color: #13264a;
    font-size: 11px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

/* Relances agence et liste administrative. */
.reminder-workflow-card {
    display: grid;
    gap: 16px;
    margin-top: 20px;
    padding: 18px;
    border: 1px solid #dce5f0;
    border-radius: 8px;
    background: #f8fafc;
}

.admin-reminder-workflow {
    margin-top: 0;
    margin-bottom: 24px;
}

.reminder-workflow-heading,
.reminder-history-heading,
.reminder-admin-action {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.reminder-workflow-heading > div,
.reminder-history-heading > div {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.reminder-workflow-heading > div > strong {
    color: #061b3a;
    font-size: 17px;
}

.reminder-workflow-heading p,
.reminder-admin-action p,
.reminder-history-heading span,
.reminder-current-summary p,
.reminder-response p,
.reminder-history-message {
    margin: 0;
}

.reminder-workflow-heading p,
.reminder-admin-action p,
.reminder-history-heading span {
    color: #52617a;
    font-size: 13px;
    line-height: 1.45;
}

.reminder-current-summary {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid #dce5f0;
    border-radius: 7px;
    background: #fff;
}

.reminder-current-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    color: #52617a;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.reminder-current-summary > p,
.reminder-history-message,
.reminder-response p {
    color: #13264a;
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.reminder-state-note {
    padding: 10px 12px;
    border-left: 4px solid #94a3b8;
    border-radius: 4px;
    background: #f1f5f9;
    color: #334155;
    font-size: 13px;
    line-height: 1.45;
}

.reminder-state-pending {
    border-left-color: #d97706;
    background: #fff7e6;
    color: #71440b;
}

.reminder-state-acknowledged {
    border-left-color: #2563eb;
    background: #eff6ff;
    color: #173b7a;
}

.reminder-state-resolved {
    border-left-color: #2f855a;
    background: #edf9f1;
    color: #185c3b;
}

.reminder-response,
.reminder-history-response {
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid #bde3ca;
    border-radius: 6px;
    background: #f2fbf5;
}

.reminder-response > strong,
.reminder-history-response > strong {
    color: #185c3b;
    font-size: 13px;
}

.reminder-admin-action {
    align-items: center;
    padding: 14px;
    border: 1px solid #bfd5fb;
    border-radius: 7px;
    background: #f4f8ff;
}

.reminder-admin-action > div {
    display: grid;
    gap: 3px;
}

.reminder-resolution-form {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid #bfd5fb;
    border-radius: 7px;
    background: #fff;
}

.reminder-resolution-form label {
    display: grid;
    gap: 6px;
}

.reminder-resolution-form textarea,
.agency-reminder-form textarea {
    width: 100%;
    min-width: 0;
    resize: vertical;
}

.reminder-history-details {
    border-top: 1px solid #dce5f0;
    padding-top: 10px;
}

.reminder-history-details > summary {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    color: #13264a;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

.reminder-history-details > summary::-webkit-details-marker {
    display: none;
}

.reminder-history-details > summary::after {
    content: "+";
    display: inline-grid;
    flex: 0 0 28px;
    place-items: center;
    min-width: 28px;
    min-height: 28px;
    margin-left: auto;
    border-radius: 999px;
    background: #e8eef6;
    color: #13264a;
    font-size: 17px;
    line-height: 1;
}

.reminder-history-details[open] > summary::after {
    content: "−";
}

.reminder-history-details > summary:focus-visible {
    border-radius: 4px;
    outline: 3px solid rgba(37, 99, 235, .34);
    outline-offset: 2px;
}

.reminder-history-list {
    display: grid;
    gap: 12px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.reminder-history-item {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid #dce5f0;
    border-radius: 7px;
    background: #fff;
}

.reminder-history-heading strong {
    color: #13264a;
    font-size: 13px;
}

.reminder-history-progress {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    color: #52617a;
    font-size: 12px;
}

.agency-reminder-box {
    display: grid;
    grid-template-columns: minmax(220px, .8fr) minmax(320px, 1.4fr);
    gap: 18px;
    align-items: end;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
}

.agency-reminder-copy {
    display: grid;
    gap: 4px;
}

.agency-reminder-copy small,
.reminder-cooldown {
    color: #52617a;
    font-size: 12px;
    line-height: 1.4;
}

.agency-reminder-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.agency-reminder-form label {
    min-width: 0;
}

.agency-reminder-form label span {
    display: block;
    margin-bottom: 5px;
    color: #13264a;
    font-size: 12px;
    font-weight: 750;
}

.agency-reminder-form input,
.agency-reminder-form textarea {
    min-width: 0;
    width: 100%;
}

.reminder-filters {
    grid-template-columns: 190px 180px minmax(260px, 1fr) auto auto;
    align-items: end;
}

.reminder-search-field {
    min-width: 0;
}

.compact-data-list .reminder-table {
    min-width: 1040px;
}

.reminder-table col.reminder-reference {
    width: 105px;
}

.reminder-table col.reminder-dossier {
    width: 115px;
}

.reminder-table col.reminder-agency {
    width: 120px;
}

.reminder-table col.reminder-address {
    width: 120px;
}

.reminder-table col.reminder-message {
    width: 140px;
}

.reminder-table col.reminder-author {
    width: 105px;
}

.reminder-table col.reminder-date {
    width: 105px;
}

.reminder-table col.reminder-count {
    width: 68px;
}

.reminder-table col.reminder-status {
    width: 90px;
}

.reminder-table col.reminder-response {
    width: 140px;
}

@media (max-width: 980px) {
    .archive-search-main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .monitoring-panels-grid,
    .agency-reminder-box {
        grid-template-columns: minmax(0, 1fr);
    }

    .monitoring-errors-panel {
        grid-column: auto;
    }

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

@media (max-width: 640px) {
    .archive-search-main {
        grid-template-columns: minmax(0, 1fr);
    }

    .tracking-filter,
    .reminder-filters,
    .agency-reminder-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .reminder-workflow-heading,
    .reminder-history-heading,
    .reminder-admin-action {
        align-items: stretch;
        flex-direction: column;
    }

    .tracking-filter .button,
    .reminder-filters .button,
    .agency-reminder-form .button,
    .reminder-admin-action .button,
    .reminder-resolution-form .button {
        width: 100%;
    }
}
