:root {
    --navy: #073172;
    --navy-2: #0c397e;
    --blue: #5291f2;
    --blue-2: #4987e5;
    --blue-soft: #eef5ff;
    --blue-soft-2: #d9e8fd;
    --text: #073172;
    --muted: #3e679e;
    --border: #cbdff8;
    --white: #ffffff;
    --shadow: 0 18px 55px rgba(7, 49, 114, .12);
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--blue-soft);
}

button, input { font: inherit; }

a { color: inherit; text-decoration: none; }

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

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
    color: var(--white);
}

.brand {
    display: block;
    padding: 4px 4px 22px;
}

.brand-logo-wrap {
    display: grid;
    place-items: center;
    min-height: 76px;
    padding: 14px;
    border-radius: 18px;
    background: var(--white);
}

.brand-logo {
    display: block;
    width: 100%;
    max-width: 225px;
    height: auto;
}

.brand-caption {
    display: block;
    margin-top: 10px;
    color: var(--blue-soft-2);
    font-size: 11px;
    font-weight: 750;
    text-align: center;
    letter-spacing: .03em;
}

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

.nav-label {
    margin: 18px 10px 4px;
    color: var(--blue-soft-2);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 13px;
    color: var(--blue-soft-2);
    font-weight: 700;
    transition: .18s ease;
}

.nav-link:hover,
.nav-link.is-active {
    color: var(--white);
    background: rgba(82, 145, 242, .30);
    transform: translateX(2px);
}

.nav-icon {
    width: 25px;
    text-align: center;
    font-size: 17px;
}

.sidebar-bottom {
    margin-top: auto;
    display: grid;
    gap: 12px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .11);
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--white);
    color: var(--navy);
    font-weight: 850;
}

.user-chip strong,
.user-chip small { display: block; }
.user-chip small { margin-top: 2px; color: var(--blue-soft-2); font-size: 11px; }
.logout-link { padding: 4px 12px; color: var(--blue-soft-2); font-size: 13px; }

.main-content { min-width: 0; padding: 28px 34px 48px; }

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

.eyebrow,
.panel-kicker {
    margin: 0 0 4px;
    color: var(--blue-2);
    font-weight: 850;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .12em;
}

h1, h2, h3, p { margin-top: 0; }

.topbar h1 { margin-bottom: 0; font-size: clamp(28px, 3vw, 40px); letter-spacing: -.04em; }
.topbar-date { padding: 11px 15px; border-radius: 13px; background: var(--white); border: 1px solid var(--border); font-weight: 750; }

.flash {
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid var(--blue);
    border-radius: 14px;
    background: var(--white);
    color: var(--navy);
    font-weight: 750;
}
.flash-success { box-shadow: inset 5px 0 0 var(--blue); }
.flash-error { box-shadow: inset 5px 0 0 var(--navy); }

.stats-row {
    display: grid;
    grid-template-columns: 210px 210px minmax(260px, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

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

.stat-card {
    min-height: 105px;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
}

.stat-card strong,
.stat-card span { display: block; }
.stat-card strong { font-size: 25px; letter-spacing: -.03em; }
.stat-card span { margin-top: 4px; color: var(--muted); font-size: 13px; }
.stat-card-wide strong { font-size: 17px; }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    display: grid !important;
    place-items: center;
    background: var(--blue-soft);
    color: var(--blue-2);
    border: 1px solid var(--blue-soft-2);
    font-size: 23px !important;
}
.stat-icon-green { background: var(--blue-soft); color: var(--navy); }

.two-columns {
    display: grid;
    grid-template-columns: minmax(350px, 455px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.panel { padding: 24px; }

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

.panel-heading h2 { margin: 0; font-size: 24px; letter-spacing: -.03em; }

.form-stack { display: grid; gap: 18px; }

label, legend { color: var(--text); font-weight: 750; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="time"] {
    width: 100%;
    margin-top: 8px;
    padding: 14px 15px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--white);
    color: var(--text);
    outline: none;
    transition: border-color .18s, box-shadow .18s, opacity .18s;
}

input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(82, 145, 242, .16); }
input:disabled { opacity: .45; cursor: not-allowed; background: var(--blue-soft); }

fieldset { margin: 0; padding: 0; border: 0; }
.field-help { margin: 6px 0 12px; color: var(--muted); font-size: 13px; line-height: 1.5; }

.day-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.day-choice { position: relative; cursor: pointer; }
.day-choice input { position: absolute; opacity: 0; pointer-events: none; }
.day-choice span {
    display: grid;
    place-items: center;
    min-height: 47px;
    padding: 9px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--white);
    color: var(--muted);
    transition: .18s ease;
}
.day-choice input:checked + span {
    border-color: var(--blue);
    background: var(--blue-soft);
    color: var(--navy);
    box-shadow: inset 0 0 0 1px var(--blue);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 11px 17px;
    border: 0;
    border-radius: 13px;
    cursor: pointer;
    font-weight: 850;
}
.btn-primary { background: linear-gradient(135deg, var(--navy), var(--blue-2)); color: var(--white); box-shadow: 0 12px 24px rgba(7, 49, 114, .20); }
.btn-secondary { background: var(--blue-soft); color: var(--navy); border: 1px solid var(--border); }
.btn-small { min-height: 38px; padding: 8px 12px; font-size: 13px; }
.btn-block { width: 100%; }

.cabinet-list,
.collaborator-list { display: grid; gap: 12px; }

.cabinet-card,
.collaborator-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: var(--white);
}
.cabinet-card.is-inactive,
.collaborator-card.is-inactive { opacity: .58; }
.cabinet-main,
.collaborator-main { min-width: 0; display: flex; align-items: center; gap: 13px; }
.cabinet-avatar,
.collaborator-avatar {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--blue-soft);
    color: var(--navy);
    border: 1px solid var(--blue-soft-2);
    font-weight: 850;
}
.cabinet-card h3,
.collaborator-card h3 { margin: 0 0 4px; font-size: 16px; }
.cabinet-card p,
.collaborator-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.cabinet-actions,
.collaborator-actions { display: flex; align-items: center; gap: 8px; }
.cabinet-actions form,
.collaborator-actions form { margin: 0; }

