/* ============================================================
   SOZANI — finances.css v1.1 (Syntaxe stricte - Fusion)
   ============================================================ */
#finances-page { width: 100%; padding-bottom: 80px; }

#finances-page .fin-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }

/* [FUSION] Sélecteurs rétablis et validés */
#finances-page .fin-kpi {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  padding: 14px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 4px solid var(--primary, #1A6B3C);
  min-width: 0;
}

#finances-page .fin-kpi-label {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

#finances-page .fin-kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.1;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#finances-page .fin-kpi.bleu { border-left-color: #0D47A1; }
#finances-page .fin-kpi.rouge { border-left-color: #B71C1C; }
#finances-page .fin-kpi.orange { border-left-color: #E65100; }

#finances-page .sub-tabs { display: flex; gap: 4px; background: #f0f0f0; border-radius: 10px; padding: 4px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
#finances-page .sub-tab { flex: 0 0 auto; min-width: 90px; padding: 8px 10px; font-size: 12px; font-weight: 500; border: none; background: transparent; border-radius: 7px; color: #666; cursor: pointer; white-space: nowrap; transition: background 0.15s, color 0.15s; }
#finances-page .sub-tab.active { background: #fff; color: #1a6b3c; font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,0.10); }

#finances-page .fin-card { background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.12); padding: 16px; margin-bottom: 12px; }
#finances-page .fin-list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #E0E0E0; }
#finances-page .fin-list-item:last-child { border-bottom: none; }
#finances-page .fin-avatar { font-size: 20px; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; background: #f5f5f5; border-radius: 50%; flex-shrink: 0; }
#finances-page .fin-body { flex: 1; min-width: 0; }
#finances-page .fin-title { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#finances-page .fin-subtitle { font-size: 0.8rem; color: #616161; overflow-wrap: anywhere; }

#finances-page .fin-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
  vertical-align: middle;
}
#finances-page .fin-badge.vert { background: #e6f4ea; color: #2e7d32; }
#finances-page .fin-badge.bleu { background: #e3f2fd; color: #1565c0; }
#finances-page .fin-badge.rouge { background: #fce4ec; color: #c62828; }
#finances-page .fin-badge.orange { background: #fff3e0; color: #e65100; }
#finances-page .fin-badge.gris { background: #f5f5f5; color: #555; }

#finances-page .fin-empty-state {
  padding: 32px 16px;
  text-align: center;
  color: #999;
}
#finances-page .fin-empty-state p { font-size: 15px; margin-bottom: 4px; }
#finances-page .fin-empty-state small { font-size: 12px; }

#finances-page .fin-form-group { margin-bottom: 14px; }
#finances-page .fin-form-label { display: block; font-size: 12px; font-weight: 600; color: #555; margin: 12px 0 4px; }
#finances-page .fin-form-input, #finances-page .fin-form-select, #finances-page .fin-form-textarea { width: 100%; padding: 10px 12px; border: 1.5px solid #ddd; border-radius: 8px; font-size: 16px; background: #fff; box-sizing: border-box; }

#finances-page .fin-form-input:focus,
#finances-page .fin-form-select:focus,
#finances-page .fin-form-textarea:focus {
  outline: none;
  border-color: var(--primary, #1A6B3C);
  box-shadow: 0 0 0 3px rgba(26, 107, 60, 0.12);
}

#finances-page .fin-btn-row { display: flex; gap: 8px; margin-top: 16px; }
#finances-page .fin-btn { padding: 11px 16px; border-radius: 9px; font-size: 14px; font-weight: 600; border: none; cursor: pointer; }
#finances-page .fin-btn-primary { background: var(--primary, #1A6B3C); color: #fff; }
#finances-page .fin-btn-secondary { background: #f0f0f0; color: #333; }
#finances-page .fin-btn-block { width: 100%; display: block; text-align: center; }
#finances-page .fin-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.fin-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(20px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
}
.fin-modal-sheet { background: #ffffff; width: 100%; max-width: 450px; border-radius: 16px; padding: 24px; max-height: 85vh; overflow-y: auto; box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
.fin-detail-grid { display: grid; grid-template-columns: minmax(90px, 35%) minmax(0, 1fr); gap: 8px 12px; font-size: 14px; overflow-wrap: anywhere; }
.fin-detail-label { color: #888; font-size: 12px; align-self: center; }

/* ============================================================
   RESPONSIVE & ACCESSIBILITÉ
   ============================================================ */

@media (max-width: 420px) {
  #finances-page .fin-btn-row {
    flex-direction: column;
  }

  #finances-page .fin-btn-row .fin-btn {
    width: 100%;
  }

  .fin-modal-sheet {
    padding: 20px;
    border-radius: 14px;
  }
}

@media (max-width: 360px) {
  #finances-page .fin-kpis {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  #finances-page *,
  .fin-modal-overlay *,
  .fin-modal-sheet * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

