/* ===== css/mobile.css =====
 * Refonte complete UX mobile - Elise Massage PWA
 * Ne casse RIEN sur desktop (tout dans @media queries sauf elements globaux)
 */

/* ===== ELEMENTS GLOBAUX (hors media query) ===== */

.mobile-only { display: none; }

/* Burger button - cache sur desktop */
.burger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: none;
  border: none;
  cursor: pointer;
}
.burger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-dark);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Menu mobile slide-in */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -300px;
  width: 280px;
  height: 100vh;
  background: white;
  z-index: 10001;
  transition: right 0.3s ease;
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.mobile-menu.open { right: 0; }

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--rose-poudre);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-dark);
}
.mobile-menu-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--text-light);
}
.mobile-menu-nav {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rose-poudre);
}
.mobile-nav-item {
  display: flex;
  align-items: center;
  padding: 0.9rem 1.25rem;
  border: none;
  background: none;
  text-align: left;
  font-size: 0.95rem;
  color: var(--text-dark);
  cursor: pointer;
  transition: background 0.15s;
}
.mobile-nav-item:hover { background: var(--beige-clair); }
.mobile-nav-item.active {
  color: var(--beige-dore);
  font-weight: 600;
  background: rgba(212,165,116,0.08);
  border-left: 3px solid var(--beige-dore);
}
.mobile-menu-actions {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
  margin-top: auto;
}
.mobile-action-item {
  padding: 0.85rem 1.25rem;
  border: none;
  background: none;
  text-align: left;
  font-size: 0.9rem;
  color: var(--text-light);
  cursor: pointer;
}
/* Version dans le header du menu burger */
.mobile-menu-version {
  font-size: 0.65rem;
  color: #bbb;
  font-weight: 400;
}

.mobile-action-item.install-btn {
  color: white;
  background: linear-gradient(135deg, #d4a574, #c4956a);
  font-weight: 600;
  border-radius: 8px;
  margin: 0.5rem 1rem;
  text-align: center;
  justify-content: center;
}
.mobile-action-item.logout {
  color: #e74c3c;
  font-weight: 500;
  border-top: 1px solid #f0f0f0;
  margin-top: 0.5rem;
}
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.4);
  z-index: 10000;
}
.mobile-menu-overlay.open { display: block; }

/* Footer version */
.app-footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.75rem;
  color: #aaa;
  border-top: 1px solid var(--rose-poudre);
  margin-top: 2rem;
}

@media (max-width: 768px) {
  .app-footer { display: none; }
}

/* Boutons ville - remplacement des inline styles */
.ville-filter-btn {
  padding: 0.4rem 1rem;
  border: 2px solid #ddd;
  background: white;
  color: var(--text-dark);
  border-radius: 20px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}