.status-badge {
    padding: 6px 9px;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 11px;
    font-weight: 850;
}
.status-active { background: var(--blue-soft); color: var(--navy); }
.status-inactive { background: var(--white); color: var(--muted); border-style: dashed; }

.icon-button {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--white);
    color: var(--navy);
    cursor: pointer;
    font-weight: 850;
}

.empty-state,
.coming-soon {
    text-align: center;
    padding: 48px 24px;
}
.empty-state > span { font-size: 38px; }
.empty-state h3 { margin: 12px 0 5px; }
.empty-state p,
.coming-soon p { color: var(--muted); }

.pill {
    display: inline-flex;
    padding: 7px 11px;
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--navy);
    border: 1px solid var(--blue-soft-2);
    font-size: 12px;
    font-weight: 850;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(135deg, var(--white), var(--blue-soft));
}

.login-card {
    width: min(540px, 100%);
    padding: 34px;
    border-radius: 28px;
    background: var(--white);
    border: 1px solid var(--border);
    box-shadow: 0 30px 90px rgba(7, 49, 114, .16);
}
.login-logo-wrap {
    display: grid;
    place-items: center;
    margin-bottom: 28px;
    padding: 12px 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--white);
}
.login-logo { width: min(360px, 100%); height: auto; display: block; }
.login-copy { margin-bottom: 22px; text-align: center; }
.login-copy h1 { margin: 15px 0 6px; font-size: 27px; }
.login-copy p { margin: 0; color: var(--muted); }

.schedule-editor { display: grid; gap: 10px; }
.schedule-row {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--white);
}
.schedule-day {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
}
.schedule-day input { width: 18px; height: 18px; accent-color: var(--blue-2); }
.schedule-time label { display: block; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.schedule-time input { margin-top: 5px; padding: 10px 11px; }

.schedule-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 7px;
}
.schedule-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: 999px;
    background: var(--blue-soft);
    border: 1px solid var(--blue-soft-2);
    color: var(--navy);
    font-size: 11px;
    font-weight: 750;
}

.card-meta {
    margin-top: 7px !important;
    color: var(--navy) !important;
    font-weight: 750;
}

@media (max-width: 1120px) {
    .app-shell { grid-template-columns: 104px minmax(0, 1fr); }
    .sidebar { padding-inline: 12px; }
    .brand-logo-wrap { padding: 9px; min-height: 58px; }
    .brand-caption { display: none; }
    .nav-link { justify-content: center; font-size: 0; }
    .nav-icon { font-size: 20px; }
    .nav-label, .user-chip > span:last-child, .logout-link { display: none; }
    .user-chip { justify-content: center; padding: 8px; }
    .two-columns { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .app-shell { display: block; }
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        padding: 13px;
    }
    .brand { max-width: 250px; padding-bottom: 12px; }
    .brand-logo-wrap { min-height: 54px; }
    .nav {
        display: flex;
        overflow-x: auto;
        gap: 7px;
        padding-bottom: 4px;
    }
    .nav-link {
        flex: 0 0 auto;
        justify-content: flex-start;
        font-size: 13px;
        white-space: nowrap;
    }
    .nav-label, .sidebar-bottom { display: none; }
    .main-content { padding: 20px 14px 36px; }
    .topbar { align-items: flex-start; }
    .topbar-date { display: none; }
    .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-card-wide { grid-column: 1 / -1; }
    .panel { padding: 18px; }
    .day-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cabinet-card,
    .collaborator-card { align-items: flex-start; flex-direction: column; }
    .cabinet-actions,
    .collaborator-actions { width: 100%; justify-content: flex-end; }
    .schedule-row { grid-template-columns: 1fr 1fr; }
    .schedule-day { grid-column: 1 / -1; }
}

/* Étape 3 — Travaux et temps */
input[type="number"] {
    width: 100%;
    margin-top: 8px;
    padding: 14px 15px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--white);
    color: var(--text);
    outline: none;
    transition: border-color .18s, box-shadow .18s;
}
input[type="number"]:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(82, 145, 242, .16); }

.work-stats-row {
    grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.work-settings-layout {
    grid-template-columns: minmax(350px, 440px) minmax(0, 1fr);
}

.mode-grid {
    display: grid;
    gap: 10px;
}

.mode-choice {
    position: relative;
    cursor: pointer;
}

.mode-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.mode-choice span {
    display: grid;
    gap: 4px;
    min-height: 76px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--white);
    transition: .18s ease;
}

.mode-choice strong { font-size: 15px; }
.mode-choice small { color: var(--muted); line-height: 1.4; }

.mode-choice input:checked + span {
    border-color: var(--blue);
    background: var(--blue-soft);
    box-shadow: inset 0 0 0 1px var(--blue);
}

.minutes-input-wrap {
    position: relative;
}

.minutes-input-wrap input {
    padding-right: 135px;
}

.minutes-input-wrap span {
    position: absolute;
    right: 13px;
    bottom: 14px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.work-type-list {
    display: grid;
    gap: 11px;
}

.work-type-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 13px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: var(--white);
}

.work-type-card.is-inactive { opacity: .55; }

.work-type-rank {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: var(--blue-soft);
    border: 1px solid var(--blue-soft-2);
    color: var(--navy);
    font-weight: 900;
}

.work-type-main { min-width: 0; }
.work-type-main h3 { margin: 0 0 8px; font-size: 16px; }
.work-type-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.work-type-meta strong { color: var(--muted); font-size: 12px; }

.work-type-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.work-type-actions form { margin: 0; }
.icon-button:disabled { opacity: .25; cursor: default; }

