@import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@500;600;700&family=Exo+2:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap");

:root {
    /* Néon rétrogaming / synthwave (réf. outrun) */
    --neon-cyan: #00e5ff;
    --neon-cyan-dim: rgba(0, 229, 255, 0.35);
    --neon-magenta: #ff2d95;
    --neon-magenta-dim: rgba(255, 45, 149, 0.4);
    --neon-purple: #a855f7;
    --bg-deep: #06060f;
    --bg-mid: #0c0c1a;
    --bg-purple: #12082a;

    /* Sémantique (conservée pour le reste de la feuille) */
    --bg: #0a0a18;
    --surface: rgba(14, 16, 36, 0.92);
    --surface-soft: rgba(20, 22, 48, 0.75);
    --surface-elevated: rgba(28, 26, 58, 0.95);
    --input-bg: rgba(12, 14, 32, 0.9);
    --text: #e8f0ff;
    --muted: #8b95b8;
    --border: rgba(0, 229, 255, 0.28);
    --border-strong: rgba(255, 45, 149, 0.35);
    --primary: #ff2d95;
    --primary-hover: #ff5aad;
    --primary-glow: 0 0 18px rgba(255, 45, 149, 0.45);
    --success: #39ffb4;
    --danger: #ff3864;
    --danger-hover: #ff5c7a;
    --shadow: 0 16px 48px rgba(0, 0, 0, 0.55), 0 0 1px rgba(0, 229, 255, 0.15);
    --sidebar-expanded: 260px;
    --sidebar-collapsed: 78px;
    --table-stripe: rgba(0, 229, 255, 0.07);
    --table-hover: rgba(0, 229, 255, 0.14);
    --table-hover-alt: rgba(255, 45, 149, 0.12);
    --table-head-hover: rgba(0, 229, 255, 0.22);
    --sidebar-bg: #070714;
    --sidebar-edge: rgba(0, 229, 255, 0.22);
    --font-display: "Orbitron", system-ui, sans-serif;
    --font-body: "Exo 2", system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--text);
    background-color: var(--bg-deep);
    background-image:
        linear-gradient(160deg, rgba(0, 229, 255, 0.07) 0%, transparent 42%),
        linear-gradient(320deg, rgba(255, 45, 149, 0.06) 0%, transparent 48%),
        radial-gradient(ellipse 100% 70% at 50% -15%, var(--bg-purple) 0%, transparent 55%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 35px,
            rgba(0, 229, 255, 0.04) 35px,
            rgba(0, 229, 255, 0.04) 36px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 35px,
            rgba(255, 45, 149, 0.03) 35px,
            rgba(255, 45, 149, 0.03) 36px
        ),
        linear-gradient(180deg, var(--bg-mid) 0%, var(--bg-deep) 100%);
    background-attachment: fixed;
}

/* Garde-fou desktop : la navigation mobile est masquee par defaut.
   Les styles mobile.css (<=900px) la reactivent explicitement. */
.afa-mobile-bar,
.afa-mobile-backdrop,
.afa-mobile-fab-menu {
    display: none;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-expanded);
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-edge);
    box-shadow: 4px 0 32px rgba(0, 0, 0, 0.5), inset -1px 0 0 rgba(255, 45, 149, 0.12);
    transition: width 140ms ease;
    z-index: 50;
}

body.sidebar-booting .sidebar,
body.sidebar-booting .container {
    transition: none !important;
}

body.sidebar-booting .sidebar-logo img,
body.sidebar-booting .sidebar-link {
    transition: none !important;
}

.sidebar-toggle {
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    color: #c8f7ff;
    padding: 8px 10px;
    border-radius: 10px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 10px;
    text-decoration: none;
    margin-bottom: 4px;
}

.sidebar-logo img {
    width: 44px;
    height: auto;
    object-fit: contain;
    transition: width 150ms ease;
}

.sidebar-logo:hover {
    background: rgba(0, 229, 255, 0.1);
}

.sidebar-toggle:hover {
    background: rgba(0, 229, 255, 0.1);
}

.sidebar-link {
    text-decoration: none;
    color: #d6f7ff;
    font-size: 0.95rem;
    padding: 10px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 160ms ease;
}

.sidebar-link:hover {
    background: rgba(0, 229, 255, 0.14);
    color: #ffffff;
}

