:root {
    --ink: #16183e;
    --muted: #6e7084;
    --line: #d8dbe6;
    --blue: #74b9d8;
    --navy: #202346;
    --orange: #f59a23;
    --paper: #ffffff;
    --soft: #f6f8fb;
    --danger: #9a2330;
    --success: #1f7a50;
    --shadow: 0 24px 80px rgba(22, 24, 62, 0.16);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    background: var(--soft);
}

a {
    color: inherit;
}

.login-page {
    min-height: 100vh;
    overflow-x: hidden;
    background: #ffffff;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 31vw);
}

.login-visual {
    min-height: 100vh;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0) 72%, rgba(255, 255, 255, 0.55) 100%),
        url("../img/login-background.jpg") center / cover no-repeat;
}

.login-panel {
    position: relative;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    justify-content: center;
    padding: clamp(32px, 5vw, 72px);
    background: var(--paper);
    border-radius: 0 0 0 56px;
    box-shadow: var(--shadow);
}

.brand-mark {
    width: 168px;
    height: auto;
    display: grid;
    place-items: center;
    margin: 0 auto 28px;
    color: var(--ink);
    font-size: 62px;
    font-weight: 800;
    letter-spacing: 0;
}

.brand-mark img {
    width: 140px;
    height: auto;
    object-fit: contain;
}

.welcome,
.subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 22px;
}

.login-panel h1 {
    margin: 2px 0 8px;
    color: var(--ink);
    font-size: clamp(38px, 4vw, 56px);
    line-height: 0.96;
    letter-spacing: 0;
}

.subtitle {
    width: fit-content;
    padding-bottom: 9px;
    border-bottom: 3px solid var(--blue);
}

.login-form,
.setup-form {
    display: grid;
    gap: 12px;
    margin-top: 30px;
}

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

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
select,
textarea {
    width: 100%;
    min-height: 44px;
    border: 2px solid #b7bac7;
    border-radius: 8px;
    padding: 0 14px;
    color: var(--ink);
    font: inherit;
    background: #ffffff;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea {
    min-height: 220px;
    padding: 16px;
    resize: vertical;
    line-height: 1.55;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(116, 185, 216, 0.25);
    outline: none;
}

input[type="date"] {
    appearance: none;
    color-scheme: light;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.72;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    background: rgba(116, 185, 216, 0.16);
    opacity: 1;
}

.password-row {
    position: relative;
}

.password-row input {
    padding-right: 98px;
}

.show-password {
    position: absolute;
    top: 50%;
    right: 10px;
    min-height: 38px;
    padding: 0 12px;
    border: 0;
    border-radius: 6px;
    color: var(--ink);
    background: transparent;
    font-weight: 700;
    cursor: pointer;
}

.remember {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 2px 0 18px;
    font-weight: 700;
}

.remember input {
    width: 20px;
    height: 20px;
    accent-color: var(--navy);
}

.primary-button,
.secondary-button,
.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    padding: 0 22px;
    color: #ffffff;
    background: var(--navy);
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(32, 35, 70, 0.18);
}

.secondary-button {
    min-height: 44px;
    background: #ffffff;
    color: var(--navy);
    border: 1px solid var(--line);
    text-transform: none;
}

.button-with-icon {
    gap: 10px;
}

.button-with-icon span {
    font-size: 20px;
    line-height: 1;
}

.forgot-link,
.setup-link {
    margin-top: 18px;
    color: var(--muted);
    text-align: center;
    text-decoration: none;
}

.setup-link a,
.back-link {
    color: var(--navy);
    font-weight: 800;
}

.alert {
    margin-top: 22px;
    padding: 14px 16px;
    border-left: 4px solid var(--danger);
    border-radius: 8px;
    color: var(--danger);
    background: #fff2f3;
}

.alert.success {
    color: var(--success);
    border-left-color: var(--success);
    background: #effaf4;
}

.alert.warning {
    color: #8a5d00;
    border-left-color: #f0a818;
    background: #fff8ea;
}

.alert p {
    margin: 0;
}

.setup-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.setup-card {
    width: min(100%, 560px);
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.setup-card h1 {
    margin: 18px 0 8px;
}

.setup-intro {
    color: var(--muted);
    line-height: 1.6;
}

.as-link {
    width: 100%;
    margin-top: 18px;
}

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

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

.mobile-nav-bar,
.sidebar-backdrop,
.mobile-menu-close {
    display: none;
}

.sidebar {
    min-height: 100vh;
    padding: 24px 18px;
    color: #ffffff;
    background: var(--navy);
}

.app-brand {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 6px 6px 28px;
}

.app-logo {
    width: 58px;
    height: 50px;
    display: grid;
    place-items: center;
    font-weight: 800;
}

.app-logo img {
    width: 54px;
    height: 46px;
    object-fit: contain;
}

.app-brand strong,
.app-brand span {
    display: block;
}

.app-brand span {
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 13px;
}

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

.nav-link,
.nav-group summary,
.nav-group a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    flex: 0 0 20px;
    align-items: center;
    justify-content: center;
    opacity: 0.88;
}

.nav-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.nav-link.active,
.nav-link:hover,
.nav-group summary:hover,
.nav-group[open] summary {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.nav-group a.active {
    color: #ffffff;
    background: rgba(116, 185, 216, 0.2);
}

.nav-group {
    border-radius: 8px;
}

.nav-group summary {
    cursor: pointer;
    list-style: none;
}

.nav-group summary::after {
    width: 7px;
    height: 7px;
    margin-left: auto;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    content: "";
    opacity: 0.68;
    transform: rotate(45deg);
    transition: transform 160ms ease;
}

.nav-badge {
    min-width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 0 7px;
    border-radius: 999px;
    color: #ffffff;
    background: var(--danger);
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}

.nav-group summary:has(.nav-badge)::after {
    margin-left: 6px;
}

.nav-group[open] summary::after {
    transform: rotate(225deg);
}

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

.nav-group a {
    margin-left: 14px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 14px;
}

.nav-group a .nav-icon {
    width: 17px;
    height: 17px;
    flex-basis: 17px;
    opacity: 0.74;
}

.logout {
    margin-top: 18px;
}

.workspace {
    min-width: 0;
    padding: 34px;
}

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

.topbar p,
.topbar h1 {
    margin: 0;
}

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

.topbar h1 {
    margin-top: 4px;
    font-size: 32px;
}

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

.content-band {
    margin-top: 32px;
    padding: 28px 0;
    border-top: 1px solid var(--line);
}

.content-band h2 {
    margin: 0 0 10px;
}

.content-band p {
    max-width: 760px;
    color: var(--muted);
    line-height: 1.7;
}

.dashboard-hero {
    margin-top: 28px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(190px, 260px);
    gap: 18px;
    align-items: stretch;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(15, 104, 160, 0.08), rgba(242, 145, 0, 0.12)),
        var(--surface);
}

.dashboard-hero span,
.dashboard-metrics span,
.dashboard-module-list span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.dashboard-hero h2 {
    margin: 8px 0 8px;
    font-size: 30px;
}

.dashboard-hero p {
    margin: 0;
    max-width: 640px;
    color: var(--muted);
    line-height: 1.7;
}