@media (max-width: 1180px) {
    .work-stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .work-stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .work-type-card { grid-template-columns: 40px minmax(0, 1fr); }
    .work-type-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

/* MVP complet — identité Production Labo uniquement */
select,
textarea,
input[type="date"] {
    width: 100%;
    margin-top: 8px;
    padding: 14px 15px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--white);
    color: var(--text);
    outline: none;
    transition: border-color .18s, box-shadow .18s;
}
select:focus,
textarea:focus,
input[type="date"]:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(82, 145, 242, .16);
}
textarea { resize: vertical; }
button { font: inherit; }
button:disabled { opacity: .45; cursor: not-allowed; }
.label-note { color: var(--muted); font-weight: 650; }
.muted-text { color: var(--muted); }
.text-link { color: var(--blue-2); font-weight: 800; }
.text-link:hover { text-decoration: underline; }

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-row-four { grid-template-columns: repeat(4, minmax(170px, 1fr)); }
.stats-row-three,
.case-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(170px, 1fr)); gap: 16px; margin-bottom: 20px; }
.field-grid { display: grid; gap: 15px; }
.field-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.compact-top { margin-top: 14px; }

/* Attribution façon balance moderne */
.balance-shell {
    display: grid;
    gap: 18px;
}
.balance-heading,
.balance-section,
.balance-submit-bar {
    border: 1px solid var(--border);
    background: var(--white);
    box-shadow: var(--shadow);
}
.balance-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 24px 28px;
    border-radius: 24px;
}
.balance-heading h2 { margin: 0 0 7px; font-size: 28px; letter-spacing: -.035em; }
.balance-heading p { margin: 0; color: var(--muted); }
.balance-step-count,
.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 11px;
    border: 1px solid var(--blue-soft-2);
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--navy);
    font-size: 12px;
    font-weight: 850;
}
.setup-warning,
.inline-notice {
    padding: 15px 17px;
    border: 1px solid var(--blue);
    border-radius: 15px;
    background: var(--blue-soft);
    color: var(--navy);
}
.setup-warning { display: flex; gap: 10px; flex-wrap: wrap; }
.balance-form { display: grid; gap: 18px; }
.balance-section { padding: 24px; border-radius: 24px; }
.balance-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}
.balance-section-title > span {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--navy);
    color: var(--white);
    font-weight: 900;
}
.balance-section-title strong,
.balance-section-title small { display: block; }
.balance-section-title strong { font-size: 19px; }
.balance-section-title small { margin-top: 2px; color: var(--muted); }
.segmented-control {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}
.segmented-control label { position: relative; cursor: pointer; }
.segmented-control input { position: absolute; opacity: 0; }
.segmented-control span {
    display: grid;
    place-items: center;
    min-height: 52px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--white);
    font-weight: 850;
}
.segmented-control input:checked + span {
    border-color: var(--blue);
    background: var(--blue-soft);
    box-shadow: inset 0 0 0 1px var(--blue);
}
.touch-grid { display: grid; gap: 11px; }
.work-touch-grid { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.collaborator-touch-grid { grid-template-columns: repeat(6, minmax(120px, 1fr)); }
.touch-button {
    min-height: 112px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--white);
    color: var(--navy);
    cursor: pointer;
    text-align: center;
    transition: .16s ease;
}
.touch-button:hover { transform: translateY(-2px); border-color: var(--blue); }
.touch-button.is-selected {
    border-color: var(--blue);
    background: var(--blue-soft);
    box-shadow: inset 0 0 0 2px var(--blue), 0 12px 28px rgba(7,49,114,.10);
}
.touch-button strong { font-size: 15px; }
.touch-button small { color: var(--muted); line-height: 1.25; }
.touch-avatar,
.lane-avatar,
.case-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    background: var(--blue-soft);
    color: var(--navy);
    border: 1px solid var(--blue-soft-2);
    font-weight: 900;
}
.touch-avatar { width: 42px; height: 42px; border-radius: 13px; }
.calculation-strip {
    display: grid;
    grid-template-columns: minmax(190px, 1fr) minmax(240px, 1fr) minmax(170px, .7fr);
    gap: 14px;
    align-items: end;
    margin-top: 18px;
    padding: 17px;
    border-radius: 17px;
    background: var(--blue-soft);
    border: 1px solid var(--blue-soft-2);
}
.stepper {
    display: grid;
    grid-template-columns: auto minmax(70px, 1fr) auto;
    gap: 6px;
    align-items: center;
    margin-top: 8px;
}
.stepper input { margin-top: 0; text-align: center; font-weight: 850; }
.stepper button,
.date-quick,
.day-arrow {
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--white);
    color: var(--navy);
    font-weight: 900;
    cursor: pointer;
}
.stepper button:hover,
.date-quick:hover,
.date-quick.is-selected,
.day-arrow:hover { border-color: var(--blue); background: var(--blue-soft); }
.calculation-result {
    min-height: 70px;
    display: grid;
    align-content: center;
    padding: 13px 16px;
    border-radius: 14px;
    background: var(--navy);
    color: var(--white);
}
.calculation-result small,
.calculation-result strong { display: block; }
.calculation-result strong { margin-top: 4px; font-size: 22px; }
.date-choice-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.date-field-inline { min-width: 220px; margin-left: auto; }
.balance-submit-bar {
    position: sticky;
    bottom: 16px;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 22px;
    border-radius: 20px;
}
.balance-submit-bar small,
.balance-submit-bar strong { display: block; }
.balance-submit-bar small { color: var(--muted); margin-bottom: 3px; }
.btn-large { min-height: 52px; padding-inline: 26px; }

/* Navigation par jours */
.day-toolbar,
.collaborator-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}
.day-toolbar {
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--white);
    box-shadow: var(--shadow);
}
.day-toolbar-main { display: flex; align-items: center; gap: 14px; }
.day-toolbar-main h2 { margin: 0; font-size: 24px; }
.day-arrow { width: 46px; padding: 0; display: grid; place-items: center; font-size: 21px; }
.date-jump-form { display: flex; align-items: end; gap: 8px; }
.date-jump-form input { width: auto; margin: 0; }
.week-strip {
    display: grid;
    grid-template-columns: repeat(7, minmax(90px, 1fr));
    gap: 8px;
    margin-bottom: 18px;
}
.week-day {
    min-height: 48px;
    display: grid;
    place-items: center;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--white);
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
}
.week-day:hover,
.week-day.is-selected { border-color: var(--blue); background: var(--blue-soft); color: var(--navy); }