.icon-svg {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    opacity: 0.95;
}

.sidebar .label {
    white-space: nowrap;
}

.sidebar-role-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 2px 10px 6px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #f8fafc;
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-role-badge--admin {
    background: rgba(168, 85, 247, 0.35);
    border-color: var(--neon-purple);
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.35);
}

.sidebar-role-badge--operator {
    background: rgba(255, 45, 149, 0.3);
    border-color: var(--neon-magenta);
    box-shadow: 0 0 12px rgba(255, 45, 149, 0.3);
}

.sidebar-role-badge--viewer {
    background: rgba(0, 229, 255, 0.2);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.25);
}

body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed);
}

body.sidebar-collapsed .sidebar .label {
    display: none;
}

body.sidebar-collapsed .sidebar-role-badge {
    margin: 2px auto 6px;
    width: 42px;
    height: 24px;
    padding: 0;
    overflow: hidden;
    text-indent: -9999px;
    position: relative;
}

body.sidebar-collapsed .sidebar-role-badge::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    color: #fff;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

body.sidebar-collapsed .sidebar-logo img {
    width: 51px;
    height: auto;
}

body:not(.sidebar-collapsed) .sidebar-logo img {
    width: calc(var(--sidebar-expanded) * 0.8);
    max-width: 100%;
    height: auto;
}

body.sidebar-collapsed .sidebar-link,
body.sidebar-collapsed .sidebar-toggle {
    justify-content: center;
    text-align: center;
}

body.sidebar-collapsed .sidebar .icon-svg {
    margin: 0;
}

.container {
    width: calc(100vw - var(--sidebar-expanded) - 48px);
    max-width: none;
    margin: 24px 24px 24px calc(var(--sidebar-expanded) + 24px);
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow:
        var(--shadow),
        0 0 24px rgba(0, 229, 255, 0.08),
        0 0 48px rgba(255, 45, 149, 0.05),
        inset 0 0 0 1px rgba(255, 45, 149, 0.12);
    transition: margin-left 180ms ease, width 180ms ease;
    overflow-x: auto;
}

body.sidebar-collapsed .container {
    width: calc(100vw - var(--sidebar-collapsed) - 48px);
    margin-left: calc(var(--sidebar-collapsed) + 24px);
}

h1 {
    margin: 0 0 22px;
    font-size: 1.7rem;
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: center;
    color: var(--text);
    text-shadow:
        0 0 20px var(--neon-cyan-dim),
        0 0 40px var(--neon-magenta-dim);
}

h2 {
    margin: 22px 0 12px;
    font-size: 1.15rem;
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-align: center;
    color: var(--neon-cyan);
}

.results-filter {
    max-width: 400px;
    margin: 0 auto 28px;
    text-align: left;
}

.results-filter select {
    margin-top: 4px;
}

.csv-export-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 0 auto 20px;
}

a.csv-export-link {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff !important;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    box-shadow: var(--primary-glow);
}

a.csv-export-link:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 22px rgba(255, 45, 149, 0.55);
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--text);
    font-size: 0.95rem;
}

input[type="submit"],
button {
    border: 0;
    border-radius: 10px;
    padding: 10px 16px;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--primary-glow);
}

input[type="submit"]:hover,
button:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 20px rgba(255, 45, 149, 0.5);
}

table {
    width: auto;
    min-width: min(640px, 100%);
    max-width: 100%;
    margin: 0 auto 24px;
    border-collapse: separate;
    border-spacing: 0;
    border: none;
    border-radius: 10px;
    overflow: hidden;
    table-layout: auto;
    background: transparent;
    box-shadow: none;
}

table tr:first-child th:first-child {
    border-top-left-radius: 10px;
}

table tr:first-child th:last-child {
    border-top-right-radius: 10px;
}

table tr:last-child td:first-child {
    border-bottom-left-radius: 10px;
}

table tr:last-child td:last-child {
    border-bottom-right-radius: 10px;
}

table tr:last-child td:only-child {
    border-radius: 0 0 10px 10px;
}

th,
td {
    padding: 11px 14px;
    text-align: left;
    white-space: nowrap;
    font-size: 0.93rem;
    border-bottom: 1px solid rgba(0, 229, 255, 0.1);
}

