/* ============================================
   RESET & BASE
============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a2c3e;
}

/* ============================================
   PAGE DE CONNEXION
============================================ */
.deat-login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9eef3 100%);
    padding: 20px;
}

.deat-login-wrapper {
    display: flex;
    max-width: 1000px;
    width: 100%;
    background: #ffffff;
    border-radius: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Partie gauche - Branding */
.deat-login-brand {
    flex: 1;
    background: #1a472a;
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
}

.deat-brand-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.deat-brand-icon i {
    font-size: 40px;
    color: #c8e6d9;
}

.deat-login-brand h2 {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.deat-login-brand p {
    font-size: 14px;
    opacity: 0.8;
}

/* Partie droite - Formulaire */
.deat-login-panel {
    flex: 1;
    padding: 48px;
    background: white;
}

.deat-login-header {
    margin-bottom: 32px;
}

.deat-login-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #1a2c3e;
    margin-bottom: 8px;
}

.deat-login-header p {
    font-size: 14px;
    color: #6b7a8a;
}

/* Formulaire */
.deat-login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.deat-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.deat-input-group label {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
}

.deat-input-group label i {
    width: 20px;
    color: #7f8c8d;
}

.deat-input-group input {
    padding: 14px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: #ffffff;
}

.deat-input-group input:focus {
    outline: none;
    border-color: #1a472a;
    box-shadow: 0 0 0 3px rgba(26, 71, 42, 0.1);
}

.deat-input-group input::placeholder {
    color: #a0afbf;
}

/* Bouton principal */
.deat-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #1a472a;
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.deat-btn-primary:hover {
    background: #0e3621;
    transform: translateY(-1px);
}

.deat-btn-primary i {
    font-size: 14px;
    transition: transform 0.2s;
}

.deat-btn-primary:hover i {
    transform: translateX(4px);
}

/* Liens */
.deat-login-footer {
    text-align: center;
    margin-top: 16px;
}

.deat-login-footer a {
    color: #6b7a8a;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.deat-login-footer a:hover {
    color: #1a472a;
}

.deat-login-footer a i {
    margin-right: 6px;
}

/* Alertes */
.deat-alert {
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.deat-alert-error {
    background: #fef2f2;
    border-left: 4px solid #dc2626;
    color: #991b1b;
}

.deat-alert-success {
    background: #ecfdf5;
    border-left: 4px solid #059669;
    color: #065f46;
}

/* ============================================
   LAYOUT PRINCIPAL AVEC SIDEBAR
============================================ */
.deat-app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   SIDEBAR
============================================ */
.deat-sidebar {
    width: 280px;
    background: linear-gradient(180deg, #1a472a 0%, #0e3621 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: all 0.3s ease;
    overflow-y: auto;
}

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

.deat-sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 700;
}

.deat-sidebar-logo i {
    font-size: 28px;
    color: #c8e6d9;
}

.deat-sidebar-logo span {
    letter-spacing: 1px;
}

.deat-sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 16px;
}

.deat-nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.deat-nav-item i {
    width: 22px;
    font-size: 18px;
}

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

.deat-nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.deat-nav-item.active i {
    color: #c8e6d9;
}

.deat-sidebar-footer {
    padding: 20px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.deat-user-info-sidebar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 8px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
}

.deat-user-avatar i {
    font-size: 40px;
    color: #c8e6d9;
}

.deat-user-details {
    display: flex;
    flex-direction: column;
}

.deat-user-name {
    font-size: 14px;
    font-weight: 600;
}

.deat-user-role {
    font-size: 11px;
    opacity: 0.7;
}

.deat-logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(220, 38, 38, 0.2);
    color: #fca5a5;
    text-decoration: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.deat-logout-btn:hover {
    background: rgba(220, 38, 38, 0.35);
    color: #fecaca;
}

/* ============================================
   CONTENU PRINCIPAL
============================================ */
.deat-main-content {
    flex: 1;
    margin-left: 280px;
    padding: 24px 32px;
    background: #f5f7fa;
    min-height: 100vh;
}

.deat-main-header {
    margin-bottom: 24px;
}

.deat-main-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #1a2c3e;
    margin-bottom: 4px;
}

.deat-main-header p {
    color: #6b7a8a;
    font-size: 14px;
}

/* ============================================
   GRILLE DE STATISTIQUES
============================================ */
.deat-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.deat-stat-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.deat-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.deat-stat-icon {
    width: 48px;
    height: 48px;
    background: #ecfdf5;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.deat-stat-icon i {
    font-size: 24px;
    color: #1a472a;
}

.deat-stat-info h3 {
    font-size: 13px;
    font-weight: 500;
    color: #6b7a8a;
    margin-bottom: 4px;
}

.deat-stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #1a2c3e;
}

