[x-cloak] {
    display: none !important;
}

/* Attribut HTML hidden — doit gagner sur nos classes display:flex / inline-flex */
[hidden] {
    display: none !important;
}

:root {
    --font: "DM Sans", system-ui, -apple-system, sans-serif;
    --bg: #f1f5f9;
    --bg-pattern: radial-gradient(ellipse 120% 80% at 100% -20%, rgba(99, 102, 241, 0.08), transparent 50%),
        radial-gradient(ellipse 80% 60% at 0% 100%, rgba(56, 189, 248, 0.06), transparent 45%);
    --surface: #ffffff;
    --surface-elevated: #ffffff;
    --sidebar: #334155;
    --sidebar-deep: #1e293b;
    --sidebar-border: rgba(255, 255, 255, 0.1);
    --sidebar-muted: #cbd5e1;
    --text: #0f172a;
    --text-secondary: #475569;
    --muted: #64748b;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --accent: #4f46e5;
    --accent-soft: rgba(79, 70, 229, 0.1);
    --accent-hover: #4338ca;
    --accent-ring: rgba(79, 70, 229, 0.25);
    --sky: #0ea5e9;
    --danger: #e11d48;
    --danger-soft: rgba(225, 29, 72, 0.08);
    --danger-border: rgba(225, 29, 72, 0.2);
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --sidebar-width: 252px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background-color: var(--bg);
    background-image: var(--bg-pattern);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

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

a:hover {
    text-decoration: underline;
}

.layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-deep) 100%);
    color: #f1f5f9;
    display: flex;
    flex-direction: column;
    padding: 1.35rem 0 1.5rem;
    position: sticky;
    top: 0;
    align-self: flex-start;
    min-height: 100vh;
    border-right: 1px solid var(--sidebar-border);
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.08);
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.25rem 1.35rem;
    margin: 0 0.75rem 1rem;
    border-bottom: 1px solid var(--sidebar-border);
    text-decoration: none;
    color: inherit;
    border-radius: 0;
    cursor: pointer;
}

.sidebar__brand:hover,
.sidebar__brand:focus,
.sidebar__brand:focus-visible {
    background: transparent;
    text-decoration: none;
    color: inherit;
    outline: none;
}

.sidebar__logo {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    padding: 4px;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

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

.sidebar__brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.sidebar__brand-name {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.03em;
    color: #f8fafc;
    line-height: 1.2;
}

.sidebar__brand-tag {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sidebar-muted);
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0 0.75rem;
    flex: 1;
}

.sidebar__footer {
    margin-top: auto;
    padding: 1rem 0.75rem 0;
    border-top: 1px solid var(--sidebar-border);
}

.sidebar__account {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.sidebar__user {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin: 0;
    padding: 0.55rem 0.65rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar__user-icon {
    flex-shrink: 0;
    display: flex;
    margin-top: 0.1rem;
    color: #94a3b8;
}

.sidebar__user-icon .icon {
    width: 1.05rem;
    height: 1.05rem;
}

.sidebar__user-email {
    font-size: 0.8125rem;
    line-height: 1.35;
    color: #e2e8f0;
    word-break: break-all;
}

.sidebar__logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: inherit;
    text-decoration: none;
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sidebar__logout:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.22);
    color: #fff;
    text-decoration: none;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-sm);
    color: #e2e8f0;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar__link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
}

.sidebar__link--active {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.45) 0%, rgba(14, 165, 233, 0.28) 100%);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.sidebar__link-icon {
    display: flex;
    opacity: 0.85;
}

.sidebar__link--active .sidebar__link-icon {
    opacity: 1;
}

.main {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    max-width: none;
    padding: 2rem 2.25rem 2.5rem;
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.page-title {
    margin: 0;
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: -0.035em;
    color: var(--text);
}

.page-sub {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
    color: var(--muted);
    font-weight: 450;
}

.card {
    background: var(--surface-elevated);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    overflow: hidden;
}

/* Admin — Playground */
.playground-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 1.25rem;
    align-items: stretch;
}

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

.playground-panel {
    padding: 1.25rem 1.35rem 1.35rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
    box-sizing: border-box;
}

