/* =======================================================
   FONTS & RESET
======================================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* =======================================================
   TYPO & LAYOUT GLOBAL
======================================================= */
body {
    font-family: "Inter", "Roboto", "Segoe UI", Arial, sans-serif;
    background: #f3f4f6;
    color: #2d2d2d;
    line-height: 1.55;
}

.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 24px 40px;
}

h1, h2, h3 {
    font-weight: 600;
    letter-spacing: -0.3px;
    color: #1e1e1e;
}

h1 { font-size: 26px; margin-bottom: 20px; }
h2 { font-size: 20px; margin-top: 30px; margin-bottom: 10px; }
h3 { font-size: 16px; margin-top: 20px; margin-bottom: 8px; }

.small {
    font-size: 13px;
    color: #6b7280;
}

/* Bloc générique type "card" (profils, formulaires, etc.) */
.section-card,
.card {
    background: #ffffff;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
}

/* =======================================================
   BOUTONS
======================================================= */

button,
.btn {
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    background: #4f46e5;
    color: #ffffff;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.05s ease;
}

button:hover,
.btn:hover {
    background: #4338ca;
    box-shadow: 0 1px 4px rgba(79, 70, 229, 0.3);
}

button:active,
.btn:active {
    transform: translateY(1px);
}

/* État chargement après soumission de formulaire */
button.btn-loading,
.btn.btn-loading {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* Variante warning */
.btn-warning {
    background: #d97706;
}
.btn-warning:hover {
    background: #b45309;
}

/* Bouton secondaire (ex: + Ajouter un spectacle) */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 6px 14px;
    border: 1px solid #4f46e5;
    background: #eef2ff;
    color: #312e81;
    font-size: 14px;
    font-weight: 500;
}
.btn-secondary:hover {
    background: #4f46e5;
    color: #ffffff;
}

/* Lien-bouton simple */
.btn-link {
    text-decoration: none;
    color: #2563eb;
}
.btn-link:hover {
    text-decoration: underline;
}

/* =======================================================
   FORMULAIRES
======================================================= */

/* Base commune */
input[type="text"],
input[type="date"],
input[type="time"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="datetime-local"],
select,
textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 8px 10px;
    margin-bottom: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
    background-color: #ffffff;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* Focus */
input[type="text"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb33;
}

/* Harmonisation widgets date/heure */
input[type="date"],
input[type="time"],
input[type="datetime-local"] {
    -webkit-appearance: none;
       -moz-appearance: textfield;
    appearance: none;
    font-family: inherit !important;
    font-size: 14px;
    color: #111827;
}
input::-webkit-datetime-edit,
input::-webkit-date-and-time-value {
    font-family: inherit !important;
    font-size: 14px;
}

/* Champ email de contact (profil) avec petit icône @ */
input[type="email"][name="email_contact"] {
    border-color: #2563eb;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%236b7280' stroke-width='1.5'%3E%3Cpath d='M8 3.25a4.25 4.25 0 1 0 0 8.5 2.25 2.25 0 0 0 0-4.5 2.25 2.25 0 1 0 0 4.5'/%3E%3Cpath d='M11 7.5V8a3 3 0 1 1-1.5-2.598'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px 16px;
}

/* =======================================================
   TABLEAUX
======================================================= */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
th {
    background: #f3f4f6;
    text-align: left;
    padding: 10px;
    font-size: 13px;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}
td {
    padding: 10px;
    border-bottom: 1px solid #f1f1f1;
    font-size: 13px;
}
tr:hover td {
    background: #f9fafb;
}

/* En-têtes triables */
th[style*="cursor"] {
    user-select: none;
}
th[style*="cursor"]:hover {
    background: #e9eaf0;
}
th[data-sort-dir="asc"]::after  { content: " ↑"; opacity: 0.6; }
th[data-sort-dir="desc"]::after { content: " ↓"; opacity: 0.6; }

/* Liens avec icône dans tableaux (PJ, etc.) */
a.btn-icon,
a.pj-link {
    color: #6A4BFF;
    text-decoration: none;
}
a.btn-icon:hover,
a.pj-link:hover {
    color: #8A6FFF;
}
table a.btn-icon svg.ico,
table a.pj-link svg.ico {
    stroke: #6A4BFF !important;
}

