/* ==========================================
   Variables & Reset
   ========================================== */
:root {
    /* Couleurs principales */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #64748b;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Arrière-plans */
    --bg-dark: #0f172a;
    --bg-sidebar: #1e293b;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;

    /* Texte */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;

    /* Bordures */
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    /* Ombres */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);

    /* Rayons de bordure */
    --radius: 12px;
    --radius-sm: 8px;

    /* Transitions */
    --transition: all 0.2s ease;

    /* Breakpoints (utilisés en commentaires pour référence) */
    /* --bp-mobile: 600px; */
    /* --bp-tablet: 768px; */
    /* --bp-desktop-sm: 900px; */
    /* --bp-desktop: 1024px; */

    /* Largeur sidebar */
    --sidebar-width: 240px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ==========================================
   Layout
   ========================================== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ==========================================
   Sidebar
   ========================================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.logo-text {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.9);
}

.sidebar-nav {
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    width: 100%;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-item.active {
    background: var(--primary);
    color: #fff;
}

/* ==========================================
   Main Content
   ========================================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px 40px;
    min-height: 100vh;
}

.section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    margin-bottom: 32px;
}

.section-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
}


/* ==========================================
   Cards
   ========================================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 20px;
}

.card-highlight {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 20px;
}

/* ==========================================
   Form Grid
   ========================================== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.form-column {
    display: flex;
    flex-direction: column;
}

/* ==========================================
   Form Elements
   ========================================== */
.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-card);
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder {
    color: var(--text-light);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ==========================================
   Buttons
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-main);
    border-color: var(--text-light);
}

.btn-large {
    padding: 14px 32px;
    font-size: 15px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 50%;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

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

/* ==========================================
   Badge
   ========================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: var(--bg-main);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

/* ==========================================
   Upload Zone
   ========================================== */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.02);
}

.upload-zone svg {
    width: 48px;
    height: 48px;
    color: var(--text-light);
    margin-bottom: 16px;
}

.upload-zone p {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upload-zone span {
    display: block;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 12px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-main);
    border-radius: var(--radius-sm);
}

.file-info svg {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.file-info span {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

/* ==========================================
   Tables
   ========================================== */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

th {
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-main);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    color: var(--text-primary);
}

tbody tr:hover {
    background: var(--bg-main);
}

.total-row {
    background: var(--bg-main);
}

.total-row td {
    font-weight: 600;
    border-top: 2px solid var(--border);
}

/* Commission input in table */
.commission-input {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
}

.commission-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ==========================================
   Action Bar
   ========================================== */
.action-bar {
    margin-top: 32px;
    display: flex;
    justify-content: center;
}

/* ==========================================
   Config Section
   ========================================== */
.config-container {
    max-width: 600px;
}

.logo-upload {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-preview {
    width: 100px;
    height: 100px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--bg-main);
}

.logo-preview svg {
    width: 32px;
    height: 32px;
    color: var(--text-light);
}

.logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ==========================================
   Historique
   ========================================== */

/* Tabs */
.historique-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-btn svg {
    width: 18px;
    height: 18px;
}

.tab-count {
    background: var(--bg-main);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.tab-btn.active .tab-count {
    background: var(--primary);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    color: var(--text-light);
    margin-bottom: 24px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
}

.historique-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.historique-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: var(--transition);
}

.historique-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary-light);
}

.historique-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.historique-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.historique-card-date {
    font-size: 12px;
    color: var(--text-light);
}

.historique-card-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.historique-card-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.historique-card-row span:first-child {
    color: var(--text-secondary);
}

.historique-card-row span:last-child {
    font-weight: 500;
    color: var(--text-primary);
}

.historique-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.historique-card-actions .btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 13px;
}

