@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Playfair+Display:wght@600;700;800&display=swap");

:root {
    --bg: #e9edf4;
    --surface: #ffffff;
    --surface-soft: #f3f6fb;
    --text: #111f53;
    --muted: #4d5a83;
    --line: rgba(17, 31, 83, 0.18);
    --primary: #111f53;
    --primary-dark: #0b1439;
    --secondary: #e9560d;
    --secondary-dark: #c9490c;
    --secondary-soft: #fff1e8;
    --copper-soft: #f6e2d6;
    --success-bg: #edf9ef;
    --success-line: #8ed1a5;
    --success-text: #166534;
    --danger-bg: #fff2f0;
    --danger-line: #f1b3ad;
    --danger-text: #9f1239;
    --radius: 14px;
    --shadow: 0 16px 38px rgba(17, 31, 83, 0.11);
    --text-size-body: clamp(0.82rem, 0.78rem + 0.16vw, 0.92rem);
    --text-size-label: clamp(0.68rem, 0.66rem + 0.12vw, 0.76rem);
    --text-size-button: clamp(0.72rem, 0.69rem + 0.14vw, 0.82rem);
    --text-size-table: clamp(0.74rem, 0.71rem + 0.12vw, 0.84rem);
    --control-padding-y: clamp(7px, 6px + 0.25vw, 10px);
    --control-padding-x: clamp(10px, 8px + 0.35vw, 13px);
    --nav-font-size: clamp(0.68rem, 0.66rem + 0.12vw, 0.76rem);
    --nav-padding-y: clamp(6px, 5px + 0.18vw, 8px);
    --nav-padding-x: clamp(10px, 8px + 0.28vw, 12px);
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Manrope", "Segoe UI", sans-serif;
    background:
        radial-gradient(1000px 460px at 98% -8%, rgba(233, 86, 13, 0.15), transparent 58%),
        radial-gradient(1020px 520px at -10% -14%, rgba(17, 31, 83, 0.2), transparent 58%),
        linear-gradient(150deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 36%),
        var(--bg);
    margin: 0;
    color: var(--text);
    line-height: 1.6;
    letter-spacing: 0.005em;
    font-size: var(--text-size-body);
}

.container {
    max-width: 1600px;
    width: min(1600px, calc(100% - 24px));
    margin: 32px auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 4px solid var(--secondary);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px;
    backdrop-filter: blur(1px);
}

.brand-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    gap: 20px;
    margin-bottom: 18px;
    padding: 12px 16px;
    border: 1px solid rgba(17, 31, 83, 0.14);
    border-radius: 16px;
    background:
        linear-gradient(125deg, #ffffff 0%, #f8faff 56%, #fff4eb 100%),
        repeating-linear-gradient(0deg, rgba(17, 31, 83, 0.015) 0 1px, transparent 1px 8px);
    box-shadow: 0 8px 20px rgba(17, 31, 83, 0.06);
    animation: fade-slide-in 460ms ease-out;
}

.brand-link {
    display: inline-flex;
    align-items: center;
}

.brand-logo {
    max-height: 60px;
    width: auto;
    display: block;
}

.brand-tagline {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    text-align: right;
}

.brand-logout {
    margin-left: auto;
    white-space: nowrap;
}

h1 {
    margin: 0 0 20px;
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(1.2rem, 0.98rem + 0.7vw, 1.7rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: var(--primary-dark);
    animation: fade-slide-in 550ms ease-out;
}

h2,
h3,
h4,
h5,
h6 {
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.topnav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
    animation: fade-slide-in 620ms ease-out;
    align-items: stretch;
}

.topnav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 1 auto;
    color: var(--text);
    text-decoration: none;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: var(--nav-padding-y) var(--nav-padding-x);
    background: #ffffff;
    font-weight: 700;
    font-size: var(--nav-font-size);
    letter-spacing: 0.005em;
    transition: all 0.18s ease;
    min-inline-size: 0;
    text-align: center;
    max-width: 100%;
}

.topnav a:hover {
    border-color: var(--secondary);
    background: var(--secondary-soft);
    transform: translateY(-1px);
}

.topnav a.active {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 5px 14px rgba(17, 31, 83, 0.25);
}

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

.actions-spaced {
    margin-top: 16px;
}

.actions-tight {
    margin-top: 10px;
}

.form-block {
    margin-bottom: 14px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff, #fbfcff);
    color: var(--text);
    padding: var(--control-padding-y) var(--control-padding-x);
    border-radius: 12px;
    text-decoration: none;
    cursor: pointer;
    font-weight: 700;
    font-size: var(--text-size-button);
    line-height: 1.25;
    transition: all 0.16s ease;
    min-inline-size: 0;
    max-width: 100%;
    text-align: center;
}

.btn:hover {
    border-color: var(--secondary);
    background: var(--secondary-soft);
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(233, 86, 13, 0.14);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #2a3f8d);
    border-color: transparent;
    color: #ffffff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #15214d);
    border-color: transparent;
}

.inline-form {
    display: inline;
}

.inline-form-gap {
    margin-left: 6px;
}

.inline-edit-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.inline-edit-form select,
.inline-edit-form input {
    width: auto;
    min-width: 170px;
    padding: 8px 10px;
}

.inline-edit-form .btn {
    padding: 8px 11px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 5px 14px rgba(17, 31, 83, 0.05);
}

thead th {
    text-align: left;
    padding: 12px 10px;
    background: linear-gradient(180deg, #f7f9ff, #edf2ff);
    color: var(--primary);
    font-size: clamp(0.68rem, 0.65rem + 0.1vw, 0.74rem);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--line);
}

tbody td {
    border-bottom: 1px solid #eef2f7;
    text-align: left;
    padding: 11px 10px;
    vertical-align: middle;
    font-size: var(--text-size-table);
    overflow-wrap: anywhere;
}

tbody tr:nth-child(even) {
    background: #fbfcff;
}

tbody tr:hover {
    background: #fff7f1;
}

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

.th-actions {
    width: min(280px, 26vw);
}

.cell-actions {
    white-space: normal;
}

.cell-actions .inline-form,
.cell-actions .inline-edit-form {
    display: inline-flex;
    vertical-align: middle;
    flex-wrap: wrap;
    gap: 6px;
}

.cell-actions .btn {
    margin-right: 0;
}

.cell-actions .btn:last-child {
    margin-right: 0;
}

.email-recipient-cell {
    min-width: 220px;
}

.email-recipient-count {
    font-weight: 700;
    color: var(--primary-dark);
}

.email-recipient-details {
    margin-top: 4px;
}

.email-recipient-details summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 0.82em;
}

.email-recipient-details ul {
    margin: 6px 0 0;
    padding-left: 18px;
}

.email-recipient-details li {
    margin: 2px 0;
}

.page-evenements .actions,
.page-lieux-evenements .actions,
.page-evenements .actions-spaced,
.page-lieux-evenements .actions-spaced {
    gap: 8px;
}

.table-evenements,
.table-lieux-evenements {
    table-layout: fixed;
}

.table-evenements th,
.table-evenements td,
.table-lieux-evenements th,
.table-lieux-evenements td {
    padding: 6px 8px;
    font-size: clamp(0.7rem, 0.68rem + 0.1vw, 0.78rem);
    line-height: 1.2;
}

.table-evenements .th-actions,
.table-lieux-evenements .th-actions {
    width: min(132px, 14vw);
}

.table-evenements .cell-actions,
.table-lieux-evenements .cell-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    align-items: center;
    justify-content: flex-start;
}

.table-evenements .cell-actions .btn,
.table-lieux-evenements .cell-actions .btn {
    padding: 6px 10px;
    font-size: clamp(0.68rem, 0.66rem + 0.08vw, 0.74rem);
}

.cell-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
}

.actions-menu {
    position: relative;
    display: inline-block;
}

.actions-menu summary {
    list-style: none;
}

.actions-menu summary::-webkit-details-marker {
    display: none;
}

.actions-menu-toggle {
    min-width: 74px;
    padding: 5px 9px;
    font-size: 0.74rem;
    border-color: rgba(17, 31, 83, 0.2);
    background: linear-gradient(180deg, #ffffff, #f6f8fd);
    color: #334155;
    box-shadow: none;
    opacity: 0.92;
}

.actions-menu-toggle:hover {
    opacity: 1;
    border-color: rgba(17, 31, 83, 0.35);
    background: #f2f5fc;
    transform: none;
    box-shadow: none;
}

.actions-menu-list {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 20;
    min-width: 180px;
    display: none;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(17, 31, 83, 0.14);
}

.actions-menu[open] .actions-menu-list {
    display: grid;
    gap: 6px;
}

.actions-menu-list .btn,
.actions-menu-list .inline-form,
.actions-menu-list .inline-form .btn {
    width: 100%;
}

.actions-menu-list .inline-form {
    display: block;
}

.table-factures,
.table-paiements,
.table-recommandations {
    table-layout: fixed;
}

.table-factures th,
.table-factures td,
.table-paiements th,
.table-paiements td,
.table-recommandations th,
.table-recommandations td {
    padding: 6px 7px;
    line-height: 1.2;
    font-size: clamp(0.7rem, 0.68rem + 0.1vw, 0.78rem);
}

.table-factures .th-actions,
.table-paiements .th-actions,
.table-recommandations .th-actions {
    width: min(180px, 20vw);
}

.table-factures .cell-actions,
.table-paiements .cell-actions,
.table-recommandations .cell-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.table-factures .cell-actions .btn,
.table-paiements .cell-actions .btn,
.table-recommandations .cell-actions .btn {
    padding: 5px 8px;
    font-size: clamp(0.66rem, 0.64rem + 0.08vw, 0.72rem);
    line-height: 1.15;
}

.table-factures td,
.table-paiements td,
.table-recommandations td {
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 901px) {
    .table-factures td,
    .table-paiements td,
    .table-recommandations td {
        white-space: nowrap;
    }
}

@media (min-width: 901px) {
    .table-evenements .cell-ellipsis,
    .table-lieux-evenements .cell-ellipsis {
        white-space: nowrap;
    }

    .table-evenements td:nth-child(2) {
        max-width: 180px;
    }

    .table-evenements td:nth-child(3) {
        max-width: 260px;
    }

    .table-lieux-evenements td:nth-child(2) {
        max-width: 180px;
    }

    .table-lieux-evenements td:nth-child(3) {
        max-width: 240px;
    }
}

.page-evenements-form .form-grid,
.page-lieux-evenements .form-grid {
    gap: 10px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    margin-left: 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    vertical-align: middle;
}

.status-badge-success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-line);
}

.participation-manager .actions {
    margin-bottom: 12px;
}

.participation-manager .form-grid {
    grid-template-columns: minmax(320px, 2fr) minmax(180px, 1fr);
    gap: 10px;
}

.participation-manager .inline-edit-form {
    gap: 6px;
}

.participation-manager .inline-edit-form select,
.participation-manager .inline-edit-form input {
    min-width: 150px;
    max-width: 260px;
    padding: 8px 10px;
}

.participation-manager .cell-actions .btn {
    padding: 8px 10px;
}

.table-participations th,
.table-participations td {
    padding-top: 9px;
    padding-bottom: 9px;
}

.page-invites .actions,
.page-paiements .actions {
    margin-bottom: 12px;
}

.page-invites .actions-spaced,
.page-paiements .actions-spaced {
    margin-top: 14px;
}

.page-invites .form-grid,
.page-paiements .form-grid {
    gap: 10px;
}

.table-invites th,
.table-invites td,
.table-paiements th,
.table-paiements td {
    padding-top: 9px;
    padding-bottom: 9px;
}

.table-invites .cell-actions,
.table-paiements .cell-actions {
    white-space: nowrap;
}

.page-factures .actions,
.page-recommandations .actions,
.page-kpi .actions {
    margin-bottom: 12px;
}

.page-kpi .actions {
    margin-bottom: 8px;
}

.table-factures th,
.table-factures td,
.table-recommandations th,
.table-recommandations td,
.table-kpi th,
.table-kpi td {
    padding-top: 9px;
    padding-bottom: 9px;
}

.table-kpi th,
.table-kpi td {
    font-size: 0.92rem;
}

.page-kpi .kpi-table-wrap {
    overflow-x: visible;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.page-kpi .table-kpi {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
    border: 0;
    border-radius: 0;
}

.page-kpi .table-kpi th[title] {
    cursor: help;
}

.page-kpi .table-kpi th,
.page-kpi .table-kpi td {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    padding: 7px 8px;
    font-size: 0.86rem;
}

.page-kpi .table-kpi th:nth-child(n + 2),
.page-kpi .table-kpi td:nth-child(n + 2) {
    text-align: right;
}

.page-kpi .table-kpi th:first-child,
.page-kpi .table-kpi td:first-child {
    position: static;
    text-align: left;
    min-width: 0;
    background: #ffffff;
}

.page-kpi .table-kpi thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}

.page-kpi .table-kpi thead th:first-child {
    z-index: 3;
}

.page-recommandations .form-grid {
    gap: 10px;
}

label {
    display: block;
    margin: 8px 0 6px;
    font-size: var(--text-size-label);
    color: #111827;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

input {
    width: 100%;
    border: 1px solid #ccd4e2;
    border-radius: 12px;
    padding: var(--control-padding-y) 11px;
    font-size: var(--text-size-body);
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
    width: 100%;
    border: 1px solid #ccd4e2;
    border-radius: 12px;
    padding: var(--control-padding-y) 11px;
    font-size: var(--text-size-body);
    background: #ffffff;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select {
    width: 100%;
    border: 1px solid #ccd4e2;
    border-radius: 12px;
    padding: var(--control-padding-y) 11px;
    font-size: var(--text-size-body);
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus {
    outline: none;
    border-color: rgba(233, 86, 13, 0.8);
    box-shadow: 0 0 0 3px rgba(233, 86, 13, 0.12);
}

select:focus {
    outline: none;
    border-color: rgba(233, 86, 13, 0.8);
    box-shadow: 0 0 0 3px rgba(233, 86, 13, 0.12);
}

textarea:focus {
    outline: none;
    border-color: rgba(233, 86, 13, 0.8);
    box-shadow: 0 0 0 3px rgba(233, 86, 13, 0.12);
}

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

.field-checkbox {
    grid-column: auto;
    display: flex;
    align-items: flex-end;
}

.field-checkbox label {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 10px 11px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
}

.field-checkbox input[type="checkbox"] {
    width: 22px !important;
    height: 22px !important;
    margin: 0;
    padding: 0;
    transform: scale(1.2);
    transform-origin: center;
    flex: 0 0 auto;
    accent-color: var(--primary);
}

.notice {
    background: var(--success-bg);
    border: 1px solid var(--success-line);
    color: var(--success-text);
    padding: 11px 12px;
    border-radius: 10px;
    margin-bottom: 12px;
}

.error {
    background: var(--danger-bg);
    border: 1px solid var(--danger-line);
    color: var(--danger-text);
    padding: 11px 12px;
    border-radius: 10px;
    margin-bottom: 12px;
}

/* ===== Facture formelle ===== */

.invoice-send-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.invoice-send-form input[type="email"] {
    width: min(260px, 38vw);
    min-width: 190px;
    padding: 8px 10px;
}

.invoice-document {
    margin-top: 14px;
    border: 1px solid #ced8ea;
    border-top: 5px solid var(--primary);
    border-radius: 14px;
    background: #fff;
    padding: 24px;
    box-shadow: 0 12px 28px rgba(17, 31, 83, 0.08);
    animation: fade-slide-in 320ms ease-out;
}

.invoice-document-header {
    display: grid;
    grid-template-columns: minmax(180px, 240px) 1fr;
    gap: 16px;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid #e3e8f3;
}

.invoice-brand-block {
    display: flex;
    align-items: center;
    min-height: 70px;
}

.invoice-brand-logo {
    max-height: 66px;
    width: auto;
}

.invoice-emetteur-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    gap: 3px;
}

.invoice-emetteur-info strong {
    color: var(--primary-dark);
    font-size: 1rem;
}

.invoice-emetteur-info span {
    color: #5f6b8a;
    font-size: 0.82rem;
}

.invoice-title-block {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.invoice-title-block h2 {
    margin: 0;
    font-family: "Playfair Display", Georgia, serif;
    color: var(--primary-dark);
    font-size: clamp(1.34rem, 1.12rem + 0.48vw, 1.7rem);
}

.invoice-number {
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 0.96rem;
    color: #6b7280;
    margin-left: 10px;
    font-weight: 700;
}

.invoice-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.invoice-status-emise {
    background: #e7eef9;
    color: #173b6f;
}

.invoice-status-payee {
    background: #e9f7ec;
    color: #146a31;
}

.invoice-status-retard {
    background: #fdecec;
    color: #9f1239;
}

.invoice-status-brouillon {
    background: #fff4e6;
    color: #b45309;
}

.invoice-meta {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 10px;
    padding: 12px;
    border: 1px solid #e5e9f4;
    border-radius: 10px;
    background: #f8fbff;
}

.invoice-meta-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.invoice-meta-item span {
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #7a849f;
    font-weight: 700;
}

.invoice-meta-item strong {
    font-size: 0.9rem;
    color: #1f2d57;
}

.invoice-parties {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(200px, 1fr));
    gap: 12px;
}

.invoice-party {
    border: 1px solid #e5e9f4;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
}

.invoice-party h4 {
    margin: 0 0 8px;
    font-size: 0.74rem;
    color: #6b7899;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.invoice-party p {
    margin: 2px 0;
}

.invoice-party .party-name {
    font-weight: 700;
    color: #192b58;
}

.invoice-party .party-muted {
    color: #5f6b8a;
    font-size: 0.84rem;
}

.invoice-lines-table {
    width: 100%;
    margin-top: 14px;
    border-collapse: collapse;
    border: 1px solid #d8e0ef;
    border-radius: 10px;
    overflow: hidden;
}

.invoice-lines-table th {
    background: #1f3f67;
    color: #fff;
    text-align: left;
    padding: 10px 11px;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.invoice-lines-table td {
    padding: 9px 11px;
    border-top: 1px solid #e8edf6;
    color: #1d2e5d;
    font-size: 0.86rem;
}

.invoice-lines-table tbody tr:nth-child(even) {
    background: #f8fbff;
}

.invoice-lines-table th:nth-child(2),
.invoice-lines-table th:nth-child(3),
.invoice-lines-table th:nth-child(4),
.invoice-lines-table td:nth-child(2),
.invoice-lines-table td:nth-child(3),
.invoice-lines-table td:nth-child(4) {
    text-align: right;
}

.invoice-totals {
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1fr minmax(260px, 340px);
    gap: 14px;
    align-items: start;
}

.invoice-payment-info {
    border: 1px solid #d9e3f2;
    border-radius: 10px;
    background: #f7faff;
    padding: 10px 12px;
}

.invoice-payment-info h4 {
    margin: 0 0 8px;
    font-size: 0.75rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #4f5f82;
}

.invoice-payment-info p {
    margin: 3px 0;
    color: #26395f;
    font-size: 0.87rem;
}

.invoice-totals-inner {
    border: 1px solid #d9e3f2;
    border-radius: 10px;
    background: #fbfdff;
    overflow: hidden;
}

.invoice-total-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    border-top: 1px solid #e8edf6;
    color: #273a65;
    font-size: 0.9rem;
}

.invoice-total-row:first-child {
    border-top: 0;
}

.invoice-total-ttc {
    background: #1d3f6b;
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.invoice-tva-mention {
    margin: 10px 12px 12px;
    color: #7a849f;
    font-size: 0.78rem;
    font-style: italic;
}

.invoice-doc-footer {
    margin-top: 16px;
    border-top: 1px solid #e2e8f4;
    padding-top: 8px;
    color: #7f89a3;
    font-size: 0.74rem;
    text-align: center;
}

@media (max-width: 900px) {
    .invoice-send-form {
        width: 100%;
        flex-wrap: wrap;
    }

    .invoice-send-form input[type="email"] {
        width: 100%;
        min-width: 0;
    }

    .invoice-document {
        padding: 14px;
    }

    .invoice-document-header {
        grid-template-columns: 1fr;
    }

    .invoice-emetteur-info {
        align-items: flex-start;
        text-align: left;
    }

    .invoice-title-block {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .invoice-parties {
        grid-template-columns: 1fr;
    }

    .invoice-totals {
        grid-template-columns: 1fr;
    }
}

@media print {
    body {
        background: #fff !important;
    }

    .brand-banner,
    .topnav,
    .actions,
    .notice,
    .error {
        display: none !important;
    }

    .container {
        width: 100% !important;
        margin: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    .invoice-document {
        margin: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    .invoice-lines-table,
    .invoice-lines-table th,
    .invoice-lines-table td,
    .invoice-totals-inner,
    .invoice-party,
    .invoice-payment-info {
        border-color: #bbb !important;
    }

    .invoice-total-ttc,
    .invoice-lines-table th {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

@keyframes fade-slide-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.kpi-roi-pos {
    color: #166534;
    font-weight: 700;
}

.kpi-roi-neg {
    color: #b91c1c;
    font-weight: 700;
}

.kpi-roi-neutral {
    color: #334155;
    font-weight: 700;
}

.rights-matrix-wrap {
    overflow-x: auto;
}

.rights-matrix {
    min-width: 980px;
}

.rights-matrix th,
.rights-matrix td {
    text-align: center;
    vertical-align: middle;
    padding-top: 6px;
    padding-bottom: 6px;
}

.rights-matrix th:first-child,
.rights-matrix td:first-child {
    text-align: left;
    min-width: 320px;
}

.rights-matrix td:first-child {
    line-height: 1.25;
}

.rights-matrix td:first-child small {
    font-size: 0.78rem;
}

.rights-cell {
    width: 108px;
}

.rights-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid var(--line);
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
}

.rights-toggle-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.rights-toggle-symbol {
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1;
}

.rights-toggle.is-yes {
    border-color: rgba(17, 31, 83, 0.36);
    background: rgba(17, 31, 83, 0.12);
}

.rights-toggle.is-yes .rights-toggle-symbol {
    color: var(--primary);
}

.rights-toggle.is-no {
    border-color: rgba(225, 29, 72, 0.35);
    background: rgba(225, 29, 72, 0.1);
}

.rights-toggle.is-no .rights-toggle-symbol {
    color: #e11d48;
}

@media (max-width: 900px) {
    .container {
        width: calc(100% - 16px);
        margin: 8px auto;
        padding: 16px;
    }

    .brand-banner {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .brand-logo {
        max-height: 50px;
    }

    .brand-tagline {
        position: static;
        transform: none;
        text-align: center;
        font-size: 0.8rem;
    }

    .brand-logout {
        margin-left: 0;
    }

    .topnav,
    .actions {
        gap: 6px;
    }

    .topnav a {
        flex: 1 1 calc(33.333% - 6px);
    }

    .actions .btn,
    .cell-actions .btn {
        flex: 1 1 calc(50% - 6px);
    }

    .table-evenements th,
    .table-evenements td,
    .table-lieux-evenements th,
    .table-lieux-evenements td {
        font-size: 0.8rem;
        padding: 7px 6px;
    }

    .actions .btn,
    .cell-actions .btn {
        min-width: 0;
    }

    .table-evenements .cell-actions,
    .table-lieux-evenements .cell-actions {
        flex-wrap: wrap;
    }

    .actions-menu {
        width: 100%;
    }

    .actions-menu-toggle {
        width: 100%;
    }

    .actions-menu-list {
        position: static;
        min-width: 0;
        margin-top: 6px;
        box-shadow: none;
    }

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

    .participation-manager .form-grid {
        grid-template-columns: 1fr;
    }

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
        width: 100%;
    }

    thead {
        display: none;
    }

    tbody tr {
        border-bottom: 1px solid var(--line);
        padding: 8px 0;
    }

    tbody td {
        border: none;
        padding: 6px 2px;
    }

    .cell-actions,
    .cell-actions .inline-form,
    .cell-actions .inline-edit-form {
        display: flex;
        width: 100%;
        flex-wrap: wrap;
    }
}

@media (max-width: 640px) {
    :root {
        --text-size-body: 0.8rem;
        --text-size-button: 0.7rem;
        --text-size-table: 0.72rem;
        --nav-font-size: 0.68rem;
    }

    .container {
        width: calc(100% - 12px);
        padding: 12px;
    }

    .topnav a,
    .actions .btn,
    .cell-actions .btn {
        flex-basis: 100%;
    }

    .table-evenements .cell-actions,
    .table-lieux-evenements .cell-actions {
        gap: 4px;
    }

    .table-evenements th,
    .table-evenements td,
    .table-lieux-evenements th,
    .table-lieux-evenements td {
        padding: 6px 4px;
        line-height: 1.15;
    }

    .brand-logo {
        max-height: 44px;
    }
}

@media (min-width: 901px) and (max-width: 1280px) {
    :root {
        --text-size-body: 0.86rem;
        --text-size-button: 0.76rem;
        --text-size-table: 0.78rem;
        --nav-font-size: 0.7rem;
    }

    .topnav {
        gap: 5px;
    }

    .table-evenements th,
    .table-evenements td,
    .table-lieux-evenements th,
    .table-lieux-evenements td {
        padding: 6px 6px;
    }
}

@media (max-width: 900px) {
    .rights-matrix-wrap table,
    .rights-matrix-wrap thead,
    .rights-matrix-wrap tbody,
    .rights-matrix-wrap th,
    .rights-matrix-wrap td,
    .rights-matrix-wrap tr {
        display: table;
    }

    .rights-matrix-wrap thead {
        display: table-header-group;
    }

    .rights-matrix-wrap tbody {
        display: table-row-group;
    }

    .rights-matrix-wrap tr {
        display: table-row;
    }

    .rights-matrix-wrap th,
    .rights-matrix-wrap td {
        display: table-cell;
        width: auto;
        border-bottom: 1px solid #eef2f7;
    }

    .page-kpi .kpi-table-wrap table,
    .page-kpi .kpi-table-wrap thead,
    .page-kpi .kpi-table-wrap tbody,
    .page-kpi .kpi-table-wrap th,
    .page-kpi .kpi-table-wrap td,
    .page-kpi .kpi-table-wrap tr {
        display: table;
    }

    .page-kpi .kpi-table-wrap thead {
        display: table-header-group;
    }

    .page-kpi .kpi-table-wrap tbody {
        display: table-row-group;
    }

    .page-kpi .kpi-table-wrap tr {
        display: table-row;
    }

    .page-kpi .kpi-table-wrap th,
    .page-kpi .kpi-table-wrap td {
        display: table-cell;
        width: auto;
        border-bottom: 1px solid #eef2f7;
    }
}
