/* Management (Gestion) View Styles - Premium Refined v5 (Toolbar & Switcher) */

.management-view {
    padding: 30px 20px;
    max-width: 1400px;
    margin: 0 auto;
    font-family: 'Inter', 'Outfit', 'Montserrat', sans-serif;
    color: var(--text-main);
}

.management-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.management-header h1 {
    font-size: 32px;
    font-weight: 800;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.02em;
}

[data-theme="neon"] .management-header h1 {
    font-family: 'Cyberpunk', sans-serif !important;
    color: #fcee09 !important;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 3rem;
    text-shadow: 1px 1px 0 var(--info), -1px -1px 0 var(--secondary);
}

@media (max-width: 768px) {
    [data-theme="neon"] .management-header h1 {
        font-size: 1.6rem;
        letter-spacing: 1px;
    }
}


.management-header h1 i {
    color: #f97316;
}

/* --- Toolbar --- */
.management-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

/* --- Tabs Navigation --- */
.management-tabs {
    display: flex;
    background: var(--bg-body-secondary);
    padding: 6px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    gap: 8px;
    width: fit-content;
}

/* Removed: .management-tabs now uses semantic tokens directly */

.management-tab {
    padding: 10px 22px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.management-tab.active {
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .management-tab.active,
[data-theme="neon"] .management-tab.active {
    background: var(--primary);
    color: white;
}

[data-theme="neon"] .management-tab.active {
    color: #010103 !important; /* Noir sur Jaune */
    font-weight: 800;
}

/* Specific fix for Gestion View Navigation Buttons */
[data-theme="neon"] .news-btn-primary {
    background: #fcee09 !important;
    color: #010103 !important;
    font-weight: 800;
}

[data-theme="neon"] .news-btn {
    background: rgba(0, 0, 0, 0.3) !important;
    color: #fff !important;
    border: 1px solid rgba(0, 243, 255, 0.3) !important;
}

[data-theme="neon"] .news-btn:hover {
    background: rgba(0, 243, 255, 0.1) !important;
    border-color: #fcee09 !important;
}

[data-theme="neon"] .news-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 243, 255, 0.3);
    color: #fff !important;
}

[data-theme="neon"] .news-control option {
    background: #1a1a1a;
    color: #fff;
}


/* --- Hub Switcher (Premium) --- */
.hub-switcher-container {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 4px 4px 4px 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
    min-width: 280px;
}

/* Removed: .hub-switcher-container now uses semantic tokens directly */

.hub-switcher-container:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.hub-switcher-container i {
    color: var(--primary);
    font-size: 20px;
}

.hub-switcher-select {
    border: none;
    background: transparent;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-main);
    padding: 8px 12px;
    width: 100%;
    cursor: pointer;
    outline: none;
}

/* --- Simplified Grid System --- */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -12px;
    margin-right: -12px;
}

[class*="col-"] {
    padding-left: 12px;
    padding-right: 12px;
    width: 100%;
}

.col-md-3 {
    flex: 0 0 25%;
    max-width: 25%;
}

.col-md-4 {
    flex: 0 0 33.33%;
    max-width: 33.33%;
}

.col-md-5 {
    flex: 0 0 41.66%;
    max-width: 41.66%;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
}

.col-md-7 {
    flex: 0 0 58.33%;
    max-width: 58.33%;
}

@media (max-width: 768px) {
    [class*="col-md-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .management-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
}

/* --- Cards --- */
.mgmt-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02), 0 12px 24px -12px rgba(0, 0, 0, 0.05);
}

/* Removed: .mgmt-card now uses semantic tokens directly */

.mgmt-card-header {
    padding: 24px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-surface-elevated);
}

/* Removed: .mgmt-card-header now uses semantic tokens directly */

.mgmt-card-body {
    padding: 30px;
}

/* --- PRESTIGE DESIGN SYSTEM (User Details) --- */
.detail-prestige-container {
    padding: 10px 0;
}

.prestige-card {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.prestige-card:hover {
    transform: translateY(-5px);
}

.prestige-header {
    background: linear-gradient(135deg, var(--bg-body), var(--bg-body-secondary));
    flex-direction: column;
    align-items: flex-start;
}

.prestige-hero {
    text-align: center;
    padding: 20px 0;
}

.prestige-val {
    background: linear-gradient(to bottom, var(--primary), #4f46e5);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.prestige-mini-stat {
    text-align: center;
    padding: 15px 10px;
    border-radius: 20px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-panel);
}

.prestige-mini-stat i {
    font-size: 20px;
    display: block;
    margin-bottom: 8px;
}

.prestige-mini-stat .val {
    font-size: 18px;
    font-weight: 900;
}

.prestige-mini-stat .label {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 800;
    opacity: 0.5;
}

.prestige-chronology {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
}

/* --- Form Controls --- */
.news-control {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    color: var(--text-main);
    font-size: 14px;
    transition: all 0.2s;
    height: 48px;
}

.news-control.is-automated {
    background: var(--bg-body-secondary);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.8;
}

/* --- Buttons --- */
.news-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    gap: 10px;
}

