/* =========================================================================
   CSS COMPLET UNIFIÉ - DASHBOARD + FACTURES + TOUS LES ÉLÉMENTS
   À charger dans TOUS vos HTML
   ========================================================================= */

/* ========== VARIABLES CSS - PALETTE COMPLÈTE ========== */
:root {
    --primary-color: #2f4b78;
    --secondary-color: #142137;
    --accent-color: #84d1f4;
    --success: #28a745;
    --error: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --text-light: #ffffff;
    --text-dark: #333333;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --bg-light: #f5f5f5;
    --bg-dark: #1a1a1a;
    --bg-primary: #2f4b78;
    --bg-secondary: #142137;
    --border-light: rgba(255,255,255,0.1);
    --border-radius-md: 10px;
    --shadow-sm: 0 2px 6px rgba(0,0,0,0.15);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.25);
    --shadow-lg: 0 4px 15px rgba(0,0,0,0.3);
    --gradient-primary: linear-gradient(135deg, #2f4b78, #84d1f4);
    --gradient-secondary: linear-gradient(135deg, #142137, #2f4b78);
    --gradient-cool: linear-gradient(135deg, #84d1f4, #2f4b78);
    --transition-speed: 0.3s ease;
    --header-height: 90px;
}

/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
}

body {
    background-color: var(--bg-secondary);
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */

.header {
    background: var(--bg-light);
    color: var(--text-light);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    height: auto;
}

.header-container {
    max-width: 100%;
    margin: 0 35px;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: auto;
}

.logo img {
    height: 50px;
    width: auto;
}

.header-controls {
    display: none;
    gap: 10px;
    align-items: center;
}

.nav {
    display: flex;
    gap: 30px;
    align-items: center;
    margin-left: auto;
}

.nav a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all var(--transition-speed);
}

.nav a:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--accent-color);
    transform: translateY(-2px);
}

/* ===== SÉLECTEUR DE LANGUE (DESKTOP) ===== */
.language-selector {
    position: relative;
}

.language-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 24px;
    cursor: pointer;
    padding: 8px 12px;
    transition: all var(--transition-speed);
    border-radius: 6px;
}

.language-btn:hover {
    transform: scale(1.2);
    background-color: rgba(0, 0, 0, 0.05);
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--text-light);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    min-width: 180px;
    box-shadow: var(--shadow-lg);
    display: none;
    margin-top: 10px;
    z-index: 2000;
    overflow: hidden;
}

.language-dropdown.show {
    display: flex;
    flex-direction: column;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    background: none;
    border: none;
    padding: 12px 20px;
    text-align: left;
    cursor: pointer;
    color: var(--text-dark);
    font-size: 15px;
    transition: all var(--transition-speed);
    width: 100%;
    font-weight: 500;
}

.language-option:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
    font-weight: bold;
    padding-left: 25px;
}

.language-option.active {
    background-color: var(--accent-color);
    color: var(--primary-color);
    font-weight: bold;
}

/* ===== SÉLECTEUR DE LANGUE (MOBILE) ===== */
.language-btn-mobile {
    display: none;
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 24px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all var(--transition-speed);
}

.language-btn-mobile:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: scale(1.1);
}

/* ===== MENU HAMBURGER (Mobile) ===== */
.menu-btn {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    gap: 6px;
    z-index: 1100;
    padding: 0.5rem;
    transition: all var(--transition-speed);
}

.menu-btn span {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
    transition: all var(--transition-speed);
}

.menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(10px, 10px);
}

.menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ========== USER MENU ========== */
.user-menu-container {
    position: relative;
}

.btn-login {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 0.6rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-login:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--text-light);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 250px;
    z-index: 1000;
    overflow: hidden;
    display: none;
    animation: slideDown 0.3s ease-out;
}

.user-dropdown.show {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: all var(--transition-speed);
    font-weight: 500;
}

.dropdown-item:hover {
    background: var(--bg-light);
    color: var(--primary-color);
    padding-left: 2rem;
}

/* ========== NAVIGATION SIDEBAR MOBILE ========== */
.nav-sidebar {
    position: fixed;
  left: 0;
  width: 400px;
  height: calc(100vh - var(--header-height));
  background: var(--bg-secondary);
  box-shadow: var(--shadow-lg);
  z-index: 150;
  transform: translateX(-100%);
  transition: transform var(--transition-speed);
  overflow-y: auto;
}