th {
    background: linear-gradient(180deg, rgba(20, 18, 45, 0.98) 0%, rgba(10, 8, 28, 0.98) 100%);
    color: #d6f7ff;
    font-weight: 600;
    font-size: 0.88rem;
    position: relative;
    border-bottom: 1px solid rgba(0, 229, 255, 0.25);
}

td {
    background: var(--surface);
}

tr:last-child th,
tr:last-child td {
    border-bottom: none;
}

table tr:not(:first-child):nth-child(even) td {
    background-color: var(--table-stripe);
}

table tr:not(:first-child):nth-child(odd) td {
    background-color: var(--surface);
}

tr:hover td {
    background: var(--table-hover) !important;
}

table tr:not(:first-child):nth-child(even):hover td {
    background: var(--table-hover-alt) !important;
}

tr:nth-child(1):hover th {
    background: var(--table-head-hover);
    color: #ffffff;
}

tr.even-row td,
tr.alternate-row td {
    background-color: var(--table-stripe) !important;
}

tr.even-row:hover td,
tr.alternate-row:hover td {
    background: var(--table-hover-alt) !important;
}

.results-table tr.results-table__stripe td {
    background-color: var(--table-stripe) !important;
}

.results-table tr:not(.results-table__stripe) td {
    background-color: var(--surface) !important;
}

.results-table tr.results-table__stripe:hover td {
    background: var(--table-hover-alt) !important;
}

.results-table tr:not(.results-table__stripe):hover td {
    background: var(--table-hover) !important;
}

/* En-tête « Tir/Cible » + « manqué » sur deux lignes (mobile / tableaux denses) */
th.th-tir-cible-manque {
    white-space: normal;
    text-align: center;
    line-height: 1.2;
    vertical-align: middle;
    max-width: 4.2rem;
}

.results-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin-bottom: 0.75rem;
}

.results-table-scroll .results-table {
    margin-bottom: 0;
    width: 100%;
    max-width: 100%;
}

.message-success {
    color: var(--success);
    text-shadow: 0 0 12px rgba(57, 255, 180, 0.45);
}

.message-error {
    color: var(--danger);
    text-shadow: 0 0 12px rgba(255, 56, 100, 0.4);
}

.auth-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-login__card {
    width: 100%;
    max-width: 520px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow:
        var(--shadow),
        0 0 30px rgba(0, 229, 255, 0.12),
        inset 0 0 0 1px rgba(255, 45, 149, 0.15);
    padding: 28px;
}

.auth-login__logo {
    display: block;
    width: min(280px, 70%);
    height: auto;
    margin: 0 auto 10px;
}

.auth-login__subtitle {
    margin: -6px 0 18px;
    text-align: center;
    color: var(--muted);
}

.auth-login__error {
    margin: 0 0 14px;
    text-align: center;
    font-weight: 600;
}

.auth-login__form {
    display: grid;
    gap: 10px;
}

.auth-login__forgot {
    margin: 16px 0 0;
    text-align: center;
    font-size: 0.95rem;
}

.auth-login__forgot a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-login__forgot a:hover {
    text-decoration: underline;
}

.admin-tools__panel--mail-test .mail-test-intro {
    margin: 0 0 20px;
    max-width: 52ch;
    line-height: 1.55;
    color: var(--muted);
    font-size: 0.98rem;
}

.admin-tools__panel--mail-test .mail-test-form {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.mail-test-report {
    margin-top: 4px;
    font-size: 0.98rem;
    line-height: 1.5;
}

.mail-test-report__banner {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 14px;
    margin-bottom: 22px;
    border: 1px solid transparent;
}

.mail-test-report__banner--success {
    background: linear-gradient(145deg, rgba(57, 255, 180, 0.12) 0%, rgba(12, 24, 32, 0.9) 100%);
    border-color: var(--success);
    color: var(--success);
    box-shadow: 0 0 16px rgba(57, 255, 180, 0.2);
}

.mail-test-report__banner--fail {
    background: linear-gradient(145deg, rgba(255, 56, 100, 0.14) 0%, rgba(24, 12, 20, 0.92) 100%);
    border-color: var(--danger);
    color: #ffb3c6;
    box-shadow: 0 0 16px rgba(255, 56, 100, 0.2);
}

.mail-test-report__banner-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    margin-top: 2px;
}

.mail-test-report__banner--fail .mail-test-report__banner-icon {
    color: var(--danger);
}

