/* ============================================================
   LE GRIMOIRE BUDGÉTAIRE - STYLES MOBILE FIRST
   Version 6 - Avec cagnottes Amazon/Steam et personnalisations
   ============================================================ */

:root {
  /* Palette "grimoire" v2 — violet/or sombre, alignée sur les maquettes Claude Design */
  --bg: #15101d;
  --bg-elevated: #1c1628;
  --surface: #201a2e;
  --surface-hover: #281f39;
  --border: rgba(201,162,75,0.16);
  --border-strong: rgba(201,162,75,0.34);
  --divider: rgba(255,255,255,0.07);
  --text: #f3ead9;
  --text-secondary: #b6a8c9;
  --text-tertiary: #7d6f94;
  --gold: #c9a24b;
  --gold-hover: #ddb85f;
  --gold-soft: rgba(201,162,75,0.13);
  --green: #7fae7a;
  --green-soft: rgba(127,174,122,0.15);
  --red: #c1596a;
  --red-soft: rgba(193,89,106,0.15);
  --amber: #d99a3c;
  --amber-soft: rgba(217,154,60,0.15);
  --violet: #9384cf;
  --violet-soft: rgba(147,132,207,0.15);
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Manrope', system-ui, sans-serif;
  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 20px;
  --max-width: 1100px;        /* Largeur max des contenus */

  /* Alias vers l'ancien nommage, gardés pour ne pas casser les styles existants */
  --parchment: var(--text);
  --parchment-dim: var(--text-secondary);
  --ink: var(--bg);
  --wine: var(--red);
  --gold-bright: var(--gold-hover);
  --green-mana: var(--green);
  --red-blood: var(--red);
  --shadow: rgba(8, 4, 14, 0.6); /* Ombre */

  /* Couleurs spécifiques pour les cagnottes */
  --amazon-color: #ff9900;    /* Orange Amazon */
  --steam-color: #66c0ff;     /* Bleu Steam */
}

/* ============================================================
   BASE MOBILE (par défaut - Mobile First)
   ============================================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Les maquettes stylent des <a>/<span> (jamais de bordure ni fond navigateur par défaut).
   L'app utilise de vrais <button> pour .navtab/.chip/.segmented-opt/.icon-btn/.btn* (gestion
   JS des clics) : sans ce reset, chaque navigateur ajoute sa propre bordure/fond de bouton
   par-dessus le design system, d'où le cadre visible autour des onglets par ex. */
button {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  padding: 0;
  margin: 0;
}

body {
  /* Fond complexe avec dégradés et motifs */
  background:
    radial-gradient(ellipse at 20% 10%, rgba(201,162,75,0.10), transparent 55%),
    radial-gradient(ellipse at 85% 90%, rgba(193,89,106,0.14), transparent 50%),
    repeating-linear-gradient(0deg,
      rgba(0,0,0,0.02) 0px,
      rgba(0,0,0,0.02) 1px,
      transparent 1px,
      transparent 3px
    ),
    linear-gradient(160deg, #15101d 0%, #1c1628 45%, #120d19 100%);
  
  background-attachment: fixed;
  color: var(--parchment);
  font-family: 'Manrope', serif;
  min-height: 100vh;
  padding: 18px 14px 70px;
}

/* ============================================================
   BARRE SUPÉRIEURE — .topnav/.brand/.navtabs/.navtab/.nav-actions/.icon-btn/
   .dot-badge viennent tous de theme-tokens.css (design system partagé des
   maquettes Claude Design, chargé avant ce fichier). Uniquement les ajouts
   nécessaires côté app ici : position du panneau d'alertes + repli mobile.
   ============================================================ */
/* La maquette Claude Design est un canvas fixe de 1440px : les 12 onglets y
   tiennent toujours. Dans une vraie fenêtre plus étroite, .navtabs (déjà en
   overflow-x:auto côté theme-tokens.css) doit défiler au lieu de comprimer
   les onglets — sans flex-shrink:0 chaque .navtab se tasse au lieu de sortir
   du cadre, ce qui coupait "Réglages" et écrasait la cloche/déconnexion. */
.brand,
.nav-actions {
  flex-shrink: 0;
}

.navtab {
  flex-shrink: 0;
}

/* theme-tokens.css masque la scrollbar de .navtabs (pensé pour un canvas de
   maquette figé) ; dans l'app réelle on la laisse visible, fine, pour que le
   défilement horizontal soit repérable quand tous les onglets ne tiennent pas. */
.navtabs {
  scrollbar-width: thin;
}

.navtabs::-webkit-scrollbar {
  display: block;
  height: 4px;
}

.navtabs::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

.nav-actions {
  position: relative;
}

.header-alerts-dropdown {
  display: none;
  position: absolute;
  top: 46px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 24px);
  padding: 0;
  overflow: hidden;
  box-shadow: 0 12px 30px var(--shadow);
  z-index: 950;
  text-align: left;
}