.historique-card-actions-secondary {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

/* Boutons d'action secondaires - Classe commune */
.btn-action-secondary {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 12px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.btn-action-secondary svg {
    width: 14px;
    height: 14px;
}

.btn-archive, .btn-restore, .btn-modifier, .btn-regenerer {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.btn-archive:hover, .btn-restore:hover, .btn-modifier:hover {
    background: var(--bg-card);
    border-color: var(--primary-light);
    color: var(--primary);
}

.btn-regenerer:hover {
    background: var(--bg-card);
    border-color: var(--success);
    color: var(--success);
}

.btn-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 12px;
    color: var(--danger);
    background: transparent;
    border: 1px solid var(--danger);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.btn-delete:hover {
    background: var(--danger);
    color: white;
}

.btn-archive svg, .btn-delete svg, .btn-restore svg, .btn-modifier svg, .btn-regenerer svg {
    width: 14px;
    height: 14px;
}


/* ==========================================
   Toast Notifications
   ========================================== */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid var(--primary);
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==========================================
   Utilities
   ========================================== */
.hidden {
    display: none !important;
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 1024px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 12px;
    }

    .nav-item {
        white-space: nowrap;
        padding: 10px 14px;
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
    }

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

    .app-container {
        flex-direction: column;
    }
}

/* ==========================================
   Mode Toggle
   ========================================== */
.mode-toggle {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    padding: 4px;
    background: var(--bg-main);
    border-radius: var(--radius);
    width: fit-content;
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.mode-btn svg {
    width: 18px;
    height: 18px;
}

.mode-btn:hover {
    color: var(--text-primary);
}

.mode-btn.active {
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* ==========================================
   Tournée Container
   ========================================== */
.tournee-container {
    margin-top: 24px;
}

.tournee-events-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.empty-events-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.empty-events-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
}

.empty-events-state p {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-events-state span {
    font-size: 13px;
}

/* ==========================================
   Tournée Event Card
   ========================================== */
.tournee-event-card {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.tournee-event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
}

.tournee-event-number {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

.btn-remove-event {
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-remove-event:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.btn-remove-event svg {
    width: 16px;
    height: 16px;
}

.tournee-event-body {
    padding: 16px;
}

/* ==========================================
   Tournée Upload Zone
   ========================================== */
.tournee-upload-zone {
    margin-top: 12px;
}

.tournee-upload-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.tournee-upload-btn:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.02);
}

.tournee-upload-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-light);
}

.tournee-upload-btn span {
    font-size: 13px;
    color: var(--text-secondary);
}

.tournee-upload-btn input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.tournee-file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(34, 197, 94, 0.05);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: var(--radius-sm);
}

.tournee-file-info svg {
    width: 20px;
    height: 20px;
    color: var(--success);
}

.tournee-file-info span {
    font-size: 13px;
    color: var(--text-primary);
}

.tournee-file-info span:first-of-type {
    flex: 1;
}

.tournee-ticket-count {
    font-size: 12px;
    color: var(--success);
    font-weight: 500;
}

.btn-remove-csv,
.btn-remove-contrat {
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Tableau des billets dans le mode tournée */
.tournee-billets-section {
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.tournee-billets-header {
    padding: 10px 14px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
}

.tournee-billets-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.tournee-billets-table-container {
    max-height: 200px;
    overflow-y: auto;
}

.tournee-billets-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.tournee-billets-table th {
    padding: 8px 10px;
    background: var(--bg-main);
    font-weight: 600;
    color: var(--text-secondary);
    text-align: left;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
}

.tournee-billets-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-light);
}

.tournee-billets-table input {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 12px;
    text-align: right;
}

.tournee-billets-table input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

/* Contrat PDF */
.contrat-upload-zone {
    margin-top: 12px;
}

.contrat-upload-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.contrat-upload-btn:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.02);
}

.contrat-upload-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-light);
}

.contrat-upload-btn span {
    font-size: 13px;
    color: var(--text-secondary);
}

.contrat-upload-btn input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.contrat-file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-sm);
}

.contrat-file-info svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.contrat-file-info span {
    flex: 1;
    font-size: 13px;
    color: var(--text-primary);
}

.btn-view-contrat {
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-view-contrat:hover {
    background: rgba(99, 102, 241, 0.1);
}

.btn-view-contrat svg {
    width: 16px;
    height: 16px;
    transition: var(--transition);
}

.btn-remove-csv:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* ==========================================
   Tournée Group (Historique)
   ========================================== */
.tournee-group {
    margin-bottom: 32px;
}

.tournee-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    margin-bottom: -1px;
}

.tournee-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.tournee-group-title svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.tournee-group-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tournee-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    padding: 16px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
}

.tournee-badge-small {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 10px;
    padding: 2px 6px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-radius: 4px;
    font-weight: 500;
}

.historique-card {
    position: relative;
}

/* ==========================================
   Versions Dropdown
   ========================================== */
.historique-card-versions {
    margin-bottom: 12px;
}

.versions-dropdown {
    position: relative;
}

.versions-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: inherit;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.versions-toggle:hover {
    border-color: var(--primary-light);
}

.versions-toggle.active {
    border-color: var(--primary);
    background: var(--bg-card);
}

.versions-toggle svg {
    width: 14px;
    height: 14px;
}

.versions-toggle .chevron {
    margin-left: auto;
    transition: transform 0.2s ease;
}

.versions-toggle.active .chevron {
    transform: rotate(180deg);
}

.versions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
}

.version-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
    font-size: 12px;
}

.version-item:last-child {
    border-bottom: none;
}

.version-number {
    font-weight: 600;
    color: var(--primary);
    min-width: 30px;
}

.version-date {
    flex: 1;
    color: var(--text-secondary);
}

.btn-version-download {
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-version-download:hover {
    background: var(--bg-main);
    color: var(--primary);
}

.btn-version-download svg {
    width: 16px;
    height: 16px;
}

/* ==========================================
   Badge Info
   ========================================== */
.badge-info {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

/* ==========================================
   Bouton Small
   ========================================== */
.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-small svg {
    width: 14px;
    height: 14px;
}

/* ==========================================
   Actions secondaires 4 colonnes (pour non-archivés)
   ========================================== */
.historique-card-actions-secondary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

/* Rétablir 2 colonnes pour archives (seulement restaurer + supprimer) */
.tab-content#tab-archives .historique-card-actions-secondary {
    grid-template-columns: repeat(2, 1fr);
}

/* ==========================================
   Accordéon - Événements Tournée
   ========================================== */
.accordion-item {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 8px;
}

.accordion-item.open {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.08);
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-card);
    cursor: pointer;
    transition: var(--transition);
}

.accordion-header:hover {
    background: var(--bg-main);
}