/* ============================================
   CARTE DE BIENVENUE
============================================ */
.deat-welcome-card {
    background: white;
    border-radius: 20px;
    padding: 32px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.deat-welcome-card i {
    font-size: 48px;
    color: #1a472a;
    margin-bottom: 16px;
}

.deat-welcome-card h2 {
    font-size: 20px;
    color: #1a2c3e;
    margin-bottom: 8px;
}

.deat-welcome-card p {
    color: #6b7a8a;
    font-size: 14px;
}

/* ============================================
   BOUTON MENU MOBILE
============================================ */
.deat-mobile-menu-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 200;
    background: #1a472a;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ============================================
   STYLES POUR LA PAGE COTISATIONS (COMPACT)
============================================ */
.deat-cotisations-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.deat-filter-bar {
    padding: 8px 16px;
    background: #fafbfc;
    border-bottom: 1px solid #eef2f6;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.deat-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.deat-filter-group label {
    font-weight: 500;
    color: #1a472a;
    font-size: 12px;
}

.deat-filter-select {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    background: white;
    font-size: 12px;
    cursor: pointer;
    min-width: 160px;
    font-family: inherit;
}

.deat-stats-badge {
    background: #ecfdf5;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 500;
    color: #1a472a;
}

.deat-btn-add {
    background: #1a472a;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
}

.deat-alert-message {
    margin: 12px 20px 0 20px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.deat-families-grid {
    padding: 12px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.deat-family-group {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #eef2f6;
    overflow: hidden;
}

.deat-family-header {
    padding: 8px 16px;
    background: linear-gradient(135deg, #1a472a 0%, #2d6a4f 100%);
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.deat-family-header i {
    font-size: 16px;
    color: #c8e6d9;
}

.deat-family-header h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.deat-family-header span {
    font-size: 10px;
    margin-left: auto;
}

.deat-members-container {
    padding: 6px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.deat-member-row {
    border-bottom: 1px solid #f0f2f5;
    padding-bottom: 6px;
}

.deat-member-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.deat-member-name {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.deat-member-avatar {
    width: 24px;
    height: 24px;
    background: #ecfdf5;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a472a;
    font-weight: 600;
    font-size: 10px;
}

.deat-member-name h4 {
    font-size: 12px;
    font-weight: 600;
    color: #1a2c3e;
    margin: 0;
}

.deat-member-dit {
    font-size: 9px;
    color: #6b7a8a;
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 20px;
}

.deat-years-scroll {
    overflow-x: auto;
}

.deat-years-row {
    display: flex;
    gap: 40px;
    min-width: min-content;
}

.deat-year-cell {
    flex-shrink: 0;
    width: 60px;
    background: #fafbfc;
    border-radius: 8px;
    padding: 4px 3px;
    text-align: center;
    border: 1px solid #eef2f6;
}

.deat-year-label {
    font-size: 9px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 4px;
}

.deat-year-check {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    padding: 3px 5px;
    border-radius: 20px;
    background: white;
    border: 1px solid #e2e8f0;
    font-size: 10px;
}

.deat-year-check:hover {
    border-color: #1a472a;
    background: #ecfdf5;
}

.deat-year-check input {
    width: 12px;
    height: 12px;
    cursor: pointer;
    accent-color: #1a472a;
    margin: 0;
}

.deat-year-check span {
    font-size: 10px;
    font-weight: 500;
}

.deat-year-check.disabled {
    opacity: 0.6;
    background: #f1f5f9;
    cursor: not-allowed;
}

.deat-confirmed-badge {
    background: #d1fae5;
    color: #065f46;
    font-size: 7px;
    padding: 1px 3px;
    border-radius: 20px;
    margin-left: 2px;
}

.deat-empty-message {
    text-align: center;
    padding: 30px;
    color: #94a3b8;
    font-size: 13px;
}
/* ============================================
   MODAL
============================================ */
.deat-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.deat-modal.active {
    display: flex;
}

.deat-modal-content {
    background: white;
    border-radius: 24px;
    max-width: 550px;
    width: 90%;
    padding: 24px;
    max-height: 85vh;
    overflow-y: auto;
}

.deat-modal-icon {
    width: 50px;
    height: 50px;
    background: #ecfdf5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.deat-modal-icon i {
    font-size: 24px;
    color: #1a472a;
}

.deat-modal-title {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 6px;
}

.deat-modal-subtitle {
    font-size: 13px;
    color: #6b7a8a;
    text-align: center;
    margin-bottom: 20px;
}

.deat-modal-form-group {
    margin-bottom: 14px;
}

.deat-modal-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 5px;
}

.deat-modal-form-group label i {
    width: 18px;
    color: #1a472a;
}

.deat-modal-form-group input, 
.deat-modal-form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    font-family: inherit;
}

.deat-modal-row {
    display: flex;
    gap: 12px;
}

.deat-modal-row .deat-modal-form-group {
    flex: 1;
}

.deat-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.deat-modal-btn {
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.deat-modal-btn-confirm {
    background: #1a472a;
    color: white;
}

.deat-modal-btn-confirm:hover {
    background: #0e3621;
}

.deat-modal-btn-cancel {
    background: #f1f5f9;
    color: #475569;
}

.deat-modal-btn-cancel:hover {
    background: #e2e8f0;
}

.deat-autocomplete-list {
    position: absolute;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    max-height: 180px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    width: calc(100% - 24px);
}

.deat-autocomplete-list div {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
}

.deat-autocomplete-list div:hover {
    background: #ecfdf5;
}

.deat-city-input-wrapper {
    position: relative;
}

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 768px) {
    .deat-login-wrapper {
        flex-direction: column;
        border-radius: 24px;
    }
    
    .deat-login-brand {
        padding: 32px;
    }
    
    .deat-login-panel {
        padding: 32px;
    }
    
    .deat-sidebar {
        width: 0;
        transform: translateX(-100%);
    }
    
    .deat-sidebar.mobile-open {
        width: 280px;
        transform: translateX(0);
    }
    
    .deat-main-content {
        margin-left: 0;
        padding: 16px;
    }
    
    .deat-stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .deat-welcome-card {
        padding: 24px 16px;
    }
    
    .deat-filter-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 16px;
    }
    
    .deat-filter-group {
        justify-content: space-between;
    }
    
    .deat-families-grid {
        padding: 12px 16px;
    }
    
    .deat-year-cell {
        width: 65px;
    }
    
    .deat-modal-row {
        flex-direction: column;
        gap: 0;
    }
    
    .deat-modal-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .deat-login-panel {
        padding: 24px;
    }
    
    .deat-login-header h1 {
        font-size: 24px;
    }
    
    .deat-main-header h1 {
        font-size: 20px;
    }
    
    .deat-year-cell {
        width: 58px;
    }
    
    .deat-year-label {
        font-size: 9px;
    }
    
    .deat-year-check span {
        font-size: 10px;
    }
}

@media (min-width: 769px) {
    .deat-mobile-menu-btn {
        display: none;
    }
}
/* ========= Sidebar: Admin accordion + fix voile blanc ========= */
.deat-nav-accordion-btn{
  width:100%;
  background:transparent;
  border:0;
  cursor:pointer;
  text-align:left;
  display:flex;
  align-items:center;
  gap:10px;
}

.deat-nav-accordion-chevron{
  margin-left:auto;
  transition:transform 220ms ease;
  opacity:0.85;
}

.deat-nav-accordion.is-open .deat-nav-accordion-chevron{
  transform:rotate(90deg);
}

.deat-nav-accordion-panel{
  max-height:0;
  opacity:0;
  padding-left:10px;
  margin-top:6px;
  overflow:hidden;
  transition:max-height 220ms ease, opacity 180ms ease;
 
}

.deat-sidebar:not(.deat-sidebar-dark) .deat-nav-accordion-panel{
  border-left:2px solid rgba(0,0,0,0.10); /* sidebar clair */
}

.deat-nav-subitem{
  padding-left:10px;
  margin-left:6px;
  border-radius:10px;
}
.deat-nav-accordion-btn{
  width:100%;
  background:transparent;
  border:0;
  cursor:pointer;
  text-align:left;
  display:flex;
  align-items:center;
  gap:10px;
}

.deat-nav-accordion-chevron{
  margin-left:auto;
  transition:transform 220ms ease;
  opacity:0.85;
}

.deat-nav-accordion.is-open .deat-nav-accordion-chevron{
  transform:rotate(90deg);
}

.deat-nav-accordion-panel{
  max-height:0;
  opacity:0;
  padding-left:10px;
  margin-top:6px;
  overflow:hidden;

 
}

.deat-sidebar:not(.deat-sidebar-dark) .deat-nav-accordion-panel{
  border-left:2px solid rgba(0,0,0,0.10); /* sidebar clair */
}

.deat-nav-subitem{
  padding-left:10px;
  margin-left:6px;
  border-radius:10px;
}
/* Fix: empêcher le bouton "Administration" de rester blanc après hover */
.deat-nav-accordion-btn,
.deat-nav-accordion-btn:focus,
.deat-nav-accordion-btn:active,
.deat-nav-accordion-btn.active{
  background:transparent !important;
  filter:none !important;
  opacity:1 !important;
  outline:none !important;
  box-shadow:none !important;
}


.deat-brand-icon i.fa-leaf {
    animation: spinY 4s infinite ease-in-out;
    display: inline-block;
}
@keyframes spinY {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(180deg); }
    100% { transform: rotateY(360deg); }
}