.header-alerts-dropdown.open {
  display: block;
}

.header-alerts-dropdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.header-alerts-dropdown-head .section-title {
  margin: 0;
}

.alerts-mark-read-link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 11.5px;
  color: var(--gold);
  font-family: var(--font-body);
}

.alerts-mark-read-link:hover {
  color: var(--gold-hover);
}

.header-alerts-dropdown-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: 460px;
  overflow: auto;
}

.header-alerts-group-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  font-weight: 700;
  margin: 6px 0 2px;
}

.header-alerts-group-label:first-child {
  margin-top: 0;
}

.header-alerts-dropdown-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  text-align: center;
}

@media (max-width: 600px) {
  .topnav {
    height: auto;
    padding: 10px 14px;
    gap: 12px;
  }

  .brand span {
    display: none;
  }

  .navtab {
    padding: 8px 10px;
    font-size: 0.78rem;
  }
}

.tab-panel {
  display: none;
  margin: 0 auto 20px;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Sous-onglets de mois (Revenus / Dépenses) : .tab-row-sub + .chip viennent de theme-tokens.css,
   mais .tab-row-sub fait flex-wrap par défaut — avec beaucoup de mois ça devient une pile
   illisible. Ici on défile à l'horizontale à la place (même principe que .navtabs). */
#revenus-month-tabs,
#depenses-month-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 6px;
}

#revenus-month-tabs::-webkit-scrollbar,
#depenses-month-tabs::-webkit-scrollbar {
  height: 4px;
}

#revenus-month-tabs::-webkit-scrollbar-thumb,
#depenses-month-tabs::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

#revenus-month-tabs .chip,
#depenses-month-tabs .chip {
  flex-shrink: 0;
}

.month-tab-current {
  color: var(--green);
}

/* Cartes de résumé du tableau de bord : .kpi-grid/.kpi-card/.kpi-label/.kpi-value
   (+ .positive/.negative) viennent de theme-tokens.css. */

/* ============================================================
   BARRE DE DÉFILEMENT PERSONNALISÉE
   ============================================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gold-soft);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
  border: 1px solid var(--gold-soft);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

::-webkit-scrollbar-thumb:active {
  background: var(--gold-bright);
}

/* ============================================================
   LAYOUT (Formulaire + Graphique)
   ============================================================ */
.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 0 auto 16px;
}

.layout .panel {
  margin: 0;
}

/* ============================================================
   FORMULAIRE
   ============================================================ */
.full-width {
  width: 100%;
}

/* Toggle Dépense/Revenu : .segmented/.segmented-opt viennent de theme-tokens.css */

/* Champs de formulaire standard */
input {
  width: 100%;
  background: rgba(243,234,217,0.06);
  border: 1px solid rgba(201,162,75,0.35);
  color: var(--parchment);
  padding: 10px;
  border-radius: 5px;
  font-family: 'Manrope', serif;
  font-size: 0.95rem;
}

input:focus {
  outline: none;
  border-color: var(--gold-bright);
}

/* ============================================================
   MENUS DÉROULANTS PERSONNALISÉS
   ============================================================ */
