:root {
    --primary-color: #3498db;
    --primary-dark: #2980b9;
    --secondary-color: #2ecc71;
    --secondary-dark: #27ae60;
    --danger-color: #e74c3c;
    --danger-dark: #c0392b;
    --warning-color: #f39c12;
    --warning-dark: #d35400;
    --dark-color: #2c3e50;
    --gray-dark: #343a40;
    --gray: #6c757d;
    --gray-light: #f8f9fa;
    --light-color: #ecf0f1;
    --border-color: #ddd;
    --sidebar-width: 250px;
    --header-height: 60px;
    --footer-height: 50px;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f6f9;
    overflow-x: hidden;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

/* Layout principal */
.admin-container {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-area {
    flex: 1;
    padding: 20px;
    margin-top: var(--header-height);
    margin-bottom: var(--footer-height);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--dark-color);
    color: white;
    z-index: 1000;
    transition: var(--transition);
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.sidebar-menu {
    list-style: none;
    padding: 10px 0;
}

.sidebar-menu-item {
    padding: 10px 20px;
    transition: var(--transition);
}

.sidebar-menu-item a {
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.sidebar-menu-item a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.sidebar-menu-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-menu-item:hover a, .sidebar-menu-item.active a {
    color: white;
}

.sidebar-menu-item.active {
    background-color: var(--primary-color);
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 15px;
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    background-color: rgba(0, 0, 0, 0.2);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background-color: white;
    box-shadow: var(--shadow);
    z-index: 900;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.page-title {
    font-size: 1.3rem;
    color: var(--dark-color);
}

.header-actions {
    display: flex;
    align-items: center;
}

.system-status {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: bold;
    color: white;
    margin-right: 15px;
}

.status-open {
    background-color: var(--secondary-color);
}

.status-closed {
    background-color: var(--danger-color);
}

.status-maintenance {
    background-color: var(--warning-color);
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--footer-height);
    background-color: white;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    color: var(--gray);
    font-size: 0.85rem;
    z-index: 900;
}

/* Cartes */
.card {
    background-color: white;
    border-radius: 5px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    margin: 0;
    font-size: 1.2rem;
    color: var(--dark-color);
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.03);
}

/* Grilles */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

.col-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.col-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Formulaires */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--dark-color);
}

input, select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

textarea {
    height: 100px;
    resize: vertical;
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: var(--transition);
}

.btn:hover {
    background-color: var(--primary-dark);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--secondary-dark);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: var(--danger-dark);
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: var(--warning-dark);
}

.btn-gray {
    background-color: var(--gray);
    color: white;
}

.btn-gray:hover {
    background-color: var(--gray-dark);
}

/* Alertes */
.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeeba;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
}

.badge-primary {
    background-color: var(--primary-color);
    color: white;
}

.badge-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.badge-danger {
    background-color: var(--danger-color);
    color: white;
}

.badge-warning {
    background-color: var(--warning-color);
    color: white;
}

.badge-info {
    background-color: #17a2b8;
    color: white;
}

.badge-light {
    background-color: var(--light-color);
    color: var(--dark-color);
}

.badge-dark {
    background-color: var(--dark-color);
    color: white;
}

/* Statistiques */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background-color: white;
    border-radius: 5px;
    box-shadow: var(--shadow);
    padding: 20px;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Tableaux */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--gray-light);
    font-weight: 600;
    color: var(--dark-color);
}

tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Calendar Cards */
.calendar-card {
    background-color: white;
    border-radius: 5px;
    box-shadow: var(--shadow);
    padding: 20px;
    border-left: 5px solid var(--primary-color);
    position: relative;
    margin-bottom: 20px;
}

.calendar-card.active {
    border-left-color: var(--secondary-color);
}

.calendar-card.archived {
    border-left-color: var(--danger-color);
    opacity: 0.7;
}