.nav-sidebar.show {
    left: 0;
}

.nav-sidebar-header {
    padding: 1.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
}

.close-nav-sidebar {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed);
}

.close-nav-sidebar:hover {
    color: var(--accent-color);
    transform: scale(1.2) rotate(90deg);
}

.nav-sidebar-content {
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
}

.nav-sidebar-content a {
    color: var(--text-light);
    text-decoration: none;
    padding: 1rem 1.5rem;
    font-size: 16px;
    font-weight: 500;
    transition: all var(--transition-speed);
    border-left: 4px solid transparent;
}

.nav-sidebar-content a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: var(--accent-color);
    color: var(--accent-color);
    padding-left: 2rem;
}



#btn-logout-sidebar {
    background: rgba(220, 53, 69, 0.2) !important;
    color: #dc3545 !important;
    border: 2px solid #dc3545;
    margin: 10px 20px;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

#btn-logout-sidebar:hover {
    background: #dc3545 !important;
    color: var(--text-light) !important;
}

/* ========== OVERLAY ========== */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-speed);
    z-index: 100;
}

.nav-overlay.show {
    background: rgba(0, 0, 0, 0.5);
    opacity: 1;
    pointer-events: auto;
}

/* ========== LANGUAGE SIDEBAR MOBILE ========== */
.language-btn-mobile {
    display: none;
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all var(--transition-speed);
}

.language-btn-mobile:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}
.language-sidebar {
    position: fixed;
    right: -350px;
    top: 0;
    width: 350px;
    height: 100vh;
    background: var(--text-light);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    transition: right var(--transition-speed);
    overflow-y: auto;
  }
  .language-sidebar.show {
    right: 0;
  }
  
  .sidebar-header {
    background: var(--primary-color);
    color: var(--text-light);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .sidebar-header h3 {
    margin: 0;
    font-size: 18px;
  }
  
  .close-sidebar {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar-content {
    padding: 20px 0;
    display: flex;
    flex-direction: column;
  }
  
  .sidebar-language-option {
    background: none;
    border: none;
    padding: 15px 20px;
    text-align: left;
    cursor: pointer;
    color: var(--text-dark);
    font-size: 16px;
    transition: all 0.3s;
    border-bottom: 1px solid #eee;
  }
  
  .sidebar-language-option:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
    font-weight: bold;
    padding-left: 30px;
  }
  
  .sidebar-language-option.active {
    background-color: var(--accent-color);
    color: var(--primary-color);
    font-weight: bold;
  }

/* ========== BODY DASHBOARD ========== */
.body-dashboard {
    display: flex;
    min-height: calc(100vh - var(--header-height));
    background-color: var(--bg-secondary);
}

/* ========== SIDEBAR PRINCIPAL ========== */
.sidebar {
    position: inherit;
    top: var(--header-height);
    width: 280px;
    color: var(--text-light);
    height: 100%;
}

.sidebar .nav-sidebar-content {
    padding: 20px 0;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* ========== DASHBOARD MAIN ========== */
.dashboard-main {
    flex: 1;
    padding: 2rem;
    background-color: var(--bg-light);
    min-height: calc(100vh - var(--header-height));
    overflow-y: auto;
}

/* ========== WELCOME TITLE ========== */
.welcome-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

#usernameLabel {
    color: var(--secondary-color);
    font-weight: 700;
}

/* ========== DASHBOARD GRID ========== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

/* ========== CALENDAR SECTION ========== */
.calendar-section {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    width: 100%;
}

#preview-calendar {
    flex: 1;
    min-height: 300px;
    border-radius: 12px;
    background-color: var(--bg-primary);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    color: var(--text-light);
    border: 1px solid var(--border-light);
}

/* ========== PROFILE COMPLETION CARD ========== */
.profile-completion-card {
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    max-width: 350px;
    height: fit-content;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid var(--border-light);
}

.half-circle-container {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
}

.half-circle {
    position: relative;
    width: 140px;
    height: 80px;
}

.half-circle svg {
    width: 100%;
    height: 100%;
}