select {
  width: 100%;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 10px 35px 10px 12px;
  border-radius: 5px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  /* Flèche dorée personnalisée */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ddb85f' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

select:focus {
  outline: none;
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 2px rgba(221, 184, 95, 0.2);
}

/* Options du menu déroulant */
select option {
  background-color: var(--bg-elevated);
  color: var(--text);
  padding: 8px 12px;
  font-size: 0.95rem;
}

select option:hover {
  background-color: var(--surface-hover);
}

select option:checked {
  background-color: var(--gold-soft);
  color: var(--gold-bright);
}

/* Libellés des champs spéciaux */
.incident-date-wrap label,
.recurrence-wrap label,
.pending-wrap label,
.mixed-payment-wrap label {
  display: block;
  font-size: 0.8rem;
  color: var(--red-blood);
  margin-bottom: 3px;
  font-style: italic;
}

.mixed-payment-wrap label {
  color: var(--gold-bright);
}

.mixed-payment-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.recurrence-wrap label {
  color: var(--gold-bright);
}

.pending-wrap label {
  color: var(--gold-bright);
}

/* Champs pour les crédits */
.credit-fields-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.credit-fields-wrap label {
  display: block;
  font-size: 0.8rem;
  color: var(--gold-bright);
  margin-bottom: 3px;
}

.credit-echeances-info {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  color: var(--parchment-dim);
  font-style: italic;
  margin: 2px 0 0;
}

/* Bouton principal (style "sceau") */
/* ============================================================
   BOUTONS AMÉLIORÉS
   ============================================================ */
input[type="submit"],
button[type="submit"],
button[type="button"] {
  transition: all 0.2s ease;
}

/* ============================================================
   LISTES DE TRANSACTIONS
   ============================================================ */
.tx-meta {
  color: var(--parchment-dim);
  font-size: 0.8rem;
  font-style: italic;
}

.tx-amount {
  font-weight: bold;
  font-size: 1rem;
}

.tx-amount.pos {
  color: var(--green-mana);
}

.tx-amount.neg {
  color: var(--red-blood);
}

.tx-actions button {
  background: none;
  border: none;
  color: rgba(217,200,159,0.5);
  padding: 4px;
  cursor: pointer;
}

.tx-actions button:hover {
  color: var(--red-blood);
}

/* ============================================================
   GESTION DES CATÉGORIES & SOUS-CATÉGORIES
   Ligne plate par catégorie (maquette Categories.html) : pastille de couleur,
   nom, sous-catégories en texte, actions modifier/supprimer.
   ============================================================ */
.category-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--divider);
}

.category-row:last-child {
  border-bottom: none;
}

.category-row-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.category-row-body {
  flex: 1;
  min-width: 0;
}