.playground-panel--editor {
    min-height: min(70vh, 640px);
}

.playground-field {
    margin-bottom: 1rem;
}

.playground-field--grow {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin-bottom: 1rem;
}

.playground-field--grow .CodeMirror {
    flex: 1 1 auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 0.875rem;
}

.playground-label {
    display: block;
    font-weight: 600;
    font-size: 0.8125rem;
    margin-bottom: 0.4rem;
    color: var(--text-secondary);
}

.playground-select {
    width: 100%;
    max-width: 28rem;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--text);
    background: #fafbfc;
    cursor: pointer;
}

.playground-select:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 3px var(--accent-ring);
}

.playground-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

.playground-copy-feedback {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent);
}

.playground-result-title {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.playground-result-empty {
    font-size: 0.9375rem;
    margin: 0;
    padding: 1rem 0;
}

.playground-result-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 2rem 1rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.playground-run-btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.playground-spinner {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    animation: playground-spin 0.7s linear infinite;
    flex-shrink: 0;
}

.playground-spinner--on-primary {
    border-color: rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
}

.playground-spinner--muted {
    width: 1.25rem;
    height: 1.25rem;
    border-color: rgba(79, 70, 229, 0.2);
    border-top-color: var(--accent);
}

@keyframes playground-spin {
    to {
        transform: rotate(360deg);
    }
}

.playground-result-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.playground-result-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 1rem;
    font-size: 0.9375rem;
}

.playground-result-row--block {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
}

.playground-result-message {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text);
    line-height: 1.5;
}

.playground-result-console-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.25rem;
}

.playground-result-console-label {
    font-size: 0.8125rem;
    font-weight: 600;
}

.playground-result-console {
    margin: 0;
    padding: 0.75rem 0.85rem;
    max-height: 220px;
    overflow: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8125rem;
    line-height: 1.45;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: var(--radius-sm);
    border: 1px solid #1e293b;
    white-space: pre-wrap;
    word-break: break-word;
}