.mail-test-report__banner--success .mail-test-report__banner-icon {
    color: var(--success);
}

.mail-test-report__banner-text {
    min-width: 0;
}

.mail-test-report__banner-title {
    display: block;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 8px;
}

.mail-test-report__banner-meta {
    margin: 0;
    font-size: 0.92rem;
    opacity: 0.92;
    line-height: 1.45;
}

.mail-test-report__banner-meta code {
    font-size: 0.88em;
    background: rgba(0, 229, 255, 0.12);
    padding: 0.1em 0.35em;
    border-radius: 4px;
    color: var(--text);
}

.mail-test-report__banner--fail .mail-test-report__banner-meta code {
    background: rgba(255, 45, 149, 0.15);
}

.mail-test-report__section-title {
    margin: 0 0 10px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.mail-test-report__interpret {
    margin: 0 0 20px;
    padding-left: 1.15rem;
    display: grid;
    gap: 10px;
    color: var(--text);
}

.mail-test-report__interpret li {
    padding-left: 4px;
}

.mail-test-report__interpret li::marker {
    color: var(--primary);
}

.mail-test-report__php-error {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 56, 100, 0.5);
    background: rgba(40, 10, 22, 0.85);
    color: #ffb3c6;
    font-size: 0.92rem;
}

.mail-test-report__php-error strong {
    display: block;
    margin-bottom: 6px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.mail-test-report__php-error p {
    margin: 0;
    word-break: break-word;
}

.mail-test-report__details {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    padding: 6px 14px 14px;
}

.mail-test-report__details summary {
    cursor: pointer;
    font-weight: 700;
    padding: 10px 6px 12px;
    color: var(--text);
    list-style-position: outside;
}

.mail-test-report__details summary::-webkit-details-marker {
    color: var(--primary);
}

.mail-test-report__tech-note {
    margin: 0 0 14px;
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.5;
}

.mail-test-report__table-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.mail-test-report__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.mail-test-report__table th,
.mail-test-report__table td {
    text-align: left;
    padding: 10px 12px;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}

.mail-test-report__table thead th {
    background: rgba(0, 229, 255, 0.1);
    font-weight: 700;
    color: var(--text);
}

.mail-test-report__table tbody tr:last-child td {
    border-bottom: none;
}

.mail-test-report__table th {
    width: 34%;
}

.auth-login__form input[type="text"],
.auth-login__form input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--text);
    font-size: 1rem;
    box-shadow: inset 0 0 12px rgba(0, 229, 255, 0.04);
}

.auth-login__form input[type="text"]:focus,
.auth-login__form input[type="password"]:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.2), 0 0 20px rgba(255, 45, 149, 0.15);
    background: var(--surface-elevated);
}

.account-summary {
    max-width: 400px;
    margin: 0 auto 16px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-soft);
}

.account-summary__row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 10px;
    align-items: center;
    padding: 8px 2px;
}

.account-summary__row + .account-summary__row {
    border-top: 1px solid rgba(0, 229, 255, 0.15);
}

.account-summary__label {
    font-weight: 700;
    color: var(--neon-cyan);
}

.account-summary__value {
    font-weight: 600;
    color: var(--text);
}

.sort-button {
    color: var(--muted);
    font-size: 0.75rem;
    margin-left: 4px;
}

th .sort-button {
    color: rgba(200, 247, 255, 0.55);
}

.participants-edit-hint {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0 0 14px;
}

.participants-edit-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.participants-edit-toolbar label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--muted);
}

.participants-edit-toolbar select {
    min-height: 40px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.9rem;
    max-width: 100%;
}

.participants-edit-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 1rem;
}

.participants-edit-empty {
    margin: 12px 0 0;
    opacity: 0.92;
    font-size: 0.95rem;
    color: var(--muted);
}

/* Cartes participants (même esprit que « Gestion des étapes » dans admin) */
.participant-edit-card {
    margin: 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.participant-edit-card--stripe {
    background: rgba(255, 255, 255, 0.03);
}

.participant-edit-card__form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.participant-edit-card__form--readonly {
    gap: 10px;
}

.participant-edit-card__field input[type="text"],
.participant-edit-card__field input[type="email"] {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 8px 10px;
    font-size: 0.9rem;
}

.participant-edit-card__label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    opacity: 0.88;
    margin-bottom: 4px;
}