.ville-filter-btn:hover { background: #f5f5f5; border-color: #ccc; }
.ville-filter-btn.active {
  border-color: var(--beige-dore);
  background: var(--beige-dore);
  color: white;
  font-weight: 600;
}

/* Dropdown items - remplacement des inline styles */
.dropdown-menu-item {
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.15s;
}
.dropdown-menu-item:hover { background: #f5f5f5; }

/* Hover card - remplacement onmouseover */
.hover-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.hover-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(212,165,116,0.2);
  border-color: var(--beige-dore);
}

/* ===============================================
   MOBILE (max-width: 768px) - REFONTE UX COMPLETE
   =============================================== */
@media (max-width: 768px) {

  /* --- VISIBILITE DESKTOP/MOBILE --- */
  .desktop-only { display: none !important; }
  .mobile-only { display: flex !important; }
  .burger-btn { display: flex !important; }

  /* --- HEADER COMPACT : logo a gauche, burger a droite --- */
  .header-content {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.4rem 0.75rem;
    gap: 0;
  }
  .app-logo { max-height: 40px; max-width: 120px; }
  .logo-text h1 { font-size: 1.1rem; }
  .header-quote { display: none; }

  /* --- CONTENU PRINCIPAL --- */
  .tab-content { padding: 0.6rem; overflow-x: hidden !important; }
  .app-container { overflow-x: hidden !important; }
  body { overflow-x: hidden !important; }

  /* ============================
     DASHBOARD - KPIs 2 colonnes + RDV en premier
     ============================ */
  .dashboard-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem;
  }

  /* RDV en premier via order */
  .rdv-section { order: -1 !important; }
  .kpi-section { order: 1 !important; }

  .kpis-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }

  .kpi-card {
    padding: 0.65rem;
    min-height: auto !important;
    text-align: center;
  }
  .kpi-label { font-size: 0.7rem; margin-bottom: 0.2rem; }
  .kpi-value { font-size: 0.95rem !important; }

  .rdv-section h2 { font-size: 1rem; margin-bottom: 0.5rem; }
  .rdv-list { max-height: none !important; }
  .rdv-item { padding: 0.6rem; font-size: 0.85rem; }

  .dashboard-header {
    flex-direction: row !important;
    align-items: center !important;
    margin-bottom: 0.75rem !important;
  }
  .dashboard-header h2 { font-size: 1.1rem; }
  .dashboard-controls button { font-size: 0.8rem; padding: 0.4rem 0.7rem; }

  /* ============================
     CALENDRIER - Cellules lisibles avec heures
     ============================ */
  .calendar-header {
    flex-direction: column;
    text-align: center;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
  }
  .calendar-header h2 { font-size: 1rem; margin: 0; }

  .calendar-controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  .calendar-controls button,
  .calendar-controls .btn-primary,
  .calendar-controls .btn-secondary {
    padding: 0.35rem 0.55rem;
    font-size: 0.72rem;
    min-height: 34px;
  }

  .calendar-header-cell {
    padding: 0.3rem 0;
    font-size: 0.6rem;
    letter-spacing: -0.5px;
  }

  /* Cellules qui remplissent l'ecran */
  .calendar-grid {
    min-height: calc(100vh - 140px) !important;
  }
  .calendar-body {
    min-height: calc(100vh - 190px) !important;
  }
  .calendar-day {
    min-height: 0 !important;
    height: auto !important;
    padding: 2px;
    overflow: hidden;
    flex: 1;
  }
  .calendar-day-number {
    font-size: 0.6rem;
    font-weight: 700;
    margin-bottom: 1px;
    line-height: 1;
  }

  /* RDV : barres colorees compactes avec heure lisible */
  .calendar-rdv {
    font-size: 0 !important;
    height: 4px !important;
    min-height: 4px !important;
    max-height: 4px !important;
    padding: 0 !important;
    border-radius: 2px !important;
    margin-bottom: 2px !important;
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    opacity: 0.85;
  }
  /* Couleurs par defaut si pas de style inline */
  .calendar-rdv.confirmé,
  .calendar-rdv.confirme { background-color: #27ae60 !important; }
  .calendar-rdv.en-attente { background-color: #f39c12 !important; }
  .calendar-rdv.annulé,
  .calendar-rdv.annule { background-color: #e74c3c !important; }
  .calendar-rdv.prestation { background-color: #d4a574 !important; opacity: 0.5; }
  .calendar-rdv.headspa { background-color: #9b59b6 !important; }

  /* Institut badge : petit tag lisible */
  .institut-badge {
    font-size: 0.5rem !important;
    padding: 1px 3px !important;
    display: inline-block !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    line-height: 1.1 !important;
    border-radius: 3px !important;
    cursor: pointer;
    background: #fff3cd !important;
    color: #856404 !important;
    border: 1px solid #ffc107 !important;
  }

  /* ============================
     PRESTATIONS - Cards compactes
     ============================ */
  .prestations-header {
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }
  .prestations-header h2 { font-size: 1rem; }
  .prestations-controls { width: 100%; }
  .prestations-controls .btn-primary { width: 100%; }

  /* Table -> Cards */
  #prestations-table thead { display: none; }
  .table-container {
    overflow: visible !important;
    box-shadow: none;
    background: transparent;
    border-radius: 0;
  }

  #prestations-table tbody tr {
    display: block;
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-bottom: 0.6rem;
    padding: 0.7rem;
    border-left: 3px solid var(--beige-dore);
  }

  #prestations-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.2rem 0;
    border: none;
    font-size: 0.82rem;
  }

  #prestations-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.75rem;
    flex-shrink: 0;
    margin-right: 0.5rem;
  }

  /* Cacher les lignes vides (Notes: -, Frais route: -) */
  #prestations-table tbody td[data-label="Notes"],
  #prestations-table tbody td[data-label="Frais route"] {
    display: none;
  }
  /* Afficher seulement si contenu utile (gere en JS via classe) */

  /* Actions en ligne horizontale */
  #prestations-table tbody td[data-label="Actions"] {
    justify-content: flex-end;
    gap: 0.3rem;
    padding-top: 0.4rem;
    margin-top: 0.2rem;
    border-top: 1px solid #f0f0f0;
  }
  #prestations-table tbody td[data-label="Actions"]::before { display: none; }
  #prestations-table tbody td[data-label="Actions"] > div {
    display: flex !important;
    flex-direction: row !important;
    gap: 0.3rem;
    width: 100%;
  }
  #prestations-table tbody td[data-label="Actions"] button {
    flex: 1;
    min-height: 36px;
    font-size: 0.75rem !important;
    padding: 0.3rem !important;
  }

  /* ============================
     BONS CADEAUX - Compact
     ============================ */
  /* Le wrapper principal : tout en colonne */
  .bons-cadeaux-header > div {
    flex-direction: column !important;
    gap: 0.5rem !important;
    align-items: stretch !important;
  }
  .bons-cadeaux-header h2 {
    font-size: 0.95rem !important;
    text-align: center;
    margin-bottom: 0 !important;
  }

  /* Resume (Actifs, Utilises, Expires, A honorer) : 1 ligne */
  #bons-cadeaux-resume {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    gap: 0.4rem !important;
    font-size: 0.7rem !important;
    margin-top: 0.25rem !important;
  }
  #bons-cadeaux-resume > span {
    white-space: nowrap;
    font-size: 0.7rem;
  }

  /* Search container full width */
  .bons-cadeaux-header .search-container {
    max-width: none !important;
    min-width: auto !important;
    flex: none !important;
    width: 100% !important;
  }
  #bons-cadeaux-search {
    width: 100% !important;
  }

  /* Bouton + filtre en ligne */
  .bons-cadeaux-header > div > div:last-child {
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.4rem !important;
  }
  .bons-cadeaux-header .btn-primary { font-size: 0.8rem; padding: 0.4rem 0.8rem; }

  /* Grid des bons : 1 colonne */
  #bons-cadeaux-list {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }

  /* Card bon cadeau : montant a gauche, statut a droite */
  .bon-cadeau-card { padding: 0.6rem !important; }
  .bon-cadeau-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
  }
  .bon-cadeau-montant {
    font-size: 1rem !important;
    margin: 0 !important;
    text-align: left !important;
  }
  .bon-cadeau-statut {
    font-size: 0.7rem !important;
    margin: 0 !important;
  }
  .bon-cadeau-description { font-size: 0.8rem; margin: 0.2rem 0; }
  .bon-cadeau-info { font-size: 0.75rem; }
  .bon-cadeau-info p { margin: 0.1rem 0; }
  .bon-cadeau-dates { font-size: 0.7rem; margin: 0.2rem 0; }
  .bon-cadeau-actions {
    display: flex !important;
    flex-direction: row !important;
    gap: 0.3rem !important;
    margin-top: 0.4rem;
  }
  .bon-cadeau-actions button,
  .bon-cadeau-actions a {
    flex: 1 !important;
    min-height: 36px !important;
    font-size: 0.75rem !important;
    padding: 0.3rem !important;
  }

  /* ============================
     ANNUAIRE / CLIENTS - Compact
     ============================ */
  .clients-header {
    padding: 0.5rem !important;
  }

  /* Titre + filtres ville en ligne compacte */
  .clients-header > div:first-child {
    flex-direction: column !important;
    gap: 0.5rem !important;
    align-items: stretch !important;
  }
  .clients-header h2 { font-size: 1rem; text-align: center; margin: 0 !important; }

  .ville-filter-buttons {
    display: flex !important;
    justify-content: center !important;
    gap: 0.3rem !important;
    flex-wrap: nowrap !important;
  }
  .ville-filter-btn { padding: 0.3rem 0.7rem; font-size: 0.78rem; }

  /* Search full width */
  .clients-header input[type="text"],
  .clients-header .search-container {
    width: 100% !important;
    max-width: none !important;
    min-width: auto !important;
  }

  .clients-header select { width: 100% !important; }

  /* Controles (Ajouter, Top clients) en ligne */
  .clients-controls,
  .clients-header > div:nth-child(2) {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.3rem !important;
  }

  /* Cacher canal acquisition sur mobile (pas la recherche !) */
  .clients-header .filter-group {
    display: none !important;
  }

  /* View controls bar - 1 ligne compacte avec tout inline */
  .view-controls-bar {
    padding: 0.3rem 0.4rem !important;
    gap: 0.3rem !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Groupes de controles en ligne */
  .view-controls-group {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.15rem !important;
    flex-shrink: 0;
  }

  /* Masquer labels "Vue:" et "Tri:" */
  .view-control-label {
    display: none !important;
  }

  /* Boutons vue grille/liste compacts */
  .view-toggle-btn {
    min-height: 32px !important;
    min-width: 32px !important;
    max-width: 36px !important;
    padding: 0.15rem !important;
    font-size: 0.75rem !important;
  }

  /* Section toggles en ligne scrollable */
  .view-controls-sections {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 0.15rem !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 1;
    min-width: 0;
  }

  /* Chaque toggle ultra compact */
  .section-toggle {
    font-size: 0.65rem !important;
    min-height: 28px !important;
    padding: 0.1rem 0.3rem !important;
    white-space: nowrap !important;
    flex-shrink: 0;
  }
  .section-toggle input[type="checkbox"] {
    width: 14px !important;
    height: 14px !important;
    margin: 0 !important;
  }

  /* Tri select compact */
  .view-sort-select {
    min-width: 90px !important;
    max-width: 120px !important;
    font-size: 0.7rem !important;
    min-height: 30px !important;
    padding: 0.15rem 0.3rem !important;
  }

  /* Sections clients : 1 colonne */
  .clients-sections { grid-template-columns: 1fr !important; gap: 0.75rem !important; }
  .clients-grid-view { grid-template-columns: 1fr !important; gap: 0.5rem !important; }

  /* Client cards compactes */
  .client-card-compact {
    padding: 0.5rem 0.6rem;
  }
  .client-card-compact .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .client-card-compact .client-name { font-size: 0.85rem; }
  .client-card-compact .badges { gap: 0.2rem; }
  .client-card-compact .card-details { font-size: 0.8rem; padding-top: 0.4rem; margin-top: 0.4rem; }
  .client-card-compact .card-actions {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.4rem;
  }
  .client-card-compact .card-actions button {
    flex: 1;
    font-size: 0.7rem;
    padding: 0.3rem;
    min-height: 34px;
  }

  /* Client table view -> cards aussi */
  .clients-table thead { display: none; }
  .clients-table tbody tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem;
    border-bottom: 1px solid #f0f0f0;
  }
  .clients-table .name-cell {
    font-weight: 600;
    flex: 1;
    min-width: 120px;
  }
  .clients-table .actions-cell {
    display: flex;
    gap: 0.2rem;
  }
  .clients-table .actions-cell button { min-height: 34px; }

  /* Dropdown menu repositionnement */
  .dropdown-menu {
    right: auto !important;
    left: 0 !important;
    min-width: 200px;
  }

  /* ============================
     ANALYTICS - Lisible et sans scroll horizontal
     ============================ */
  .analytics-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  .analytics-grid > * {
    width: 100% !important;
    max-width: 100% !important;
    grid-column: auto !important;
    grid-row: auto !important;
  }
  .analytics-container {
    width: 100% !important;
  }

  /* Controles globaux analytics */
  .global-analytics-controls {
    flex-direction: column !important;
    gap: 0.5rem !important;
    text-align: center;
    padding: 0.5rem !important;
  }
  .global-analytics-controls > div {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.3rem !important;
  }

  /* Header analytics */
  .analytics-header {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.6rem;
  }
  .analytics-header h3 { font-size: 0.95rem; text-align: center; }

  .analytics-period-selector {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.2rem;
  }
  .period-btn {
    padding: 0.35rem 0.5rem !important;
    font-size: 0.72rem !important;
    min-height: 32px !important;
  }

  /* Charts - repliables */
  .chart-container, .modern-chart {
    grid-column: auto !important;
    grid-row: auto !important;
  }
  .chart-header {
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.5rem !important;
    cursor: pointer;
  }
  .chart-header h3 {
    font-size: 0.85rem;
    margin: 0;
  }
  .chart-header::after {
    content: "▼";
    font-size: 0.55rem;
    color: var(--text-light);
    transition: transform 0.2s;
  }
  .chart-container.collapsed .chart-header::after,
  .modern-chart.collapsed .chart-header::after {
    transform: rotate(-90deg);
  }
  .chart-container.collapsed .chart-wrapper,
  .modern-chart.collapsed .chart-wrapper,
  .chart-container.collapsed .table-wrapper,
  .modern-chart.collapsed .table-wrapper,
  .chart-container.collapsed .chart-stats,
  .modern-chart.collapsed .chart-stats {
    display: none !important;
  }
  /* Stats container aussi repliable */
  .stats-container.collapsed .stats-grid,
  .modern-stats.collapsed .stats-grid {
    display: none !important;
  }

  .chart-wrapper {
    padding: 0.25rem;
    min-height: 180px !important;
  }

  /* Filter pills - repliables sur mobile */
  .modern-filters {
    padding: 0.4rem !important;
  }
  .modern-filters h4 {
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .modern-filters h4::after {
    content: "▼";
    font-size: 0.6rem;
    transition: transform 0.2s;
  }
  .modern-filters.collapsed h4::after {
    transform: rotate(-90deg);
  }
  .modern-filters.collapsed .filter-pills {
    display: none !important;
  }

  .filter-pills {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.25rem !important;
    flex-direction: unset !important;
  }
  .filter-pill {
    min-width: auto !important;
    padding: 0.25rem 0.4rem !important;
    font-size: 0.68rem;
    min-height: 28px !important;
    border-radius: 16px !important;
  }
  .pill-content { font-size: 0.72rem; }
  .pill-amount { font-size: 0.68rem; }

  /* Stats */
  .modern-stats .stats-header { padding: 0.5rem; }
  .modern-stats .stats-header h3 { font-size: 0.9rem; }
  .stats-grid { padding: 0.5rem !important; }
  .stat-item {
    padding: 0.5rem 0;
    font-size: 0.8rem;
  }

  /* Table canaux revenus */
  #canaux-revenus-table { font-size: 0.7rem; }
  #canaux-revenus-table th,
  #canaux-revenus-table td { padding: 0.35rem 0.2rem; }

  /* Google Ads section */
  #google-ads-analytics { font-size: 0.85rem; }

  /* ============================
     DEPENSES - Compact
     ============================ */
  .depenses-header {
    flex-direction: column !important;
    gap: 0.5rem !important;
  }
  .depenses-header h2 { font-size: 1rem; text-align: center; }

  /* Filtres en 2 colonnes */
  .depenses-actions-row {
    flex-direction: column !important;
    gap: 0.4rem !important;
  }
  .depenses-filters {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 0.25rem !important;
    align-items: flex-end !important;
  }
  .depenses-filters .filter-group label {
    display: none !important;
  }
  .depenses-filters .filter-group {
    flex: 1;
    min-width: 0;
  }
  .depenses-filters select {
    width: 100% !important;
    font-size: 0.7rem;
    padding: 0.3rem 0.2rem;
    min-height: 34px;
  }
  .depenses-filters > button {
    font-size: 0.65rem;
    padding: 0.3rem 0.5rem;
    white-space: nowrap;
    min-height: 34px;
  }
  /* Compteur resultats */
  #depenses-results-count {
    margin-left: 0 !important;
    text-align: center;
    grid-column: 1 / -1;
  }
  #depenses-search {
    width: 100% !important;
    max-width: none !important;
  }

  /* Resume des depenses compact */
  .depenses-summary { padding: 0.6rem; }
  .depenses-summary h3 { font-size: 0.95rem; }
  .resume-total { font-size: 1rem; }
  .resume-categories {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.3rem !important;
  }
  .resume-item { font-size: 0.8rem; padding: 0.3rem; }

  /* Table depenses -> Cards */
  #depenses-table thead { display: none; }
  #depenses-table tbody tr {
    display: block;
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-bottom: 0.5rem;
    padding: 0.6rem;
    border-left: 3px solid var(--rose-accent);
  }
  #depenses-table tbody tr.depense-auto {
    border-left-color: var(--beige-dore);
  }
  #depenses-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.15rem 0;
    border: none;
    font-size: 0.8rem;
  }
  #depenses-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.72rem;
    flex-shrink: 0;
    margin-right: 0.5rem;
  }
  /* Cacher fournisseur et notes si vides */
  #depenses-table tbody td[data-label="Fournisseur"],
  #depenses-table tbody td[data-label="Notes"] {
    display: none;
  }
  /* Actions en ligne */
  #depenses-table tbody td[data-label="Actions"] {
    justify-content: flex-end;
    gap: 0.3rem;
    padding-top: 0.3rem;
    margin-top: 0.15rem;
    border-top: 1px solid #f0f0f0;
  }
  #depenses-table tbody td[data-label="Actions"]::before { display: none; }
  #depenses-table tbody td[data-label="Actions"] .depenses-actions {
    display: flex !important;
    flex-direction: row !important;
    gap: 0.3rem;
  }
  #depenses-table tbody td[data-label="Actions"] button {
    min-height: 34px;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }

  /* ============================
     MODALS - Full width mobile
     ============================ */
  .modal {
    width: 98% !important;
    max-width: none !important;
    max-height: 95vh !important;
    margin: 0.5rem !important;
    border-radius: 10px !important;
  }
  .modal-content { padding: 0.75rem !important; }
  .modal h2, .modal h3 { font-size: 1rem; }
  .form-row { grid-template-columns: 1fr !important; }

  /* Parametres modal - grille 1 colonne */
  .parametres-grid {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }
  .parametres-card {
    padding: 0.75rem !important;
  }

  /* ============================
     KPI CUSTOMIZATION
     ============================ */
  .kpi-controls {
    opacity: 1 !important;
    position: relative !important;
    top: auto !important;
    right: auto !important;
    justify-content: center;
    margin-top: 0.3rem;
  }
}

/* ===============================================
   TRES PETIT MOBILE (max-width: 480px)
   =============================================== */
@media (max-width: 480px) {
  .app-logo { max-height: 32px; max-width: 90px; }
  .tab-content { padding: 0.4rem; }

  .kpis-grid { gap: 0.35rem !important; }
  .kpi-card { padding: 0.5rem; }
  .kpi-label { font-size: 0.65rem; }
  .kpi-value { font-size: 0.9rem; }

  .calendar-day { min-height: 40px; }
  .calendar-rdv { width: 6px; height: 6px; }

  .filter-pills { grid-template-columns: 1fr !important; }

  .depenses-filters { grid-template-columns: 1fr !important; }
  .resume-categories { grid-template-columns: 1fr !important; }

  .bon-cadeau-actions { flex-direction: column; }
  .bon-cadeau-actions button { width: 100%; }
}