.progress-fill {
    transition: stroke-dashoffset 1s ease-in-out, stroke 0.5s ease;
}

.percentage-text {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 28px;
    font-weight: bold;
    color: var(--accent-color);
}

.profile-details {
    margin: 1.5rem 0;
}

.completion-message {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-light);
}

.complete-profile-btn {
    width: 100%;
    padding: 1.5rem;
    background: var(--gradient-cool);
    color: var(--text-light);
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.complete-profile-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.complete-profile-btn:active {
    transform: translateY(0);
}

/* ========== AVAILABILITY SECTION ========== */
.availability-section h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.disponibiltéContainer {
    background-color: var(--bg-primary);
    border-radius: 12px;
    padding: 1.5rem;
    min-height: 200px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ========== STATISTICS SECTION ========== */
.statistics-section h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.visibility-stats h3 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.visibility-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.visibility-item {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-primary));
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid var(--border-light);
    text-align: center;
    transition: all var(--transition-speed);
    position: relative;
    overflow: hidden;
}

.visibility-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform var(--transition-speed);
}

.visibility-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--secondary-color);
}

.visibility-item:hover::before {
    transform: scaleX(1);
}

.visibility-item h3 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.visibility-item p {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-color);
    margin: 0;
}

.mission-stats h3 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.mission-stat-item {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-primary));
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid var(--border-light);
    margin-bottom: 1.5rem;
    transition: all var(--transition-speed);
}

.mission-stat-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--success);
}

.mission-stat-item h3 {
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.mission-stat-item span {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-light);
    display: block;
    margin-bottom: 0.5rem;
}

.mission-stat-item p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* ========== DISPONIBILITÉ PAGE SPÉCIFIQUE ========== */
.body-disponibilite {
    width: 100%;
}

.container-disponibilite {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.main-disponibilite {
    width: 100%;
}

.main-disponibilite h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideInUp 0.6s ease-out;
}

.section-previewDate {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: fadeIn 0.6s ease-out;
}

.previewEventt {
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.previewEventt h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========== TABLEAU DISPONIBILITÉS ========== */
.tableDisponibiliti {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-light);
}

.tableDisponibiliti thead {
    background: rgba(132, 209, 244, 0.15);
    border-bottom: 2px solid var(--accent-color);
}

.tableDisponibiliti th {
    padding: 1.2rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tableDisponibiliti tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all var(--transition-speed);
}

.tableDisponibiliti tbody tr:hover {
    background-color: rgba(132, 209, 244, 0.1);
    transform: scale(1.01);
}

.tableDisponibiliti td {
    padding: 1.2rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.tableDisponibiliti td strong {
    color: var(--text-light);
    font-weight: 600;
}

/* ========== FACTURES STYLES ===== */
.factures-container {
    background: white;
    border-radius: var(--border-radius-md);
    padding: 30px;
    box-shadow: var(--shadow-md);
}

.factures-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.factures-header h2 {
    font-size: 24px;
    color: var(--text-dark);
    margin: 0;
}

.factures-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-light);
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    font-size: 14px;
    transition: background var(--transition-speed);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--secondary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    font-size: 14px;
    transition: all var(--transition-speed);
}

.btn-secondary:hover {
    background: #e8e8e8;
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

/* FILTERS */
.filters-section {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 500;
}

.filter-group select,
.filter-group input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition-speed);
}

.filter-group select:focus,
.filter-group input:focus {
    border-color: var(--accent-color);
}

/* STATS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-secondary);
    color: var(--text-light);
    padding: 20px;
    border-radius: var(--border-radius-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.stat-card h3 {
    font-size: 12px;
    opacity: 0.9;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .value {
    font-size: 28px;
    font-weight: bold;
    margin: 0;
}

/* TABLE */
.factures-table-wrapper {
    overflow-x: auto;
}

.factures-table {
    width: 100%;
    border-collapse: collapse;
}

.factures-table thead {
    background: #f9f9f9;
    border-bottom: 2px solid var(--accent-color);
}

.factures-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 14px;
}

.factures-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: var(--text-dark);
}

.factures-table tbody tr:hover {
    background: #f9f9f9;
}