.participant-edit-card__id {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.participant-edit-card__id-value {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.participant-edit-card__ro {
    display: block;
    padding: 8px 10px;
    font-size: 0.9rem;
    border-radius: 8px;
    background: rgba(0, 229, 255, 0.06);
    word-break: break-word;
}

.participant-edit-card__readonly-label {
    font-size: 0.88rem;
    color: var(--muted);
    font-weight: 600;
}

.participant-edit-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 4px;
    border-top: 1px solid var(--border);
    margin-top: 2px;
}

.participant-edit-card__actions .participants-edit__save {
    min-width: 48px;
    min-height: 48px;
}

.participants-edit__save {
    padding: 8px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.6rem;
    min-height: 2.4rem;
}

.participants-edit__save-icon {
    width: 1.2rem;
    height: 1.2rem;
    flex-shrink: 0;
}

.participants-search {
    max-width: 420px;
    margin: 0 auto 14px;
    position: relative;
    background: linear-gradient(180deg, rgba(20, 22, 48, 0.95) 0%, rgba(12, 14, 32, 0.9) 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35), 0 0 20px rgba(0, 229, 255, 0.06);
}

.participants-search label {
    margin-bottom: 6px;
    font-size: 0.84rem;
    color: var(--muted);
}

.participants-search input[type="search"] {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--input-bg);
    color: var(--text);
    padding: 10px 12px 10px 38px;
    font-size: 0.93rem;
    transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.participants-search::before {
    content: "";
    position: absolute;
    left: 18px;
    top: calc(50% + 10px);
    width: 15px;
    height: 15px;
    border: 2px solid var(--neon-cyan);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.75;
    transform: translateY(-50%);
}

.participants-search::after {
    content: "";
    position: absolute;
    left: 31px;
    top: calc(50% + 18px);
    width: 7px;
    height: 2px;
    background: var(--neon-magenta);
    transform: rotate(45deg);
    border-radius: 2px;
    pointer-events: none;
    opacity: 0.9;
}

.participants-search input[type="search"]:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.2);
    background: var(--surface-elevated);
}

.participant-edit-card.participant-edit-card--match {
    outline: 2px solid var(--neon-magenta-dim);
    outline-offset: 2px;
}

@media (min-width: 901px) {
    .participant-edit-card {
        padding: 10px 12px;
    }

    .participant-edit-card__form:not(.participant-edit-card__form--readonly) {
        display: grid;
        grid-template-columns: 52px minmax(88px, 1fr) minmax(88px, 1fr) minmax(140px, 1.5fr) minmax(96px, 1fr) 56px;
        grid-template-areas: "id nom prenom email tel actions";
        gap: 10px 12px;
        align-items: end;
    }

    .participant-edit-card__form--readonly {
        display: grid;
        grid-template-columns: 52px minmax(88px, 1fr) minmax(88px, 1fr) minmax(140px, 1.5fr) minmax(96px, 1fr) auto;
        grid-template-areas: "id nom prenom email tel actions";
        gap: 10px 12px;
        align-items: end;
    }

    .participant-edit-card__id {
        grid-area: id;
    }

    .participant-edit-card__field--nom {
        grid-area: nom;
    }

    .participant-edit-card__field--prenom {
        grid-area: prenom;
    }

    .participant-edit-card__field--email {
        grid-area: email;
    }

    .participant-edit-card__field--tel {
        grid-area: tel;
    }

    .participant-edit-card__actions {
        grid-area: actions;
        border-top: 0;
        margin-top: 0;
        padding-top: 0;
        justify-content: flex-end;
    }

    .participant-edit-card__form:not(.participant-edit-card__form--readonly) .participant-edit-card__label,
    .participant-edit-card__form--readonly .participant-edit-card__label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .participant-edit-card__id .participant-edit-card__label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .participants-edit-toolbar {
        margin-bottom: 16px;
    }
}

.bulk-delete-participants__check {
    width: 2.75rem;
    text-align: center;
    vertical-align: middle;
}

.bulk-delete-participants__check input {
    width: auto;
    margin: 0;
}

.bulk-delete-submit {
    margin-top: 1rem;
    text-align: center;
}

.bulk-delete-participants th,
.bulk-delete-participants td {
    white-space: normal;
}

/* Ajout / modification résult — liste + formulaire */
.enregistrement-resultats {
    display: flex;
    align-items: flex-start;
    gap: 22px;
    margin-top: 8px;
    text-align: left;
}