.category-row-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.category-row-sub {
  font-size: 11.5px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.category-row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.category-row-actions .icon-btn {
  width: 32px;
  height: 32px;
}

/* Chips de sous-catégories (.chip officielle), utilisés dans la modale "Modifier la catégorie" */
.subcategory-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip .subcat-remove {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font-size: 0.95rem;
  line-height: 1;
}

.chip .subcat-remove:hover {
  color: var(--red);
}

.add-subcategory-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.add-subcategory-form input {
  flex: 1;
}

/* ============================================================
   ÉPARGNE (maquette Epargne.html)
   ============================================================ */
.epargne-row {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.epargne-col-main {
  flex: 1;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.epargne-col-history {
  flex: 1.4;
  min-width: 320px;
}

.savings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.savings-balance {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  margin-top: 10px;
}

/* ============================================================
   AMÉLIORATIONS POUR TABLETTE (768px et +)
   ============================================================ */
@media (min-width: 768px) {
  body {
    padding: 25px 20px 60px;
  }

  .panel {
    padding: 20px;
  }

  .panel h2 {
    font-size: 1.1rem;
  }

  .layout {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 20px;
  }

  .form-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .overdraft-nums {
    flex-direction: row;
    justify-content: space-between;
  }

  .tx-item {
    flex-wrap: nowrap;
    gap: 0;
  }

  .tx-info {
    min-width: auto;
  }

  .tx-meta {
    font-size: 0.85rem;
  }

  .credit-fields-wrap {
    grid-template-columns: 1fr 1fr;
  }

  #tab-sceaux .form-grid {
    grid-template-columns: 2fr 1fr;
  }
}

/* ============================================================
   AMÉLIORATIONS POUR DESKTOP (1024px et +)
   ============================================================ */
@media (min-width: 1024px) {
  body {
    padding: 30px 25px 70px;
  }

  .topnav {
    padding: 10px 18px;
  }

  .brand {
    font-size: 1.05rem;
  }

  .panel {
    padding: 22px;
    max-width: var(--max-width);
    box-shadow: 0 10px 30px var(--shadow);
  }

  .panel h2 {
    font-size: 1.15rem;
  }

  .layout {
    gap: 22px;
    max-width: var(--max-width);
    margin: 0 auto 22px;
  }

  .form-grid {
    gap: 12px;
  }

  input, select {
    padding: 11px;
    font-size: 1rem;
    border-radius: 6px;
  }

  .btn-seal {
    padding: 13px;
    font-size: 0.92rem;
  }

  .tx-list {
    max-height: 460px;
  }

  .tx-item {
    padding: 11px 6px;
  }

  .tx-label {
    font-size: 1.05rem;
  }

  .tx-meta {
    font-size: 0.86rem;
  }

  .tx-amount {
    font-size: 1.1rem;
  }

  .chart-container {
    height: 280px;
  }

  .projection-result h3 {
    font-size: 1.15rem;
  }

  .projection-result p {
    font-size: 1rem;
  }

  .projection-result li {
    font-size: 0.95rem;
  }

  .credit-projection h4 {
    font-size: 1rem;
  }

  .credit-projection p {
    font-size: 0.95rem;
  }

  .projection-summary h4,
  .projection-summary p {
    font-size: 0.95rem;
  }

}

/* ============================================================
   AMÉLIORATIONS POUR GRANDS ÉCRANS (1200px et +)
   ============================================================ */
@media (min-width: 1200px) {
  body {
    padding: 40px 48px 80px;
  }

  .layout {
    gap: 22px;
    margin: 0 auto 22px;
  }

  .overdraft-box {
    gap: 8px;
  }

  .overdraft-bar-bg {
    height: 12px;
    border-radius: 6px;
  }

  .overdraft-nums {
    font-size: 0.88rem;
  }

  .overdraft-summary {
    font-size: 0.95rem;
    margin-top: 4px;
  }

  .wallets-list {
    gap: 16px;
  }

  .wallets-history-list {
    max-height: 350px;
  }
}

/* ============================================================
   COMPOSANTS TRANSVERSES — Toasts
   Remplacent les alert() natifs. Voir showToast() dans app.js.
   ============================================================ */
.toast-container {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  width: calc(100% - 28px);
  max-width: 420px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-s);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.88rem;
  padding: 12px 14px;
  box-shadow: 0 8px 24px var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.toast-success {
  border-left-color: var(--green);
}

.toast.toast-error {
  border-left-color: var(--red);
}

.toast.toast-info {
  border-left-color: var(--gold);
}

/* ============================================================
   COMPOSANTS TRANSVERSES — Modales
   Remplacent confirm()/prompt() natifs. Voir confirmModal()/promptModal() dans app.js.
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 4, 14, 0.68);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1100;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.modal-overlay.visible {
  opacity: 1;
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-l);
  padding: 20px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 20px 50px var(--shadow);
  transform: translateY(6px);
  transition: transform 0.18s ease;
}

.modal-overlay.visible .modal-box {
  transform: translateY(0);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--gold);
  margin-bottom: 10px;
}

.modal-body {
  color: var(--text);
  font-size: 0.92rem;
  margin-bottom: 12px;
}

.modal-input {
  width: 100%;
  margin-bottom: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal-btn {
  border: none;
  border-radius: var(--radius-s);
  padding: 9px 16px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.modal-btn:hover {
  filter: brightness(1.1);
}

.modal-btn:active {
  transform: scale(0.97);
}

.modal-btn-cancel {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}

.modal-btn-primary {
  background: linear-gradient(160deg, var(--gold-hover), var(--gold));
  color: var(--bg);
}

.modal-btn-danger {
  background: var(--red);
  color: var(--text);
}

/* Badges (.badge, .badge-red/amber/green/violet/gold) et barres de progression
   (.progress > .progress-bar[.green|.amber|.red]) viennent de theme-tokens.css. */

/* .modal-backdrop/.modal (theme-tokens.css) sont pensés pour un canvas figé (position:absolute,
   toujours affiché). Ici il faut un vrai modal plein écran qu'on affiche/masque au clic. */
.modal-backdrop {
  position: fixed;
  z-index: 1150;
  display: none;
}
.modal-backdrop.open {
  display: flex;
}

/* ============================================================
   EN-TÊTE DE PAGE (titre + sous-titre, action à droite) — un par onglet
   ============================================================ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text);
  margin-bottom: 2px;
}

.page-sub {
  font-size: 0.82rem;
  color: var(--text-tertiary);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 10px;
}

@media (min-width: 768px) {
  .page-title {
    font-size: 1.7rem;
  }
}

/* Rangée de cartes à ratio libre (Réglages) — reprend le flex row à plat des
   maquettes (gap:20px, cartes flex:1) avec un flex-wrap pour rester utilisable
   en mobile, ce que le canvas de maquette fixe ne montre pas. */
.settings-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.category-manager-grid {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.empty-note {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  font-style: italic;
}

.see-all-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-tertiary);
  text-decoration: none;
}

.see-all-link:hover {
  color: var(--gold);
}

.dashboard-row {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.dashboard-alerts-col {
  flex: 1.1;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dashboard-chart-col {
  flex: 1;
  min-width: 280px;
}

/* ============================================================
   GRAPHIQUE EN ANNEAU (Tableau de bord — dépenses par catégorie)
   ============================================================ */
.donut-chart-row {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.chart-container-donut {
  position: relative;
  width: 150px;
  height: 150px;
  flex-shrink: 0;
}

.chart-legend {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text);
}

.chart-legend-item .chart-legend-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chart-legend-item .chart-legend-amount {
  color: var(--text-tertiary);
}

/* ============================================================
   MINI GRAPHIQUE EN BARRES (historique d'un montant variable)
   ============================================================ */
/* ============================================================
   ALERTES — .floating-add, .alert-row, .icon-circle, .btn/.btn-ghost/.btn-sm
   viennent de theme-tokens.css ; seuls le contenu texte de chaque alerte
   (sans équivalent officiel) et la position du "+" restent définis ici.
   ============================================================ */
.floating-add {
  z-index: 900;
}

.floating-add i {
  width: 24px;
  height: 24px;
}

.alert-body {
  flex: 1;
  min-width: 0;
}

.alert-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.alert-detail {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* ============================================================
   REVENUS / DÉPENSES — recherche, filtres, pagination
   ============================================================ */
.tx-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.tx-filters select {
  width: auto;
}

.tx-list-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.tx-total-row {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 12px;
}

.tx-total-row span:first-child {
  font-size: 13px;
  color: var(--text-secondary);
}

.tx-total-amount {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
}

.tx-total-amount.positive {
  color: var(--green);
}

.tx-total-amount.negative {
  color: var(--red);
}

.tx-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 0;
}

/* ============================================================
   RÉCURRENCES — tableau
   ============================================================ */
.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.data-table th,
.data-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--divider);
  white-space: nowrap;
}

.data-table th {
  color: var(--text-tertiary);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.data-table td:last-child {
  text-align: right;
}

.data-table button {
  background: none;
  border: none;
  color: var(--parchment-dim);
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.data-table button:hover {
  color: var(--red);
}

@media (min-width: 768px) {
  .tx-filters {
    flex-direction: row;
  }

  .tx-filters input[type="search"] {
    flex: 2;
  }

  .tx-filters select {
    flex: 1;
  }
}