.news-btn-primary {
    background: var(--primary);
    color: white;
}

.news-btn-success {
    background: #10b981;
    color: white;
}

.news-btn-secondary {
    background: #64748b;
    color: white;
}

.news-btn-danger {
    background: #ef4444;
    color: white;
}

/* --- Tables --- */
.mgmt-table {
    width: 100%;
    border-collapse: collapse;
}

.mgmt-table th {
    padding: 16px 24px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg-surface-elevated);
    border-bottom: 2px solid var(--border-panel);
}

.mgmt-table td {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
}

.mgmt-table tr:hover {
    background: var(--bg-hover);
}

/* --- Avatars --- */
.avatar-sm {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    /* Circle */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
    border: 2px solid var(--bg-card);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* --- Badges & Roles --- */
.badge {
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    display: inline-flex;
}

.badge.super_admin {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.badge.sector_manager {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
}

.badge.coordinator {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.badge.user,
.badge.conseiller {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.badge.tech_iti {
    background: #faf5ff;
    color: #7e22ce;
}

/* --- Tables (Team Refinement - Legacy Look) --- */
.mgmt-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px;
    /* Space between rows */
}

.mgmt-table th {
    padding: 12px 24px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.05em;
    background: transparent;
    border: none;
}

[data-theme="neon"] .mgmt-table th {
    color: #010103 !important; /* Noir pour lisibilité sur fond jaune */
    background: #fcee09 !important; /* En-têtes jaunes pour le style Cyberpunk */
    font-weight: 900;
    border-bottom: 2px solid #000;
}

[data-theme="neon"] .mgmt-table td {
    border-bottom: 1px solid rgba(0, 243, 255, 0.1);
    color: #fff !important;
}

[data-theme="neon"] .mgmt-table td {
    border-bottom: 1px solid rgba(0, 243, 255, 0.1);
}


.mgmt-table td:first-child {
    border-left: 1px solid var(--border-color);
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
}

.mgmt-table td:last-child {
    border-right: 1px solid var(--border-color);
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
}

.mgmt-table tr:hover td {
    background: var(--bg-hover);
}

/* --- Modals & Overlays --- */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.confirm-overlay .mgmt-card {
    width: 100%;
    max-height: 90vh;
    animation: modalSlideUp 0.3s cubic;
}

@keyframes modalSlideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Utility Classes */
.text-6xl {
    font-size: 3.75rem;
    line-height: 1;
}

.tracking-widest {
    letter-spacing: 0.1em;
}

.tracking-tighter {
    letter-spacing: -0.05em;
}

.font-black {
    font-weight: 900;
}

.grid {
    display: grid;
}

.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-8 {
    gap: 2rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.p-10 {
    padding: 2.5rem;
}

.opacity-40 {
    opacity: 0.4;
}

.opacity-50 {
    opacity: 0.5;
}

.opacity-60 {
    opacity: 0.6;
}

.cursor-pointer {
    cursor: pointer;
}

.w-full {
    width: 100%;
}

.text-center {
    text-align: center;
}

.items-baseline {
    align-items: baseline;
}

.justify-center {
    justify-content: center;
}

.prestige-size-10 {
    font-size: 18px;
}

/* Minimal Icon Buttons for Team Rows */
.news-btn-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 18px;
}

.news-btn-icon:hover {
    background: #f1f5f9;
    color: var(--primary);
    transform: translateY(-1px);
}

.news-btn-icon.text-danger:hover {
    background: #fee2e2;
    color: #ef4444;
}

[data-theme="dark"] .news-btn-icon:hover {
    background: #232e3f;
}

.prestige-tracking-wide {
    letter-spacing: 0.3em;
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Prestige Delete Button */
.btn-delete-prestige {
    width: 38px;
    height: 38px;
    background: #fee2e2;
    color: #ef4444;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-delete-prestige:hover {
    background: #fecaca;
    color: #b91c1c;
    transform: scale(1.05);
}

[data-theme="dark"] .btn-delete-prestige {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

[data-theme="dark"] .btn-delete-prestige:hover {
    background: rgba(239, 68, 68, 0.25);
}

/* Polished Selectors in Header */
.mgmt-card-header .news-control {
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    font-weight: 700;
    border-color: #e2e8f0;
    height: 38px;
    padding: 0 16px;
    font-size: 13px;
    border-radius: 12px;
    width: auto;
    color: var(--text-main);
    cursor: pointer;
    margin: 0;
}

.mgmt-card-header .news-control:hover {
    border-color: var(--primary);
    background: #f8fafc;
}

[data-theme="dark"] .mgmt-card-header .news-control {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

[data-theme="neon"] .mgmt-card-header .news-control {
    background: #0f0f1d !important;
    border-color: rgba(0, 243, 255, 0.3) !important;
    color: #fcee09 !important;
    box-shadow: 0 0 8px rgba(0, 243, 255, 0.1);
}

/* News Submit Button Refinement */
.news-submit-btn {
    height: 48px;
    width: 48px;
    min-width: 48px;
    background: #10b981;
    color: white;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.news-submit-btn:hover {
    background: #059669;
    transform: scale(1.05);
}

.news-submit-btn i {
    font-size: 18px;
}

/* --- Premium Period Selector --- */
.period-selector-premium {
    display: flex;
    align-items: center;
    background: white;
    padding: 2px 12px;
    border-radius: 50px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    gap: 8px;
    height: 38px;
}

[data-theme="dark"] .period-selector-premium,
[data-theme="neon"] .period-selector-premium {
    background: var(--bg-input);
    border-color: var(--border-panel);
}

.period-select-minimal {
    background: transparent;
    border: none;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    padding: 4px 8px;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

[data-theme="dark"] .period-select-minimal {
    color: #cbd5e1;
}

[data-theme="neon"] .period-select-minimal {
    color: #fcee09;
}

.period-select-minimal:hover {
    color: var(--primary);
}


/* --- Segmented Control --- */
.segmented-control {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 12px;
    gap: 4px;
}

[data-theme="dark"] .segmented-control,
[data-theme="neon"] .segmented-control {
    background: var(--bg-panel);
}

.segmented-item {
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 6px;
}

.segmented-item i {
    font-size: 14px;
}

.segmented-item:hover {
    color: var(--primary);
}

.segmented-item.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .segmented-item.active,
[data-theme="neon"] .segmented-item {
    color: rgba(255, 255, 255, 0.5); /* Plus visible sur fond sombre */
}

[data-theme="neon"] .segmented-item:hover {
    color: #fcee09;
}

[data-theme="neon"] .segmented-item.active {
    background: #fcee09;
    color: #010103 !important;
    font-weight: 900;
}

/* --- Hub Stats Switcher Buttons --- */
.mgmt-mode-btn {
    flex: 1;
    font-weight: 700;
    height: 44px;
    background: var(--bg-card);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
    border-radius: 12px;
}

.mgmt-mode-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.mgmt-mode-btn.global.active {
    background: #7c3aed;
    border-color: #7c3aed;
}

[data-theme="neon"] .mgmt-mode-btn {
    background: rgba(0, 0, 0, 0.5) !important;
    color: #fff !important;
    border: 1px solid rgba(0, 243, 255, 0.3) !important;
}

[data-theme="neon"] .mgmt-mode-btn:hover {
    color: #fcee09 !important;
    border-color: #fcee09 !important;
}

[data-theme="neon"] .mgmt-mode-btn.active {
    background: #fcee09 !important;
    color: #010103 !important;
    border-color: #fcee09 !important;
    box-shadow: 0 0 20px rgba(252, 238, 9, 0.4) !important;
}

[data-theme="neon"] .mgmt-mode-btn.global.active {
    background: #bc00ff !important; /* Purple Cyberpunk */
    color: #ffffff !important;
    border-color: #bc00ff !important;
    box-shadow: 0 0 20px rgba(188, 0, 255, 0.4) !important;
}

/* Ensure data rows in all tables are light for readability */
[data-theme="neon"] .mgmt-table tbody tr td,
[data-theme="neon"] .mgmt-table tfoot tr td {
    color: #ffffff !important;
}

[data-theme="neon"] .mgmt-table tbody tr:hover {
    background: rgba(0, 243, 255, 0.05) !important;
}


/* =====================================================================
   NEON: Global Hub Performance Tables
   ===================================================================== */

/* Cartes neon : angles vifs + bordure visible (override border:none inline) */
[data-theme="neon"] .mgmt-card {
    border: 1px solid rgba(0, 243, 255, 0.2) !important;
    border-radius: 4px !important;
}

/* Header de carte neon */
[data-theme="neon"] .mgmt-card-header {
    background: #0d0d20;
    border-bottom-color: rgba(0, 243, 255, 0.2);
}

[data-theme="neon"] .mgmt-card-header h2,
[data-theme="neon"] .mgmt-card-header h3 {
    color: #e0e0ff;
}

/* Icones dans les en-tetes de cartes (fonds clairs hardcodes -> neon) */
[data-theme="neon"] .mgmt-card-header h3 > div {
    background: rgba(0, 243, 255, 0.12) !important;
}

/* Alignement des tableaux globaux avec les tables individuelles (meme espacement) */
[data-theme="neon"] .mgmt-table {
    border-spacing: 0 4px;
}