/* Tableau chef */
.board-help {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}
.board-save-state { color: var(--navy); }
.production-board {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(285px, 325px);
    gap: 14px;
    overflow-x: auto;
    padding: 2px 2px 22px;
    scroll-snap-type: x proximity;
}
.board-lane {
    align-self: start;
    min-height: 400px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgba(255,255,255,.78);
    scroll-snap-align: start;
}
.lane-unassigned { border-style: dashed; }
.lane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.lane-header > div { display: flex; align-items: center; gap: 9px; min-width: 0; }
.lane-avatar { width: 42px; height: 42px; border-radius: 13px; }
.lane-header h3 { margin: 0; font-size: 16px; }
.lane-header p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.lane-header > strong {
    min-width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--navy);
    color: var(--white);
}
.capacity-bar {
    height: 7px;
    overflow: hidden;
    margin-bottom: 7px;
    border-radius: 999px;
    background: var(--blue-soft-2);
}
.capacity-bar span { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.lane-warning {
    margin-bottom: 8px;
    padding: 7px 9px;
    border: 1px solid var(--blue);
    border-radius: 10px;
    background: var(--blue-soft);
    color: var(--navy);
    font-size: 11px;
    font-weight: 850;
}
.lane-task-list { min-height: 250px; display: grid; align-content: start; gap: 9px; }
.lane-placeholder {
    display: none;
    min-height: 50px;
    place-items: center;
    border: 1px dashed var(--blue);
    border-radius: 13px;
    color: var(--muted);
    font-size: 12px;
}
.lane-task-list:empty .lane-placeholder,
.board-task.is-dragging ~ .lane-placeholder { display: grid; }
.board-task {
    padding: 13px;
    border: 1px solid var(--border);
    border-left: 5px solid var(--blue);
    border-radius: 15px;
    background: var(--white);
    box-shadow: 0 8px 22px rgba(7,49,114,.07);
    cursor: grab;
}
.board-task:active { cursor: grabbing; }
.board-task.is-dragging { opacity: .35; }
.board-task.status-problem { border-left-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.board-task.status-done { opacity: .58; }
.board-task.status-in_progress { background: var(--blue-soft); }
.task-card-top,
.task-card-meta,
.task-card-actions,
.timeline-heading,
.timeline-meta,
.operator-task-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
}
.drag-handle { color: var(--muted); font-weight: 900; letter-spacing: -2px; }
.task-status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 8px;
    border: 1px solid var(--blue-soft-2);
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--navy);
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
}
.status-problem .task-status-chip { border-color: var(--navy); background: var(--white); }
.status-done .task-status-chip { background: var(--navy); color: var(--white); }
.task-card-link { display: grid; gap: 2px; margin: 10px 0; }
.task-card-link small { color: var(--muted); }
.task-card-link strong { font-size: 19px; }
.task-card-link span { font-size: 13px; font-weight: 750; }
.task-card-meta { justify-content: flex-start; flex-wrap: wrap; color: var(--muted); font-size: 11px; font-weight: 800; }
.task-card-meta span { padding: 4px 7px; border-radius: 8px; background: var(--blue-soft); }
.task-card-actions { margin-top: 10px; justify-content: flex-end; }
.task-card-actions a { color: var(--blue-2); font-size: 11px; font-weight: 850; }
.task-problem-note,
.operator-problem {
    margin: 10px 0 0;
    padding: 9px 10px;
    border: 1px solid var(--navy);
    border-radius: 10px;
    background: var(--blue-soft);
    color: var(--navy);
    font-size: 12px;
}
.empty-day-panel { min-height: 300px; display: grid; place-items: center; }

/* Vue opérateur */
.collaborator-select-form { min-width: 280px; }
.collaborator-select-form select { margin-top: 5px; }
.selected-collaborator-badge { display: flex; align-items: center; gap: 10px; }
.selected-collaborator-badge strong,
.selected-collaborator-badge small { display: block; }
.selected-collaborator-badge small { margin-top: 3px; color: var(--muted); }
.operator-stack { display: grid; gap: 13px; max-width: 980px; margin: 0 auto; }
.operator-task {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 15px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--white);
    box-shadow: var(--shadow);
}
.operator-task.is-current { border-color: var(--blue); box-shadow: inset 0 0 0 2px var(--blue), var(--shadow); }
.operator-task.is-done { opacity: .58; }
.operator-order {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: var(--navy);
    color: var(--white);
    font-size: 20px;
    font-weight: 900;
}
.current-label {
    display: inline-flex;
    margin-bottom: 8px;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--blue);
    color: var(--white);
    font-size: 11px;
    font-weight: 900;
}
.operator-task-heading { align-items: flex-start; }
.operator-task-heading small { color: var(--muted); font-weight: 800; }
.operator-task-heading h2 { margin: 2px 0; font-size: 26px; }
.operator-task-heading p { margin: 0; font-weight: 800; }
.operator-task-time { padding: 10px 13px; border-radius: 12px; background: var(--blue-soft); font-weight: 900; }
.operator-task-detail { color: var(--muted); }
.operator-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-top: 16px; }