.enregistrement-resultats__picker {
    flex: 0 0 min(320px, 38%);
    min-width: 220px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    max-height: min(72vh, 560px);
    display: flex;
    flex-direction: column;
}

.enregistrement-resultats__picker label {
    font-size: 0.88rem;
    margin-bottom: 6px;
}

.enregistrement-resultats__search {
    width: 100%;
    margin-bottom: 10px;
}

.enregistrement-resultats__list {
    flex: 1;
    overflow-y: auto;
    margin: 0 -4px;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 120px;
}

.enregistrement-resultats__list:empty::after {
    content: "Aucun participant ne correspond à la recherche.";
    color: var(--muted);
    font-size: 0.9rem;
    padding: 8px;
}

.enregistrement-resultats__item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font-size: 0.92rem;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease;
}

.enregistrement-resultats__item:hover {
    background: var(--table-hover);
    border-color: var(--neon-cyan);
}

.enregistrement-resultats__item.is-selected {
    background: var(--table-stripe);
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.enregistrement-resultats__item-id {
    display: block;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 2px;
}

.enregistrement-resultats__item-name {
    display: block;
}

.enregistrement-resultats__etapes {
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.25;
}

.enregistrement-resultats__etapes--none {
    font-style: italic;
}

.enregistrement-resultats__form-wrap {
    flex: 1;
    min-width: 0;
}

.enregistrement-resultats__form-wrap h2 {
    text-align: left;
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.05rem;
}

.enregistrement-resultats__form .form-row {
    margin-bottom: 16px;
}

.enregistrement-resultats__form .form-row label {
    display: block;
    margin-bottom: 6px;
}

.enregistrement-resultats__empty {
    color: var(--muted);
    padding: 12px;
}

.enregistrement-resultats__scan {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.enregistrement-resultats__scan-hint {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0 0 8px;
    line-height: 1.35;
}

.enregistrement-resultats__scan-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.enregistrement-resultats__scan-actions button.secondary {
    background: var(--surface-soft);
    color: var(--text);
    border: 1px solid var(--border);
}

.enregistrement-resultats__scan-actions button.secondary:hover {
    background: rgba(0, 229, 255, 0.12);
    border-color: var(--neon-cyan);
}

#qr-reader {
    min-height: 0;
    border-radius: 10px;
    overflow: hidden;
    max-width: 100%;
}

.dashboard-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin: 0 0 22px;
}

.dashboard-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 110px;
    padding: 10px 8px;
    border: 0;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    transition: background 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.dashboard-tile:hover {
    transform: translateY(-1px);
    background: var(--primary-hover);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 0 24px rgba(255, 45, 149, 0.35);
}

.dashboard-tile__icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
}

.dashboard-tile span {
    text-align: center;
    line-height: 1.2;
    font-size: 0.84rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.dashboard-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    background: var(--surface-soft);
}

.dashboard-card h2 {
    text-align: left;
    margin: 0 0 10px;
}

.dashboard-card__sub {
    margin: 16px 0 8px;
    font-size: 1rem;
}

@media (max-width: 800px) {
    .enregistrement-resultats {
        flex-direction: column;
    }

    .enregistrement-resultats__picker {
        flex: none;
        width: 100%;
        max-height: 45vh;
    }

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

@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .container {
        transition: none !important;
    }
}

@media (max-width: 900px) {
    .sidebar {
        width: var(--sidebar-collapsed);
    }

    .sidebar .label {
        display: none;
    }

    .container {
        width: auto;
        margin: 16px 14px 16px calc(var(--sidebar-collapsed) + 12px);
        padding: 18px;
    }
}

@media (max-width: 640px) {
    .sidebar {
        width: 62px;
        padding: 10px 8px;
    }

    .icon-svg {
        width: 17px;
        height: 17px;
        flex-basis: 17px;
    }

    .container {
        margin: 10px 8px 10px 74px;
        padding: 14px;
        border-radius: 10px;
    }

    h1 {
        font-size: 1.35rem;
        margin-bottom: 14px;
    }

    h2 {
        font-size: 1rem;
        margin-top: 16px;
        margin-bottom: 10px;
    }

    th, td {
        padding: 8px 6px;
        font-size: 0.9rem;
    }
}