.dashboard-hero-metric {
    display: grid;
    align-content: center;
    justify-items: start;
    gap: 4px;
    padding: 18px;
    border: 1px solid rgba(15, 104, 160, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
}

.dashboard-hero-metric strong {
    font-size: 42px;
    line-height: 1;
}

.dashboard-metrics {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.dashboard-metrics div,
.dashboard-module-list a,
.dashboard-request-list a {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.dashboard-metrics div {
    min-height: 116px;
    display: grid;
    align-content: center;
    gap: 7px;
    padding: 18px;
}

.dashboard-metrics strong {
    font-size: 30px;
    line-height: 1;
}

.dashboard-metrics small,
.dashboard-module-list small,
.dashboard-request-list small {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 24px;
}

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

.dashboard-module-list,
.dashboard-request-list {
    display: grid;
    gap: 10px;
}

.dashboard-module-list a,
.dashboard-request-list a {
    display: grid;
    gap: 5px;
    padding: 16px;
    color: inherit;
    text-decoration: none;
}

.dashboard-module-list a:hover,
.dashboard-request-list a:hover {
    border-color: rgba(15, 104, 160, 0.35);
    transform: translateY(-1px);
}

.dashboard-module-list strong {
    font-size: 24px;
}

.dashboard-request-list strong {
    font-size: 15px;
}

.dashboard-request-list span {
    color: var(--ink);
    font-weight: 800;
}

.dashboard-latest-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.dashboard-latest-card {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.dashboard-latest-head {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--line);
}

.dashboard-latest-head h3 {
    margin: 0;
    font-size: 17px;
}

.dashboard-latest-head a {
    color: var(--blue);
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
}

.dashboard-latest-list {
    display: grid;
    gap: 0;
}

.dashboard-latest-list a {
    display: grid;
    gap: 5px;
    padding: 14px 16px;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--line);
}

.dashboard-latest-list a:last-child {
    border-bottom: 0;
}

.dashboard-latest-list a:hover {
    background: rgba(15, 104, 160, 0.06);
}

.dashboard-latest-list strong,
.dashboard-latest-list span,
.dashboard-latest-list small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.dashboard-latest-list span,
.dashboard-latest-list small {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.compact-empty {
    padding: 18px;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.section-heading h2,
.section-heading p {
    margin: 0;
}

.section-heading p {
    margin-top: 4px;
}

.list-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 130px auto auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 18px;
}

.search-field,
.per-page-field {
    display: grid;
    gap: 6px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 18px;
}

.pagination span {
    color: var(--muted);
    font-weight: 700;
}

.secondary-button.disabled {
    pointer-events: none;
    opacity: 0.45;
}

.narrow-form {
    width: min(100%, 520px);
}

.settings-form {
    width: min(100%, 920px);
}

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

.settings-grid label {
    display: grid;
    gap: 8px;
}

.check-field {
    min-height: 58px;
    display: flex !important;
    align-items: center;
    gap: 10px;
    align-self: end;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.check-field input {
    width: 20px;
    height: 20px;
    accent-color: var(--navy);
}

.settings-check-full {
    width: min(100%, 920px);
    align-self: stretch;
}

.form-note {
    margin: 4px 0 10px;
    color: var(--muted);
    font-size: 14px;
}

.settings-template {
    display: grid;
    gap: 12px;
    margin-top: 18px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.settings-template.no-top-border {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.settings-template h3 {
    margin: 0;
}

.settings-template p {
    margin: 0;
    color: var(--muted);
}

.settings-template code {
    color: var(--navy);
    font-weight: 800;
}

.access-request-shell {
    width: min(100%, 980px);
}

.access-request-form {
    gap: 24px;
}

.request-form-section {
    display: grid;
    gap: 14px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.request-form-section:first-of-type {
    padding-top: 0;
    border-top: 0;
}

.request-form-section h2 {
    margin: 0;
}

.radio-stack {
    display: grid;
    gap: 9px;
}

.radio-stack label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-weight: 700;
}

.radio-stack input[type="text"] {
    width: min(100%, 260px);
    min-height: 42px;
}

.quality-grid,
.quality-review-grid {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) repeat(3, 100px);
    gap: 8px;
    align-items: center;
}

.quality-grid > *,
.quality-review-grid > * {
    min-height: 34px;
    display: grid;
    align-items: center;
}

.quality-grid strong,
.quality-review-grid strong {
    justify-content: center;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
    text-transform: uppercase;
}

.quality-grid label,
.quality-review-grid span:not(:first-child) {
    justify-content: center;
    text-align: center;
}

.quality-grid input {
    width: 18px;
    height: 18px;
    accent-color: var(--navy);
}

.diag-axis-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
}

.diag-axis-card {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.diag-axis-title,
.diag-subfamily-list label {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: var(--ink);
}

.diag-axis-title {
    font-size: 15px;
}

.diag-axis-picker input,
.diag-subfamily-list input {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    accent-color: var(--navy);
}

.diag-axis-title strong,
.diag-subfamily-list span {
    min-width: 0;
    line-height: 1.35;
}

.diag-subfamily-list {
    display: grid;
    gap: 7px;
    padding-left: 29px;
}

.diag-subfamily-list label {
    font-size: 12px;
    font-weight: 700;
}

.diag-subfamily-list span {
    color: var(--muted);
}

.diag-admin-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 18px;
    align-items: start;
}

.diag-catalog-list,
.diag-catalog-actions,
.diag-selected-list {
    display: grid;
    gap: 10px;
}

.diag-selected-list {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.diag-selected-list span {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--navy);
    background: #fbfcfe;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
}

.diag-catalog-subfamilies {
    display: grid;
    gap: 8px;
}

.diag-catalog-subfamilies details {
    padding: 10px 12px;
    border: 1px solid #eceef4;
    border-radius: 8px;
    background: #fbfcfe;
}

.diag-catalog-subfamilies summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    font-weight: 900;
}

.diag-catalog-subfamilies small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.diag-proposition-list {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.diag-proposition-list article {
    display: grid;
    gap: 4px;
    padding: 10px;
    border-left: 4px solid var(--blue);
    border-radius: 0 8px 8px 0;
    background: #ffffff;
}

.diag-proposition-list strong,
.diag-proposition-list p,
.diag-proposition-list span,
.diag-proposition-list small {
    margin: 0;
    max-width: none;
}

.diag-proposition-list span,
.diag-proposition-list small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

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

.diag-value-grid input,
.diag-value-grid select {
    min-height: 46px;
}

.diag-content-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.diag-content-stats div {
    min-height: 92px;
    display: grid;
    align-content: center;
    gap: 6px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.diag-content-stats span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.diag-content-stats strong {
    font-size: 28px;
}

.diag-content-create {
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1fr) minmax(360px, 1.4fr);
    gap: 16px;
    align-items: start;
}

.diag-content-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.diag-content-index {
    position: sticky;
    top: 18px;
    display: grid;
    gap: 8px;
}

.diag-content-index a {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--navy);
    background: #ffffff;
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
}

.diag-content-list,
.diag-content-subfamilies,
.diag-content-propositions {
    display: grid;
    gap: 12px;
}

.diag-content-axis > header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.diag-inline-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin: 0;
}

.diag-inline-form input {
    min-height: 46px;
    font-weight: 900;
}

.diag-inline-form .secondary-button,
.diag-edit-block .secondary-button,
.diag-proposal-form .secondary-button {
    min-height: 46px;
}

.diag-content-subfamily,
.diag-content-proposal {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.diag-content-subfamily > summary,
.diag-content-proposal > summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 13px 14px;
    cursor: pointer;
}

.diag-content-subfamily > summary span,
.diag-content-proposal > summary small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.diag-content-proposal > summary span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.diag-content-subfamily-body,
.diag-proposal-form,
.diag-edit-block {
    display: grid;
    gap: 12px;
}

.diag-content-subfamily-body {
    padding: 0 14px 14px;
}

.diag-proposal-form {
    padding: 0 14px 14px;
}

.diag-proposal-form textarea {
    min-height: 96px;
}

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

.diag-pending-card {
    display: grid;
    gap: 14px;
}

.diag-pending-card header {
    align-items: start;
}

.diag-pending-card header div {
    display: grid;
    gap: 4px;
}

.diag-pending-card header small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.diag-pending-body {
    display: grid;
    gap: 12px;
}

.diag-pending-body p {
    margin: 0;
    color: var(--ink);
    font-weight: 800;
    line-height: 1.5;
}

.diag-pending-form,
.diag-pending-reject-form {
    display: grid;
    gap: 12px;
    margin: 0;
}

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

.diag-pending-fields label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.diag-pending-fields input,
.diag-pending-fields textarea {
    width: 100%;
    color: var(--ink);
    font-size: 14px;
    font-weight: 800;
    text-transform: none;
}

.diag-pending-proposition-field {
    grid-column: 1 / -1;
}

.diag-pending-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.diag-pending-meta span {
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: #fbfcfe;
    font-size: 12px;
    font-weight: 800;
}

.diag-pending-meta strong {
    color: var(--ink);
}

.diag-pending-actions {
    display: flex;
    justify-content: flex-end;
    margin: 0;
}

.diag-pending-reject-form {
    justify-content: flex-end;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
}

.questionnaire-shell.diag-passation-shell {
    width: min(calc(100% - 32px), 1520px);
    max-width: 1520px;
}

.diag-passation-head {
    margin-bottom: 18px;
}

.questionnaire-shell.diag-export-public {
    width: min(calc(100% - 32px), 1280px);
    max-width: 1280px;
}

.diag-export-preset-report {
    border-color: #1f9d83;
    background: #f3faf8;
}

.diag-passation-summary,
.diag-axis-overview {
    display: grid;
    gap: 12px;
}

.diag-passation-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 18px 0;
}

.diag-passation-summary div,
.diag-axis-overview a {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.diag-passation-summary span,
.diag-axis-overview span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.diag-passation-summary strong {
    display: block;
    margin-top: 5px;
    font-size: 30px;
}

.diag-passation-summary small {
    color: var(--muted);
    font-weight: 800;
}

.diag-axis-overview {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: 22px;
}

.diag-axis-overview a {
    display: grid;
    gap: 5px;
    color: var(--diag-axis-color, var(--navy));
    text-decoration: none;
    border-left: 5px solid var(--diag-axis-color, var(--navy));
    background: var(--diag-axis-soft, #fbfcfe);
}

.diag-passation-form,
.diag-passation-axis {
    display: grid;
    gap: 16px;
}

.diag-passation-axis {
    padding-top: 20px;
    border-top: 3px solid var(--diag-axis-color, var(--line));
}

.diag-passation-axis h2 {
    margin: 0;
    color: var(--diag-axis-color, var(--navy));
}

.diag-passation-subfamily {
    overflow-x: auto;
    border: 1px solid var(--diag-axis-line, var(--line));
    border-left: 5px solid var(--diag-axis-color, var(--line));
    border-radius: 8px;
    background: #ffffff;
}

.diag-passation-subfamily > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    color: var(--diag-axis-color, var(--navy));
    background: var(--diag-axis-soft, #ffffff);
    cursor: pointer;
}

.diag-passation-subfamily > summary span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.diag-passation-table {
    display: grid;
    overflow-x: auto;
    border-top: 1px solid var(--line);
}

.diag-passation-row {
    display: grid;
    grid-template-columns: minmax(320px, 1.8fr) 84px 72px 72px 82px minmax(190px, 1fr) 120px 140px 110px;
    gap: 6px;
    align-items: stretch;
    min-width: 1250px;
    padding: 8px 10px;
    border-bottom: 1px solid #eceef4;
}

.diag-passation-row:last-child {
    border-bottom: 0;
}

.diag-passation-row-head {
    color: var(--muted);
    background: #fbfcfe;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.diag-passation-row label {
    display: block;
}

.diag-passation-row > span {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 7px 9px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
}

.diag-passation-row input,
.diag-passation-row select,
.diag-passation-row textarea {
    min-height: 38px;
    padding: 7px 9px;
    border-width: 1px;
    font-size: 12px;
}

.diag-passation-row textarea {
    min-height: 38px;
}

.diag-passation-row select[data-diag-priority="haute"] {
    color: #b42318;
    border-color: #f3b7b1;
    background-color: #fef3f2;
    font-weight: 800;
}

.diag-passation-row select[data-diag-priority="basse"] {
    color: #5f6f8f;
    background-color: #f8fafc;
}

.diag-export-presets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.diag-export-preset {
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    text-decoration: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.diag-export-preset:hover,
.diag-export-preset.is-active {
    border-color: var(--navy);
    box-shadow: 0 8px 18px rgba(32, 35, 70, 0.12);
}

.diag-export-preset strong {
    color: var(--ink);
    font-size: 15px;
}

.diag-export-preset span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.diag-export-form {
    display: grid;
    gap: 16px;
}

.diag-export-fieldset {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.diag-export-fieldset legend {
    padding: 0 6px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.diag-export-fieldset h3 {
    margin: 0 0 8px;
    color: var(--ink);
    font-size: 13px;
}

.diag-export-fieldset h3 small {
    color: var(--muted);
    font-weight: 700;
}

.diag-export-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    align-items: start;
}

.diag-export-filters > label {
    display: grid;
    gap: 8px;
}

.diag-export-checks {
    display: grid;
    gap: 7px;
}

.diag-export-checks-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
}

.diag-export-checks-wide {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.diag-export-checks label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--ink);
    font-size: 13px;
    line-height: 1.35;
}

.diag-export-checks input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin: 0;
    accent-color: var(--navy);
}

.diag-export-check-all {
    grid-column: 1 / -1;
    color: var(--muted) !important;
    font-weight: 800;
}

.diag-export-range {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

.diag-export-range label {
    display: grid;
    gap: 4px;
    font-size: 12px;
}

.diag-export-hint {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.diag-export-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.diag-export-preview td {
    font-size: 13px;
    line-height: 1.4;
}

.diag-export-preview td.is-overdue {
    color: #b42318;
    font-weight: 800;
}

.diag-priority-tag {
    display: inline-flex;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.diag-priority-tag.is-haute {
    color: #ffffff;
    background: #b42318;
}

.diag-priority-tag.is-normale {
    color: #7a3e06;
    background: #fdebd3;
}

.diag-priority-tag.is-basse {
    color: #3f4b63;
    background: #e7eaf1;
}

.diag-legacy-deadline {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.3;
}

.diag-passation-proposal {
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
}

.diag-passation-add {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) 84px 72px 72px 82px 168px;
    gap: 6px;
    align-items: end;
    min-width: 820px;
    padding: 8px 10px 10px;
    border-top: 1px solid var(--line);
    background: #fbfcfe;
}

.diag-passation-add label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.diag-passation-add input,
.diag-passation-add select,
.diag-passation-add textarea {
    margin-top: 4px;
    min-height: 36px;
    padding: 6px 8px;
    border-width: 1px;
    font-size: 12px;
}

.diag-passation-add-proposal textarea {
    min-height: 36px;
}

.diag-passation-add .secondary-button {
    grid-column: 4 / -1;
    width: 100%;
    min-height: 36px;
    padding: 8px 12px;
    white-space: nowrap;
    font-size: 12px;
    line-height: 1.15;
}

.diag-passation-actions {
    position: sticky;
    bottom: 0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 14px 0 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), #ffffff 35%);
}

.diag-back-top {
    align-self: center;
}

.diag-request-edit {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.diag-integration-fieldset {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.diag-integration-fieldset legend {
    color: var(--navy);
    font-weight: 900;
}

.diag-integration-fieldset label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
}

.request-filter-form {
    display: grid;
    grid-template-columns: minmax(180px, 260px) minmax(160px, 220px) auto;
    gap: 12px;
    align-items: end;
}

.request-filter-form label {
    display: grid;
    gap: 6px;
}

.request-list {
    display: grid;
    gap: 16px;
}

.request-card {
    display: grid;
    gap: 18px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.request-card > header,
.request-card-status,
.request-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.request-card > header {
    justify-content: space-between;
}

.request-card-status {
    align-items: flex-end;
    flex-direction: column;
}

.request-card-status small {
    color: var(--muted);
    font-weight: 800;
}

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

.request-detail-grid div {
    min-height: 82px;
    display: grid;
    align-content: center;
    gap: 4px;
    padding: 12px;
    border: 1px solid #eceef4;
    border-radius: 8px;
    background: #fbfcfe;
}

.request-detail-grid span,
.request-comment span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.request-detail-grid strong {
    line-height: 1.4;
}

.request-details summary,
.reject-panel summary {
    width: fit-content;
    cursor: pointer;
    color: var(--navy);
    font-weight: 900;
}

.request-details[open],
.reject-panel[open] {
    display: grid;
    gap: 14px;
}

.request-comment {
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.request-comment p {
    margin: 0;
    max-width: none;
    color: var(--ink);
}

.request-attachment-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.request-attachment-list > span {
    width: 100%;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.request-attachment-list a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid #dfe3ee;
    border-radius: 8px;
    background: #ffffff;
    color: var(--navy);
    font-weight: 900;
    text-decoration: none;
}

.request-attachment-list small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.reject-panel {
    min-width: min(100%, 420px);
}

.reject-panel textarea {
    min-height: 130px;
}

.delete-request-panel {
    padding-top: 12px;
    border-top: 1px dashed var(--line);
}

.delete-request-panel summary {
    width: fit-content;
    cursor: pointer;
    color: var(--danger);
    font-weight: 900;
}

.request-delete-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.request-delete-actions p {
    margin: 0;
    max-width: 680px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

.data-table th,
.data-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

.list-progress {
    width: min(100%, 260px);
}

.list-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
}

.list-progress-head strong {
    font-size: 15px;
}

.list-progress-head span,
.list-progress small,
.status-muted {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.list-progress-bar {
    height: 10px;
    margin-bottom: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #e9ebf2;
}

.list-progress-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), var(--orange));
}

.icon-button {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--navy);
    background: #ffffff;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(22, 24, 62, 0.08);
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.icon-button:hover,
.icon-button:focus {
    border-color: var(--blue);
    box-shadow: 0 12px 24px rgba(22, 24, 62, 0.14);
    outline: none;
    transform: translateY(-1px);
}

.icon-button span {
    font-size: 20px;
    line-height: 1;
}

.icon-button.danger-icon {
    color: var(--danger);
}

.icon-button.danger-icon:hover,
.icon-button.danger-icon:focus {
    border-color: #e0a6ad;
}

.modal-open {
    overflow: hidden;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(22, 24, 62, 0.42);
}

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

.confirm-modal {
    width: min(100%, 480px);
    padding: 24px;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.confirm-modal h2 {
    margin: 0 0 10px;
}

.confirm-modal p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.invitation-modal {
    width: min(100%, 560px);
    padding: 28px;
}

.modal-kicker {
    width: fit-content;
    margin-bottom: 14px;
    padding: 7px 10px;
    border-radius: 999px;
    color: var(--navy);
    background: rgba(116, 185, 216, 0.18);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.modal-recap {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.modal-recap span {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--navy);
    background: #f8fafc;
    font-size: 13px;
    font-weight: 800;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 22px;
}

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

.danger-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.danger-text {
    color: var(--danger);
}

.form-actions,
.action-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.inline-delete-form {
    margin: 0;
}

.delete-line-form {
    margin-top: 16px;
}

.rh360-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.rh360-summary div {
    min-height: 96px;
    display: grid;
    align-content: center;
    gap: 6px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.rh360-summary span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.rh360-summary strong {
    font-size: 24px;
}

.rh360-progress {
    margin-top: 18px;
}

.status-pill {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    border: 1px solid rgba(31, 122, 80, 0.25);
    border-radius: 999px;
    color: var(--success);
    background: #effaf4;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}

.participant-form {
    margin-bottom: 22px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.rh360-table-space {
    margin-top: 8px;
}

.person-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.person-cell strong,
.person-cell span {
    display: block;
}

.person-cell span:not(.avatar-chip) {
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.avatar-chip {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #ffffff !important;
    background: linear-gradient(135deg, #202346 0%, #315673 55%, #74b9d8 100%);
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0;
    text-align: center;
    text-transform: uppercase;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
    margin: 0 !important;
    overflow: hidden;
}

.avatar-chip.large {
    width: 74px;
    height: 74px;
    flex-basis: 74px;
    font-size: 25px;
}

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

.feedback-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.feedback-card header {
    display: grid;
    gap: 3px;
    margin-bottom: 14px;
}

.feedback-card header span,
.feedback-card h3 {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.feedback-card h3,
.feedback-card p {
    margin: 0;
}

.feedback-card h3 {
    margin-top: 14px;
}

.feedback-card p {
    margin-top: 5px;
    max-width: none;
    color: var(--ink);
    line-height: 1.55;
}

.rh360-public-shell {
    width: min(100%, 1040px);
}

.rh360-public-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.rh360-public-head p,
.rh360-public-head h1,
.rh360-public-head span {
    margin: 0;
}

.rh360-public-head p {
    color: var(--muted);
    font-weight: 800;
    text-transform: uppercase;
}

.rh360-public-head span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-weight: 700;
}

.date-pill {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--navy);
    background: #ffffff;
    font-weight: 800;
    white-space: nowrap;
}

.rh360-peer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.peer-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 92px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.peer-card.is-done {
    border-color: rgba(31, 122, 80, 0.35);
    background: #f4fbf7;
}

.external-block {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.relation-form textarea {
    min-height: 150px;
}

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

.report-person {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

.report-person-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px;
    border-bottom: 1px solid var(--line);
    background: #fbfcfe;
}

.report-counts {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.report-counts span {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
    color: var(--navy);
    background: rgba(116, 185, 216, 0.14);
    font-size: 13px;
    font-weight: 800;
}

.report-comment-table {
    display: grid;
}

.report-comment-row {
    display: grid;
    grid-template-columns: 180px repeat(3, minmax(0, 1fr));
    border-bottom: 1px solid var(--line);
}

.report-comment-row.external-report-row {
    grid-template-columns: 150px 150px repeat(3, minmax(0, 1fr));
}

.report-comment-row > * {
    margin: 0;
    padding: 12px;
    border-right: 1px solid var(--line);
    line-height: 1.5;
}

.report-comment-row > *:last-child {
    border-right: 0;
}

.report-comment-header {
    color: var(--muted);
    background: #f6f8fb;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.report-empty {
    padding: 16px;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
}

.report-note {
    display: grid;
    gap: 8px;
    padding: 16px;
}

.report-note textarea {
    min-height: 140px;
}

.report-actions {
    justify-content: flex-end;
    margin-top: 18px;
}

.mission-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.mission-summary div,
.empty-state,
.mission-admin-category,
.assignment-detail {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.mission-summary div {
    min-height: 96px;
    display: grid;
    align-content: center;
    gap: 6px;
    padding: 18px;
}

.mission-summary span,
.assignment-mission span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.mission-summary strong {
    font-size: 28px;
}

.copy-assignment-form,
.inline-create-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.inline-create-form {
    grid-template-columns: minmax(220px, 1fr) auto;
}

.attribution-switcher {
    width: min(100%, 640px);
    margin-bottom: 16px;
}

.attribution-switcher label {
    display: grid;
    gap: 8px;
}

.attribution-create-form {
    grid-template-columns: minmax(200px, 1fr) 170px minmax(200px, 0.8fr) 110px minmax(190px, 0.7fr) auto;
}

.matrix-logo-thumb {
    width: 64px;
    height: 40px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
}

.matrix-logo-preview {
    align-items: start;
}

.matrix-logo-preview img {
    width: 120px;
    max-height: 72px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
}

.public-logo-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(260px, 0.8fr);
    gap: 16px;
    align-items: center;
}

.public-logo-panel > img,
.dossier-company-logo {
    width: 130px;
    max-height: 76px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
}

.dossier-company-logo {
    display: block;
    margin-top: 10px;
}

.public-logo-form {
    display: grid;
    gap: 10px;
}

.public-link-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.7fr);
    gap: 16px;
    align-items: end;
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.public-link-panel span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.public-link-panel a {
    word-break: break-all;
}

.public-link-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 10px;
    align-items: end;
    margin: 0;
}

.matrix-filter-toolbar {
    grid-template-columns: minmax(260px, 420px);
}

.matrix-table .active-row td {
    background: rgba(116, 185, 216, 0.08);
}

.matrix-count-pill {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    margin: 2px 4px 2px 0;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--navy);
    background: var(--soft);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.matrix-actions {
    flex-wrap: nowrap;
}

.matrix-actions .icon-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    transform: none;
}

.matrix-activate-button {
    min-height: 34px;
    padding: 0 14px;
    font-size: 13px;
    box-shadow: none;
}

.file-upload-field {
    min-height: 46px;
    display: grid;
    grid-template-columns: auto minmax(160px, 1fr);
    align-items: center;
    gap: 10px;
    padding: 4px;
    border: 1px solid #b8bfcd;
    border-radius: 8px;
    background: #ffffff;
}

.file-upload-field input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.file-upload-button {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border-radius: 6px;
    color: #ffffff;
    background: var(--navy);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
}

.file-upload-name {
    min-width: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.matrix-modal {
    width: min(100%, 620px);
}

.modal-field {
    display: grid;
    gap: 8px;
    margin-top: 16px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.modal-field input {
    color: var(--ink);
    font-size: 15px;
    font-weight: 700;
    text-transform: none;
}

.copy-feedback {
    margin: 10px 0 0;
    color: var(--success) !important;
    font-weight: 800;
}

.public-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0 6px;
}

.public-tabs a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--navy);
    background: #ffffff;
    font-weight: 800;
    text-decoration: none;
}

.public-tabs .tab-picto {
    width: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    line-height: 1;
}

.public-tabs a.active {
    color: #ffffff;
    background: var(--navy);
    border-color: var(--navy);
}

.mission-public-shell {
    width: 100%;
}

.public-matrix-wrap {
    max-height: 62vh;
}

.public-assignment-form {
    display: grid;
    grid-template-columns: 58px;
    gap: 4px;
    justify-items: stretch;
    margin: 0;
    padding: 4px;
}

.public-assignment-form .matrix-cell {
    min-width: 50px;
    height: 38px;
}

.public-assignment-form select {
    min-height: 32px;
    padding: 0 6px;
    border-width: 1px;
    font-size: 11px;
}

.public-copy-assignment-form {
    margin-bottom: 14px;
}

.inline-create-form.compact {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.mission-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.matrix-toolbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr)) repeat(4, minmax(120px, max-content));
    gap: 10px;
    align-items: end;
    margin-bottom: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.public-matrix-toolbar {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.public-matrix-toolbar .secondary-button {
    width: 100%;
    padding: 0 16px;
    white-space: nowrap;
}

.matrix-toolbar label {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.matrix-toolbar input,
.matrix-toolbar select {
    width: 100%;
    min-width: 0;
    min-height: 44px;
}

.matrix-count-line {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.mission-legend span {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.mission-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
}

.level-low,
.mission-dot.level-low {
    background: #2f9d57;
}

.level-medium,
.mission-dot.level-medium {
    background: #f0a818;
}

.level-high,
.mission-dot.level-high {
    background: #c73d43;
}

.mission-matrix-wrap {
    width: 100%;
    max-height: 70vh;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.mission-matrix {
    min-width: 920px;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.mission-matrix th,
.mission-matrix td {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.mission-matrix thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 10px;
    background: #fbfcfe;
}

.mission-label-col {
    position: sticky;
    left: 0;
    z-index: 6;
    width: 360px;
    min-width: 360px;
    padding: 12px;
    background: #ffffff;
    text-align: left;
}

.mission-matrix thead .mission-label-col {
    z-index: 8;
    background: #fbfcfe;
}

.mission-category-row th {
    position: sticky;
    left: 0;
    z-index: 4;
    padding: 11px 12px;
    color: #ffffff;
    background: var(--navy);
    text-align: left;
}

.employee-heading {
    width: 86px;
    min-width: 86px;
    vertical-align: bottom;
}

.employee-heading strong,
.employee-heading small {
    display: block;
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.employee-heading .avatar-chip {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    font-size: 13px;
}

.employee-heading small {
    color: var(--muted);
    font-size: 11px;
}

.matrix-cell-form {
    margin: 0;
}

.matrix-cell {
    width: 100%;
    min-width: 50px;
    height: 46px;
    display: grid;
    grid-template-columns: 1fr;
    place-items: center;
    border: 0;
    color: #ffffff;
    text-decoration: none;
    cursor: pointer;
}

.matrix-cell strong {
    font-size: 16px;
    line-height: 1;
}

.matrix-cell span {
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.matrix-cell.empty {
    color: var(--muted);
    background: #ffffff;
}

.matrix-cell.empty:hover,
.matrix-cell.empty:focus {
    color: var(--navy);
    background: rgba(116, 185, 216, 0.12);
    outline: none;
}

.matrix-cell.level-low {
    background: #2f9d57;
}

.matrix-cell.level-medium {
    background: #f0a818;
}

.matrix-cell.level-high {
    background: #c73d43;
}

.matrix-cell.level-none {
    color: var(--navy);
    background: #e9ebf2;
}

.empty-state {
    display: grid;
    gap: 12px;
    padding: 22px;
}

.empty-state h3,
.empty-state p {
    margin: 0;
}

.mission-admin-list {
    display: grid;
    gap: 16px;
}

.mission-admin-category {
    padding: 18px;
}

.mission-admin-category > header,
.mission-admin-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.mission-admin-items {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.mission-admin-item {
    padding: 12px;
    border: 1px solid #eceef4;
    border-radius: 8px;
    background: #fbfcfe;
}

.mission-title-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin: 0;
}

.mission-title-form input,
.inline-create-form input {
    min-height: 46px;
}

.mission-title-form .primary-button,
.mission-title-form .secondary-button,
.inline-create-form .primary-button,
.inline-create-form .secondary-button {
    min-height: 46px;
    padding: 0 18px;
}

.assignment-detail {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 18px;
    margin-bottom: 22px;
    padding: 20px;
}

.assignment-person {
    display: flex;
    align-items: center;
    gap: 14px;
}

.assignment-person p,
.assignment-person h2,
.assignment-person span {
    margin: 0;
}

.assignment-person p,
.assignment-person span {
    color: var(--muted);
    font-weight: 700;
}

.assignment-mission {
    display: grid;
    align-content: center;
    gap: 8px;
    padding: 16px;
    border-left: 1px solid var(--line);
}

.assignment-mission strong {
    font-size: 22px;
    line-height: 1.35;
}

.job-status {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    margin: 2px;
    padding: 0 10px;
    border-radius: 999px;
    color: var(--navy);
    background: #eef2f7;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.job-status.pending { background: #fff5d8; color: #876018; }
.job-status.signed { background: #e8fbf4; color: var(--success); }
.job-status.cancelled { background: #fff2f3; color: var(--danger); }
.job-status.alerting { background: #ffe9e9; color: var(--danger); }

.create-dossier-panel summary {
    cursor: pointer;
    color: var(--navy);
    font-weight: 800;
}

.condition-picker {
    display: grid;
    gap: 10px;
}

.condition-picker fieldset {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.condition-picker legend {
    color: var(--navy);
    font-weight: 900;
}

.condition-picker label {
    display: block;
    margin: 7px 0;
    color: var(--ink);
    font-weight: 700;
}

.dossier-head,
.dossier-layout {
    display: grid;
    gap: 18px;
}

.dossier-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.dossier-layout {
    grid-template-columns: 280px minmax(0, 1fr);
}

.dossier-side {
    display: grid;
    align-content: start;
    gap: 10px;
}

.dossier-side h2 {
    margin: 0 0 8px;
}

.dossier-side a {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #ffffff;
    text-decoration: none;
    font-weight: 900;
}

.dossier-side a.active {
    border-color: var(--blue);
    background: rgba(116, 185, 216, 0.12);
}

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

.status-form,
.dossier-editor {
    display: grid;
    gap: 10px;
}

.job-html-editor {
    min-height: 520px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
}

.job-editable-surface {
    min-height: 620px;
    padding: 22px;
    border: 2px solid #b7bac7;
    border-radius: 8px;
    background: #f6f8fb;
    outline: none;
}

.job-editable-surface .fp-sheet {
    max-width: 186mm;
    margin: 0 auto;
    padding: 4mm 6mm;
    background: #ffffff;
}

.regenerate-form {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.regenerate-form p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.job-editable-surface:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(116, 185, 216, 0.25);
}

.job-sheet {
    color: var(--ink);
}

.job-hero {
    padding: 26px;
    border-radius: 8px;
    color: #ffffff;
    background: var(--navy);
}

.job-hero span,
.job-identity span,
.job-section h2 {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.job-hero span {
    color: rgba(255, 255, 255, 0.7);
}

.job-hero h1,
.job-hero p {
    margin: 0;
}

.job-hero h1 {
    margin: 6px 0;
}

.job-identity {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 18px 0;
}

.job-identity div,
.job-condition-grid section,
.job-signatures div {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.job-identity strong {
    display: block;
    margin-top: 4px;
}

.job-section {
    margin-top: 24px;
}

.job-section h2 {
    margin: 0 0 10px;
}

.job-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.job-list li {
    padding: 12px;
    border-left: 4px solid var(--blue);
    border-radius: 0 8px 8px 0;
    background: #ffffff;
    line-height: 1.5;
}

.job-list span {
    display: inline-flex;
    margin-right: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    color: #ffffff;
    background: var(--navy);
    font-size: 12px;
    font-weight: 800;
}

.job-empty {
    margin: 0;
    color: var(--muted);
}

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

.job-condition-grid h4 {
    margin: 0 0 8px;
}

.job-condition-grid ul {
    margin: 0;
    padding-left: 18px;
    line-height: 1.55;
}

.job-signatures {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 28px;
}

.job-signatures div {
    min-height: 120px;
}

.public-page {
    min-height: 100vh;
    padding: clamp(18px, 4vw, 54px);
    background:
        linear-gradient(120deg, rgba(116, 185, 216, 0.16), rgba(245, 154, 35, 0.08)),
        var(--soft);
}

.questionnaire-shell {
    width: min(100%, 920px);
    margin: 0 auto;
    padding: clamp(24px, 5vw, 56px);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.questionnaire-shell.mission-public-shell {
    width: 100%;
}

.questionnaire-shell h1 {
    margin: 0 0 18px;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.08;
}

.questionnaire-shell p {
    color: var(--muted);
    line-height: 1.7;
}

.progress-line {
    height: 12px;
    margin-bottom: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--line);
}

.progress-line span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--blue);
}

.step-label {
    margin: 0 0 22px;
    font-weight: 800;
    text-transform: uppercase;
}

.question-card {
    display: block;
    width: 100%;
    margin: 14px 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.selected-question {
    background: #f7f8fb;
}

.question-card h2 {
    margin: 0 0 12px;
    font-size: 22px;
}

.question-button {
    width: 100%;
    border: 0;
    padding: 0;
    color: var(--ink);
    background: transparent;
    font: inherit;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.45;
    text-align: left;
    cursor: pointer;
}

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

.choice-grid .secondary-button {
    width: 100%;
}

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

.ranking-board {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 18px;
}

.ranking-source,
.ranking-slots {
    display: grid;
    gap: 12px;
}

.ranking-source {
    align-content: start;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7f8fb;
}

.ranking-source h2 {
    margin: 0 0 4px;
    font-size: 18px;
}

.ranking-phrase {
    display: block;
    width: 100%;
    min-height: 76px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #ffffff;
    font: inherit;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.35;
    text-align: left;
    cursor: grab;
}

.ranking-phrase.is-dragging {
    opacity: 0.55;
}

.ranking-slot {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: stretch;
    gap: 12px;
    min-height: 96px;
}

.ranking-position {
    display: grid;
    width: 42px;
    height: 42px;
    margin-top: 27px;
    place-items: center;
    border-radius: 50%;
    color: #ffffff;
    background: var(--navy);
    font-weight: 900;
}

.ranking-slot-body {
    position: relative;
    min-height: 96px;
    padding: 9px;
    border: 2px dashed #cfd5e3;
    border-radius: 8px;
    background: #ffffff;
}

.ranking-slot-body.is-drag-over,
.ranking-source.is-drag-over {
    border-color: var(--blue);
    background: #eef8fc;
}

.ranking-slot-body .ranking-phrase {
    min-height: 76px;
}

.ranking-placeholder {
    position: absolute;
    inset: 9px;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-weight: 800;
    text-align: center;
    pointer-events: none;
}

.ranking-slot-body:has(.ranking-phrase) .ranking-placeholder {
    display: none;
}

.ranking-form .primary-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.answered-list {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px dashed var(--line);
}

.answered-list p {
    margin: 8px 0;
}

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

.score-card {
    min-height: 132px;
    display: grid;
    align-content: center;
    gap: 6px;
    padding: 18px;
    border-radius: 8px;
    color: #ffffff;
    background: var(--score-color);
}

.score-card strong {
    font-size: 38px;
    line-height: 1;
}

.score-card span {
    font-size: 18px;
    font-weight: 800;
}

.score-card small {
    opacity: 0.86;
}

.result-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 28px;
    padding: 28px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #ffffff;
    box-shadow: 0 18px 46px rgba(22, 24, 62, 0.08);
}

.result-hero::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 7px;
    background: linear-gradient(180deg, var(--blue), var(--orange));
}

.result-hero p,
.result-hero h2,
.result-hero span {
    margin: 0;
}

.result-hero p,
.result-hero span {
    color: var(--muted);
}

.result-hero h2 {
    margin: 4px 0;
    font-size: 34px;
}

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

.territory-card {
    min-height: 112px;
    display: grid;
    align-content: center;
    gap: 6px;
    padding: 18px;
    border-radius: 8px;
    color: #ffffff;
}

.territory-card strong {
    font-size: 38px;
    line-height: 1;
}

.territory-card span {
    font-weight: 800;
    text-transform: uppercase;
}

.territory-card.action,
.insight-score.action,
.vigilance-item span.action {
    background: #e8453c;
}

.territory-card.innovation,
.insight-score.innovation,
.vigilance-item span.innovation {
    background: #ffc000;
}

.territory-card.gestion,
.insight-score.gestion,
.vigilance-item span.gestion {
    background: #4caf50;
}

.territory-card.reflexion,
.insight-score.reflexion,
.vigilance-item span.reflexion {
    background: #5b6fd4;
}

.result-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
    gap: 18px;
}

.result-panel {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.function-score-list,
.profile-insight-list,
.ratio-list,
.vigilance-list,
.keyword-list {
    display: grid;
    gap: 12px;
}

.function-score-head,
.ratio-title,
.vigilance-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.function-score-head span,
.vigilance-item strong {
    font-weight: 800;
}

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

.function-tile {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid #eceef4;
    border-radius: 8px;
    background: #fafafa;
}

.function-tile-head {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.function-tile h3,
.function-tile p {
    margin: 0;
}

.function-tile h3 {
    font-size: 16px;
}

.function-tile p {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.function-dot {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #ffffff;
    font-size: 18px;
    font-weight: 900;
}

.function-dot.action {
    background: #e8453c;
}

.function-dot.innovation {
    background: #ffc000;
}

.function-dot.gestion {
    background: #4caf50;
}

.function-dot.reflexion {
    background: #5b6fd4;
}

.score-track,
.ratio-bar-ui {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--line);
}

.score-track.function-track {
    height: 8px;
}

.score-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.ratio-title {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.ratio-bar-ui {
    height: 30px;
    display: flex;
}

.ratio-bar-ui span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
}

.ratio-bar-ui span:first-child {
    background: #1c1c1c;
}

.ratio-bar-ui span:last-child {
    background: #767676;
}

.profile-insight {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.profile-insight:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.profile-insight h3,
.profile-insight p {
    margin: 0;
}

.profile-insight h3 {
    margin-bottom: 6px;
}

.profile-insight p {
    max-width: none;
    font-size: 14px;
    line-height: 1.45;
}

.profile-insight .plus {
    color: #247144;
}

.profile-insight .risk {
    margin-top: 4px;
    color: #a33a36;
}

.insight-score,
.vigilance-item span {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #ffffff;
    font-weight: 900;
}

.vigilance-item span {
    width: 34px;
    height: 34px;
    border-radius: 7px;
}

.spaced-title {
    margin-top: 24px;
}

.keyword-list p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.interpretation {
    max-width: 980px;
}

.compare-picker-head {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
}

.compare-picker-head .search-field {
    width: min(100%, 360px);
}

.compare-counter {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.compare-picker {
    max-height: 360px;
    overflow-y: auto;
    padding: 2px;
}

.compare-picker label[hidden] {
    display: none;
}

.compare-picker input:disabled + span {
    opacity: 0.45;
}

.compare-table th,
.compare-table td {
    padding: 10px 12px;
    text-align: center;
    vertical-align: middle;
}

.compare-table th:first-child,
.compare-table td:first-child {
    text-align: left;
}

.compare-person {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ink);
    text-decoration: none;
    text-transform: none;
}

.compare-chip {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-radius: 3px;
}

.compare-group td {
    padding-top: 18px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.compare-territory,
.compare-territory-small {
    font-weight: 900;
    text-transform: uppercase;
}

.compare-territory-small {
    margin-left: 6px;
    font-size: 11px;
}

.compare-territory.action,
.compare-territory-small.action {
    color: #e8453c;
}

.compare-territory.innovation,
.compare-territory-small.innovation {
    color: #c99700;
}

.compare-territory.gestion,
.compare-territory-small.gestion {
    color: #3d8b40;
}

.compare-territory.reflexion,
.compare-territory-small.reflexion {
    color: #5b6fd4;
}

.compare-score {
    min-width: 34px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border-radius: 7px;
    font-weight: 900;
}

.compare-score.is-best {
    color: #ffffff;
}

.compare-score.is-best.action {
    background: #e8453c;
}

.compare-score.is-best.innovation {
    background: #ffc000;
}

.compare-score.is-best.gestion {
    background: #4caf50;
}

.compare-score.is-best.reflexion {
    background: #5b6fd4;
}

.compare-score.is-low {
    color: #9a9cab;
    background: #f0f1f5;
}

.compare-gap-alert {
    color: var(--danger);
    font-weight: 900;
}

.profile-text {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.profile-text p,
.profile-text li,
.profile-text div {
    max-width: none;
    color: var(--ink);
    font-size: 15px;
    line-height: 1.75;
}

.profile-text p:first-child {
    margin-top: 0;
}

.profile-text p:last-child {
    margin-bottom: 0;
}

@media (max-width: 900px) {
    .login-shell,
    .app-page,
    .result-layout {
        grid-template-columns: 1fr;
    }

    .app-page {
        display: block;
    }

    .login-visual {
        min-height: 34vh;
    }

    .login-panel {
        min-height: auto;
        border-radius: 28px 28px 0 0;
        margin-top: -32px;
    }

    .mobile-nav-bar {
        position: sticky;
        top: 0;
        z-index: 40;
        min-height: 68px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 10px 18px;
        color: #ffffff;
        background: var(--navy);
        box-shadow: 0 14px 34px rgba(22, 24, 62, 0.18);
    }

    .mobile-brand {
        min-width: 0;
        display: inline-flex;
        align-items: center;
        gap: 10px;
        color: #ffffff;
        text-decoration: none;
    }

    .mobile-brand img {
        width: 44px;
        height: 38px;
        flex: 0 0 auto;
        object-fit: contain;
    }

    .mobile-brand span,
    .mobile-brand strong,
    .mobile-brand small {
        display: block;
    }

    .mobile-brand strong {
        line-height: 1.1;
    }

    .mobile-brand small {
        margin-top: 2px;
        color: rgba(255, 255, 255, 0.66);
        font-size: 12px;
    }

    .mobile-menu-button,
    .mobile-menu-close {
        width: 44px;
        height: 44px;
        display: inline-flex;
        flex: 0 0 44px;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(255, 255, 255, 0.18);
        border-radius: 8px;
        color: #ffffff;
        background: rgba(255, 255, 255, 0.1);
        cursor: pointer;
    }

    .mobile-menu-close {
        margin-left: auto;
    }

    .mobile-menu-button svg,
    .mobile-menu-close svg {
        width: 22px;
        height: 22px;
        fill: none;
        stroke: currentColor;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-width: 2;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 60;
        width: min(86vw, 330px);
        min-height: 100vh;
        padding: 18px 14px 24px;
        overflow-y: auto;
        overscroll-behavior: contain;
        transform: translateX(-105%);
        transition: transform 200ms ease;
        box-shadow: 20px 0 60px rgba(10, 12, 34, 0.32);
    }

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

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 55;
        display: block;
        background: rgba(12, 14, 34, 0.5);
    }

    .sidebar-backdrop[hidden] {
        display: none;
    }

    body.mobile-menu-open {
        overflow: hidden;
    }

    .app-brand {
        padding: 4px 4px 20px;
    }

    .nav-link,
    .nav-group summary,
    .nav-group a {
        min-height: 48px;
    }

    .nav-group a {
        margin-left: 8px;
    }

    .workspace {
        padding: 24px;
    }

    .dashboard-hero,
    .dashboard-latest-grid,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

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

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

@media (max-width: 560px) {
    .login-panel,
    .setup-card {
        padding: 24px;
    }

    .brand-mark {
        width: 136px;
        height: auto;
        font-size: 48px;
    }

    .brand-mark img {
        width: 128px;
    }

    .welcome,
    .subtitle {
        font-size: 18px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .section-heading,
    .pagination {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .choice-grid,
    .settings-grid,
    .dashboard-metrics,
    .dashboard-latest-grid,
    .diag-value-grid,
    .diag-content-stats,
    .diag-passation-summary,
    .diag-content-create,
    .diag-content-layout,
    .request-filter-form,
    .request-detail-grid,
    .result-grid,
    .territory-grid,
    .rh360-summary,
    .mission-summary,
    .feedback-grid,
    .rh360-peer-grid,
    .copy-assignment-form,
    .inline-create-form,
    .attribution-create-form,
    .public-link-panel,
    .public-link-form,
    .public-logo-panel,
    .assignment-detail {
        grid-template-columns: 1fr;
    }

    .ranking-board {
        grid-template-columns: 1fr;
    }

    .quality-grid,
    .quality-review-grid {
        grid-template-columns: minmax(130px, 1fr) repeat(3, minmax(58px, 1fr));
        font-size: 13px;
    }

    .request-card > header,
    .request-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .request-card-status {
        align-items: flex-start;
    }

    .result-hero,
    .rh360-public-head,
    .report-person-head,
    .peer-card {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .form-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .mission-label-col {
        width: 260px;
        min-width: 260px;
    }

    .mission-admin-category > header,
    .mission-admin-item,
    .mission-title-form,
    .diag-admin-layout,
    .attribution-create-form,
    .public-link-panel,
    .public-link-form,
    .matrix-toolbar,
    .dossier-head,
    .dossier-layout,
    .job-identity,
    .job-condition-grid,
    .job-signatures {
        grid-template-columns: 1fr;
    }

    .report-counts {
        justify-content: flex-start;
    }

    .diag-content-index {
        position: static;
    }

    .diag-content-axis > header,
    .diag-inline-form,
    .diag-pending-fields {
        grid-template-columns: 1fr;
    }

    .report-comment-row,
    .report-comment-row.external-report-row {
        grid-template-columns: 1fr;
    }

    .report-comment-row > * {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .report-comment-row > *:last-child {
        border-bottom: 0;
    }
}

/* Matrice d’affectation interactive (partials/mission-matrix.php) */

.mm {
    display: grid;
    gap: 14px;
}

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

a.mm-summary-alert {
    text-decoration: none;
}

.mm-summary-alert.is-warning {
    border-color: #f3cf8a;
    background: #fff8ea;
}

.mm-summary-alert.is-warning strong {
    color: #8a5d00;
}

.mm-table .mm-dossier-badge,
.mm-dossier-badge {
    display: inline-block;
    min-height: 0;
    max-width: 100%;
    margin-top: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    color: #8a5d00;
    background: #fdf1d6;
    font-size: 10px;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
}

.mm-dossier-badge:hover,
.mm-dossier-badge:focus-visible {
    background: #f9e2ad;
    outline: none;
}

.mm-dialog textarea {
    min-height: 88px;
    padding: 10px 14px;
}

.mm-check {
    display: flex !important;
    align-items: center;
    gap: 10px;
    color: var(--ink);
}

.mm-check input {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    accent-color: var(--navy);
}

/* Vue inversée : collaborateurs en lignes, missions en colonnes */
.mm-table.is-transposed .mission-label-col {
    width: 250px;
    min-width: 250px;
}

.mm-category-head {
    padding: 8px 10px !important;
    color: #ffffff;
    background: var(--navy) !important;
    text-align: left;
    white-space: nowrap;
}

.mm-category-head .mm-service-actions button {
    border-color: rgba(255, 255, 255, 0.4);
}

.mm-mission-head {
    min-width: 112px;
    max-width: 170px;
    padding: 8px !important;
    vertical-align: bottom;
    text-align: left;
    white-space: normal;
}

.mm-mission-head .mm-mission-name {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
}

.mm-group-row th,
.mm-group-row td {
    background: rgba(116, 185, 216, 0.14) !important;
}

.mm-group-row th {
    padding: 6px 10px;
}

.mm-rowhead-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
}

.mm-rowhead-inner [data-dossier-for]:empty {
    display: none;
}

.mm-rowhead-inner .mm-dossier-badge {
    margin-top: 0;
}

.mm-employee-inline > span {
    min-width: 0;
}

.mm-employee-inline {
    flex: 1 1 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    border: 0;
    color: var(--ink);
    background: none;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.mm-employee-inline .avatar-chip {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    font-size: 12px;
}

.mm-employee-inline strong,
.mm-employee-inline small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mm-employee-inline small {
    color: var(--muted);
    font-size: 11px;
}

.mm-employee-inline:hover strong,
.mm-employee-inline:focus-visible strong {
    text-decoration: underline;
}

.mm-add-inline {
    min-height: 38px;
    box-shadow: none;
}

.mm-summary-alert {
    min-height: 96px;
    display: grid;
    align-content: center;
    gap: 6px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #ffffff;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.mm-summary-alert.is-alert {
    border-color: #e0a6ad;
    background: #fff5f6;
}

.mm-summary-alert.is-alert strong {
    color: var(--danger);
}

.mm-summary-alert.is-active {
    box-shadow: inset 0 0 0 2px var(--navy);
}

.mm-toolbar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    align-items: end;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.mm-toolbar label {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.mm-toolbar input[type="search"],
.mm-toolbar select {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    border: 2px solid #b7bac7;
    border-radius: 8px;
    padding: 0 12px;
    color: var(--ink);
    font: inherit;
    background: #ffffff;
}

.mm-toolbar .check-field {
    min-height: 44px;
}

.mm-toolbar-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mm-services {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.mm-services[hidden],
.mm-hint[hidden],
.mm-popover[hidden],
.mm-toast[hidden] {
    display: none;
}

.mm-services-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.mm-chip {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--navy);
    background: #ffffff;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.mm-chip small {
    color: var(--muted);
    font-size: 11px;
}

.mm-chip[aria-pressed="true"] {
    color: #ffffff;
    background: var(--navy);
    border-color: var(--navy);
}

.mm-chip[aria-pressed="true"] small {
    color: rgba(255, 255, 255, 0.75);
}

.mm-legend {
    margin-bottom: 0;
}

.mm-legend-hint {
    border-style: dashed !important;
}

.mm-swatch {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.mm-hint {
    margin: 0;
    padding: 12px 14px;
    border-left: 4px solid var(--blue);
    border-radius: 8px;
    color: var(--navy);
    background: rgba(116, 185, 216, 0.14);
    font-weight: 700;
}

.mm-table td {
    padding: 0;
}

.mm-table.mm-grouped .mm-head-people th {
    top: var(--mm-head-offset, 44px);
}

.mm-corner {
    vertical-align: bottom;
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

.mm-service-head {
    padding: 6px 8px !important;
    border-bottom: 3px solid var(--blue) !important;
    text-align: left;
    white-space: nowrap;
}

.mm-service-head.is-none {
    border-bottom-color: var(--line) !important;
}

.mm-service-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.mm-service-toggle {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 2px;
    border: 0;
    color: var(--navy);
    background: none;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.mm-service-toggle strong {
    overflow: hidden;
    text-overflow: ellipsis;
}

.mm-service-toggle small {
    padding: 1px 7px;
    border-radius: 999px;
    color: var(--muted);
    background: #e9ebf2;
    font-size: 11px;
    font-weight: 800;
}

.mm-service-actions {
    display: inline-flex;
    gap: 4px;
}

.mm-service-actions button {
    width: 26px;
    height: 26px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--navy);
    background: #ffffff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.mm-service-actions button:hover,
.mm-service-actions button:focus-visible {
    border-color: var(--blue);
}

.mm-employee-button {
    width: 100%;
    min-height: 104px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 4px;
    padding: 4px 0;
    border: 0;
    border-radius: 6px;
    color: var(--ink);
    background: none;
    font: inherit;
    cursor: pointer;
}

.mm-employee-button:hover,
.mm-employee-button:focus-visible {
    background: rgba(116, 185, 216, 0.14);
    outline: none;
}

.mm-employee-button strong,
.mm-employee-button small {
    display: block;
    max-width: 76px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mm-employee-button small {
    color: var(--muted);
    font-size: 11px;
}

.mm-load {
    color: var(--muted);
    font-size: 10px;
    font-style: normal;
    font-weight: 800;
    white-space: nowrap;
}

.mm-employee-head.is-new {
    animation: mm-flash 2.2s ease-out;
}

@keyframes mm-flash {
    0%,
    40% {
        background: rgba(245, 154, 35, 0.3);
    }

    100% {
        background: #fbfcfe;
    }
}

.mm-collapsed-head button,
.mm-collapsed-cell button {
    width: 100%;
    min-width: 64px;
    border: 0;
    color: var(--muted);
    background: repeating-linear-gradient(135deg, #f6f8fb 0 6px, #eef1f6 6px 12px);
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.mm-collapsed-head button {
    min-height: 104px;
    display: grid;
    align-content: center;
    border-radius: 6px;
}

.mm-collapsed-head strong {
    color: var(--navy);
    font-size: 18px;
}

.mm-collapsed-cell button {
    height: 44px;
}

.mm-collapsed-cell.has-holder button {
    color: var(--navy);
}

.mm-add-col {
    width: 92px;
    min-width: 92px;
    background: #fbfcfe;
}

.mm-add-employee-button {
    width: 100%;
    min-height: 104px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 4px;
    border: 2px dashed var(--line);
    border-radius: 8px;
    color: var(--navy);
    background: #ffffff;
    font: inherit;
    cursor: pointer;
}

.mm-add-employee-button span {
    font-size: 26px;
    line-height: 1;
}

.mm-add-employee-button small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.mm-add-employee-button:hover,
.mm-add-employee-button:focus-visible {
    border-color: var(--blue);
    outline: none;
}

.mm-category-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.mm-category-row td {
    background: var(--navy);
}

.mm-category-name {
    padding: 0;
    border: 0;
    color: #ffffff;
    background: none;
    font: inherit;
    font-weight: 900;
    text-align: left;
    cursor: pointer;
}

.mm-category-name:hover,
.mm-category-name:focus-visible {
    text-decoration: underline;
    outline: none;
}

.mm-category-row small {
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.mm-mission-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.mm-mission-name {
    margin-right: auto;
    padding: 0;
    border: 0;
    color: var(--ink);
    background: none;
    font: inherit;
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
}

.mm-mission-name:hover,
.mm-mission-name:focus-visible {
    color: var(--navy);
    text-decoration: underline;
    outline: none;
}

.mm-tag {
    flex: 0 0 auto;
    display: inline-block;
    margin-right: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
}

.mm-tag.is-target {
    color: #ffffff;
    background: #e07b1f;
}

.mm-tag.is-arbitrate {
    color: #ffffff;
    background: #9699ad;
}

.mm-coverage {
    flex: 0 0 auto;
    padding: 3px 8px;
    border-radius: 999px;
    color: var(--success);
    background: #effaf4;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.mm-coverage.is-partial {
    color: #8a5d00;
    background: #fdf1d6;
}

.mm-coverage.is-missing {
    color: var(--danger);
    background: #fff2f3;
}

.mm-cell {
    width: 100%;
    min-width: 56px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 0;
    color: var(--muted);
    background: #ffffff;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
    user-select: none;
}

.mm-cell strong {
    font-size: 15px;
    line-height: 1;
}

.mm-cell span {
    font-size: 11px;
    text-transform: uppercase;
}

.mm-cell.is-empty span {
    opacity: 0;
    font-size: 18px;
}

.mm-cell.is-empty:hover,
.mm-cell.is-empty:focus-visible {
    color: var(--navy);
    background: rgba(116, 185, 216, 0.14);
}

.mm-cell.is-empty:hover span,
.mm-cell.is-empty:focus-visible span {
    opacity: 1;
}

.mm-cell:focus-visible,
.mm-cell.is-active {
    outline: 3px solid var(--navy);
    outline-offset: -3px;
}

/* Titulaire : aplat de couleur. Remplaçant : teinte claire bordée. */
.mm-r1,
.mm-r2 {
    color: #ffffff;
}

.mm-r1.mm-l0 {
    color: var(--navy);
    background: #dfe2ec;
}

.mm-r1.mm-l1 {
    background: #2f9d57;
}

.mm-r1.mm-l2 {
    background: #f0a818;
}

.mm-r1.mm-l3 {
    background: #c73d43;
}

.mm-r2.mm-l0 {
    color: var(--navy);
    background: #f4f5f9;
    box-shadow: inset 0 0 0 2px #b7bac7;
}

.mm-r2.mm-l1 {
    color: #1f6b3b;
    background: #e4f4ea;
    box-shadow: inset 0 0 0 2px #2f9d57;
}

.mm-r2.mm-l2 {
    color: #8a5d00;
    background: #fdf1d6;
    box-shadow: inset 0 0 0 2px #f0a818;
}

.mm-r2.mm-l3 {
    color: #9a2330;
    background: #f8e1e2;
    box-shadow: inset 0 0 0 2px #c73d43;
}

.mm-add-row th,
.mm-add-row td {
    background: #fbfcfe;
}

.mm-inline-form {
    display: flex;
    gap: 8px;
    margin: 0;
}

.mm-inline-form input {
    min-height: 38px;
    border-width: 1px;
    border-style: dashed;
    font-size: 14px;
}

.mm-inline-form input:focus {
    border-style: solid;
}

.mm-inline-form .secondary-button {
    min-height: 38px;
    padding: 0 12px;
    box-shadow: none;
}

.mm-add-category-row input {
    font-weight: 800;
}

.mm-no-result {
    padding: 22px !important;
    color: var(--muted);
    text-align: center;
}

.mm-popover {
    position: fixed;
    z-index: 40;
    width: 360px;
    max-width: calc(100vw - 16px);
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.mm-popover-head {
    display: grid;
    gap: 3px;
    margin-bottom: 12px;
}

.mm-popover-head span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.mm-popover-grid {
    display: grid;
    grid-template-columns: auto repeat(3, minmax(0, 1fr));
    gap: 6px;
    align-items: center;
}

.mm-popover-grid > span {
    padding-right: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.mm-option {
    min-height: 36px;
    padding: 0 4px;
    border: 0;
    border-radius: 6px;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.mm-option[aria-pressed="true"],
.mm-option:focus-visible {
    outline: 3px solid var(--navy);
    outline-offset: 2px;
}

.mm-popover-foot {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.mm-option-clear {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--danger);
    background: #ffffff;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.mm-option-clear:disabled {
    cursor: default;
    opacity: 0.4;
}

.mm-dialog {
    width: min(calc(100% - 32px), 520px);
    padding: 24px;
    border: 0;
    border-radius: 8px;
    color: var(--ink);
    background: #ffffff;
    box-shadow: var(--shadow);
}

.mm-dialog::backdrop {
    background: rgba(22, 24, 62, 0.42);
}

.mm-dialog h2 {
    margin: 0 0 12px;
}

.mm-dialog-note {
    margin: 0 0 14px;
    color: var(--muted);
    line-height: 1.5;
}

.mm-dialog-note[hidden],
.mm-dialog-error[hidden] {
    display: none;
}

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

.mm-dialog-fields label {
    display: grid;
    gap: 6px;
}

.mm-dialog-fields label.is-wide {
    grid-column: 1 / -1;
}

.mm-dialog-fields.is-list {
    display: block;
}

/* Collaborateurs inactifs : lien de la ligne de comptage et liste de la boîte de dialogue. */
.mm-link-button {
    padding: 0;
    border: 0;
    color: var(--navy);
    background: none;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.mm-inactive-list {
    display: grid;
    gap: 8px;
    max-height: min(60vh, 420px);
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}

.mm-inactive-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.mm-inactive-list .avatar-chip {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    font-size: 12px;
}

.mm-inactive-name {
    min-width: 0;
    flex: 1;
}

.mm-inactive-name strong,
.mm-inactive-name small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mm-inactive-name small {
    color: var(--muted);
    font-weight: 700;
}

.mm-inactive-list button {
    min-height: 36px;
    padding: 0 12px;
}

@media (max-width: 520px) {
    .mm-inactive-list li {
        flex-wrap: wrap;
    }

    .mm-inactive-name {
        flex-basis: calc(100% - 44px);
    }
}

.mm-dialog-error {
    margin: 14px 0 0;
    padding: 10px 12px;
    border-left: 4px solid var(--danger);
    border-radius: 8px;
    color: var(--danger);
    background: #fff2f3;
}

.mm-dialog-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

.mm-dialog-actions [hidden] {
    display: none;
}

/* Le bouton principal reste premier dans le DOM (validation par Entrée) mais s’affiche à droite. */
.mm-dialog-delete {
    margin-right: auto;
}

.mm-dialog-actions [data-mm-dialog-continue] {
    order: 1;
}

.mm-dialog-actions [data-mm-dialog-submit] {
    order: 2;
}

.mm-dialog-actions button:disabled {
    cursor: wait;
    opacity: 0.6;
}

.mm-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 50;
    max-width: min(420px, calc(100vw - 32px));
    padding: 12px 16px;
    border-left: 4px solid var(--success);
    border-radius: 8px;
    color: var(--ink);
    background: #ffffff;
    box-shadow: var(--shadow);
    font-weight: 700;
}

/* Listes réorganisables de la page Conditions (assets/js/mission-lists.js) */

.mission-admin-category > header.has-grip,
.mission-admin-item.has-grip {
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.mission-admin-item.has-grip > form:last-child,
.mission-admin-category > header.has-grip > form:last-child {
    margin: 0;
}

.mission-lists-hint {
    margin: 16px 0 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.mission-lists .mm-grip {
    width: 28px;
    height: 36px;
    border-radius: 6px;
    font-size: 16px;
}

.mission-lists .mm-grip:focus-visible {
    outline: 3px solid var(--navy);
    outline-offset: 1px;
}

.data-table .sort-col {
    width: 44px;
    padding-right: 0;
}

.mm-brush {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.mm-brush-option {
    min-width: 46px;
    min-height: 34px;
    padding: 0 10px;
    border: 0;
    border-radius: 6px;
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.mm-brush-eraser {
    border: 1px dashed #b7bac7;
    color: var(--danger);
    background: #ffffff;
}

.mm-brush-option[aria-pressed="true"] {
    outline: 3px solid var(--navy);
    outline-offset: 2px;
}

.mm-brush-hint {
    margin-left: 4px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.mm-table.is-painting .mm-cell {
    cursor: crosshair;
    touch-action: none;
}

.mm-cell.is-painted {
    animation: mm-pulse 0.35s ease-out;
}

@keyframes mm-pulse {
    from {
        filter: brightness(1.25);
    }

    to {
        filter: none;
    }
}

.mm-grip {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 16px;
    color: #b7bac7;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: -3px;
    line-height: 1;
    cursor: grab;
    user-select: none;
}

.mm-grip:hover {
    color: var(--navy);
}

.mm-category-row .mm-grip {
    color: rgba(255, 255, 255, 0.5);
}

.mm-category-row .mm-grip:hover {
    color: #ffffff;
}

.mm-employee-head .mm-grip {
    width: 100%;
    height: 14px;
    transform: rotate(90deg);
}

.mm-category-inner .mm-category-name {
    margin-right: auto;
}

.is-dragging {
    opacity: 0.45;
}

th.is-drop-before {
    box-shadow: inset 4px 0 0 var(--orange) !important;
}

th.is-drop-after {
    box-shadow: inset -4px 0 0 var(--orange) !important;
}

.mm-service-head.is-drop-after {
    background: rgba(245, 154, 35, 0.22) !important;
}

tr.is-drop-before > *,
tr.is-drop-before .mm-cell {
    box-shadow: inset 0 4px 0 var(--orange) !important;
}

tr.is-drop-after > *,
tr.is-drop-after .mm-cell {
    box-shadow: inset 0 -4px 0 var(--orange) !important;
}

.mm-popover-foot {
    align-items: center;
    gap: 10px;
}

.mm-popover-scope {
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--navy);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.3;
    cursor: pointer;
}

.mm-popover-scope input {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    accent-color: var(--navy);
}

.mm-toast {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mm-toast button {
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--navy);
    background: #ffffff;
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.mm-toast button[hidden] {
    display: none;
}

.mm-toast[data-type="error"] {
    border-left-color: var(--danger);
    color: var(--danger);
}

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

    .mm-toolbar {
        grid-template-columns: 1fr;
    }

    .mm-dialog-fields {
        grid-template-columns: 1fr;
    }

    .mm-mission-label {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .mm-table.is-transposed .mission-label-col {
        width: 168px;
        min-width: 168px;
    }

    .mm-employee-inline .avatar-chip {
        display: none !important;
    }
}