/* Dossiers */
.filter-panel { margin-bottom: 18px; }
.filter-form { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.filter-search { flex: 1 1 320px; }
.case-list { display: grid; gap: 10px; }
.case-row {
    display: grid;
    grid-template-columns: minmax(230px, 1.4fr) minmax(130px, .7fr) minmax(130px, .7fr) minmax(180px, 1fr) auto 28px;
    gap: 16px;
    align-items: center;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--white);
    transition: .16s ease;
}
.case-row:hover { transform: translateY(-1px); border-color: var(--blue); }
.case-ident { display: flex; align-items: center; gap: 11px; min-width: 0; }
.case-avatar { width: 44px; height: 44px; border-radius: 13px; }
.case-avatar-large { width: 62px; height: 62px; border-radius: 18px; }
.case-ident small,
.case-ident strong,
.case-cell small,
.case-cell strong { display: block; }
.case-ident small,
.case-cell small { color: var(--muted); font-size: 11px; }
.case-ident strong { margin-top: 2px; font-size: 18px; }
.case-cell strong { margin-top: 4px; font-size: 13px; }
.case-progress > div { height: 7px; overflow: hidden; border-radius: 999px; background: var(--blue-soft-2); }
.case-progress > div span { display: block; height: 100%; background: var(--blue); }
.case-progress small { display: block; margin-top: 5px; color: var(--muted); }
.case-arrow { font-size: 20px; font-weight: 900; }
.case-hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 17px; }
.case-hero-main { display: flex; align-items: center; gap: 15px; }
.case-hero-main h2 { margin: 2px 0 5px; font-size: 34px; }
.case-hero-main p { margin: 0; color: var(--muted); }
.case-hero-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.case-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(310px, .7fr); gap: 18px; align-items: start; }
.case-side { display: grid; gap: 18px; }
.case-status-actions { display: grid; gap: 8px; }
.case-timeline { display: grid; gap: 0; }
.timeline-task { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; padding-bottom: 16px; }
.timeline-task::before { content: ''; position: absolute; left: 12px; top: 22px; bottom: -3px; width: 2px; background: var(--blue-soft-2); }
.timeline-task:last-child::before { display: none; }
.timeline-dot { position: relative; z-index: 1; width: 20px; height: 20px; margin-top: 15px; border: 5px solid var(--white); border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.timeline-task.status-done .timeline-dot { background: var(--navy); }
.timeline-card { padding: 14px 15px; border: 1px solid var(--border); border-radius: 15px; background: var(--white); }
.timeline-heading { align-items: flex-start; }
.timeline-heading small { color: var(--muted); }
.timeline-heading h3 { margin: 3px 0 0; }
.timeline-meta { justify-content: flex-start; flex-wrap: wrap; margin: 10px 0; }
.timeline-meta span { padding: 5px 8px; border-radius: 8px; background: var(--blue-soft); color: var(--navy); font-size: 11px; font-weight: 800; }

/* Édition, historique, absences */
.edit-task-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(290px, .65fr); gap: 18px; align-items: start; }
.danger-zone { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.history-list { display: grid; gap: 10px; }
.history-list article { padding: 11px; border: 1px solid var(--border); border-radius: 12px; background: var(--blue-soft); }
.history-list strong,
.history-list span { display: block; }
.history-list span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.history-list p { margin: 7px 0 0; font-size: 12px; }
.absence-list { display: grid; gap: 9px; }
.absence-list article { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--border); border-radius: 14px; }
.absence-list strong,
.absence-list span,
.absence-list small { display: block; }
.absence-list span { margin-top: 2px; }
.absence-list small { margin-top: 4px; color: var(--muted); }

@media (max-width: 1300px) {
    .work-touch-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
    .collaborator-touch-grid { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
    .stats-row-four { grid-template-columns: repeat(2, minmax(170px, 1fr)); }
    .case-row { grid-template-columns: minmax(220px, 1.5fr) repeat(2, minmax(120px, .7fr)) minmax(160px, 1fr) auto; }
    .case-arrow { display: none; }
}

@media (max-width: 980px) {
    .case-layout,
    .edit-task-layout { grid-template-columns: 1fr; }
    .work-touch-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
    .calculation-strip { grid-template-columns: 1fr 1fr; }
    .calculation-result { grid-column: 1 / -1; }
    .case-row { grid-template-columns: minmax(220px, 1.5fr) minmax(120px, .7fr) minmax(180px, 1fr) auto; }
    .case-row .case-cell:nth-of-type(3) { display: none; }
}

@media (max-width: 760px) {
    .topbar-actions .btn { display: none; }
    .balance-heading,
    .day-toolbar,
    .collaborator-selector,
    .case-hero,
    .balance-submit-bar { align-items: stretch; flex-direction: column; }
    .balance-heading h2 { font-size: 23px; }
    .segmented-control,
    .field-grid-2,
    .field-grid-3,
    .stats-row-three,
    .case-summary-grid { grid-template-columns: 1fr; }
    .work-touch-grid,
    .collaborator-touch-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
    .touch-button { min-height: 100px; }
    .calculation-strip { grid-template-columns: 1fr; }
    .calculation-result { grid-column: auto; }
    .date-field-inline { width: 100%; min-width: 0; margin-left: 0; }
    .balance-submit-bar { position: static; }
    .week-strip { overflow-x: auto; display: flex; }
    .week-day { flex: 0 0 90px; }
    .date-jump-form { flex-wrap: wrap; }
    .production-board { grid-auto-columns: minmax(275px, 88vw); }
    .operator-task { grid-template-columns: 42px minmax(0, 1fr); padding: 14px; }
    .operator-order { width: 40px; height: 40px; border-radius: 12px; }
    .operator-task-heading { display: block; }
    .operator-task-time { display: inline-block; margin-top: 9px; }
    .case-row { grid-template-columns: 1fr auto; }
    .case-row .case-cell,
    .case-row .case-progress { display: none; }
    .case-hero-actions { justify-content: flex-start; }
    .filter-form > * { width: 100%; }
}
.task-order-actions {
    display: grid;
    grid-template-columns: 34px 34px minmax(0, 1fr);
    gap: 6px;
    margin-top: 10px;
}
.task-order-actions button,
.task-order-actions select {
    min-height: 34px;
    margin: 0;
    padding: 5px 7px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--white);
    color: var(--navy);
    font-size: 11px;
    font-weight: 850;
}
.task-order-actions button { cursor: pointer; }
.task-order-actions button:hover,
.task-order-actions select:focus { border-color: var(--blue); background: var(--blue-soft); }
.lane-task-list > .lane-placeholder:only-child { display: grid; }

/* =========================================================
   Production Labo — Accueil visuel et header commun V2
   ========================================================= */
:root {
    --joy-orange: #f28a34;
    --joy-green: #22ae86;
    --joy-purple: #8067e8;
    --joy-cyan: #31afd0;
}