/* FACTURE REFERENCE */
.facture-ref {
    font-weight: 600;
    color: var(--primary-color);
}

/* CLIENT NAME */
.client-name {
    font-weight: 500;
    color: var(--text-dark);
}

/* MONTANT */
.amount {
    font-weight: 600;
    color: var(--text-dark);
}

.amount.paid {
    color: var(--success);
}

/* STATUS BADGE */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    min-width: 100px;
}

.status-paid {
    background: #e8f5e9;
    color: var(--success);
}

.status-pending {
    background: #fff3e0;
    color: var(--warning);
}

.status-overdue {
    background: #ffebee;
    color: var(--error);
}

/* DATE */
.facture-date {
    color: #999;
    font-size: 13px;
}

/* ACTIONS */
.facture-actions {
    display: flex;
    gap: 8px;
}

.action-btn-small {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    transition: transform var(--transition-speed), color var(--transition-speed);
    color: #666;
}

.action-btn-small:hover {
    transform: scale(1.2);
    color: var(--primary-color);
}

/* PAGINATION */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
    transition: all var(--transition-speed);
}

.pagination button:hover {
    border-color: var(--accent-color);
    color: var(--primary-color);
}

.pagination button.active {
    background: var(--primary-color);
    color: var(--text-light);
    border-color: var(--primary-color);
}

/* ========== MODALS & POPUPS ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 15px;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--primary-color);
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
}

.close-btn:hover {
    color: var(--primary-color);
}

/* PREVIEW FACTURE */
.invoice-preview {
    background: #f9f9f9;
    padding: 30px;
    border-radius: var(--border-radius-md);
    border: 2px solid var(--accent-color);
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.8;
    margin-top: 20px;
}

.invoice-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 20px;
}

.invoice-header h1 {
    margin: 0;
    font-size: 24px;
    color: var(--primary-color);
}

.invoice-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.invoice-section h3 {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--primary-color);
    margin: 0 0 10px 0;
    font-weight: 600;
}

.invoice-section p {
    margin: 5px 0;
}

.invoice-items {
    grid-column: 1 / -1;
    margin-bottom: 20px;
}

.invoice-items table {
    width: 100%;
    border-collapse: collapse;
}

.invoice-items th {
    border-bottom: 2px solid var(--primary-color);
    padding: 10px 0;
    text-align: left;
    font-weight: bold;
    color: var(--primary-color);
}

.invoice-items td {
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.invoice-items td:last-child {
    text-align: right;
}

.invoice-totals {
    grid-column: 1 / -1;
    text-align: right;
}

.invoice-totals table {
    margin-left: auto;
    width: 200px;
}

.invoice-totals tr:last-child {
    border-top: 2px solid var(--primary-color);
    font-weight: bold;
    font-size: 14px;
    color: var(--primary-color);
}

.invoice-totals td {
    padding: 8px 0;
}

.invoice-totals td:first-child {
    text-align: left;
}

/* ========== BUTTONS ========== */
.btn-add {
    background: var(--gradient-cool);
    color: var(--text-light);
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
    margin-bottom: 1.5rem;
    display: inline-block;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-edit, .btn-delete {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--transition-speed);
    text-decoration: none;
    display: inline-block;
}

.btn-edit {
    background-color: var(--info);
    color: var(--text-light);
}

.btn-edit:hover {
    background-color: #138496;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-delete {
    background-color: var(--error);
    color: var(--text-light);
}

.btn-delete:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ========== MODAL AJOUTER DISPONIBILITÉ ========== */
.modal_adddisponibiliti {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease-out;
}

.modal-content_adddisponibiliti {
    background: var(--text-light);
    border-radius: 12px;
    padding: 2.5rem;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    animation: slideInUp 0.3s ease-out;
}

.modal-content_adddisponibiliti h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.modal-content_adddisponibiliti p {
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
}

.modal-content_adddisponibiliti label {
    display: block;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.modal-content_adddisponibiliti input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--bg-light);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all var(--transition-speed);
    font-family: inherit;
}

.modal-content_adddisponibiliti input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(132, 209, 244, 0.1);
}

.modal-content_adddisponibiliti button {
    width: 100%;
    padding: 1.2rem;
    margin-top: 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
}

