/* ============================================
   TABS NAVIGATION SYSTEM
   ============================================ */

/* Small button variant */
.retro-btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Outline button variant */
.retro-btn-outline {
    background: white;
    border: 2px solid var(--color-primary, #8ebceb);
    color: var(--color-primary, #8ebceb);
}

.retro-btn-outline:hover {
    background: var(--color-primary, #8ebceb);
    color: white;
}

.tabs-container {
    margin-bottom: var(--spacing-md, 16px);
}

.tabs-nav {
    display: flex;
    gap: 4px;
    background: var(--color-bg-alt, #f5f5f5);
    padding: 4px;
    border-radius: var(--border-radius-lg, 8px);
    overflow-x: auto;
    scrollbar-width: thin;
}

.tabs-nav::-webkit-scrollbar {
    height: 4px;
}

.tabs-nav::-webkit-scrollbar-track {
    background: transparent;
}

.tabs-nav::-webkit-scrollbar-thumb {
    background: var(--color-border, #e0e0e0);
    border-radius: 2px;
}

.tab-button {
    flex: 0 0 auto;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: var(--border-radius-md, 6px);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-secondary, #666666);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    text-decoration: none;
}

.tab-button:hover {
    background: rgba(142, 188, 235, 0.1);
    color: var(--color-primary, #8ebceb);
    text-decoration: none;
}

.tab-button.active {
    background: white;
    color: var(--color-primary, #8ebceb);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tab-button:focus {
    outline: 2px solid var(--color-primary, #8ebceb);
    outline-offset: 2px;
}

.tab-button i {
    font-size: 16px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

/* Badge pour compteurs */
.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--color-primary, #8ebceb);
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.tab-button.active .tab-badge {
    background: var(--color-primary-dark, #6a9dd4);
}

/* Responsive */
@media (max-width: 768px) {
    .tabs-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    
    .tab-button {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .tab-button i {
        font-size: 14px;
    }
}

/* ============================================
   COLUMN SELECTOR
   ============================================ */

.column-selector {
    position: relative;
    display: inline-block;
}

.column-selector-button {
    padding: 8px 16px;
    background: white;
    border: 2px solid var(--color-border, #e0e0e0);
    border-radius: var(--border-radius-md, 6px);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary, #333333);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.column-selector-button:hover {
    border-color: var(--color-primary, #8ebceb);
    color: var(--color-primary, #8ebceb);
}

.column-selector-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 250px;
    background: white;
    border: 2px solid var(--color-border, #e0e0e0);
    border-radius: var(--border-radius-md, 6px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px;
    display: none;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}

.column-selector-dropdown.active {
    display: block;
}

.column-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 2px solid var(--color-border, #e0e0e0);
    margin-bottom: 8px;
}

.column-selector-header strong {
    font-size: 14px;
    color: var(--color-text-primary, #333333);
}

.column-selector-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: var(--color-text-secondary, #666666);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.column-selector-close:hover {
    background: var(--color-bg-alt, #f5f5f5);
    color: var(--color-error, #f44336);
}

.column-selector-body {
    padding: 0 4px;
}

.column-selector-body label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--border-radius-sm, 4px);
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 14px;
    color: var(--color-text-primary, #333333);
    user-select: none;
}

.column-selector-body label:hover {
    background: var(--color-bg-alt, #f5f5f5);
}

.column-selector-body input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.column-selector-body input[type="checkbox"]:checked + span {
    font-weight: 600;
    color: var(--color-primary, #8ebceb);
}

.column-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--border-radius-sm, 4px);
    cursor: pointer;
    transition: background 0.2s ease;
}

.column-option:hover {
    background: var(--color-bg-alt, #f5f5f5);
}

.column-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.column-option label {
    flex: 1;
    font-size: 14px;
    color: var(--color-text-primary, #333333);
    cursor: pointer;
    user-select: none;
}

.column-option input[type="checkbox"]:checked + label {
    font-weight: 600;
    color: var(--color-primary, #8ebceb);
}

/* Divider */
.column-selector-divider {
    height: 1px;
    background: var(--color-border, #e0e0e0);
    margin: 8px 0;
}

/* Actions */
.column-selector-actions {
    display: flex;
    gap: 8px;
    padding: 8px 12px 4px 12px;
}

.column-selector-actions button {
    flex: 1;
    padding: 6px 12px;
    border: none;
    border-radius: var(--border-radius-sm, 4px);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.column-selector-actions .btn-select-all {
    background: var(--color-primary-light, #a8cef0);
    color: white;
}

.column-selector-actions .btn-select-all:hover {
    background: var(--color-primary, #8ebceb);
}

.column-selector-actions .btn-reset {
    background: var(--color-bg-alt, #f5f5f5);
    color: var(--color-text-secondary, #666666);
}

.column-selector-actions .btn-reset:hover {
    background: var(--color-border, #e0e0e0);
}

/* Cacher colonnes avec data-column-hidden */
th[data-column-hidden="true"],
td[data-column-hidden="true"] {
    display: none !important;
}

/* Table responsive sans scroll horizontal */
.responsive-table-wrapper {
    width: 100%;
    overflow: visible;
}

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

.responsive-table th,
.responsive-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-border, #e0e0e0);
}

.responsive-table th {
    background: var(--color-bg-alt, #f5f5f5);
    font-weight: 600;
    color: var(--color-text-primary, #333333);
    white-space: nowrap;
}

.responsive-table td {
    color: var(--color-text-primary, #333333);
}

/* Colonnes cachees */
.responsive-table th[data-column-hidden="true"],
.responsive-table td[data-column-hidden="true"] {
    display: none;
}

/* Mobile: mode carte */
@media (max-width: 768px) {
    .responsive-table thead {
        display: none;
    }
    
    .responsive-table tbody tr {
        display: block;
        margin-bottom: 16px;
        background: white;
        border: 2px solid var(--color-border, #e0e0e0);
        border-radius: var(--border-radius-md, 6px);
        padding: 12px;
    }
    
    .responsive-table td {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border: none;
    }
    
    .responsive-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--color-text-secondary, #666666);
        margin-right: 12px;
    }
    
    .responsive-table td[data-column-hidden="true"] {
        display: none !important;
    }
}