body {
    background: #f5f8fc;
}

.app-shell-header {
    display: block;
    min-height: 100vh;
}

.global-header {
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 92px;
    display: grid;
    grid-template-columns: minmax(220px, 310px) minmax(300px, 1fr) auto;
    align-items: center;
    gap: 24px;
    padding: 15px 32px;
    border-bottom: 1px solid #e4edf9;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 8px 28px rgba(7, 49, 114, .06);
    backdrop-filter: blur(14px);
}

.global-brand {
    display: flex;
    align-items: center;
    min-width: 0;
}
.global-brand img {
    display: block;
    width: min(265px, 100%);
    max-height: 58px;
    object-fit: contain;
    object-position: left center;
}

.global-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.global-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 43px;
    padding: 10px 17px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--navy);
    font-size: 14px;
    font-weight: 800;
    transition: .18s ease;
}
.global-nav-link:hover {
    border-color: var(--border);
    background: var(--blue-soft);
}
.global-nav-link.is-active {
    background: linear-gradient(135deg, #2e7fe8, var(--blue));
    color: white;
    box-shadow: 0 10px 22px rgba(46, 127, 232, .22);
}

.global-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 11px;
}
.connection-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border-radius: 999px;
    background: #edf9f5;
    color: #087759;
    font-size: 12px;
    font-weight: 850;
}
.connection-pill i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #34ba8d;
    box-shadow: 0 0 0 4px rgba(52, 186, 141, .11);
}

.header-menu {
    position: relative;
}
.header-menu > summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
}
.header-menu > summary::-webkit-details-marker { display: none; }
.settings-menu > summary {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: white;
    color: var(--navy);
    font-weight: 850;
}
.settings-menu[open] > summary,
.settings-menu > summary:hover {
    background: var(--blue-soft);
    border-color: var(--blue);
}
.account-menu > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 5px 4px 8px;
    border-radius: 15px;
}
.account-menu > summary:hover { background: var(--blue-soft); }
.header-avatar {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--navy);
    color: white;
    font-weight: 900;
}
.header-user-copy strong,
.header-user-copy small { display: block; white-space: nowrap; }
.header-user-copy strong { font-size: 13px; }
.header-user-copy small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.header-chevron { padding: 6px; font-weight: 900; }

.header-popover {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    z-index: 120;
    min-width: 295px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: white;
    box-shadow: 0 24px 65px rgba(7, 49, 114, .18);
}
.settings-popover a {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 13px;
}
.settings-popover a:hover,
.account-popover a:hover { background: var(--blue-soft); }
.settings-popover strong,
.settings-popover small { display: block; }
.settings-popover strong { font-size: 14px; }
.settings-popover small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.popover-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--blue-soft);
    color: var(--blue-2);
    font-size: 18px;
    font-weight: 900;
}
.account-popover { min-width: 235px; }
.account-lab {
    padding: 10px 11px 12px;
    border-bottom: 1px solid #e9f0fa;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}
.account-popover a {
    display: block;
    padding: 11px;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 800;
}

.main-content-header {
    width: min(1760px, 100%);
    margin: 0 auto;
    padding: 34px 36px 55px;
}
.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 25px;
}
.page-heading h1 {
    margin: 0;
    font-size: clamp(31px, 3.2vw, 48px);
    line-height: 1;
    letter-spacing: -.045em;
}
.page-heading-action { flex: 0 0 auto; }

.home-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}
.home-hero h1 {
    margin: 0;
    font-size: clamp(39px, 4vw, 58px);
    line-height: 1;
    letter-spacing: -.05em;
}
.home-hero p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 17px;
    font-weight: 650;
}
.home-date {
    padding: 11px 15px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: white;
    color: var(--navy);
    font-size: 13px;
    font-weight: 800;
}