#validerDisponibilite_adddisponibiliti {
    background: var(--gradient-cool);
    color: var(--text-light);
}

#validerDisponibilite_adddisponibiliti:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

#annulerModal_adddisponibiliti {
    background: var(--bg-light);
    color: var(--text-dark);
    margin-top: 0.75rem;
}

#annulerModal_adddisponibiliti:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

/* ========== FOOTER ========== */
.footer {
    background: var(--secondary-color);
    color: var(--text-light);
    text-align: center;
    padding: 2rem;
    border-top: 2px solid var(--accent-color);
}

.footer p {
    margin: 0;
    font-weight: 500;
}

/* ========== ANIMATIONS ========== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-grid > * {
    animation: fadeIn 0.6s ease-out;
}

.dashboard-grid > *:nth-child(1) { animation-delay: 0.1s; }
.dashboard-grid > *:nth-child(2) { animation-delay: 0.2s; }
.dashboard-grid > *:nth-child(3) { animation-delay: 0.3s; }

/* ========== RESPONSIVE DESIGN ========== */

@media (max-width: 1200px) {
    .visibility-content {
        grid-template-columns: repeat(2, 1fr);
    }

    .calendar-section {
        flex-direction: column;
    }

    .profile-completion-card {
        max-width: 100%;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    /* AFFICHER MENU MOBILE */
    .header-controls {
        display: flex !important;
        gap: 1rem;
        align-items: center;
    }

    .nav {
        display: none !important;
    }

    .menu-btn {
        display: flex !important;
    }

    .language-btn-mobile {
        display: flex !important;
    }

    .sidebar {
        display: none !important;
    }

    .dashboard-main {
        padding: 1.5rem;
    }

    .welcome-title {
        font-size: 1.8rem;
    }

    .factures-container {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 1rem;
        margin: 0 15px;
    }

    .logo img {
        height: 50px;
    }

    .dashboard-main {
        margin-left: 0;
        padding: 1.5rem;
    }

    .welcome-title {
        font-size: 1.5rem;
    }

    .calendar-section {
        flex-direction: column;
    }

    #preview-calendar {
        min-height: 200px;
    }

    .profile-completion-card {
        max-width: 100%;
    }

    .visibility-content {
        grid-template-columns: 1fr;
    }

    .visibility-item p {
        font-size: 2rem;
    }

    .dashboard-grid {
        gap: 1.5rem;
    }

    .tableDisponibiliti th,
    .tableDisponibiliti td {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .main-disponibilite h1 {
        font-size: 1.5rem;
    }

    .previewEventt {
        padding: 1.5rem;
    }

    .factures-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .factures-actions {
        width: 100%;
    }

    .filters-section {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group select,
    .filter-group input {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .factures-table {
        font-size: 12px;
    }

    .factures-table th,
    .factures-table td {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .header {
        height: auto;
    }

    :root {
        --header-height: auto;
    }

    .header-container {
        padding: 0 0.75rem;
        margin: 0 10px;
    }

    .logo img {
        height: 45px;
    }

    .menu-btn span {
        width: 20px;
    }

    .dashboard-main {
        padding: 1rem;
    }

    .welcome-title {
        font-size: 1.3rem;
        gap: 0.5rem;
    }

    .profile-completion-card {
        padding: 1.5rem;
    }

    .visibility-item {
        padding: 1.5rem;
    }

    .visibility-item p {
        font-size: 1.8rem;
    }

    .mission-stat-item span {
        font-size: 1.6rem;
    }

    .percentage-text {
        font-size: 24px;
    }

    .visibility-content {
        grid-template-columns: 1fr;
    }

    .mission-stat-item {
        padding: 1.5rem;
    }

    .tableDisponibiliti {
        font-size: 0.8rem;
    }

    .tableDisponibiliti th,
    .tableDisponibiliti td {
        padding: 0.5rem;
    }

    .modal-content_adddisponibiliti {
        padding: 1rem;
        width: 95%;
    }

    .modal-content_adddisponibiliti h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .language-sidebar {
        width: 100%;
        right: -100%;
    }

    .factures-container {
        padding: 1rem;
    }

    .factures-header h2 {
        font-size: 18px;
    }

    .btn-primary,
    .btn-secondary {
        font-size: 12px;
        padding: 8px 12px;
    }

    .stat-card .value {
        font-size: 20px;
    }

    .modal-content {
        padding: 20px;
        width: 95%;
    }

    .invoice-preview {
        padding: 15px;
        font-size: 11px;
    }
}

@media (max-width: 360px) {
    .logo img {
        height: 40px;
    }

    .welcome-title {
        font-size: 1.1rem;
    }

    .visibility-item h3 {
        font-size: 0.75rem;
    }

    .dashboard-main {
        padding: 0.75rem;
    }

    .factures-header h2 {
        font-size: 16px;
    }
}
/* ===== TABLE FACTURES - VERSION RESPONSIVE ===== */

/* ===== CONTENEUR ===== */
.factures-table-wrapper {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ===== TABLE DE BASE ===== */
.factures-table {
    width: 100%;
    border-collapse: collapse;
}

.factures-table thead {
    background-color: #f5f5f5;
    border-bottom: 2px solid #ddd;
}

.factures-table th {
    padding: 15px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.factures-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s ease;
}

.factures-table tbody tr:hover {
    background-color: #f9f9f9;
}

.factures-table tbody tr:last-child {
    border-bottom: none;
}

.factures-table td {
    padding: 15px;
    font-size: 14px;
    color: #555;
}

/* ===== BADGES STATUT ===== */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.badge-payee {
    background-color: #d4edda;
    color: #155724;
}

.badge-attente {
    background-color: #fff3cd;
    color: #856404;
}

.badge-retard {
    background-color: #f8d7da;
    color: #721c24;
}

/* ===== ACTIONS ===== */
.actions {
    display: flex;
    gap: 8px;
}

.btn-action {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    transition: transform 0.2s ease, opacity 0.2s ease;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
}

.btn-action:hover {
    transform: scale(1.15);
    background-color: #f0f0f0;
}

.btn-action:active {
    transform: scale(0.95);
}

/* ===== RESPONSIVE MOBILE 768px ===== */
@media (max-width: 768px) {
    .factures-table {
        display: block;
    }

    .factures-table thead {
        display: none;
    }

    .factures-table tbody {
        display: block;
        padding: 15px;
    }

    .factures-table tbody tr {
        display: block;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 0;
        margin-bottom: 15px;
        background-color: white;
        overflow: hidden;
    }

    .factures-table tbody tr:last-child {
        margin-bottom: 0;
    }

    .factures-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 15px;
        border-bottom: 1px solid #f0f0f0;
        position: relative;
    }

    .factures-table td:last-child {
        border-bottom: none;
        border-top: 1px solid #f0f0f0;
        margin-top: 5px;
        padding: 15px;
        justify-content: flex-end;
    }

    .factures-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #666;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        min-width: 75px;
        margin-right: 10px;
    }

    .factures-table td:last-child::before {
        content: "";
        margin: 0;
        min-width: 0;
    }

    /* Styles spécifiques par colonne */
    .factures-table td:nth-child(1)::before { content: "N° Facture"; }
    .factures-table td:nth-child(2)::before { content: "Client"; }
    .factures-table td:nth-child(3)::before { content: "Date"; }
    .factures-table td:nth-child(4)::before { content: "Montant"; }
    .factures-table td:nth-child(5)::before { content: "Statut"; }
    .factures-table td:nth-child(6)::before { content: ""; }
}

/* ===== RESPONSIVE TRÈS MOBILE 576px ===== */
@media (max-width: 576px) {
    .factures-table-wrapper {
        border-radius: 0;
        margin: 0 -20px;
    }

    .factures-table tbody {
        padding: 12px;
    }

    .factures-table tbody tr {
        margin-bottom: 12px;
    }

    .factures-table td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .factures-table td::before {
        font-size: 10px;
        min-width: 65px;
    }

    .factures-table td:last-child {
        padding: 12px;
    }

    .actions {
        gap: 6px;
    }

    .btn-action {
        min-width: 30px;
        min-height: 30px;
        font-size: 14px;
        padding: 3px 6px;
    }

    .badge {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* ===== VARIANTE: CARD LAYOUT FULL (OPTIONNEL) ===== */
.factures-table.variant-cards tbody tr {
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    padding: 15px;
}

.factures-table.variant-cards tbody tr:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.factures-table.variant-cards td {
    padding: 8px 0;
    border-bottom: none;
}

.factures-table.variant-cards td:last-child {
    border-top: none;
    padding: 8px 0;
    margin-top: 0;
}

/* ===== VARIANTE: COMPACT ===== */
.factures-table.variant-compact td {
    padding: 10px;
    font-size: 13px;
}

.factures-table.variant-compact th {
    padding: 10px;
    font-size: 12px;
}

/* ===== VARIANTE: STRIPED (RAYURES ALTERNÉES) ===== */
.factures-table.variant-striped tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.factures-table.variant-striped tbody tr:hover {
    background-color: #f0f0f0;
}

/* ===== VARIANTE: COLORÉE PAR STATUT ===== */
.factures-table.variant-colored tbody tr {
    border-left: 4px solid transparent;
}

.factures-table tbody tr:has(.badge-payee) {
    border-left-color: #28a745;
}

.factures-table tbody tr:has(.badge-attente) {
    border-left-color: #ffc107;
}

.factures-table tbody tr:has(.badge-retard) {
    border-left-color: #dc3545;
}

/* ===== VARIANTE: EXPANSION (CLIQUABLE) ===== */
.factures-table.variant-expandable tbody tr {
    cursor: pointer;
}

.factures-table.variant-expandable tbody tr.expanded {
    background-color: #f9f9f9;
}

.details-expandable {
    display: none;
}

.factures-table.variant-expandable tbody tr.expanded .details-expandable {
    display: block;
    padding: 15px;
    background-color: #f9f9f9;
}

/* ===== ÉTAT VIDE ===== */
.table-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #999;
    text-align: center;
}

.table-empty svg {
    width: 80px;
    height: 80px;
    opacity: 0.5;
    margin-bottom: 20px;
}

.table-empty p {
    font-size: 16px;
    margin-bottom: 10px;
}

/* ===== CHARGEMENT ===== */
.table-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f0f0f0;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== IMPRESSION ===== */
@media print {
    .factures-table-wrapper {
        box-shadow: none;
    }

    .factures-table thead {
        background-color: white;
        border: 1px solid #000;
    }

    .factures-table th {
        border: 1px solid #000;
    }

    .factures-table td {
        border: 1px solid #000;
    }

    .actions {
        display: none;
    }

    .factures-table tbody tr {
        page-break-inside: avoid;
    }
}

/* ===== ACCESSIBILITÉ ===== */
.btn-action:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .factures-table tbody tr,
    .btn-action {
        transition: none;
    }

    .spinner {
        animation: none;
        border-top: 4px solid #4CAF50;
    }
}

/* ===== MODE SOMBRE (OPTIONNEL) ===== */
@media (prefers-color-scheme: dark) {
    .factures-table-wrapper {
        background-color: var(--bg-light);
    }

    .factures-table thead {
        background-color: #2a2a2a;
        border-bottom-color: #444;
    }

    .factures-table th {
        color: #e0e0e0;
    }

    .factures-table tbody tr {
        border-bottom-color: var(--bg-light);
    }

    .factures-table tbody tr:hover {
        background-color: var(--bg-light);
    }

    .factures-table td {
        color: #c0c0c0;
    }

    .btn-action:hover {
        background-color: var(--bg-light);
    }

    .badge {
        filter: brightness(0.9);
    }

    @media (max-width: 768px) {
        .factures-table tbody tr {
            border-color: var(--accent-color);
            background-color: var(--bg-light);
        }

        .factures-table td {
            border-bottom-color:var(--accent-color);
        }
    }
}
/* ========== UTILITY CLASSES ========== */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-dark { color: var(--text-dark); }
.text-white { color: white; }
.text-success { color: var(--success); }
.text-error { color: var(--error); }

.bg-primary { background-color: var(--bg-primary); }
.bg-secondary { background-color: var(--bg-secondary); }
.bg-light { background-color: var(--bg-light); }
.bg-success { background-color: var(--success); }

.gradient-primary { background: var(--gradient-primary); }
.gradient-secondary { background: var(--gradient-secondary); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.rounded { border-radius: var(--border-radius-md); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }