:root { color-scheme: light; --abis-blue: #0462ba; --abis-cyan: #00B0FF; --abis-ink: #17223d; }
body { margin: 0; background: #f3f6fa; color: var(--abis-ink); font-family: system-ui, sans-serif; font-size: 1rem; line-height: 1.6; }
.brand-bar { background: #1E1739; border-bottom: 4px solid var(--abis-cyan); }
.brand-inner { display: flex; align-items: center; justify-content: center; gap: 1rem; max-width: 72rem; padding: 1.2rem 1.5rem; margin: auto; color: white; }
.brand-inner img { display: block; max-width: 100%; }
.auth-card { max-width: 38rem; margin: 3rem auto; padding: clamp(1.25rem, 5vw, 2.5rem); border: 1px solid #dbe4ef; border-radius: 1rem; background: #fff; box-shadow: 0 12px 40px #17223d0a; }
h1 { font-size: clamp(1.65rem, 5vw, 2rem); margin-bottom: 1.3rem; font-weight: 700; letter-spacing: -.025em; }
.account-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; border-bottom: 1px solid #e2e8ef; margin-bottom: 1.5rem; padding-bottom: .7rem; }
.form-control, .form-select { min-height: 3rem; font-size: 1rem; }
.form-text { font-size: .9rem; color: #52617a; }
.btn { display: inline-flex; align-items: center; justify-content: center; text-align: center; min-height: 2.75rem; }
.btn[hidden] { display: none !important; }
a { color: #045da9; }
.secret { display: block; padding: 1rem; margin-top: .5rem; border: 1px solid #c6d8eb; border-radius: .4rem; background: #edf5fd; color: #17223d; overflow-wrap: anywhere; user-select: all; }
.recovery-list { list-style: none; padding: 1rem; background: #edf5fd; border-radius: .5rem; }
.recovery-list li { padding: .25rem; }
.recovery-list code { color: #17223d; font-size: .95rem; }
.content-wide { max-width: 72rem; }
.section-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.user-table { min-width: 44rem; }
.user-table th, .user-table td { padding: 1rem .75rem; }
.user-table small { font-size: .875rem; }
.user-table .badge { font-weight: 500; font-size: .875rem; }
.user-actions { display: flex; flex-direction: column; gap: .5rem; }
.admin-confirmation { margin: 1.5rem 0; padding: 1rem; border: 1px solid #c6d8eb; border-radius: .5rem; background: #f6faff; }
.role-help { border-top: 1px solid #dbe4ef; padding-top: 1rem; }
@media (max-width: 640px) { .auth-card { margin: 1rem; } .brand-inner { padding: 1rem; } .brand-inner img { width: 120px; height: auto; } }

.client-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.client-details dd { overflow-wrap: anywhere; }
.months-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: .75rem; }
.month-summary { padding: .9rem; background: #edf6ff; border-radius: .6rem; }
.month-summary span, .month-summary strong { display: block; }
.month-summary span { color: #495b70; font-size: .9rem; }
.empty-state { padding: 1.5rem; background: #f4f7fa; border-radius: .6rem; color: #495b70; }
h1 { overflow-wrap: anywhere; }
.ticket-table { min-width: 58rem; }
.ticket-table th, .ticket-table td { overflow-wrap: anywhere; max-width: 22rem; }
.intervention-card { border: 1px solid #dbe4ef; border-radius: .75rem; padding: 1.25rem; margin-bottom: 1rem; }
.dashboard-summary { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 1rem; margin: 1.5rem 0; }
.dashboard-summary strong { font-size: 1.65rem; }
.dashboard-section { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid #dbe4ef; }
.chart-scroll { overflow-x: auto; }
.bar-chart { display: block; max-width: none; }
.chart-legend { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-top: 1rem; }
.chart-legend span { overflow-wrap: anywhere; }
.pie-chart { width: 100%; max-width: 280px; display: block; margin: auto; }
.client-chart-layout { display: grid; grid-template-columns: minmax(180px,280px) minmax(0,1fr); gap: 1.5rem; align-items: start; }
.dashboard-ticket-table { min-width: 650px; }
.dashboard-ticket-table th, .dashboard-ticket-table td { overflow-wrap: anywhere; max-width: 24rem; }
@media (max-width: 640px) { .client-chart-layout { grid-template-columns: minmax(0,1fr); } }
.accounting-table { min-width: 900px; }
.accounting-table th, .accounting-table td { max-width: 24rem; overflow-wrap: anywhere; }
.accounting-state-form { position: relative; display: flex; flex-wrap: wrap; gap: .5rem; min-width: 180px; }
.accounting-state-form .form-select { min-width: 180px; }

/* Navigation latérale : rail d’icônes sur ordinateur, volet en flux sur mobile. */
.app-layout { --sidebar-width: 17rem; padding-left: var(--sidebar-width); }
.sidebar-collapsed .app-layout { --sidebar-width: 5rem; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); display: flex; flex-direction: column; padding: 1.1rem .8rem; background: #1E1739; color: #fff; overflow-y: auto; z-index: 20; }
.sidebar-brand { display: flex; align-items: center; justify-content: center; min-height: 4.5rem; margin-bottom: 1rem; }
.sidebar-brand img { display: block; max-width: 100%; height: auto; }
.sidebar-monogram { display: none; width: 44px; }
.sidebar-toggle, .sidebar-link { display: flex; align-items: center; gap: .8rem; width: 100%; min-height: 3rem; padding: .75rem .85rem; border: 0; border-radius: .6rem; background: transparent; color: #fff; text-decoration: none; text-align: left; line-height: 1.35; }
.sidebar-toggle { margin-top: 1.2rem; margin-bottom: .35rem; color: #d7edff; }
.sidebar-toggle[hidden] { display: none; }
.sidebar-menu { display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.nav-icon { width: 1.3rem; height: 1.3rem; flex: 0 0 1.3rem; }
.nav-label { overflow-wrap: anywhere; }
.sidebar-link:hover, .sidebar-toggle:hover { background: #ffffff18; color: white; }
.sidebar-link[aria-current] { background: white; color: #064d8d; box-shadow: 0 3px 12px #00356833; }
.sidebar-logout { margin: 0; padding: 0; }
.sidebar :focus-visible { outline: 3px solid #7ddcff; outline-offset: 2px; }
.app-layout .auth-card { max-width: 48rem; margin: 2rem auto; width: calc(100% - 3rem); padding: clamp(1.25rem, 3vw, 2.5rem); }
.app-layout .content-wide { max-width: 76rem; }
.sidebar-collapsed .sidebar .nav-label { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sidebar-collapsed .sidebar-brand img { display: none; }
.sidebar-brand a { color: white; text-decoration: none; }
.sidebar-collapsed .sidebar-monogram { display: block; }
.sidebar-collapsed .sidebar-monogram img { display: block; }
.skip-link { position: fixed; top: .5rem; left: 1rem; transform: translateY(-200%); padding: .5rem 1rem; background: white; z-index: 30; }
.skip-link:focus { transform: translateY(0); }
.settings-tabs { display: flex; flex-wrap: wrap; gap: .5rem; border-bottom: 1px solid #dbe4ef; padding-bottom: .8rem; margin-bottom: 1.5rem; }
.settings-tabs a { padding: .6rem 1rem; border-radius: .5rem; text-decoration: none; }
.settings-tabs a[aria-current] { background: #edf6ff; font-weight: 700; }
@media (max-width: 767px) {
    .app-layout, .sidebar-collapsed .app-layout { padding-left: 0; }
    .sidebar { position: static; width: 100%; padding: .75rem 1rem; display: grid; grid-template-columns: minmax(0,1fr) auto; }
    .sidebar-brand { justify-content: start; margin: 0; min-height: 3rem; }
    .sidebar-brand img { width: 125px; }
    .sidebar-toggle { width: auto; margin: 0; grid-column: 2; grid-row: 1; }
    .sidebar-toggle .nav-label { display: none; }
    .sidebar-menu { grid-column: 1 / -1; margin-top: .8rem; }
    .sidebar-logout { padding-top: .5rem; grid-column: 1 / -1; }
    .sidebar-collapsed .sidebar-menu, .sidebar-collapsed .sidebar-logout { display: none; }
    .sidebar-collapsed .sidebar-brand a { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
    .sidebar-collapsed .sidebar-monogram { display: none; }
    .sidebar-collapsed .sidebar-brand img { display: block; }
    .app-layout .auth-card { margin: 1rem; width: calc(100% - 2rem); padding: 1.25rem; }
}

/* Tableau de bord compact : deux graphiques côte à côte sur ordinateur. */
.dashboard-page h1 { margin-bottom: .2rem; }
.dashboard-intro { color: #64748b; font-size: .9rem; margin-bottom: 1rem; }
.dashboard-page .dashboard-summary { grid-template-columns: repeat(4,minmax(0,1fr)); gap: .8rem; margin: 1rem 0; }
.dashboard-summary .month-summary { border: 1px solid #dce8f3; padding: .85rem 1rem; text-decoration: none; color: #17223d; }
.dashboard-summary .month-summary span { font-size: .85rem; }
.dashboard-summary .month-summary span span { display: inline; float: right; }
.dashboard-summary small { display: block; color: #52617a; font-size: .75rem; }
.dashboard-summary .summary-open, .dashboard-summary .summary-mine { background: #eaf3ff; border-color: #b7d7ff; }
.summary-open strong, .summary-mine strong { color: #1260bb; }
.dashboard-summary a:hover { box-shadow: 0 4px 14px #17223d18; border-color: #0462ba; }
.dashboard-summary a:focus-visible { outline: 3px solid #0462ba; outline-offset: 3px; }
.dashboard-charts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.dashboard-panel { min-width: 0; padding: 1rem; border: 1px solid #dbe4ef; border-radius: .8rem; background: linear-gradient(180deg,#f8fbff,white 35%); }
.dashboard-panel h2 { font-size: 1.08rem; font-weight: 700; margin-bottom: .25rem; }
.chart-subtitle { color: #64748b; font-size: .8rem; margin-bottom: .6rem; }
.dashboard-panel .bar-chart { width: 100%; height: auto; max-width: 100%; }
.dashboard-panel .bar-chart text { font-size: 16px; }
.dashboard-panel .chart-legend { gap: .3rem .75rem; margin-top: .25rem; font-size: .78rem; }
.chart-legend svg, .client-chart-legend svg { flex-shrink: 0; }
.dashboard-panel .client-chart-layout { grid-template-columns: minmax(0,1.35fr) minmax(0,1fr); gap: .6rem; align-items: center; min-height: 220px; }
.dashboard-panel .pie-chart { width: 100%; max-width: 300px; }
.client-chart-legend { list-style: none; margin: 0; padding: 0; font-size: .8rem; }
.client-chart-legend li { padding: .3rem 0; }
.client-chart-legend li div { overflow-wrap: anywhere; line-height: 1.25; }
.client-chart-legend small { display: block; padding-left: 1.2rem; color: #64748b; font-size: .75rem; }
.chart-details { margin-top: .75rem; font-size: .8rem; }
.chart-details summary { color: #045da9; }
@media (max-width: 1100px) {
    .dashboard-charts { grid-template-columns: minmax(0,1fr); }
    .dashboard-panel .pie-chart { max-width: 300px; }
}
@media (max-width: 767px) {
    .dashboard-page .dashboard-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .dashboard-charts { grid-template-columns: minmax(0,1fr); }
    .dashboard-panel .client-chart-layout { grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); }
}

@media (max-width: 767px) { .dashboard-panel .bar-chart text { font-size: 24px; } }

/* Même barre compacte pour les filtres de tickets et de comptabilité. */
.filter-bar { display: grid; align-items: end; gap: .4rem; margin-bottom: 1rem; }
.filter-bar-tickets { grid-template-columns: 5.5rem minmax(0,1fr) 6.4rem 6.8rem 6.8rem minmax(0,1fr) minmax(0,1fr) 5.5rem 7rem auto; }
.filter-bar-accounting { grid-template-columns: 5.5rem minmax(0,1fr) 6.4rem 6.8rem 6.8rem minmax(0,1fr) minmax(0,1fr) 6.5rem auto; }
.filter-bar-clients { grid-template-columns: minmax(0,1fr) minmax(0,2fr) minmax(0,1.5fr) minmax(0,1fr) auto; }
.filter-field { min-width: 0; }
.filter-bar .form-label { display: block; margin-bottom: .25rem; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.filter-bar .form-control, .filter-bar .form-select { width: 100%; min-width: 0; min-height: 2.4rem; height: 2.4rem; padding: .35rem .45rem; font-size: .8rem; }
.filter-bar .form-select { padding-right: 1.5rem; background-position: right .4rem center; background-size: 12px 9px; }
.filter-bar .btn { min-height: 2.4rem; padding: .35rem .65rem; font-size: .8rem; }
.filter-mine { position: relative; min-height: 2.4rem; display: flex; align-items: center; gap: .3rem; font-size: .75rem; line-height: 1.2; }
.filter-mine .form-check-input { flex: 0 0 1rem; margin: 0; }
.filter-mine label { cursor: pointer; }
@media (max-width: 1100px) { .filter-bar { grid-template-columns: repeat(4,minmax(0,1fr)); } }
@media (max-width: 900px) { .filter-bar { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; } }
@media (max-width: 767px) {
    .filter-bar .form-control, .filter-bar .form-select { font-size: 1rem; height: 2.75rem; }
    .filter-bar .btn, .filter-mine { position: relative; min-height: 2.75rem; }
}

/* Apparence : clair par défaut, sombre choisi explicitement depuis le compte. */
.btn-primary { --bs-btn-bg: #00B0FF; --bs-btn-border-color: #00B0FF; --bs-btn-color: #102238; --bs-btn-hover-bg: #33c0ff; --bs-btn-hover-border-color: #33c0ff; --bs-btn-hover-color: #102238; --bs-btn-active-bg: #00B0FF; --bs-btn-active-border-color: #00B0FF; --bs-btn-active-color: #102238; }
.btn-outline-primary { --bs-btn-color: #06557b; --bs-btn-border-color: #00B0FF; --bs-btn-hover-bg: #00B0FF; --bs-btn-hover-border-color: #00B0FF; --bs-btn-hover-color: #102238; --bs-btn-active-bg: #00B0FF; --bs-btn-active-border-color: #00B0FF; --bs-btn-active-color: #102238; }
.theme-preference .btn[aria-pressed="true"] { background: #00B0FF; color: #102238; border-color: #00B0FF; font-weight: 700; }
.theme-preference [hidden] { display: none; }
html[data-bs-theme="dark"] { color-scheme: dark; --abis-ink: #f0edf9; --bs-body-bg: #1E1739; --bs-body-color: #f0edf9; --bs-secondary-color: #bdb5d2; --bs-secondary-rgb: 189, 181, 210; --bs-border-color: #4a405f; --bs-tertiary-bg: #302747; --bs-secondary-bg: #302747; --bs-emphasis-color: #fff; }
[data-bs-theme="dark"] body { background: #1E1739; color: #f0edf9; }
[data-bs-theme="dark"] .auth-card { background: #28203f; border-color: #493f5c; box-shadow: 0 12px 40px #0002; }
[data-bs-theme="dark"] .sidebar, [data-bs-theme="dark"] .brand-bar { background: #1E1739; border-right: 1px solid #493f5c; }
[data-bs-theme="dark"] .sidebar-link[aria-current] { background: #00B0FF; color: #102238; }
[data-bs-theme="dark"] a { color: #6bd1ff; }
[data-bs-theme="dark"] .sidebar a { color: #f0edf9; }
[data-bs-theme="dark"] .sidebar a[aria-current] { color: #102238; }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: #6bd1ff; }
[data-bs-theme="dark"] a.btn-primary { color: #102238; }
[data-bs-theme="dark"] a.btn-outline-primary:hover { color: #102238; }
[data-bs-theme="dark"] .form-text, [data-bs-theme="dark"] .dashboard-intro, [data-bs-theme="dark"] .chart-subtitle, [data-bs-theme="dark"] .client-chart-legend small, [data-bs-theme="dark"] .dashboard-summary small, [data-bs-theme="dark"] .month-summary span { color: #c5bdd8; }
[data-bs-theme="dark"] .month-summary, [data-bs-theme="dark"] .empty-state, [data-bs-theme="dark"] .admin-confirmation, [data-bs-theme="dark"] .secret, [data-bs-theme="dark"] .recovery-list, [data-bs-theme="dark"] .settings-tabs a[aria-current] { background: #352b4e; color: #f0edf9; border-color: #514666; }
[data-bs-theme="dark"] .recovery-list code { color: #e4ddf3; }
[data-bs-theme="dark"] .dashboard-summary .month-summary { color: #f0edf9; border-color: #514666; }
[data-bs-theme="dark"] .dashboard-summary .summary-open, [data-bs-theme="dark"] .dashboard-summary .summary-mine { background: #223551; }
[data-bs-theme="dark"] .summary-open strong, [data-bs-theme="dark"] .summary-mine strong { color: #6bd1ff; }
[data-bs-theme="dark"] .dashboard-panel { background: #28203f; border-color: #514666; }
[data-bs-theme="dark"] .bar-chart text { fill: #d8d1e8; }
[data-bs-theme="dark"] .bar-chart line { stroke: #514666; }
[data-bs-theme="dark"] .chart-details summary { color: #6bd1ff; }
[data-bs-theme="dark"] .account-bar, [data-bs-theme="dark"] .role-help, [data-bs-theme="dark"] .intervention-card, [data-bs-theme="dark"] .settings-tabs { border-color: #514666; }
[data-bs-theme="dark"] .skip-link { background: #28203f; color: #6bd1ff; }

/* Action de création alignée avec le titre des deux pages principales. */
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.3rem; }
.page-heading h1 { margin-bottom: 0; }
.page-heading .btn { display: inline-flex; align-items: center; justify-content: center; margin-left: auto; flex-shrink: 0; }
.dashboard-page .page-heading { margin-bottom: .2rem; }

/* Infobulles communes aux barres et secteurs, utilisables aussi au clavier. */
.chart-tooltip { position: fixed; z-index: 100; max-width: min(20rem, calc(100vw - 1rem)); padding: .65rem .85rem; border: 1px solid #70638f; border-radius: .5rem; background: #1E1739; color: #fff; box-shadow: 0 4px 16px #0003; font-size: .85rem; line-height: 1.5; white-space: pre-line; pointer-events: none; }
.chart-tooltip[hidden] { display: none; }
.chart-segment { cursor: default; }
.chart-segment:hover, .chart-segment:focus-visible { stroke: #1E1739; stroke-width: 2; filter: brightness(1.12); outline: none; }
[data-bs-theme="dark"] .chart-segment:hover, [data-bs-theme="dark"] .chart-segment:focus-visible { stroke: white; }

.dashboard-panel .bar-chart .bar-category { font-size: 13px; }

.intervention-form-section {
    border: 1px solid var(--bs-border-color);
    border-radius: .75rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}
.intervention-form-section > legend {
    float: none;
    width: auto;
    padding: 0 .4rem;
}


/* Création compacte : même formulaire, champs regroupés sans masquer les aides. */
#intervention-create-form .intervention-form-section { padding: .75rem 1rem; margin-bottom: .75rem; }
#intervention-create-form .intervention-form-section > legend { margin-bottom: .25rem; font-size: 1.05rem; }
#intervention-create-form .intervention-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: .65rem 1rem; }
#intervention-create-form .intervention-field { min-width: 0; }
#intervention-create-form .form-label { margin-bottom: .2rem; }
#intervention-create-form .form-control, #intervention-create-form .form-select { min-height: 2.5rem; margin-bottom: 0 !important; }
#intervention-create-form .form-text { margin: .25rem 0 0; font-size: .8rem; line-height: 1.35; }
#intervention-create-form textarea { resize: vertical; }
#intervention-create-form #intervention-details { margin-top: .65rem; }
#intervention-create-form #intervention-details[hidden] { display: none; }
#intervention-create-form .intervention-summary { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 2rem; }
#intervention-create-form .intervention-summary p { margin: 0; }
#intervention-create-form .intervention-summary .field-status { flex: 1 1 12rem; }
@media (min-width: 768px) {
    #intervention-create-form .intervention-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    #intervention-create-form .intervention-grid > .intervention-field { grid-column: span 3; }
    #intervention-create-form .field-title, #intervention-create-form .field-description { grid-column: 1 / -1 !important; }
    #intervention-create-form #intervention-details > .field-intervention_date,
    #intervention-create-form #intervention-details > .field-duration_minutes,
    #intervention-create-form #intervention-details > .field-technician_id { grid-column: span 2; }
}

#intervention-create-form #intervention-total { display: inline; vertical-align: baseline; }
#intervention-create-form .intervention-summary { align-items: baseline; }
#intervention-create-form .intervention-summary .field-status { display: flex; align-items: baseline; gap: .75rem; }
#intervention-create-form .intervention-summary .field-status .form-select { width: auto; flex: 1; }

.technician-picker { position: relative; }
.technician-picker > summary { cursor: pointer; list-style: none; white-space: normal; }
.technician-picker > summary::-webkit-details-marker { display: none; }
.technician-picker > summary:focus-visible { outline: 3px solid var(--abis-cyan); outline-offset: 2px; }
.technician-options { position: absolute; z-index: 20; left: 0; right: 0; max-height: 16rem; overflow-y: auto; padding: .5rem; border: 1px solid var(--bs-border-color); border-radius: .5rem; background: var(--bs-body-bg); color: var(--bs-body-color); box-shadow: 0 4px 12px #0002; }
.technician-options label { display: flex; align-items: baseline; gap: .6rem; padding: .45rem; cursor: pointer; }
.technician-options label:hover { background: var(--bs-tertiary-bg); }
.technician-options input { flex-shrink: 0; }

.signature-canvas { display: block; width: min(100%, 50rem); height: auto; border: 2px solid #786d94; border-radius: .5rem; background: #fff; touch-action: none; cursor: crosshair; }


/* Deux panneaux équilibrés, légende des interventions à gauche du tracé. */
.activity-chart-layout { display: grid; grid-template-columns: minmax(6.5rem,.8fr) minmax(0,2fr); gap: .75rem; align-items: center; min-height: 15rem; }
.activity-chart-legend { min-width: 0; }
.activity-chart-legend h3 { font-size: .76rem; font-weight: 700; margin: .75rem 0 .35rem; }
.activity-chart-legend h3:first-child { margin-top: 0; }
.activity-chart-legend ul { list-style: none; margin: 0; padding: 0; }
.activity-chart-legend li { display: flex; align-items: baseline; gap: .4rem; margin: .35rem 0; font-size: .78rem; line-height: 1.3; }
.activity-chart-legend li svg { flex: 0 0 12px; }
.activity-chart-legend li span { overflow-wrap: anywhere; }
.activity-chart-plot { min-width: 0; }
.dashboard-panel .client-chart-layout { min-height: 15rem; }
.dashboard-panel .bar-chart text { font-size: 21px; }
.dashboard-panel .bar-chart .bar-category { font-size: 19px; }
@media (max-width: 480px) {
    .activity-chart-layout { grid-template-columns: minmax(5.5rem,.75fr) minmax(0,1.5fr); gap: .35rem; }
    .activity-chart-legend li { font-size: .72rem; }
}

.sidebar-tooltip { position: fixed; z-index: 100; max-width: min(18rem, calc(100vw - 1rem)); padding: .55rem .8rem; border-radius: .5rem; background: #1E1739; color: #fff; border: 1px solid #695d85; box-shadow: 0 3px 12px #0003; font-size: .875rem; line-height: 1.4; overflow-wrap: anywhere; pointer-events: none; }
.sidebar-tooltip[hidden] { display: none; }

/* Listes compactes ; les libellés et titres restent affichés en entier. */
.ticket-table, .accounting-table { font-size: .875rem; line-height: 1.3; }
.ticket-table > :not(caption) > * > *, .accounting-table > :not(caption) > * > * { padding: .4rem .5rem; }
.accounting-state-form { gap: .15rem; min-width: 16.4rem; }
.accounting-state-headings, .accounting-state-form fieldset { display: grid; grid-template-columns: 3.6rem 3.6rem 5.6rem 3.6rem; align-items: center; gap: 0; width: 16.4rem; }
.accounting-state-headings { text-align: center; font-size: .75rem; white-space: nowrap; }
.accounting-state-form .form-check { margin-bottom: 0; min-height: 1.8rem; display: flex; align-items: center; justify-content: center; gap: .4rem; padding-left: 0; }
.accounting-state-form .form-check-input { float: none; margin: 0; flex-shrink: 0; }
.accounting-state-form .form-check-label { padding: .2rem 0; cursor: pointer; white-space: nowrap; }
.accounting-save-status:empty { display: none !important; }

/* Hiérarchie et champs clairement délimités dans la création d’intervention. */
#intervention-create-form .intervention-form-section { background: #f3f6fc; border: 1px solid #cbd7e8; }
#intervention-create-form .intervention-form-section > legend { color: #1E1739; font-weight: 700; }
#intervention-create-form .form-label { color: #263450; font-weight: 600; }
#intervention-create-form .form-control, #intervention-create-form .form-select { background-color: #fff; border: 1px solid #8699b6; box-shadow: 0 1px 2px #1e17390a; }
#intervention-create-form .form-control:focus, #intervention-create-form .form-select:focus, #intervention-create-form .technician-picker > summary:focus-visible { border-color: #0087c4; box-shadow: 0 0 0 3px #00b0ff30; }
[data-bs-theme="dark"] #intervention-create-form .intervention-form-section { background: #29213f; border-color: #615575; }
[data-bs-theme="dark"] #intervention-create-form .intervention-form-section > legend, [data-bs-theme="dark"] #intervention-create-form .form-label { color: #f0edf9; }
[data-bs-theme="dark"] #intervention-create-form .form-control, [data-bs-theme="dark"] #intervention-create-form .form-select { background-color: #1E1739; border-color: #8c7ba6; color: #f0edf9; }

/* Fiche compacte, sans tronquer les descriptions ni masquer les actions. */
.ticket-detail .section-toolbar { margin-bottom: .65rem; gap: .5rem; }
.ticket-overview, .ticket-detail .intervention-card, .ticket-reports { padding: .85rem 1rem; margin-bottom: .85rem; border: 1px solid #cbd7e8; border-radius: .65rem; background: #f3f6fc; }
.ticket-overview h2 { font-size: 1.15rem; margin-bottom: .65rem; }
.ticket-facts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .55rem 1rem; margin: 0; }
.ticket-facts dt { font-size: .78rem; color: #53627a; font-weight: 600; }
.ticket-facts dd { margin: .1rem 0 0; overflow-wrap: anywhere; }
.ticket-detail .intervention-card h3 { font-size: 1rem; }
.ticket-detail .intervention-card p, .ticket-reports p, .ticket-reports ul { margin-bottom: .45rem; }
.ticket-detail .intervention-card .client-notes { background: #fff; border-radius: .35rem; padding: .6rem .75rem; margin-bottom: .6rem !important; }
.ticket-detail .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 2.4rem; font-size: .875rem; }
[data-bs-theme="dark"] .ticket-overview, [data-bs-theme="dark"] .ticket-detail .intervention-card, [data-bs-theme="dark"] .ticket-reports { background: #29213f; border-color: #615575; }
[data-bs-theme="dark"] .ticket-facts dt { color: #c5bdd8; }
[data-bs-theme="dark"] .ticket-detail .intervention-card .client-notes { background: #1E1739; }
@media (max-width: 767px) { .ticket-facts { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 480px) { .ticket-facts { grid-template-columns: minmax(0,1fr); } }

.accounting-table td.accounting-states-cell { max-width: none; }

.back-button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.4rem; font-size: .875rem; }

/* Informations client et champs de saisie mieux délimités. */
.client-detail-panel, .client-edit-form { background: #f3f6fc; border: 1px solid #cbd7e8; border-radius: .65rem; padding: 1rem; margin-bottom: 1rem; }
.client-detail-panel .client-details { margin-bottom: 0; }
.client-detail-panel dt { color: #53627a; font-size: .875rem; }
.client-detail-panel .client-notes { background: #fff; padding: .65rem .75rem; border-radius: .35rem; }
.client-edit-form .form-label { font-weight: 600; color: #263450; }
.client-edit-form .form-control, .client-edit-form .form-select { background-color: #fff; border-color: #8699b6; }
.client-edit-form .form-control:focus, .client-edit-form .form-select:focus { border-color: #0087c4; box-shadow: 0 0 0 3px #00b0ff30; }
[data-bs-theme="dark"] .client-detail-panel, [data-bs-theme="dark"] .client-edit-form { background: #29213f; border-color: #615575; }
[data-bs-theme="dark"] .client-detail-panel dt { color: #c5bdd8; }
[data-bs-theme="dark"] .client-edit-form .form-label { color: #f0edf9; }
[data-bs-theme="dark"] .client-detail-panel .client-notes, [data-bs-theme="dark"] .client-edit-form .form-control, [data-bs-theme="dark"] .client-edit-form .form-select { background-color: #1E1739; color: #f0edf9; border-color: #8c7ba6; }

.months-grid .contract-month-none strong, .months-grid .contract-month-unset strong { color: #1260bb; }
.months-grid .contract-month-within strong { color: #157347; }
.months-grid .contract-month-over strong { color: #b42332; }
[data-bs-theme="dark"] .months-grid .contract-month-none strong, [data-bs-theme="dark"] .months-grid .contract-month-unset strong { color: #6bd1ff; }
[data-bs-theme="dark"] .months-grid .contract-month-within strong { color: #75dfa6; }
[data-bs-theme="dark"] .months-grid .contract-month-over strong { color: #ff9ca6; }

/* Encarts mensuels : couleur de toute la carte, en thèmes clair et sombre. */
.months-grid .contract-month-within { background: #d7f2e2; }
.months-grid .contract-month-over { background: #fbe0e3; }
.months-grid .contract-month-none, .months-grid .contract-month-unset { background: #e0efff; }
[data-bs-theme="dark"] .months-grid .contract-month-within { background: #194535; }
[data-bs-theme="dark"] .months-grid .contract-month-over { background: #582835; }
[data-bs-theme="dark"] .months-grid .contract-month-none,
[data-bs-theme="dark"] .months-grid .contract-month-unset { background: #233f60; }
.client-contract-indicator { display: inline-flex; align-items: center; justify-content: center; width: 1.7rem; height: 1.7rem; border: 1px solid currentColor; border-radius: .4rem; font-weight: 700; }

/* Champs courts de la création : largeur adaptée au contenu sur grand écran. */
@media (min-width: 768px) {
    #intervention-create-form .field-client_id .form-select { max-width: 22rem; }
    #intervention-create-form .field-contact_name .form-control { max-width: 18rem; }
    #intervention-create-form .field-type .form-select { max-width: 22rem; }
    #intervention-create-form .field-intervention_date .form-control { max-width: 11rem; }
    #intervention-create-form .field-duration_minutes .form-control { max-width: 10rem; }
    #intervention-create-form .intervention-summary .field-status { flex: 0 1 16rem; }
}

.login-page .brand-bar, .two-factor-page .brand-bar { border-bottom: 0; }
.login-page .auth-card { max-width: 30rem; width: calc(100% - 2rem); margin-left: auto; margin-right: auto; }

#intervention-create-form #client-search-controls { max-width: 22rem; margin-bottom: .35rem; }
#intervention-create-form #client-search-status:empty { display: none; }
@media (max-width: 767px) { #intervention-create-form #client-search-controls { max-width: none; } }
#intervention-create-form #client-search-controls { position: relative; }
#intervention-create-form #client_id[hidden] { display: none; }
.client-results { position: absolute; top: 2.5rem; left: 0; right: 0; max-height: 15rem; overflow-y: auto; z-index: 30; background: var(--bs-body-bg, #fff); color: var(--bs-body-color, #17223d); border: 1px solid #8699b6; border-radius: .4rem; box-shadow: 0 5px 15px #0002; }
.client-results [role="option"] { padding: .55rem .7rem; cursor: pointer; overflow-wrap: anywhere; }
.client-results [role="option"]:hover, .client-results [aria-selected="true"] { background: #00B0FF; color: #102238; }

/* Types repérables immédiatement dans les fiches comportant plusieurs lignes. */
.intervention-type-badge { display: inline-block; padding: .4rem .7rem; border-radius: .4rem; font-weight: 750; background: #dfe9ff; color: #183878; }
.intervention-type-badge.type-remote { background: #d0f2fb; color: #075569; }
.intervention-type-badge.type-onsite { background: #ede0ff; color: #542580; }

/* Ajout et modification de ligne : champs courts groupés, textes extensibles. */
.line-edit-form .intervention-form-section { padding: .75rem 1rem; margin-bottom: .5rem; background: var(--bs-tertiary-bg); border: 1px solid var(--bs-border-color); border-radius: .65rem; }
.line-edit-form legend { font-size: 1.05rem; margin-bottom: .4rem; }
.line-fields-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: .65rem 1rem; }
.line-edit-form .intervention-field { min-width: 0; }
.line-edit-form .form-label { margin-bottom: .2rem; }
.line-edit-form .form-control, .line-edit-form .form-select { margin-bottom: 0 !important; min-height: 2.5rem; }
.line-edit-form .form-text { margin: .25rem 0 0; font-size: .8rem; line-height: 1.35; }
.line-edit-form textarea { resize: vertical; }
@media (min-width: 768px) {
    .line-fields-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .line-edit-form .field-description, .line-edit-form .field-pdf { grid-column: 1 / -1; }
}
@media (min-width: 1200px) {
    .line-fields-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr) minmax(0, .8fr) minmax(0, 1.5fr); }
    .line-edit-form .field-description, .line-edit-form .field-sold_equipment { grid-column: span 2; }
}

/* Notification hors du tableau : aucun changement de largeur ou hauteur des lignes. */
.accounting-save-status:not(:empty) { position: fixed; right: 1rem; bottom: 1rem; z-index: 1050; width: max-content; max-width: min(28rem, calc(100vw - 2rem)); padding: .65rem 1rem; border: 1px solid var(--bs-border-color); border-radius: .5rem; background: var(--bs-body-bg); color: var(--bs-body-color); box-shadow: 0 3px 12px #0002; }

.client-inline-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: .65rem 1rem; margin-bottom: .75rem; }
.client-inline-form .client-form-field { min-width: 0; }
.client-inline-form .form-label { margin-bottom: .2rem; }
.client-inline-form .form-control, .client-inline-form .form-select { margin-bottom: 0 !important; }
@media (min-width: 768px) {
    .client-inline-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .client-inline-grid .client-form-field:last-child { grid-column: 1 / -1; }
}

/* Colonnes stables pendant le chargement progressif, indépendantes des nouveaux noms. */
.clients-table, .ticket-table, .accounting-table { table-layout: fixed; }
.clients-table { min-width: 59rem; }
.ticket-table { min-width: 70rem; }
.accounting-table { min-width: 68.5rem; }
.clients-table th:nth-child(1), .ticket-table th:nth-child(4), .accounting-table th:nth-child(4) { width: 18rem; }
.clients-table th:nth-child(2), .clients-table th:nth-child(4) { width: 10rem; }
.clients-table th:nth-child(5), .clients-table th:nth-child(6) { width: 5rem; }
.ticket-table thead th:nth-child(1), .accounting-table thead th:nth-child(1) { width: 8rem; }
.ticket-table thead th:nth-child(2), .accounting-table thead th:nth-child(2) { width: 7rem; }
.ticket-table thead th:nth-child(3), .accounting-table thead th:nth-child(3),
.ticket-table thead th:nth-child(6), .accounting-table thead th:nth-child(6) { width: 5rem; }
.ticket-table thead th:nth-child(7) { width: 7rem; }
.accounting-table thead th:nth-child(5) { width: 8rem; }
.accounting-table thead th:nth-child(7) { width: 17.5rem; }
.clients-table td, .ticket-table td, .accounting-table td { overflow-wrap: anywhere; }
.client-name-truncated, .intervention-title-truncated { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Noms reliés directement au camembert ; défilement local sur petit écran. */
.dashboard-panel .client-chart-layout.client-chart-labelled { display: block; overflow-x: auto; }
.dashboard-panel .pie-chart.pie-chart-labelled { width: 100%; min-width: 580px; max-width: none; color: var(--bs-body-color); }
.pie-chart-labelled a { color: inherit; }
.pie-chart-labelled a:hover text { text-decoration: underline; }

.accounting-state-headings > span:nth-child(3) { white-space: nowrap; }
.accounting-ticket-reference { display: flex; align-items: center; gap: .35rem; white-space: nowrap; }
.accounting-ticket-reference a { flex-shrink: 0; }

/* Repère discret des fiches contenant plusieurs lignes d’intervention. */
.ticket-table .multiple-interventions-row > *,
.accounting-table .multiple-interventions-row > * { --bs-table-bg: #eaf3fc; }
[data-bs-theme="dark"] .ticket-table .multiple-interventions-row > *,
[data-bs-theme="dark"] .accounting-table .multiple-interventions-row > * { --bs-table-bg: #263653; }

/* Fiche client : panneaux parallèles et historique compact comme les listes principales. */
.client-details-columns { display: grid; grid-template-columns: minmax(0,1fr); gap: 1.25rem; align-items: start; }
.client-details-columns > div { min-width: 0; }
@media (min-width: 992px) { .client-details-columns { grid-template-columns: repeat(2,minmax(0,1fr)); } }
.filter-bar-client-history { grid-template-columns: 5rem 8rem 8rem 8rem 8rem minmax(8rem,1fr) auto; }
.client-history-actions, .client-history-help { grid-column: 1 / -1; }
.client-history-table { table-layout: fixed; min-width: 58rem; font-size: .875rem; line-height: 1.3; }
.client-history-table > :not(caption) > * > * { padding: .4rem .5rem; overflow-wrap: anywhere; }
.client-history-table th:nth-child(1) { width: 8rem; }
.client-history-table th:nth-child(2) { width: 7rem; }
.client-history-table th:nth-child(4), .client-history-table th:nth-child(5) { width: 8rem; }
.client-history-table th:nth-child(6) { width: 5rem; }
.client-history-table th:nth-child(7) { width: 7rem; }
@media (max-width: 1100px) { .filter-bar-client-history { grid-template-columns: repeat(4,minmax(0,1fr)); } }
@media (max-width: 900px) { .filter-bar-client-history { grid-template-columns: repeat(2,minmax(0,1fr)); } }

.client-months-grid { grid-template-columns: repeat(6,minmax(0,1fr)); }
@media (max-width: 767px) { .client-months-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width: 450px) { .client-months-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }

/* Encarts du mois : bleu distinct du panneau gris, texte contrasté dans les deux thèmes. */
[aria-labelledby="current-month-stats"] .month-summary { background: #d5eaff; border: 0; color: #173b63; }
[aria-labelledby="current-month-stats"] .month-summary span,
[aria-labelledby="current-month-stats"] .month-summary small { color: #284d73; }
[data-bs-theme="dark"] [aria-labelledby="current-month-stats"] .month-summary { background: #23476b; color: #f2f8ff; }
[data-bs-theme="dark"] [aria-labelledby="current-month-stats"] .month-summary span,
[data-bs-theme="dark"] [aria-labelledby="current-month-stats"] .month-summary small { color: #deedfc; }

/* Liste utilisateurs compacte : actions côte à côte et espacement réduit. */
.user-table { font-size: .875rem; line-height: 1.3; }
.user-table > :not(caption) > * > * { padding: .4rem .5rem; }
.user-table .user-actions { flex-direction: row; gap: .4rem; white-space: nowrap; }
.user-table .user-actions .btn { min-height: 2rem; padding: .25rem .5rem; font-size: .8rem; }
.user-table td:nth-child(2), .user-table td:nth-child(5) { white-space: nowrap; }
@media (pointer: coarse) { .user-table .user-actions .btn { min-height: 2.75rem; } }

/* Aperçu des interventions, hors du tableau pour éviter son découpage. */
.ticket-preview { position: fixed; z-index: 1080; width: min(440px, calc(100vw - 24px)); max-height: min(580px, calc(100vh - 24px)); overflow-y: auto; padding: 1rem; border: 1px solid #c8d8e8; border-radius: .75rem; background: #fff; color: #17223d; box-shadow: 0 8px 30px #17223d30; font-size: .82rem; line-height: 1.4; overflow-wrap: anywhere; }
.ticket-preview[hidden] { display: none; }
.ticket-preview .preview-title { margin: .3rem 0; font-weight: 600; }
.ticket-preview .preview-meta { color: #52617a; font-size: .76rem; }
.ticket-preview .preview-line { margin: .6rem 0; padding: .55rem .65rem; border-radius: .4rem; background: #edf4fb; }
.ticket-preview p { margin: .25rem 0; white-space: pre-line; }
[data-bs-theme="dark"] .ticket-preview { background: #28203f; color: #f0edf9; border-color: #514565; }
[data-bs-theme="dark"] .ticket-preview .preview-line { background: #352c4e; }
[data-bs-theme="dark"] .ticket-preview .preview-meta { color: #c6bfd6; }

.client-company-heading { position: sticky; top: 0; padding: .35rem .7rem; background: #e7edf6; color: #334764; font-size: .75rem; font-weight: 750; letter-spacing: .04em; border-bottom: 1px solid #d1dce9; }
.client-results [role="option"] { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.client-result-name { min-width: 0; }
.client-company-badge { flex-shrink: 0; padding: .1rem .35rem; border-radius: .3rem; background: #e9f4ff; color: #24527b; font-size: .65rem; font-weight: 700; }
[data-bs-theme="dark"] .client-company-heading { background: #352c4e; color: #e4ddf3; border-color: #514565; }
[data-bs-theme="dark"] .client-company-badge { background: #46395f; color: #e4ddf3; }

.dashboard-section { margin-top: 1.5rem; padding: 1.1rem; border-radius: 1rem; background: #f3f7fc; border: 1px solid #e0e8f2; }
.dashboard-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.dashboard-section-heading h2 { margin: 0; font-size: 1.2rem; color: #1E1739; }
.dashboard-section-heading > span { font-size: .8rem; color: #52617a; }

.dashboard-section .dashboard-summary { margin: .85rem 0; }
.dashboard-section .dashboard-panel h2 { font-size: 1rem; }
.dashboard-section .dashboard-panel { box-shadow: none; }
[data-bs-theme="dark"] .dashboard-section { background: #241c3c; border-color: #443859; }

[data-bs-theme="dark"] .dashboard-section-heading h2 { color: #f0edf9; }
[data-bs-theme="dark"] .dashboard-section-heading > span { color: #c5bdd8; }
@media(max-width: 575px) { .dashboard-section { padding: .7rem; } .dashboard-section .dashboard-summary { gap: .5rem; } .dashboard-section .month-summary { padding: .6rem; } }

.dashboard-section .month-summary, .dashboard-section .dashboard-panel { background: #fff; border-color: #dce5ef; }
.dashboard-section .summary-open { background: #d9edff; border-color: #b5d6f2; color: #102238; }
.dashboard-section .summary-open span, .dashboard-section .summary-open small { color: #102238; }
.dashboard-section .summary-open:hover { background: #c7e4ff; border-color: #8bbde8; }
[data-bs-theme="dark"] .dashboard-section .month-summary, [data-bs-theme="dark"] .dashboard-section .dashboard-panel { background: #302747; border-color: #514666; }
[data-bs-theme="dark"] .dashboard-section .summary-open { background: #243b53; border-color: #426687; color: #d9edff; }
[data-bs-theme="dark"] .dashboard-section .summary-open span, [data-bs-theme="dark"] .dashboard-section .summary-open small { color: #d9edff; }
[data-bs-theme="dark"] .dashboard-section .summary-open:hover { background: #2c4965; border-color: #648bad; }

.attachment-indicator { display: inline-flex; vertical-align: middle; margin-left: .3rem; color: #0877b5; }
.attachment-indicator svg { display: block; }
[data-bs-theme="dark"] .attachment-indicator { color: #6bd1ff; }

/* Numéro et trombone inséparables dans les trois listes. */
a[data-ticket-preview] { display: inline-flex; align-items: center; flex-wrap: nowrap; white-space: nowrap; overflow-wrap: normal; }
a[data-ticket-preview] .attachment-indicator { flex: 0 0 auto; }
.ticket-table thead th:first-child, .accounting-table thead th:first-child, .client-history-table th:first-child { width: 9rem; }

/* Les filtres restent dans le flux puis suivent le défilement de leur liste. */
.filter-bar-tickets,
.filter-bar-accounting,
.filter-bar-client-history,
.filter-bar-clients {
    position: sticky;
    top: 0;
    z-index: 15;
    padding: .65rem;
    background: #fff;
    border: 1px solid #dce5ef;
    border-radius: .5rem;
    box-shadow: 0 3px 10px #17223d12;
    max-height: 45vh;
    max-height: 45dvh;
    overflow-y: auto;
}
[data-bs-theme="dark"] .filter-bar-tickets,
[data-bs-theme="dark"] .filter-bar-accounting,
[data-bs-theme="dark"] .filter-bar-client-history,
[data-bs-theme="dark"] .filter-bar-clients {
    background: #28203f;
    border-color: #514666;
    box-shadow: 0 3px 10px #0003;
}
.draft-notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem .8rem; margin-bottom: 1rem; border-radius: .5rem; background: #edf5ff; color: #284d73; font-size: .82rem; }
.draft-notice small { flex-basis: 100%; }
[data-bs-theme="dark"] .draft-notice { background: #302747; color: #d9d2e8; }

/* Création compacte : champs courts regroupés, zones de texte côte à côte. */
#intervention-create-form .intervention-form-section { padding: .6rem .8rem; margin-bottom: .6rem; }
#intervention-create-form .intervention-grid { gap: .4rem .75rem; }
#intervention-create-form .form-control, #intervention-create-form .form-select { min-height: 2.4rem; }
#intervention-create-form .mb-3 { margin-bottom: .45rem !important; }
#intervention-create-form .field-technician_id > .form-text:not([role="alert"]),
#intervention-create-form .field-duration_minutes > .form-text { display: none; }
.extra-line-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .5rem .75rem; }
.extra-description, .extra-material { grid-column: span 2; }
#intervention-create-form textarea { min-height: 8rem; resize: vertical; }
@media(min-width:768px) {
    #intervention-create-form .intervention-grid > .field-intervention_date,
    #intervention-create-form .intervention-grid > .field-duration_minutes,
    #intervention-create-form .intervention-grid > .field-technician_id { grid-column: span 2; }
    #intervention-create-form .intervention-grid > .field-description,
    #intervention-create-form .intervention-grid > .field-sold_equipment { grid-column: span 3 !important; }
    #intervention-create-form .field-pdf { grid-column: 1 / -1; }
}
@media(max-width:767px) { .extra-line-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .extra-description, .extra-material { grid-column: 1 / -1; } }
.client-note-dialog { width: min(38rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); overflow-y: auto; padding: 1.5rem; border: 2px solid #e5a62a; border-radius: .8rem; background: #fff8e8; color: #332a17; box-shadow: 0 16px 60px #0004; }
.client-note-dialog::backdrop { background: #1e1739a6; }
.client-note-dialog h2 { font-size: 1.2rem; margin-bottom: 1rem; }
.client-note-content { white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 1.3rem; max-height: 55dvh; overflow-y: auto; }
[data-bs-theme="dark"] .client-note-dialog { background: #302747; color: #fff3d5; border-color: #e5a62a; }

/* Repères positifs/négatifs communs aux notes et contrats. */
.client-contract-indicator.indicator-yes, .client-maintenance-badge { color: #146c43; background: #d1e7dd; }
.client-contract-indicator.indicator-no { color: #b02a37; background: #f8d7da; }
.client-maintenance-badge { display: inline-block; padding: .05rem .3rem; border-radius: .3rem; font-weight: 700; font-size: .8rem; }
[data-bs-theme="dark"] .client-contract-indicator.indicator-yes,
[data-bs-theme="dark"] .client-maintenance-badge { color: #a3e9c3; background: #143c2a; }
[data-bs-theme="dark"] .client-contract-indicator.indicator-no { color: #ffb3ba; background: #51232b; }

/* Présentation commune des quatre listes principales. */
.list-table-frame { border: 1px solid #dce5ef; border-radius: .5rem; margin-bottom: 1rem; }
.list-table { margin-bottom: 0; font-size: .875rem; line-height: 1.3; --bs-table-border-color: #e3eaf2; }
.list-table > :not(caption) > * > * { padding: .5rem .6rem; vertical-align: middle; }
.list-table > thead > tr > th { --bs-table-bg: #edf3fa; color: #344660; font-size: .75rem; font-weight: 700; white-space: nowrap; padding-block: .65rem; }
.list-table > tbody > tr:last-child > * { border-bottom-width: 0; }
.list-table > tbody > tr:hover > * { --bs-table-bg-state: #edf5fc; }
.list-table small, .list-table .badge { font-size: .75rem; }
.list-table tbody a:not(.btn) { text-decoration: none; }
.list-table tbody a:not(.btn):hover { text-decoration: underline; }
.section-toolbar > p { margin-bottom: 0; color: var(--bs-secondary-color); font-size: .875rem; }
.dashboard-section .summary-open strong { color: #174f7a; }
[data-bs-theme="dark"] .dashboard-section .summary-open strong { color: #a9d8ff; }
[data-bs-theme="dark"] .list-table-frame { border-color: #514666; }
[data-bs-theme="dark"] .list-table { --bs-table-border-color: #453c59; }
[data-bs-theme="dark"] .list-table > thead > tr > th { --bs-table-bg: #382e4d; color: #e2dbf0; }
[data-bs-theme="dark"] .list-table > tbody > tr:hover > * { --bs-table-bg-state: #35314d; }

.client-results-filter { position: fixed; right: auto; z-index: 1050; font-size: .85rem; }
.filter-bar #client_id[hidden] { display: none; }

/* Version discrète, lisible même lorsque le menu est replié. */
.sidebar .sidebar-version { display: block; flex-shrink: 0; margin-top: .65rem; padding: .4rem 0; text-align: center; font-size: .7rem; line-height: 1.3; color: #cec8df; text-decoration: none; }
.sidebar .sidebar-version:hover, .sidebar .sidebar-version[aria-current] { color: #fff; text-decoration: underline; }
.release-entry { padding: 1.1rem 0; border-top: 1px solid var(--bs-border-color); }
.release-entry li + li { margin-top: .45rem; }
@media (max-width: 767px) {
    .sidebar-version { grid-column: 1 / -1; }
    .sidebar-collapsed .sidebar-version { display: none; }
}

/* Un accès compact aux filtres sur téléphone, présentation habituelle sur ordinateur. */
.responsive-filters { display: contents; }
.responsive-filters > summary { display: none; }
@media (max-width: 767px) {
    .filter-bar { position: static; max-height: none; overflow: visible; }
    .responsive-filters { display: block; position: sticky; top: 0; z-index: 15; margin-bottom: 1rem; border: 1px solid var(--bs-border-color); border-radius: .5rem; background: var(--bs-body-bg); }
    .responsive-filters > summary { display: list-item; padding: .7rem 1rem; min-height: 44px; cursor: pointer; font-size: .9rem; font-weight: 600; }
    .responsive-filters[open] { max-height: 65vh; max-height: 65dvh; overflow-y: auto; }
    .responsive-filters .filter-bar { position: static; margin: 0; border: 0; border-radius: 0; box-shadow: none; max-height: none; }
}

/* Garder le contrat visible même lorsque le nom du client est tronqué. */
.intervention-client-name { display: flex; align-items: center; gap: .35rem; min-width: 0; }
.intervention-client-name .client-name-truncated { min-width: 0; }
.intervention-client-name .client-maintenance-badge { flex-shrink: 0; }