.accordion-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.accordion-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.accordion-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.accordion-date {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.accordion-tickets {
    font-size: 12px;
    color: var(--success);
    font-weight: 500;
    white-space: nowrap;
}

.accordion-status {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.accordion-status.status-ready {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.accordion-status.status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.accordion-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.accordion-toggle {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.accordion-toggle:hover {
    background: var(--bg-main);
    color: var(--text-primary);
}

.accordion-toggle .chevron {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.accordion-item.open .accordion-toggle .chevron {
    transform: rotate(180deg);
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-item.open .accordion-body {
    max-height: 600px;
}

.accordion-body .tournee-event-body {
    padding: 16px;
    border-top: 1px solid var(--border-light);
}

/* Form hint pour le DL TTC */
.form-hint {
    display: block;
    font-size: 11px;
    color: var(--text-light);
    margin-top: 4px;
}

/* ==========================================
   Redditions - Toolbar avec filtres
   ========================================== */
.redditions-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    font-weight: 500;
}

.filter-group select {
    padding: 8px 12px;
    min-width: 140px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-card);
    cursor: pointer;
    transition: var(--transition);
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.view-toggle {
    display: flex;
    background: var(--bg-main);
    border-radius: var(--radius-sm);
    padding: 4px;
    border: 1px solid var(--border);
}

.view-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.view-btn svg {
    width: 16px;
    height: 16px;
}

.view-btn:hover {
    color: var(--text-primary);
}

.view-btn.active {
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* ==========================================
   Vue Kanban
   ========================================== */
.kanban-view {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    min-height: 400px;
}

.kanban-column {
    background: var(--bg-main);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--border);
}

.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

.kanban-column-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.kanban-count {
    background: var(--primary);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.kanban-column[data-status="archived"] .kanban-count {
    background: var(--secondary);
}

.kanban-column-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 600px;
    overflow-y: auto;
}

.kanban-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.kanban-empty p {
    font-size: 14px;
}

/* Groupes tournée dans Kanban */
.kanban-tournee-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 8px;
}

.kanban-tournee-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

.kanban-tournee-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

.kanban-tournee-count {
    font-size: 11px;
    color: var(--text-light);
}

.btn-add-tournee-date {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: var(--primary-light);
    border: none;
    border-radius: 50%;
    color: var(--primary);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-add-tournee-date:hover {
    background: var(--primary);
    color: white;
}

.btn-add-tournee-date svg {
    width: 14px;
    height: 14px;
}

.btn-tournee-synthesis {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: rgba(16, 185, 129, 0.1);
    border: none;
    border-radius: 50%;
    color: #10b981;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-tournee-synthesis:hover {
    background: #10b981;
    color: white;
}

.btn-tournee-synthesis svg {
    width: 14px;
    height: 14px;
}

/* Carte Kanban */
.kanban-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    transition: var(--transition);
}

.kanban-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
}

.kanban-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
    gap: 8px;
}

.kanban-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
}

.kanban-card-date {
    font-size: 10px;
    color: var(--text-light);
    white-space: nowrap;
    background: var(--bg-main);
    padding: 2px 6px;
    border-radius: 4px;
}

.kanban-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-secondary);
    padding-bottom: 8px;
}

.kanban-card-meta span:not(:last-child)::after {
    content: '·';
    margin-left: 6px;
    color: var(--text-light);
}

.kanban-card-amount {
    font-weight: 700;
    color: var(--success);
}

.kanban-card-amount::after {
    display: none;
}

.kanban-card-actions {
    display: flex;
    gap: 4px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
}