.playground-result-actions {
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

/* Admin Settings */
.settings-page {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
}

.settings-alerts {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.settings-alerts .run-in-progress-banner {
    margin: 0;
    width: 100%;
}

.settings-overview {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    margin-bottom: 1.5rem;
}

.settings-overview__inner {
    padding: 1.5rem 1.65rem 1.65rem;
}

.settings-overview__grid {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .settings-overview__grid {
        grid-template-columns: 1fr 1fr;
        align-items: start;
        gap: 2rem;
    }

    .settings-overview__section:first-child {
        padding-right: 2rem;
        border-right: 1px solid var(--border-light);
    }

    .settings-overview__section--action {
        padding-left: 0.25rem;
    }
}

.settings-overview__title {
    margin: 0 0 0.85rem;
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.02em;
}

.settings-overview__dl {
    margin: 0;
    display: grid;
    gap: 1rem;
}

.settings-overview__dl-row {
    display: grid;
    gap: 0.25rem;
}

.settings-overview__dl dt {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.settings-overview__dl dd {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.4;
}

.settings-overview__lead {
    margin: 0 0 1.25rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    max-width: 36rem;
}

.settings-overview__action {
    margin-top: 0.25rem;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Formulaires admin à deux panneaux (Settings, Project, …) */
.settings-form-columns,
.project-form-columns {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

@media (min-width: 900px) {
    .settings-form-columns,
    .project-form-columns {
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
        gap: 1.5rem;
    }

    .project-form-columns > :only-child {
        grid-column: 1 / -1;
    }
}

.settings-form-panel,
.project-form-panel {
    max-width: none;
    width: 100%;
    box-sizing: border-box;
    padding: 1.5rem 1.65rem 1.65rem;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.settings-form-panel__title,
.project-form-panel__title {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.02em;
}

.settings-form-panel__subtitle {
    margin: 0 0 0.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
}

.settings-form-panel__intro,
.project-form-panel__intro {
    margin: 0 0 1.25rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.settings-form-panel--full {
    margin-bottom: 1.25rem;
}

.settings-form-panel .form-row input[type="number"] {
    max-width: 8rem;
}

.custom-fields-collection {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
}

.custom-fields-collection__head,
.custom-fields-collection__item {
    display: grid;
    grid-template-columns: minmax(7rem, 10rem) minmax(8rem, 1fr) minmax(10rem, 1.35fr) 2.25rem;
    gap: 0.45rem 0.55rem;
    align-items: center;
    padding: 0.45rem 0.55rem;
}

.custom-fields-collection__head {
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.custom-fields-collection__item {
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.custom-fields-collection__item:last-child {
    border-bottom: none;
}

.custom-fields-collection__field {
    min-width: 0;
}

.custom-fields-collection__field input[type="text"] {
    width: 100%;
    padding: 0.38rem 0.5rem;
    font-size: 0.8125rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    box-sizing: border-box;
}

.custom-fields-collection__field input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}

.custom-fields-collection__field .form-error,
.custom-fields-collection__field ul {
    margin: 0.2rem 0 0;
    font-size: 0.6875rem;
    line-height: 1.3;
}

.custom-fields-collection__actions {
    display: flex;
    justify-content: center;
}

.custom-fields-collection__empty {
    margin: 0;
    padding: 0.75rem 0.55rem;
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--border);
}

.settings-form-panel--compact-fields .settings-form-panel__intro--tight {
    margin-bottom: 0.75rem;
}

.settings-form-panel--compact-fields [data-collection-add] {
    margin-top: 0.15rem;
}

@media (max-width: 720px) {
    .custom-fields-collection__head {
        display: none;
    }

    .custom-fields-collection__item {
        grid-template-columns: 1fr 2.25rem;
        grid-template-areas:
            "key actions"
            "label actions"
            "desc actions";
        align-items: start;
        padding: 0.55rem;
    }

    .custom-fields-collection__field:nth-child(1) { grid-area: key; }
    .custom-fields-collection__field:nth-child(2) { grid-area: label; }
    .custom-fields-collection__field:nth-child(3) { grid-area: desc; }
    .custom-fields-collection__actions { grid-area: actions; align-self: center; }
}

.btn--xs {
    padding: 0.25rem 0.55rem;
    font-size: 0.8125rem;
    gap: 0.3rem;
}

.btn--xs .icon {
    width: 0.9rem;
    height: 0.9rem;
}

/* Bloc Slack : config (formulaire principal) + test (formulaire séparé) */
.settings-slack-wrap__part {
    width: 100%;
    box-sizing: border-box;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    background: var(--surface-elevated);
}

.settings-slack-wrap__config {
    padding: 1.5rem 1.65rem 1.65rem;
    border-top: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
    margin-bottom: 0;
    box-shadow: var(--shadow-md);
}

.settings-slack-wrap__test {
    padding: 1.25rem 1.65rem 1.35rem;
    background: #fafbfc;
    border-bottom: 1px solid var(--border);
    border-top: 1px solid var(--border-light);
    border-radius: 0 0 var(--radius) var(--radius);
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-md);
}

.settings-slack-test {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
    margin: 0;
}

.settings-slack-test__hint {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.45;
    max-width: 42rem;
}

.settings-form-footer,
.project-form-footer {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 1.5rem;
    padding-top: 0.25rem;
    width: 100%;
}

.project-form-panel__note {
    margin: -0.35rem 0 1rem;
    font-size: 0.8125rem;
    line-height: 1.45;
}

.project-form-panel__title--compact {
    font-size: 1rem;
}

.project-form-modal-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (max-width: 767px) {
    .settings-overview__section:first-child {
        padding-bottom: 1.5rem;
        border-bottom: 1px solid var(--border-light);
    }
}

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

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

table.data th,
table.data td {
    padding: 0.9rem 1.35rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

table.data tbody tr {
    transition: background 0.12s ease;
}

table.data tbody tr:hover {
    background: #fafbfc;
}

table.data th {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
    font-weight: 600;
    background: linear-gradient(180deg, #fafbfc 0%, #f4f6f8 100%);
    border-bottom: 1px solid var(--border);
}

table.data tr:last-child td {
    border-bottom: none;
}

table.data td.muted {
    color: var(--text-secondary);
    font-size: 0.875rem;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-hint {
    margin: 0;
    padding: 0 1.25rem 1.25rem;
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.45;
    text-align: center;
}

.card-hint--inline {
    padding: 0;
    text-align: left;
}

.project-run-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.run-in-progress-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    width: 100%;
    padding: 0.9rem 1rem;
    margin-bottom: 1.25rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    box-sizing: border-box;
}

.project-run-actions .run-in-progress-banner {
    margin-bottom: 0;
}

.run-in-progress-banner__content {
    min-width: 0;
}

.run-in-progress-banner__title {
    margin: 0 0 0.2rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #92400e;
}

.run-in-progress-banner__meta {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.run-in-progress-banner--projects {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.run-in-progress-banner--projects .run-in-progress-banner__title {
    color: #1e40af;
}

.run-in-progress-banner__project-list {
    margin: 0.35rem 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.35rem;
    font-size: 0.875rem;
}

.run-in-progress-banner__session-link {
    margin-left: 0.35rem;
    font-size: 0.8125rem;
    white-space: nowrap;
}

.project-checks-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem 0;
}

.project-checks-header__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.check-history {
    padding: 0.5rem 0;
    overflow: hidden;
}

.check-history-batch {
    border-bottom: 1px solid var(--border);
}

.check-history-batch:last-child {
    border-bottom: none;
}

.check-history-batch__summary {
    display: flex;
    align-items: center;
    gap: 0.75rem 1rem;
    flex-wrap: wrap;
    padding: 0.9rem 1.25rem;
    cursor: pointer;
    list-style: none;
    font-size: 0.9375rem;
}

.check-history-batch__summary::-webkit-details-marker {
    display: none;
}

.check-history-batch__summary::before {
    content: '';
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.check-history-batch[open] > .check-history-batch__summary::before {
    transform: rotate(45deg);
}

.check-history-batch__date {
    font-weight: 600;
    color: var(--text);
}

.check-history-batch__id {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    color: var(--muted);
    min-width: 0;
}

.check-history-batch__id-label {
    flex-shrink: 0;
}

.check-history-batch__id-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 0.1rem 0.45rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.check-history-batch__id-link {
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.check-history-batch__id-link:hover {
    color: var(--accent);
    border-color: var(--accent-ring);
    background: var(--accent-soft);
    text-decoration: none;
}

.run-session-meta {
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    display: grid;
    gap: 0.65rem;
}

.run-session-meta__row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.9375rem;
}

.run-session-meta__label {
    min-width: 7rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.run-session-projects {
    display: grid;
    gap: 1.25rem;
}

.run-session-project__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem 0.5rem;
}

.run-session-project__title {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 600;
}

.run-session-project__counts {
    margin: 0;
    font-size: 0.875rem;
}

.check-history-batch__counts {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.875rem;
}

.check-history-batch__body {
    padding: 0 0 0.5rem;
}

.run-message-cell {
    max-width: 22rem;
    vertical-align: top;
}

.run-message-details__summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    list-style: none;
}

.run-message-details__summary::-webkit-details-marker {
    display: none;
}

.run-message-details:not([open]) .run-message-details__full {
    display: none;
}

.run-message-details[open] .run-message-details__preview,
.run-message-details[open] .run-message-details__hint {
    display: none;
}

.run-message-details__preview {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
}

.run-message-details__hint {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent, #2563eb);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.run-message-details__full {
    margin: 0.5rem 0 0;
    padding: 0.65rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: 6px;
}

table.data td strong {
    font-weight: 600;
    color: var(--text);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-secondary);
    background: #f1f5f9;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    color: var(--muted);
    background: transparent;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
}

.btn-icon:hover {
    color: var(--text);
    background: #f1f5f9;
    text-decoration: none;
}

.btn-icon:focus-visible {
    outline: 2px solid var(--accent-ring);
    outline-offset: 2px;
}

.btn-icon--edit:hover {
    color: var(--accent);
    background: var(--accent-soft);
}

.btn-icon--danger:hover {
    color: var(--danger);
    background: var(--danger-soft);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 1.1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    line-height: 1.25;
    letter-spacing: -0.01em;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

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

.btn:active {
    transform: scale(0.98);
}

.btn .icon {
    width: 17px;
    height: 17px;
}

.btn--primary {
    background: linear-gradient(180deg, #6366f1 0%, var(--accent) 100%);
    color: #fff;
    box-shadow: 0 1px 2px rgba(79, 70, 229, 0.25);
}

.btn--primary:hover {
    background: linear-gradient(180deg, #5558e8 0%, var(--accent-hover) 100%);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn--ghost {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-secondary);
}

.btn--ghost:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--text);
}

.btn--danger {
    background: var(--surface);
    color: var(--danger);
    border-color: var(--danger-border);
}

.btn--danger:hover {
    background: var(--danger-soft);
    border-color: rgba(225, 29, 72, 0.35);
}

.flash-list {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
}

.flash {
    padding: 0.8rem 1.1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.flash--success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.flash--error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

a.link-strong {
    color: inherit;
    text-decoration: none;
}

a.link-strong:hover {
    text-decoration: underline;
}

.form-stack {
    max-width: 560px;
}

.form-row {
    margin-bottom: 1.1rem;
}

.form-row--last {
    margin-bottom: 0;
}

.form-row label {
    display: block;
    font-weight: 600;
    font-size: 0.8125rem;
    margin-bottom: 0.4rem;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}

.form-row input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]),
.form-row select,
.form-row textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--text);
    background: #fafbfc;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.form-row select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    padding-right: 2.25rem;
}

.form-row select[multiple] {
    min-height: 8.5rem;
    background-image: none;
    padding-right: 0.85rem;
}

.form-row textarea {
    min-height: 6rem;
    resize: vertical;
    line-height: 1.45;
}

.form-row input:hover,
.form-row select:hover,
.form-row textarea:hover {
    border-color: #cbd5e1;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 3px var(--accent-ring);
}

.form-row .help-text,
.form-row .form-text {
    margin: 0.4rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--muted);
}

.form-row .form-error,
.form-row .invalid-feedback,
.form-row ul {
    margin: 0.4rem 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.8125rem;
    color: var(--danger);
}

/* Checkbox + label sur une ligne */
.form-row--check {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.form-row--check > label {
    display: inline;
    margin-bottom: 0;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
    cursor: pointer;
}

.form-row--check input[type="checkbox"] {
    margin: 0;
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--accent);
}

.form-row--check .form-error,
.form-row--check .form-errors,
.form-row--check ul {
    flex-basis: 100%;
    width: 100%;
}

/* Switch / toggle — plugins sur fiche projet (taille proche des .btn / champs formulaire) */
.assignment-toggle-form {
    display: inline-flex;
    margin: 0;
    vertical-align: middle;
}

.assignment-toggle {
    position: relative;
    display: inline-block;
    width: 2.25rem;
    height: 1.125rem;
    flex-shrink: 0;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.assignment-toggle__input {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.assignment-toggle__track {
    position: absolute;
    inset: 0;
    display: block;
    border-radius: 999px;
    background: #e2e8f0;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.1);
    transition: background 0.2s ease, box-shadow 0.2s ease;
    pointer-events: none;
}

.assignment-toggle__thumb {
    position: absolute;
    top: 0.125rem;
    left: 0.125rem;
    width: 0.875rem;
    height: 0.875rem;
    border-radius: 50%;
    background: linear-gradient(180deg, #fff 0%, #f1f5f9 100%);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.1),
        0 1px 3px rgba(15, 23, 42, 0.14);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

/* Piste 36px, thumb 14px, marges 2px → course 18px */
.assignment-toggle__input:checked + .assignment-toggle__track .assignment-toggle__thumb {
    transform: translateX(1.125rem);
}

.assignment-toggle__input:checked + .assignment-toggle__track {
    background: var(--accent);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

.assignment-toggle__input:focus-visible + .assignment-toggle__track {
    box-shadow:
        inset 0 1px 3px rgba(15, 23, 42, 0.12),
        0 0 0 3px var(--accent-ring);
}

.assignment-toggle__input:focus-visible:checked + .assignment-toggle__track {
    box-shadow:
        inset 0 1px 2px rgba(15, 23, 42, 0.08),
        0 0 0 3px var(--accent-ring);
}

.assignment-toggle:hover .assignment-toggle__input:not(:checked) + .assignment-toggle__track {
    background: #cbd5e1;
}

.assignment-toggle:hover .assignment-toggle__input:checked + .assignment-toggle__track {
    background: var(--accent-hover);
}

.form-errors,
.form-error {
    color: var(--danger);
    font-size: 0.8125rem;
    margin-top: 0.35rem;
}

.form-actions {
    display: flex;
    gap: 0.65rem;
    margin-top: 1.75rem;
    flex-wrap: wrap;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 50;
}

.modal {
    background: var(--surface);
    border-radius: calc(var(--radius) + 2px);
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.modal__header {
    padding: 1.2rem 1.35rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.modal__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.modal__body {
    padding: 1.35rem;
}

.modal__footer {
    padding: 1rem 1.35rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    background: #fafbfc;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--muted);
    border-radius: var(--radius-sm);
    line-height: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
    background: #f1f5f9;
    color: var(--text);
}

.empty-hint {
    text-align: center;
    padding: 2.5rem 1.5rem !important;
    color: var(--muted);
    font-size: 0.9375rem;
}

/* Dashboard */
.dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 960px) {
    .dashboard-kpis {
        grid-template-columns: repeat(2, 1fr);
    }
}

.dashboard-kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.15rem 1.25rem;
    box-shadow: var(--shadow-sm);
}

.dashboard-kpi__label {
    margin: 0 0 0.35rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.dashboard-kpi__value {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1.2;
}

.dashboard-kpi__value--ok {
    color: #15803d;
}

.dashboard-kpi__value--warning {
    color: #b45309;
}

.dashboard-kpi__value--error {
    color: #be123c;
}

.dashboard-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    padding: 0.75rem 1.1rem 0;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 0.5rem;
}

.dashboard-filter-bar__label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.dashboard-filter-bar__btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.dashboard-filter-btn {
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #f8fafc;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.dashboard-filter-btn:hover {
    background: #f1f5f9;
    color: var(--text);
}

.dashboard-filter-btn--active {
    background: var(--accent-soft);
    border-color: rgba(79, 70, 229, 0.35);
    color: var(--accent);
}

.badge--error {
    color: #9f1239;
    background: #fff1f2;
    border-color: rgba(225, 29, 72, 0.25);
}

.badge--warning {
    color: #92400e;
    background: #fffbeb;
    border-color: rgba(180, 83, 9, 0.25);
}

.badge--ok {
    color: #166534;
    background: #f0fdf4;
    border-color: rgba(21, 128, 61, 0.25);
}

.badge--never {
    color: var(--text-secondary);
    background: #f8fafc;
    border-color: var(--border);
}

.badge--running {
    color: #1d4ed8;
    background: #eff6ff;
    border-color: rgba(29, 78, 216, 0.25);
}

@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-height: unset;
        position: relative;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        padding: 1rem;
        gap: 0.75rem;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }

    .sidebar__brand {
        border-bottom: none;
        margin-bottom: 0;
        padding: 0.35rem 0.75rem;
        margin: 0;
        flex: 1;
        min-width: 200px;
    }

    .sidebar__nav {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 0;
        flex: 1 1 100%;
    }

    .main {
        padding: 1.35rem 1.15rem 2rem;
    }

    table.data td.muted {
        max-width: 180px;
    }
}

.guest-layout {
    min-height: 100vh;
    background: var(--bg);
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-card {
    width: 100%;
    max-width: 24rem;
    padding: 1.75rem;
}

.login-card__title {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
}

.login-card__sub {
    margin: 0 0 1.25rem;
    font-size: 0.9375rem;
}

.login-form__submit {
    width: 100%;
    margin-top: 0.5rem;
}

.user-form-card {
    padding: 1.25rem;
    max-width: 36rem;
}

.list-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 0.25rem;
}

.list-filter-bar__field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 10rem;
    flex: 1 1 12rem;
}

.list-filter-bar__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.list-filter-bar__input {
    font-family: inherit;
    font-size: 0.875rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
    min-height: 2.25rem;
}

.list-filter-bar__input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}

.list-filter-bar__select {
    cursor: pointer;
}

.list-filter-bar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    padding-bottom: 0.1rem;
}