.home-action-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(190px, 1fr));
    gap: 17px;
    margin-bottom: 22px;
}
.home-action-card {
    position: relative;
    min-height: 148px;
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) 20px;
    align-items: center;
    gap: 13px;
    padding: 21px;
    overflow: hidden;
    border-radius: 22px;
    color: white;
    box-shadow: 0 18px 38px rgba(7, 49, 114, .16);
    transition: transform .18s ease, box-shadow .18s ease;
}
.home-action-card::after {
    content: '';
    position: absolute;
    width: 155px;
    height: 155px;
    right: -80px;
    bottom: -100px;
    border: 24px solid rgba(255,255,255,.11);
    border-radius: 42px;
    transform: rotate(17deg);
}
.home-action-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 48px rgba(7, 49, 114, .21);
}
.home-card-day { background: linear-gradient(135deg, #0a387c, #1a5db8); }
.home-card-problem { background: linear-gradient(135deg, #e77a25, var(--joy-orange)); }
.home-card-done { background: linear-gradient(135deg, #159a75, var(--joy-green)); }
.home-card-present { background: linear-gradient(135deg, #6d56d6, var(--joy-purple)); }
.home-card-add { background: linear-gradient(135deg, #158eb4, var(--joy-cyan)); }
.home-action-icon {
    width: 59px;
    height: 59px;
    display: grid;
    place-items: center;
    position: relative;
    z-index: 1;
    border-radius: 17px;
    background: rgba(255,255,255,.92);
    color: var(--navy);
    font-size: 28px;
    font-weight: 900;
}
.home-action-copy {
    position: relative;
    z-index: 1;
    min-width: 0;
}
.home-action-copy small,
.home-action-copy strong,
.home-action-copy em { display: block; }
.home-action-copy small {
    margin-bottom: 3px;
    font-size: 13px;
    font-style: normal;
    font-weight: 850;
}
.home-action-copy strong {
    font-size: 32px;
    line-height: 1.05;
    letter-spacing: -.04em;
}
.home-action-copy .home-action-word { font-size: 24px; }
.home-action-copy em {
    margin-top: 5px;
    opacity: .88;
    font-size: 11px;
    font-style: normal;
    font-weight: 650;
}
.home-action-arrow {
    position: relative;
    z-index: 1;
    font-size: 29px;
    font-weight: 500;
}

.home-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 335px;
    gap: 20px;
    align-items: start;
}
.home-production-panel,
.home-side-panel {
    border: 1px solid var(--border);
    border-radius: 23px;
    background: white;
    box-shadow: var(--shadow);
}
.home-production-panel { padding: 25px 27px 19px; }
.home-panel-heading,
.home-side-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}
.home-panel-heading { margin-bottom: 18px; }
.home-panel-heading h2,
.home-side-heading h2 { margin: 0; letter-spacing: -.025em; }
.home-panel-heading h2 { font-size: 24px; }
.home-panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.home-panel-heading > a,
.home-side-link {
    color: var(--blue-2);
    font-size: 12px;
    font-weight: 850;
}
.home-collaborator-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(210px, 1fr));
    overflow-x: auto;
}
.home-collaborator-column {
    min-width: 0;
    padding: 0 15px;
    border-right: 1px solid #e6eef9;
}
.home-collaborator-column:first-child { padding-left: 0; }
.home-collaborator-column:last-child { padding-right: 0; border-right: 0; }
.home-collaborator-column > header {
    min-height: 44px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    margin-bottom: 12px;
}
.home-person-avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--navy);
    color: white;
    font-size: 11px;
    font-weight: 900;
}
.home-collaborator-column > header strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-collaborator-column > header small {
    padding: 5px 8px;
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue-2);
    white-space: nowrap;
    font-size: 10px;
    font-weight: 850;
}
.home-task-list { display: grid; gap: 8px; }
.home-task-row {
    min-height: 65px;
    display: grid;
    grid-template-columns: 27px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 9px;
    border: 1px solid #dbe8f9;
    border-left: 3px solid var(--blue);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 5px 15px rgba(7,49,114,.045);
}
.home-task-row:hover { background: #f8fbff; }
.home-task-number {
    color: var(--blue-2);
    font-size: 16px;
    font-weight: 900;
    text-align: center;
}
.home-task-copy { min-width: 0; }
.home-task-copy strong,
.home-task-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-task-copy strong { font-size: 11px; }
.home-task-copy small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.home-task-status {
    padding: 5px 7px;
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue-2);
    white-space: nowrap;
    font-size: 9px;
    font-weight: 850;
}
.home-task-status.status-problem { background: #fff0e6; color: #bd5a13; }
.home-task-status.status-done { background: #eaf9f4; color: #087759; }
.home-task-status.status-in_progress { background: #e9f2ff; color: #2169cb; }
.home-column-link {
    display: block;
    margin-top: 14px;
    color: var(--blue-2);
    font-size: 11px;
    font-weight: 850;
}
.home-no-task,
.home-empty-state,
.home-side-empty {
    color: var(--muted);
    font-size: 12px;
}
.home-no-task { padding: 22px 9px; text-align: center; }
.home-empty-state {
    display: grid;
    gap: 5px;
    padding: 55px 20px;
    text-align: center;
}
.home-empty-state strong { color: var(--navy); font-size: 16px; }

.home-side-stack { display: grid; gap: 18px; }
.home-side-panel { padding: 20px; }
.home-side-heading { margin-bottom: 13px; }
.home-side-heading h2 { font-size: 20px; }
.home-side-heading > span {
    min-width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue-2);
    font-size: 11px;
    font-weight: 900;
}
.home-side-list { display: grid; gap: 8px; }
.home-side-list a {
    min-height: 61px;
    display: grid;
    grid-template-columns: 33px minmax(0, 1fr) 12px;
    align-items: center;
    gap: 9px;
    padding: 9px;
    border: 1px solid #dbe8f9;
    border-radius: 12px;
    background: #fafdff;
}
.home-side-list a:hover { background: var(--blue-soft); }
.home-side-icon {
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: white;
    color: var(--blue-2);
    border: 1px solid var(--border);
    font-weight: 900;
}
.home-side-list strong,
.home-side-list small { display: block; }
.home-side-list strong { font-size: 11px; }
.home-side-list small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.3; }
.home-problem-list a { background: #fff8f2; border-color: #f4d1b7; }
.home-problem-list .home-side-icon { color: #bd5a13; border-color: #f4d1b7; }
.home-side-link { display: block; margin-top: 13px; }
.home-side-empty { padding: 20px 3px 5px; }

/* Les anciennes pages conservent leurs fonctions mais adoptent le même cadre. */
.panel,
.stat-card,
.balance-heading,
.balance-section,
.balance-submit-bar,
.day-toolbar,
.board-lane {
    box-shadow: 0 12px 34px rgba(7, 49, 114, .08);
}

@media (max-width: 1400px) {
    .global-header { grid-template-columns: 230px 1fr auto; padding-inline: 23px; }
    .connection-pill { display: none; }
    .home-action-grid { grid-template-columns: repeat(3, minmax(210px, 1fr)); }
    .home-card-add { grid-column: span 2; }
    .home-dashboard-grid { grid-template-columns: minmax(0, 1fr) 300px; }
    .home-collaborator-grid { grid-template-columns: repeat(4, minmax(225px, 1fr)); }
}

@media (max-width: 1120px) {
    .global-header {
        position: static;
        grid-template-columns: 220px 1fr;
        gap: 13px;
    }
    .global-nav { order: 3; grid-column: 1 / -1; justify-content: flex-start; overflow-x: auto; }
    .global-header-actions { justify-self: end; }
    .header-user-copy { display: none; }
    .home-dashboard-grid { grid-template-columns: 1fr; }
    .home-side-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
    .global-header {
        display: flex;
        flex-wrap: wrap;
        min-height: auto;
        padding: 12px 14px;
    }
    .global-brand { width: 185px; }
    .global-brand img { max-height: 45px; }
    .global-header-actions { margin-left: auto; }
    .settings-menu > summary span,
    .header-chevron { display: none; }
    .settings-menu > summary { width: 43px; justify-content: center; padding: 8px; }
    .account-menu > summary { padding: 0; }
    .global-nav { width: 100%; order: 4; justify-content: flex-start; overflow-x: auto; }
    .global-nav-link { flex: 0 0 auto; min-height: 38px; padding: 8px 13px; font-size: 12px; }
    .header-popover { position: fixed; top: 78px; left: 12px; right: 12px; min-width: 0; }
    .main-content-header { padding: 24px 14px 38px; }
    .page-heading { align-items: flex-start; }
    .page-heading-action { min-height: 40px; padding: 8px 12px; font-size: 12px; }
    .home-hero { align-items: flex-start; }
    .home-date { display: none; }
    .home-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
    .home-card-add { grid-column: 1 / -1; }
    .home-action-card { min-height: 126px; grid-template-columns: 48px minmax(0, 1fr) 15px; padding: 15px; }
    .home-action-icon { width: 46px; height: 46px; border-radius: 14px; font-size: 22px; }
    .home-action-copy small { font-size: 11px; }
    .home-action-copy strong { font-size: 26px; }
    .home-action-copy em { display: none; }
    .home-production-panel { padding: 18px 14px; }
    .home-panel-heading { align-items: flex-start; }
    .home-panel-heading p { display: none; }
    .home-collaborator-grid { display: flex; overflow-x: auto; }
    .home-collaborator-column { flex: 0 0 280px; padding-inline: 12px; }
    .home-side-stack { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .global-brand { width: 160px; }
    .home-hero h1 { font-size: 38px; }
    .home-action-grid { grid-template-columns: 1fr; }
    .home-card-add { grid-column: auto; }
    .home-action-card { min-height: 112px; }
    .page-heading { display: grid; }
    .page-heading-action { width: 100%; }
}

/* Header final retenu : logo à gauche, paramètres et compte à droite. */
.global-header {
    grid-template-columns: minmax(230px, 320px) auto;
}
.global-header-actions {
    grid-column: 2;
}
@media (max-width: 1120px) {
    .global-header {
        grid-template-columns: minmax(200px, 260px) auto;
    }
    .global-header-actions { grid-column: auto; }
}
@media (max-width: 800px) {
    .global-header { display: flex; }
}

/* =========================================================
   Production Labo — Header, pauses et attribution V3
   ========================================================= */
.global-nav {
    min-width: 150px;
}
.global-nav-link {
    min-width: 116px;
}
.collaborator-page-actions {
    display: flex;
    justify-content: flex-end;
    margin: -5px 0 16px;
}
.schedule-row {
    grid-template-columns: 132px repeat(4, minmax(110px, 1fr));
}
.schedule-time-pause input {
    background: #f8fbff;
}
.date-choice-row .date-quick {
    min-width: 132px;
}
@media (max-width: 1180px) {
    .schedule-row {
        grid-template-columns: 120px repeat(2, minmax(130px, 1fr));
    }
    .schedule-time-pause,
    .schedule-row .schedule-time:last-child {
        grid-column: auto;
    }
}
@media (max-width: 760px) {
    .collaborator-page-actions { justify-content: stretch; }
    .collaborator-page-actions .btn { width: 100%; }
    .schedule-row { grid-template-columns: 1fr 1fr; }
    .schedule-day { grid-column: 1 / -1; }
    .date-choice-row .date-quick { flex: 1 1 145px; }
}

/* =========================================================
   Production Labo — Correctifs de présentation V4
   Header compact sur une seule ligne + page collaborateurs
   ========================================================= */

/* Header desktop : logo à gauche, Accueil exactement au centre,
   paramètres et compte à droite, sans seconde ligne vide. */
.global-header {
    min-height: 86px;
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(120px, 1fr) minmax(330px, auto);
    align-items: center;
    gap: 20px;
    padding: 12px 30px;
}
.global-brand {
    grid-column: 1;
    justify-self: start;
}
.global-brand img {
    width: min(255px, 100%);
    max-height: 52px;
}
.global-nav {
    grid-column: 2;
    justify-self: center;
    width: auto;
    min-width: 0;
    order: initial;
}
.global-nav-link {
    min-width: 116px;
}
.global-header-actions {
    grid-column: 3;
    justify-self: end;
    width: auto;
    margin-left: 0;
}

/* La page Collaborateurs dispose enfin de la largeur nécessaire
   pour afficher les horaires et la pause de midi sans chevauchement. */
.collaborator-settings-layout {
    grid-template-columns: minmax(690px, 760px) minmax(440px, 1fr);
    gap: 20px;
    align-items: start;
}
.collaborator-settings-layout > .panel,
.collaborator-settings-layout .form-panel,
.collaborator-settings-layout .collaborator-list,
.collaborator-settings-layout .collaborator-card,
.collaborator-settings-layout .collaborator-main {
    min-width: 0;
}
.collaborator-settings-layout .form-panel {
    overflow: visible;
}
.collaborator-settings-layout .schedule-row {
    grid-template-columns: 112px repeat(4, minmax(104px, 1fr));
    gap: 8px;
    width: 100%;
}
.collaborator-settings-layout .schedule-time,
.collaborator-settings-layout .schedule-time input {
    min-width: 0;
    width: 100%;
}
.collaborator-settings-layout .collaborator-card {
    width: 100%;
}
.collaborator-settings-layout .schedule-chip {
    max-width: 100%;
    white-space: normal;
    line-height: 1.35;
}

@media (max-width: 1500px) {
    .collaborator-settings-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1180px) {
    .global-header {
        grid-template-columns: minmax(185px, 230px) minmax(100px, 1fr) auto;
        gap: 12px;
        padding-inline: 20px;
    }
    .global-brand img { max-height: 46px; }
    .header-user-copy { display: none; }
}

@media (max-width: 820px) {
    .global-header {
        display: flex;
        flex-wrap: wrap;
        min-height: auto;
        padding: 11px 14px;
    }
    .global-brand { width: 180px; }
    .global-header-actions { margin-left: auto; }
    .global-nav {
        order: 4;
        width: 100%;
        justify-content: center;
    }
    .collaborator-settings-layout .schedule-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .collaborator-settings-layout .schedule-day {
        grid-column: 1 / -1;
    }
}