.btn-icon-small {
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: var(--bg-main);
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-icon-small:hover {
    background: var(--bg-card);
    color: var(--primary);
    border: 1px solid var(--primary-light);
}

.btn-icon-small.btn-delete:hover {
    color: var(--danger);
    border-color: var(--danger);
}

.btn-icon-small svg {
    width: 14px;
    height: 14px;
}

/* ==========================================
   Vue Liste / Tableau
   ========================================== */
.list-view {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

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

.redditions-table th {
    background: var(--bg-main);
    padding: 14px 16px;
    text-align: left;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    border-bottom: 2px solid var(--border);
    border-right: 1px solid var(--border);
}

.redditions-table th:last-child {
    border-right: none;
}

.redditions-table td {
    padding: 16px;
    font-size: 13px;
    color: var(--text-primary);
    vertical-align: middle;
    border-right: 1px solid var(--border-light);
}

.redditions-table td:last-child {
    border-right: none;
}

.redditions-table .list-row-main td {
    background: var(--bg-card);
    border-bottom: none;
    padding-bottom: 10px;
}

.redditions-table .list-row-main:hover td {
    background: rgba(99, 102, 241, 0.02);
}

.redditions-table .cell-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
    max-width: 250px;
}

.redditions-table .cell-actions {
    display: flex;
    gap: 4px;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.status-badge.active {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.status-badge.archived {
    background: rgba(100, 116, 139, 0.1);
    color: var(--secondary);
}

/* État vide pour la liste */
.list-view .empty-state {
    padding: 60px 20px;
}

/* ==========================================
   Responsive pour la vue Kanban
   ========================================== */
@media (max-width: 900px) {
    .kanban-view {
        grid-template-columns: 1fr;
    }
    
    .redditions-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filters {
        order: 2;
    }
    
    .view-toggle {
        order: 1;
        align-self: flex-start;
        margin-bottom: 12px;
    }
}

@media (max-width: 600px) {
    .accordion-summary {
        flex-wrap: wrap;
        gap: 6px;
    }

    .accordion-title {
        max-width: 120px;
    }

    .accordion-date,
    .accordion-tickets {
        font-size: 11px;
    }
}

/* ==========================================
   Import Update Button
   ========================================== */
.import-update-section {
    display: flex;
    align-items: center;
}

#import-update-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

#import-update-btn svg {
    width: 16px;
    height: 16px;
}

/* ==========================================
   Modal
   ========================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 90%;
    max-width: 600px;
}

.modal-content.modal-large {
    max-width: 900px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-main);
}

/* ==========================================
   Mapping Commission Config
   ========================================== */
.mapping-commission-config {
    padding: 16px;
    background: var(--bg-sidebar);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.commission-config-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.commission-config-header strong {
    color: #ffffff;
    font-size: 14px;
}

.mapping-commission-hint {
    font-size: 12px;
    color: #94a3b8;
    font-style: italic;
}

.commission-categories-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.commission-category-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.commission-category-label {
    min-width: 150px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.commission-category-input {
    width: 100px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: #ffffff;
    color: #1e293b;
    text-align: right;
}

.commission-category-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.commission-category-input::placeholder {
    color: #94a3b8;
}

.commission-unit {
    font-size: 13px;
    color: #cbd5e1;
}

/* ==========================================
   Mapping List
   ========================================== */
.mapping-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mapping-item {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.mapping-item.matched {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.05);
}

.mapping-item.unmatched {
    border-color: var(--warning);
    background: rgba(245, 158, 11, 0.05);
}

.mapping-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.mapping-event-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.mapping-event-stats {
    font-size: 12px;
    color: var(--text-secondary);
}

.mapping-select-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mapping-select-wrapper label {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.mapping-select-wrapper select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--bg-card);
}

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

.mapping-changes-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.mapping-change-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    padding: 4px 0;
}

.mapping-change-category {
    flex: 1;
    color: var(--text-primary);
}

.mapping-change-old {
    color: var(--danger);
    text-decoration: line-through;
}

.mapping-change-arrow {
    color: var(--text-light);
}

.mapping-change-new {
    color: var(--success);
    font-weight: 500;
}

.mapping-no-changes {
    font-size: 12px;
    color: var(--text-light);
    font-style: italic;
}

/* ==========================================
   Kanban Card Details - Categories
   ========================================== */
.kanban-card-categories {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}

.kanban-card-categories .categories-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    padding-bottom: 4px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
}

.category-row {
    display: grid;
    grid-template-columns: 1fr 55px 75px;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    margin: 2px 0;
    font-size: 10px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.03) 0%, rgba(99, 102, 241, 0.06) 100%);
    border-radius: 4px;
    border-left: 2px solid var(--primary);
}

.category-row:nth-child(even) {
    background: linear-gradient(135deg, rgba(100, 116, 139, 0.03) 0%, rgba(100, 116, 139, 0.06) 100%);
    border-left-color: var(--secondary);
}

.category-name {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-qty {
    text-align: right;
    font-weight: 600;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.category-qty::after {
    content: ' bil.';
    font-weight: 400;
    font-size: 9px;
    color: var(--text-light);
}

.category-revenue {
    text-align: right;
    font-weight: 600;
    color: var(--success);
    font-variant-numeric: tabular-nums;
}

/* ==========================================
   List View Details - Categories
   ========================================== */
.list-row-details {
    background: var(--bg-main);
}

.list-row-details td {
    padding: 0 16px 20px 16px !important;
    border-bottom: 1px solid var(--border) !important;
}

.list-categories-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.list-category-item {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.list-category-item .category-name {
    font-weight: 600;
    color: var(--text-primary);
}

.list-category-item .category-name::after {
    content: ':';
}

.list-category-item .category-stats {
    font-variant-numeric: tabular-nums;
}

.list-category-item .category-stats strong {
    color: var(--success);
    font-weight: 600;
    margin-left: 4px;
}

/* ==========================================
   Modale Confirmation Tournée
   ========================================== */
.tournee-confirm-summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.confirm-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-main);
    border-radius: var(--radius-sm);
}

.confirm-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.confirm-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.confirm-warning {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 12px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--warning);
}