.calendar-status {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

status-active {
    background-color: var(--secondary-color);
}

.status-inactive {
    background-color: var(--primary-color);
}

.status-archived {
    background-color: var(--danger-color);
}

.calendar-card h3 {
    margin-top: 0;
    margin-bottom: 15px;
    padding-right: 80px;
}

.calendar-card p {
    margin-bottom: 10px;
    color: var(--gray);
}

.calendar-card p strong {
    color: var(--dark-color);
}

.calendar-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

/* Utilitaires */
.form-check label{margin-left: 15px;}

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 5px !important; }
.mb-2 { margin-bottom: 10px !important; }
.mb-3 { margin-bottom: 15px !important; }
.mb-4 { margin-bottom: 20px !important; }
.mb-5 { margin-bottom: 25px !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 5px !important; }
.mt-2 { margin-top: 10px !important; }
.mt-3 { margin-top: 15px !important; }
.mt-4 { margin-top: 20px !important; }
.mt-5 { margin-top: 25px !important; }

.ms-auto { margin-left: auto !important; }
.me-auto { margin-right: auto !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }

.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-left { text-align: left !important; }

.d-flex { display: flex !important; }
.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.align-items-center { align-items: center !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-end { justify-content: flex-end !important; }
.flex-wrap { flex-wrap: wrap !important; }
.gap-1 { gap: 5px !important; }
.gap-2 { gap: 10px !important; }
.gap-3 { gap: 15px !important; }
.gap-4 { gap: 20px !important; }

/* Éléments de chargement */
.loading {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* Onglets */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    margin-bottom: -1px;
    border: 1px solid transparent;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    transition: var(--transition);
}

.tab:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.tab.active {
    border-color: var(--border-color);
    border-bottom-color: white;
    background-color: white;
    color: var(--primary-color);
    font-weight: 500;
}

.tab-content {
    /*display: none;*/
}
#active-calendars,
#archived-calendars,
#calendar-tables,
#all-tables {
    display: none;
}
#all-tables.tab-content.active,
#calendar-tables.tab-content.active,
#active-calendars.tab-content.active,
#archived-calendars.tab-content.active {
    display: block;
}

/* Responsive */
@media (max-width: 992px) {
    .col-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 70px;
    }
    
    .sidebar-logo-text {
        display: none;
    }
    
    .sidebar-menu-item a span {
        display: none;
    }
    
    .sidebar-menu-item a i {
        margin-right: 0;
        font-size: 1.2rem;
    }
    
    .col-2, .col-3 {
        grid-template-columns: 1fr;
    }
    
    .sidebar-footer {
        display: none;
    }
}

@media (max-width: 576px) {
    .grid {
        grid-template-columns: 1fr;
    }
    
    .stats-container {
        grid-template-columns: 1fr 1fr;
    }
    
    .header {
        flex-direction: column;
        height: auto;
        padding: 10px;
    }
    
    .page-title {
        margin-bottom: 10px;
    }
}

.stat-card {
    padding: 1.5rem 1rem;
    border-radius: 0.75rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
  }
  
  .stat-card:hover {
    transform: translateY(-5px);
  }
  
  .stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
  }
  
  .stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #333;
  }
  
  .stat-label {
    font-size: 0.95rem;
    color: #777;
  }
  .stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem; /* équivalent à Bootstrap g-4 (~24px) */
    margin-left: -12px;
    margin-right: -12px;
  }
  
  .stats-grid > div {
    flex: 1 1 calc(25% - 1.5rem);
    min-width: 250px;
  }
  
  @media (max-width: 1200px) {
    .stats-grid > div {
      flex: 1 1 calc(33.333% - 1.5rem);
    }
  }
  
  @media (max-width: 768px) {
    .stats-grid > div {
      flex: 1 1 calc(50% - 1.5rem);
    }
  }
  
  @media (max-width: 576px) {
    .stats-grid > div {
      flex: 1 1 100%;
    }
  }
  