/* =======================================================
   TAGS & BADGES
======================================================= */

.tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    margin-right: 4px;
    margin-bottom: 4px;
    background: #eef2ff;
    color: #3730a3;
}

.tag-ok {
    background: #dcfce7;
    color: #166534;
}
.tag-missing {
    background: #fef3c7;
    color: #92400e;
}
.tag-bad {
    background: #fee2e2;
    color: #991b1b;
}

/* Badges par type d’évènement */
.badge-type {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
}
.badge-type-residence { background: #6a1b9a; }
.badge-type-concert   { background: #0277bd; }
.badge-type-atelier   { background: #2e7d32; }
.badge-type-rencontre { background: #c62828; }
.badge-type-autre     { background: #616161; }

/* Pour les lignes de statut dans dashboard_dates, etc. */
.status-row {
    border-left: 4px solid transparent;
}
.status-en-discussion  { border-left-color: #f97316; }
.status-option         { border-left-color: #eab308; }
.status-confirmé       { border-left-color: #22c55e; }
.status-réalisé        { border-left-color: #0ea5e9; }
.status-annulé         { border-left-color: #ef4444; }
.status-à-facturer     { border-left-color: #8b5cf6; }
.status-facturé        { border-left-color: #4f46e5; }

/* =======================================================
   STAT CARDS (Dashboard)
======================================================= */
.stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    flex: 1;
    background: #ffffff;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 22px;
    font-weight: 600;
}

.stat-total   { border-left: 4px solid #4f46e5; }
.stat-confirm { border-left: 4px solid #22c55e; }
.stat-discuss { border-left: 4px solid #f97316; }
.stat-option  { border-left: 4px solid #eab308; }
.stat-cancel  { border-left: 4px solid #ef4444; }

/* =======================================================
   NAVBAR & TOPBAR
======================================================= */

.topnav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 18px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
    order: 1;
}

.nav-brand {
    font-size: 1rem;
    font-weight: 600;
    color: #4f46e5;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    order: 2;
    flex: 1;
}

.nav-item {
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 8px;
    color: #374151;
    font-weight: 500;
    transition: 0.2s background, 0.2s color;
}
.nav-item:hover {
    background: #eef2ff;
    color: #4f46e5;
}
.nav-item.active {
    background: #4f46e5;
    color: #ffffff !important;
}

/* CTA "Nouvelle date" à droite */
.nav-cta-wrapper .nav-cta {
    background: #111827;
    color: #f9fafb !important;
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
}
.nav-cta-wrapper .nav-cta:hover {
    background: #1f2937;
}
.nav-cta-wrapper .nav-cta.active {
    border-color: #f97316;
}

/* Burger pour mobile */
.nav-toggle {
    display: none;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 1.2rem;
    color: #4f46e5;
    cursor: pointer;
    transition: 0.2s;
}
.nav-toggle.open {
    background: #eef2ff;
    border-color: #c7d2fe;
}

/* ── Nav Groups / Dropdowns ─────────────────────────────────────────── */
.nav-group {
    position: relative;
}
.nav-group-label {
    cursor: default;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    user-select: none;
}
.nav-group-label::after {
    content: '▾';
    font-size: .55em;
    opacity: .5;
    transition: transform .15s;
    margin-left: 1px;
}
.nav-group:hover .nav-group-label::after {
    transform: rotate(-180deg);
}
.nav-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 170px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0,0,0,.12);
    padding: 4px;
    z-index: 200;
    flex-direction: column;
    gap: 1px;
}
.nav-group:hover .nav-dropdown {
    display: flex;
}
.nav-dropdown .nav-item {
    white-space: nowrap;
    font-size: .82rem;
    padding: 7px 12px;
    border-radius: 6px;
    display: block;
}
/* Sous-nav Finance ─────────────────────────────────────────────────── */
.finance-subnav {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0;
    flex-wrap: wrap;
}
.fsn-item {
    text-decoration: none;
    padding: 7px 14px;
    font-size: .85rem;
    font-weight: 500;
    color: #6b7280;
    border-radius: 6px 6px 0 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
}
.fsn-item:hover  { color: #4f46e5; }
.fsn-item.fsn-active { color: #4f46e5; border-bottom-color: #4f46e5; font-weight: 600; }

/* Zone droite : avatar + power */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 16px;
    order: 3;
}

/* Pastille avatar profil */
.profil-avatar {
    width: 40px;
    height: 40px;
    border-radius: 9999px;
    background: #111827;
    color: #f9fafb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}
.profil-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}
.profil-avatar:hover {
    filter: brightness(1.05);
}

/* Bouton power / déconnexion */
.nav-logout {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #c5c9d1;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}
.nav-logout .ico {
    width: 32px;
    height: 32px;
}
.nav-logout svg {
    stroke-width: 2.6;
}
.nav-logout:hover {
    background: #fee2e2;
    border-color: #ef4444;
}

/* Icônes SVG génériques */
.ico,
svg.ico {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    stroke: currentColor;
    fill: none;
    vertical-align: middle;
}

/* Liens d’action avec icône */
.action-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    border-radius: 6px;
    color: #2563eb;
    text-decoration: none;
    transition: background 0.2s;
}
.action-icon:hover {
    background: #eef2ff;
}
button.action-icon, button.action-icon.btn-link {
    background: none;
    border: none;
    cursor: pointer;
    font-size: inherit;
}

/* =======================================================
   FLASH MESSAGES
======================================================= */

.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
    border: 1px solid transparent;
    animation: flash-in 0.2s ease;
}

@keyframes flash-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.flash-success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.flash-error   { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.flash-warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.flash-info    { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }

.flash-close {
    background: transparent;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    padding: 0 4px;
    flex-shrink: 0;
}
.flash-close:hover {
    opacity: 1;
    transform: none;
    box-shadow: none;
}

/* ── Empty state ──────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #6b7280;
}
.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: .5;
}
.empty-state p {
    font-size: .95rem;
    margin: 0 0 16px;
}

/* =======================================================
   PAGE DE CONNEXION
======================================================= */

.login-body {
    background: #f3f4f6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 380px;
    background: #ffffff;
    padding: 30px 26px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.login-container h1 {
    font-size: 22px;
    margin-bottom: 20px;
    color: #111827;
    text-align: center;
    font-weight: 600;
}

.login-container form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-container label {
    font-size: 14px;
    color: #374151;
}

.login-container input[type="email"],
.login-container input[type="password"] {
    padding: 10px 12px;
    border-radius: 8px;
}

.login-container button {
    background: #4f46e5;
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 8px;
}

/* =======================================================
   PROFIL / LOGO
======================================================= */

.profil-logo-block {
    margin-bottom: 20px;
}
.profil-logo-preview img {
    display: block;
    width: 80px;
    height: 80px;
    border-radius: 16px;
    object-fit: cover;
    margin-bottom: 6px;
}

/* =======================================================
   DEVIS (mise en page PDF/print)
======================================================= */

.devis-header{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    margin-bottom:25px;
}
.devis-col-left{
    width:50%;
    font-size:13px;
    line-height:1.35;
}
.devis-col-right{
    width:50%;
    text-align:right;
    font-size:13px;
}
.devis-date-ville{
    font-weight:bold;
    margin-bottom:12px;
    font-size:13px;
}
.devis-attention{
    margin-top:10px;
    font-size:13px;
    line-height:1.35;
}

/* =======================================================
   SPECTACLES / PROJETS
======================================================= */

.spectacles-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    margin-bottom: 10px;
}

/* =======================================================
   SPECTACLES — formulaire d'édition
======================================================= */

/* En-tête du formulaire */
.form-edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}
.form-edit-header h2 { margin: 0; }

/* Section card blanche */
.form-section {
    background: #fff;
    border: 1px solid #e9ecf0;
    border-radius: 12px;
    padding: 20px 24px 8px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.form-section-label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: #6366f1;
    margin-bottom: 14px;
}

/* Séparateur de section */
.form-section-divider {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #9ca3af;
    margin: 20px 0 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.form-section-divider::before,
.form-section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

/* Groupe de champ */
.form-group {
    margin-bottom: 14px;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Labels */
.spectacle-form label,
.form-group > label {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.form-label-hint {
    font-weight: 400;
    color: #9ca3af;
    text-transform: none;
    letter-spacing: 0;
    font-size: 11px;
}

/* Inputs */
.spectacle-form input[type=text],
.spectacle-form input[type=email],
.spectacle-form input[type=number],
.spectacle-form input[type=url],
.spectacle-form input[type=file],
.spectacle-form textarea,
.spectacle-form select:not([multiple]) {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13.5px;
    font-family: inherit;
    background: #fff;
    color: #111827;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}
.spectacle-form input:focus,
.spectacle-form textarea:focus,
.spectacle-form select:focus {
    outline: none;
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.spectacle-form textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}
.spectacle-form input[type=file] {
    padding: 5px 8px;
    background: #f9fafb;
    font-size: 12.5px;
    cursor: pointer;
}

/* Multi-select checkboxes (remplace <select multiple>) */
.multi-select-wrapper {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    max-height: 200px;
    overflow-y: auto;
}
.multi-select-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 400 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    color: #374151;
    transition: background .1s;
    user-select: none;
}
.multi-select-option:hover { background: #f5f3ff; }
.multi-select-option input[type=checkbox] { width: 15px; height: 15px; accent-color: #6366f1; flex-shrink: 0; }
.multi-select-option:has(input:checked) {
    background: #ede9fe;
    color: #4f46e5;
    font-weight: 500 !important;
}

/* Hint text */
.form-hint {
    font-size: 12px;
    color: #9ca3af;
    margin: 4px 0 0;
}

/* Details / summary dépliables */
.form-details {
    background: #fff;
    border: 1px solid #e9ecf0;
    border-radius: 12px;
    margin-bottom: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.form-details > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    list-style: none;
    user-select: none;
    background: #fafafa;
    transition: background .15s;
}
.form-details > summary::-webkit-details-marker { display: none; }
.form-details > summary::after {
    content: "›";
    margin-left: auto;
    font-size: 18px;
    color: #9ca3af;
    transition: transform .2s;
    line-height: 1;
}
.form-details[open] > summary::after { transform: rotate(90deg); }
.form-details[open] > summary {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
}
.form-details > summary:hover { background: #f3f4f6; }
.form-details-icon { font-size: 15px; line-height: 1; }
.form-details-hint {
    font-size: 11.5px;
    font-weight: 400;
    color: #9ca3af;
}
.form-details > div {
    padding: 20px 24px;
}
.form-details > div h3 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #6366f1;
    margin: 0 0 12px;
}
.form-details > div h3:not(:first-child) { margin-top: 20px; }

/* Bouton enregistrer */
.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 16px 0 8px;
    border-top: 1px solid #f0f0f0;
}
.btn-save {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #4f46e5;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s, box-shadow .15s;
    box-shadow: 0 1px 3px rgba(79,70,229,.3);
}
.btn-save:hover {
    background: #4338ca;
    box-shadow: 0 3px 8px rgba(79,70,229,.35);
}
.btn-sm {
    font-size: 12px;
    padding: 5px 12px;
}

/* Wrapper form add */
.spectacle-form-wrapper {
    margin-bottom: 24px;
    padding: 20px 24px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
}

/* =======================================================
   SPECTACLES — liste & cards
======================================================= */
.spectacles-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.spectacle-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 4px;
}

.spectacle-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    transition: box-shadow .2s, border-color .2s;
}
.spectacle-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
    border-color: #c7d2fe;
}

/* Vignette */
.spectacle-thumb {
    width: 110px;
    flex-shrink: 0;
}
.spectacle-thumb img {
    width: 110px;
    height: 100%;
    min-height: 110px;
    object-fit: cover;
    display: block;
    border-radius: 0;
}

/* Corps de la card */
.spectacle-main {
    min-width: 0;
    padding: 14px 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.spectacle-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}

.spectacle-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 2px 0 2px;
}
.spectacle-meta .tag {
    background: #ede9fe;
    color: #5b21b6;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.spectacle-meta .meta-item {
    font-size: 12px;
    color: #6b7280;
    align-self: center;
}

.spectacle-desc {
    margin: 2px 0 0;
    font-size: 13px;
    color: #4b5563;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.spectacle-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}
.spectacle-links a {
    font-size: 12px;
    color: #4b5563;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    transition: background .15s, border-color .15s;
}
.spectacle-links a:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #111;
}

/* Actions dans la card */
.spectacle-actions {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    align-items: center;
    gap: 1px;
    padding: 6px 10px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}

.spectacle-actions .action-icon {
    font-size: 11.5px;
    padding: 4px 7px;
    border-radius: 5px;
    gap: 4px;
    color: #6b7280;
    font-weight: 500;
    letter-spacing: .01em;
}
.spectacle-actions .action-icon .ico {
    width: 13px;
    height: 13px;
    stroke-width: 2;
    flex-shrink: 0;
}
.spectacle-actions .action-icon:hover { background: #f0f0f0; color: #111; }

/* Couleurs par type d’action */
.spectacle-actions .action-icon.act-edit      { color: #3b82f6; }
.spectacle-actions .action-icon.act-edit:hover{ background: #eff6ff; color: #1d4ed8; }
.spectacle-actions .action-icon.act-visuals   { color: #8b5cf6; }
.spectacle-actions .action-icon.act-visuals:hover { background: #f5f3ff; color: #6d28d9; }
.spectacle-actions .action-icon.act-dates     { color: #10b981; }
.spectacle-actions .action-icon.act-dates:hover { background: #ecfdf5; color: #047857; }
.spectacle-actions .action-icon.act-budget    { color: #f59e0b; }
.spectacle-actions .action-icon.act-budget:hover { background: #fffbeb; color: #b45309; }
.spectacle-actions .action-icon.act-comm      { color: #0ea5e9; }
.spectacle-actions .action-icon.act-comm:hover { background: #f0f9ff; color: #0369a1; }
.spectacle-actions .action-icon.act-delete    { color: #d1d5db; }
.spectacle-actions .action-icon.act-delete:hover { background: #fef2f2; color: #ef4444; }

/* Séparateur entre actions */
.spectacle-actions .action-sep {
    width: 1px;
    height: 14px;
    background: #e5e7eb;
    margin: 0 3px;
    flex-shrink: 0;
}

/* Full-width : le corps + actions sur toute la ligne */
.spectacle-card-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Séparation vignette / corps quand pas de vignette */
.spectacle-card.no-thumb {
    grid-template-columns: 1fr;
}

/* =======================================================
   PRINT
======================================================= */

@media print {
    nav, .topnav, .no-print {
        display: none !important;
    }
    body {
        background: white;
    }
}

/* =======================================================
   RESPONSIVE — TABLETTE (≤ 900px)
======================================================= */
@media (max-width: 900px) {
    .finance-grid {
        grid-template-columns: 1fr !important;
    }
}

/* =======================================================
   RESPONSIVE — MOBILE (≤ 768px)
======================================================= */
@media (max-width: 768px) {

    /* ── Page layout ─────────────────────────────────── */
    .page-container {
        padding: 12px 10px 32px;
    }

    h1 { font-size: 20px; margin-bottom: 14px; }
    h2 { font-size: 17px; }

    /* ── Navigation ──────────────────────────────────── */
    .topnav {
        flex-wrap: wrap;
        padding: 8px 12px;
        gap: 8px;
    }

    .nav-left {
        flex: 1;
        min-width: 0;
    }

    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        font-size: 1.3rem;
        order: 3;
    }

    /* Profil + logout : toujours visible à côté du burger */
    .topbar-right {
        order: 2;
        margin-left: 0;
    }

    .nav-links {
        order: 4;
        flex: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        display: none;
        margin-top: 4px;
        border-top: 1px solid #e5e7eb;
        padding-top: 6px;
        max-height: calc(100dvh - 60px);
        overflow-y: auto;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links .nav-item {
        width: 100%;
        text-align: left;
        padding: 12px 14px;
        min-height: 44px;
        display: flex;
        align-items: center;
        border-radius: 6px;
    }

    /* Dropdowns mobile */
    .nav-group { width: 100%; }
    .nav-group-label {
        width: 100%;
        display: flex !important;
        justify-content: space-between;
        background: #f1f5f9;
        padding: 11px 14px;
        min-height: 44px;
        border-radius: 6px;
        font-size: .85rem;
        font-weight: 600;
        color: #374151;
        cursor: pointer;
    }
    .nav-group-label.active { background: #ede9fe; color: #4f46e5; }
    .nav-group:hover .nav-dropdown { display: none; } /* désactiver le hover CSS sur mobile */
    .nav-dropdown {
        position: static;
        box-shadow: none;
        border: none;
        background: transparent;
        padding: 2px 0 4px 12px;
        display: none;
    }
    .nav-dropdown.open { display: flex !important; }
    .nav-dropdown .nav-item {
        font-size: .82rem;
        color: #4b5563;
        min-height: 40px;
        padding: 10px 14px;
    }

    .nav-cta-wrapper {
        order: 3;
        width: 100%;
        display: flex;
        justify-content: stretch;
    }
    .nav-cta-wrapper .nav-cta {
        width: 100%;
        text-align: center;
        padding: 12px;
    }

    /* ── Formulaires ──────────────────────────────────── */
    input[type="text"],
    input[type="date"],
    input[type="time"],
    input[type="number"],
    input[type="email"],
    input[type="password"],
    input[type="datetime-local"],
    select,
    textarea {
        font-size: 16px; /* évite le zoom automatique sur iOS */
        padding: 10px 12px;
        min-height: 44px;
    }

    button, .btn {
        min-height: 44px;
        padding: 10px 16px;
    }

    /* ── Cards / sections ──────────────────────────────── */
    .section-card, .card {
        padding: 12px;
        margin-bottom: 14px;
        border-radius: 10px;
    }

    /* ── Stats ────────────────────────────────────────── */
    .stats-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .stat-card {
        padding: 10px 12px;
    }
    .stat-value {
        font-size: 18px;
    }

    /* ── Compta stats ─────────────────────────────────── */
    .compta-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .compta-stat {
        padding: 10px 12px;
        min-width: 0;
    }
    .compta-stat .val {
        font-size: 1.05rem;
    }

    /* ── Tableaux — scroll horizontal avec indication ─── */
    .table-responsive-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -10px;
        padding: 0 10px;
    }

    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 12px;
    }
    th, td {
        white-space: nowrap;
        padding: 8px;
    }

    /* ── Formulaire édition ───────────────────────────── */
    .form-row { grid-template-columns: 1fr; }
    .form-section { padding: 14px 16px 6px; }
    .form-details > div { padding: 14px 16px; }
    .form-edit-header { flex-direction: column; align-items: flex-start; }

    /* ── Spectacles cards ─────────────────────────────── */
    .spectacle-card {
        grid-template-columns: 1fr;
    }
    .spectacle-thumb {
        width: 100%;
        max-height: 160px;
        overflow: hidden;
    }
    .spectacle-thumb img {
        width: 100%;
        height: 160px;
        object-fit: cover;
    }
    .spectacle-actions {
        gap: 4px;
        padding: 8px;
    }
    .spectacle-actions .action-icon span {
        display: none; /* icônes seules sur mobile */
    }
    .spectacle-actions .action-icon {
        padding: 8px;
        min-width: 40px;
        justify-content: center;
    }

    /* ── Action icons — plus large pour touch ─────────── */
    .action-icon {
        padding: 6px 8px;
        min-width: 36px;
        min-height: 36px;
        justify-content: center;
    }

    /* ── Filter bars ─────────────────────────────────── */
    .filter-bar {
        gap: 6px;
    }
    .filter-bar a {
        padding: 7px 12px;
        font-size: .8rem;
    }


    /* ── Masquer colonnes secondaires sur mobile ─────── */
    .col-hide-md, .col-hide-mobile { display: none !important; }

    /* ── Card panel / header / body ─────────────────── */
    .card-panel { margin-bottom: 14px; border-radius: 10px; }
    .card-header { padding: 10px 12px; flex-wrap: wrap; gap: 6px; }
    .card-header h2, .card-header h3 { font-size: .85rem; }
    .card-body { padding: 10px 12px; }
    .card-body.no-pad { padding: 0; }

    /* ── Boutons sm : ne pas imposer 44px de hauteur ── */
    .btn-sm, .btn-small {
        min-height: 36px !important;
        padding: 5px 12px !important;
        font-size: .78rem !important;
    }

    /* ── Meta-row / missing-list / info-box ─────────── */
    .meta-row { font-size: .8rem; gap: 6px 16px; }
    .missing-list { font-size: .78rem; }
    .info-box { font-size: .78rem; }

    /* ── Finance grid (deux colonnes → une) ─────────── */
    .finance-grid { grid-template-columns: 1fr !important; }

    /* ── Formulaire : form-row déjà 1-col à 600px ──── */

    /* ── Card-header link pill ───────────────────────── */
    .card-header > a, .card-header .card-link {
        font-size: .68rem;
        padding: 3px 9px;
    }
}

/* =======================================================
   RESPONSIVE — PETIT MOBILE (≤ 480px)
======================================================= */
@media (max-width: 480px) {
    .page-container {
        padding: 10px 8px 28px;
    }

    h1 { font-size: 18px; }

    /* Stats : empilées */
    .stats-row {
        grid-template-columns: 1fr;
    }

    .compta-stats {
        grid-template-columns: 1fr;
    }

    /* Boutons pleine largeur dans les formulaires */
    .form-actions-mobile {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    .form-actions-mobile .btn,
    .form-actions-mobile button {
        width: 100%;
        justify-content: center;
    }

    /* ── Card-header : empiler h2 + lien sur très petit écran */
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .card-header > a, .card-header .card-link {
        align-self: flex-start;
    }
}
.tache-select {
    font-size: 12px;
    padding: 4px 6px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #fff;
    cursor: pointer;
}

.tache-select.a_faire { border-color: #facc15; background:#fefce8; }
.tache-select.bloque  { border-color: #60a5fa; background:#eff6ff; }
.tache-select.fait    { border-color: #4ade80; background:#f0fdf4; }

.booking-link.booking-disabled {
    opacity: 0.6;
    pointer-events: none;
    text-decoration: none;
}

/* Bouton copie : même look que les autres icônes d'action */
.btn-icon-copy {
    border: none;
    background: transparent;
    color: #2563eb;           /* même violet que les liens PJ */
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Hover : léger changement de teinte, sans rond */
.btn-icon-copy:hover {
    background: transparent;
    color: #8A6FFF;
    transform: none;
}

/* Pas d'effet "enfoncé" particulier */
.btn-icon-copy:active {
    transform: none;
}

/* Icône "copie" alignée sur les autres */
.ico-copy {
    width: 16px;
    height: 16px;
    display: block;
    stroke: currentColor;
    stroke-width: 1;
    fill: none;
}
.action-icon .ico {
    color: #2563eb;
}
.stat-card.stat-deplacements {
    background: #fff7e6;
}
.stat-card.stat-deplacements .stat-value {
    font-weight: 700;
}
.btn-auto-submit-hidden {
    display: none;
}
/* Résumé pliable avec chevron */
/* style commun */
.summary-collapse {
    cursor: pointer;
    font-weight: 600;
    list-style: none; /* vire le marqueur natif sur Firefox */
}

/* vire le marqueur natif sur WebKit */
.summary-collapse::-webkit-details-marker {
    display: none;
}

/* chevron par défaut (détails fermés) */
.summary-collapse::before {
    content: "▸";
    margin-right: 6px;
    font-size: 1.6em;
}

/* chevron quand le <details> est ouvert */
details[open] > .summary-collapse::before {
    content: "▾";
}
/* Base : aligné à droite sur les écrans "normaux" */
summary.summary-bilan {
    display: flex;
    align-items: center;
    gap: 8px;            /* petit espace entre texte et solde */
}

.summary-bilan-label {
    flex: 1 1 auto;      /* prend toute la place dispo */
    min-width: 0;
}

.summary-bilan-solde {
    flex: 0 0 auto;
    margin-left: auto;   /* pousse le solde à droite */
    font-weight: 700;
}

/* Sur petit écran : on autorise le retour à la ligne propre */
@media (max-width: 640px) {
    summary.summary-bilan {
        flex-wrap: wrap;              /* le contenu peut passer sur 2 lignes */
    }

    .summary-bilan-label {
        flex: 1 0 100%;               /* ligne entière pour le texte */
    }

    .summary-bilan-solde {
        flex: 0 0 100%;               /* ligne entière pour le solde */
        text-align: right;            /* mais toujours aligné à droite */
        margin-left: 0;
    }
}
/* =======================================================
   DASHBOARD — tableau scrollable sur tous écrans
======================================================= */
.dash-cards-wrap {
    display: none;
}
.dash-table-wrap {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* =======================================================
   Mise en page par défaut : 2 colonnes
======================================================= */
.finance-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 16px;
}

/* =======================================================
   CARD PANEL (header + body structure)
======================================================= */
.card-panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #f3f4f6;
}
.card-header h2,
.card-header h3 {
    margin: 0;
    font-size: .9rem;
    font-weight: 700;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}
.card-header > a,
.card-header .card-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: .72rem;
    font-weight: 600;
    color: #4f46e5;
    text-decoration: none;
    background: #eef2ff;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid #c7d2fe;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background .15s, color .15s, border-color .15s;
}
.card-header > a:hover,
.card-header .card-link:hover {
    background: #4f46e5;
    color: #fff;
    border-color: #4f46e5;
    text-decoration: none;
}
.card-body {
    padding: 14px 16px;
}
.card-body.no-pad {
    padding: 0;
}

/* =======================================================
   BOUTONS — variantes supplémentaires
======================================================= */
.btn-sm,
.btn-small {
    padding: 5px 12px !important;
    font-size: .8rem !important;
    min-height: auto !important;
}
.btn-ghost {
    background: transparent;
    color: #374151;
    border: 1px solid #d1d5db;
}
.btn-ghost:hover {
    background: #f3f4f6;
    box-shadow: none;
}

/* =======================================================
   FORMULAIRES — utilitaires
======================================================= */
.form-label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}
.field-hint {
    font-size: .73rem;
    color: #9ca3af;
    margin-top: 2px;
    margin-bottom: 0;
}
.field-suggestions {
    font-size: .75rem;
    color: #6b7280;
    margin-top: 3px;
}
.field-suggestions a {
    color: #4f46e5;
    text-decoration: underline dotted;
    cursor: pointer;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}
@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }
}
.form-field {
    margin-bottom: 12px;
}
.form-field > input,
.form-field > select,
.form-field > textarea {
    margin-bottom: 0;
}

/* =======================================================
   FILTER BAR (pill-style filters)
======================================================= */
.filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
}
.filter-bar a {
    font-size: .82rem;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid #d1d5db;
    text-decoration: none;
    color: #374151;
    background: #fff;
    white-space: nowrap;
}
.filter-bar a.active,
.filter-bar a:hover {
    background: #4f46e5;
    color: #fff;
    border-color: #4f46e5;
}
.filter-bar select {
    font-size: .82rem;
    padding: 5px 10px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    margin-bottom: 0;
    width: auto;
}

/* =======================================================
   INFO BOX (lien sécurisé, formulaire public, etc.)
======================================================= */
.info-box {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: .82rem;
    color: #0369a1;
}
.info-box-title {
    font-weight: 600;
    margin-bottom: 6px;
    color: #0c4a6e;
}
.info-box a {
    color: #0284c7;
    word-break: break-all;
}

/* =======================================================
   MISSING LIST (champs manquants)
======================================================= */
.missing-list {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 7px;
    padding: 10px 14px;
    font-size: .83rem;
    color: #78350f;
}
.missing-list li { margin-bottom: 2px; }

/* =======================================================
   META ROW (mini ligne d'infos)
======================================================= */
.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    font-size: .875rem;
    color: #374151;
    margin-bottom: 4px;
}
.meta-row strong { color: #111827; }