/* Bouton avec spinner */
.btn-text,
.btn-spinner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-spinner.hidden,
.btn-text.hidden {
    display: none;
}

.spinner-icon {
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ==========================================
   Bulk Edit Mode
   ========================================== */

/* Toggle button active state */
#toggle-bulk-mode.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.bulk-toggle {
    display: flex;
    align-items: center;
}

/* Bulk Action Bar */
.bulk-action-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-sidebar);
    padding: 12px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 100;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.bulk-action-bar.hidden {
    display: none;
}

.bulk-action-info {
    font-size: 14px;
    color: white;
    font-weight: 500;
}

#bulk-selected-count {
    font-weight: 700;
    color: var(--primary-light);
}

.bulk-action-buttons {
    display: flex;
    gap: 8px;
}

.bulk-action-buttons .btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.bulk-action-buttons .btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.bulk-action-buttons .btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.bulk-action-buttons .btn-primary:hover {
    background: var(--primary-dark);
}

/* Checkbox styling */
.bulk-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Kanban card checkbox */
.kanban-card-checkbox {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
}

.kanban-card {
    position: relative;
}

/* Add padding when checkbox is present */
.kanban-card:has(.kanban-card-checkbox) .kanban-card-header,
.kanban-card:has(.kanban-card-checkbox) .kanban-card-meta,
.kanban-card:has(.kanban-card-checkbox) .kanban-card-categories {
    padding-left: 30px;
}

.kanban-card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
    background: rgba(99, 102, 241, 0.02);
}

/* List row checkbox */
.cell-checkbox,
.th-checkbox {
    width: 40px;
    text-align: center;
}

.list-row-main.selected {
    background: rgba(99, 102, 241, 0.05);
}

.list-row-main.selected td {
    border-bottom-color: var(--primary-light);
}

/* Bulk Edit Modal */
.bulk-edit-mode-toggle {
    display: flex;
    background: var(--bg-main);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.bulk-mode-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.bulk-mode-btn:hover {
    color: var(--text-primary);
}

.bulk-mode-btn.active {
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.bulk-edit-section {
    margin-bottom: 20px;
}

.bulk-categories-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.bulk-categories-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 250px;
    overflow-y: auto;
    padding: 4px;
}

.bulk-category-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--bg-main);
    border-radius: var(--radius-sm);
}

.bulk-category-label {
    min-width: 150px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.bulk-category-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bulk-category-input {
    width: 100px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    text-align: right;
}

.bulk-category-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-suffix {
    font-size: 12px;
    color: var(--text-light);
}

/* Bulk Preview */
.bulk-preview {
    padding: 16px;
    background: var(--bg-main);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.bulk-preview h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bulk-preview-content {
    display: flex;
    gap: 24px;
}

.preview-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.preview-label {
    font-size: 12px;
    color: var(--text-light);
}

.preview-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.preview-empty {
    font-size: 13px;
    color: var(--text-light);
    font-style: italic;
}

/* Kanban card categories */
.kanban-card-categories {
    padding: 8px 0;
    border-top: 1px solid var(--border-light);
    margin-top: 8px;
}

.kanban-card-categories .category-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    padding: 3px 0;
}

.kanban-card-categories .category-name {
    flex: 1;
    color: var(--text-secondary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kanban-card-categories .category-qty {
    color: var(--text-light);
    min-width: 30px;
    text-align: right;
}

.kanban-card-categories .category-revenue {
    color: var(--success);
    font-weight: 600;
    min-width: 60px;
    text-align: right;
}
