/* =============================================
   CHEZ JOJO BORLETTE - Feuille de styles principale
   Couleurs: Jaune Abricot | Bleu Ardoise | Blanc
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;800&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --abricot:       #F4A340;
  --abricot-light: #FDC97A;
  --abricot-dark:  #D4851C;
  --abricot-pale:  #FEF3E2;
  --bleu:          #2C4A6E;
  --bleu-mid:      #3D6494;
  --bleu-light:    #5882B5;
  --bleu-pale:     #EBF0F8;
  --blanc:         #FFFFFF;
  --gris-clair:    #F8F9FB;
  --gris-bord:     #E2E8F0;
  --texte:         #1A2B42;
  --texte-doux:    #5A6B80;
  --rouge:         #E53E3E;
  --rouge-pale:    #FFF5F5;
  --vert:          #2E8B57;
  --vert-pale:     #F0FFF4;
  --orange:        #DD6B20;
  --accent:        #7C3AED; /* nouveau accent violet */
  --accent-light:  #F3E8FF;
  --accent-dark:   #5B21B6;
  --shadow-sm:     0 1px 3px rgba(44,74,110,0.08), 0 1px 2px rgba(44,74,110,0.04);
  --shadow-md:     0 4px 12px rgba(44,74,110,0.10), 0 2px 6px rgba(44,74,110,0.06);
  --shadow-lg:     0 8px 24px rgba(44,74,110,0.14), 0 4px 12px rgba(44,74,110,0.08);
  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     16px;
  --sidebar-w:     260px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--gris-clair);
  color: var(--texte);
  min-height: 100vh;
}

/* Global bold style: prefer stronger weights for clearer emphasis */
body { font-weight: 600; }
strong, b { font-weight: 800; }

/* Headings and key UI elements bolder */
.section-title { font-weight: 800; }
.card-title { font-weight: 800; }
.topbar-title { font-weight: 800; }
.nav-item { font-weight: 700; }
.badge { font-weight: 800; }
.form-label { font-weight: 800; }
.modal .modal-title { font-weight: 800; }
.btn { font-weight: 800; }

/* Table headers stronger */
thead th { font-weight: 800; }

/* Ensure stat values remain prominent */
.stat-value { font-weight: 900; }

/* Typographie améliorée: meilleure lisibilité et hiérarchie */
body { line-height: 1.55; }
.section-title { font-size: 1.6rem; letter-spacing: -0.6px; }
.topbar-title { font-size: 1.12rem; font-weight: 700; }
.card-title { font-size: 1rem; font-weight: 700; }
.modal .modal-title { font-size: 1.05rem; font-weight: 800; color: var(--bleu); }
.form-label { font-size: .86rem; font-weight: 700; }

/* Stat values: reduced for better layout */
.stat-value { font-size: 1.4rem; }
@media (max-width: 768px) { .stat-value { font-size: 1.1rem; } }
@media (min-width: 1200px) { .stat-value { font-size: 1.9rem; } }

/* Slightly increase spacing in cards for airy feel */
.card { padding: 0.35rem; }
.card .card-body { padding: 1.6rem; }

/* Improve contrast for badges and small text */
.stat-sub, .form-control::placeholder { color: var(--texte-doux); }

/* ===================== LOGIN PAGE ===================== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bleu) 0%, var(--bleu-mid) 50%, var(--bleu-light) 100%);
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content:'';
  position:absolute; inset:0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.login-card {
  background: var(--blanc);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2.8rem;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: fadeUp .5s ease;
}
.login-logo {
  text-align: center;
  margin-bottom: 1.8rem;
}
.login-logo .logo-icon {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--abricot), var(--abricot-dark));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; margin: 0 auto 1rem;
  box-shadow: 0 8px 24px rgba(244,163,64,.4);
}
.login-logo h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem; font-weight: 800;
  color: var(--bleu);
  line-height: 1.2;
}
.login-logo p { color: var(--texte-doux); font-size: .85rem; margin-top:.3rem; }

/* ===================== LAYOUT ===================== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--bleu) 0%, #1E3554 100%);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .3s ease;
  box-shadow: 4px 0 20px rgba(0,0,0,.15);
}
.sidebar-brand {
  padding: 1.5rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-brand .brand-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--abricot), var(--abricot-dark));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; margin-bottom: .6rem;
  box-shadow: 0 4px 12px rgba(244,163,64,.4);
}
.sidebar-brand h2 {
  font-family: 'Playfair Display', serif;
  color: var(--blanc);
  font-size: 1rem; font-weight: 700; line-height: 1.2;
}
.sidebar-brand span {
  color: var(--abricot-light);
  font-size: .7rem; text-transform: uppercase; letter-spacing: 1px;
}

.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }
.nav-section { padding: .6rem 1.2rem .3rem; }
.nav-section-label {
  color: rgba(255,255,255,.3);
  font-size: .65rem; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem 1.2rem;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  border-radius: 0;
  font-size: .88rem; font-weight: 500;
  transition: all .2s;
  cursor: pointer;
  border: none; background: none; width: 100%; text-align: left;
}
.nav-item .nav-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; flex-shrink: 0;
  background: rgba(255,255,255,.05);
  transition: all .2s;
}

/* Bootstrap icon tweaks */
.bi { vertical-align: middle; display: inline-block; }
.logo-icon .bi { font-size: 1.6rem; color: var(--blanc); }
.brand-icon .bi { font-size: 1.05rem; color: var(--blanc); }
.nav-icon .bi { font-size: 1.05rem; color: rgba(255,255,255,.9); }
.logout-link .bi { font-size: 1rem; color: rgba(255,255,255,.6); }
.nav-item:hover { color: var(--blanc); background: rgba(255,255,255,.07); }
.nav-item:hover .nav-icon { background: rgba(244,163,64,.2); }
.nav-item.active {
  color: var(--blanc);
  background: linear-gradient(90deg, rgba(244,163,64,.2), rgba(244,163,64,.05));
  border-right: 3px solid var(--abricot);
}
.nav-item.active .nav-icon {
  background: linear-gradient(135deg, var(--abricot), var(--abricot-dark));
  color: var(--blanc);
  box-shadow: 0 2px 8px rgba(244,163,64,.4);
}
.sidebar-footer {
  padding: 1rem 1.2rem;
  border-top: 1px solid rgba(255,255,255,.1);
}
.user-pill {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .8rem;
  background: rgba(255,255,255,.07);
  border-radius: var(--radius-sm);
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--abricot), var(--abricot-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; color: var(--blanc); flex-shrink: 0;
}
.user-pill-info { flex: 1; min-width: 0; }
.user-pill-name { color: var(--blanc); font-size: .8rem; font-weight: 600; truncate: ellipsis; white-space: nowrap; overflow: hidden; }
.user-pill-role { color: var(--abricot-light); font-size: .65rem; text-transform: uppercase; letter-spacing: .5px; }

/* MAIN CONTENT */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex; flex-direction: column;
  min-height: 100vh;
}
.topbar {
  background: var(--blanc);
  border-bottom: 1px solid var(--gris-bord);
  padding: 0 1.5rem;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}
.topbar-title {
  font-size: 1.05rem; font-weight: 600; color: var(--texte);
  display: flex; align-items: center; gap: .5rem;
}
.topbar-actions { display: flex; align-items: center; gap: .6rem; }

.page-content { padding: 1.5rem; flex: 1; }

/* Dashboard enhancements */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1rem;
}
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem; color: var(--bleu);
  font-weight: 700; letter-spacing: -0.5px;
}
.section-title span { color: var(--abricot-dark); }
.dashboard-report { border-radius: 14px; overflow: hidden; }
.filters-bar { display:flex; gap:1rem; align-items:end; flex-wrap:wrap; margin-bottom:1rem; }
.filters-bar .form-group { margin-bottom:0; }

/* Improve card header visuals for dashboard */
.card-header .card-title i { margin-right: .5rem; color: var(--abricot-dark); }

/* Tighter stat card icons */
.stat-icon i { font-size: 1.15rem; color: var(--texte); }


/* ===================== CARDS ===================== */
.card {
  background: var(--blanc);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gris-bord);
}
.card-header {
  padding: 1.1rem 1.3rem;
  border-bottom: 1px solid var(--gris-bord);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title {
  font-size: .9rem; font-weight: 600; color: var(--texte);
  display: flex; align-items: center; gap: .5rem;
}
.card-body { padding: 1.3rem; }

/* Chart containers: ensure visible, consistent heights */
.card .card-body .chart-wrap { height: 260px; position: relative; }
.card .card-body canvas { width: 100% !important; height: 100% !important; display: block; }

/* Make stat cards and cards more compact on small screens */
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .card .card-body { padding: 1rem; }
  .section-title { font-size: 1.15rem; }
}

/* Specific chart sizes and visual polish */
.chart-evolution-wrap { height: 360px; }
.chart-groupes-wrap { height: 320px; }
.chart-pie-wrap { height: 260px; }
.chart-wrap { background: linear-gradient(180deg, rgba(255,255,255,0.6), rgba(255,255,255,0.85)); border-radius: 10px; padding: 8px; box-shadow: 0 6px 20px rgba(26,43,66,0.06); }
.card .card-body .chart-wrap canvas { border-radius: 6px; }

/* Group list style in dashboard */
#group-list { display:flex;flex-direction:column;gap:.5rem; }
#group-list > div { padding: .35rem 0; }
#group-list .group-name { font-weight:700; font-size:0.95rem; }

/* Currency cells for tables */
.currency-cell { text-align:right; white-space:nowrap; }
.table-wrap table td.currency-cell { font-weight:700; }

/* Responsive layout for group performance area */
.group-performance-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1rem;
}

/* Group indicators */
.group-dot { width:12px;height:12px;border-radius:50%;display:inline-block;margin-right:.5rem;vertical-align:middle;box-shadow:0 2px 6px rgba(0,0,0,0.06); }
.group-name { vertical-align:middle; font-weight:700; }
.group-pill { display:inline-flex;align-items:center;gap:.5rem;padding:.28rem .5rem;border-radius:999px;color:#fff;font-weight:700;font-size:.9rem; }
@media (max-width: 900px) {
  .group-performance-grid { grid-template-columns: 1fr; }
  #chart-groupes { height: 320px !important; }
}

@media (max-width: 768px) {
  .chart-evolution-wrap { height: 260px; }
  .chart-groupes-wrap { height: 240px; }
}

/* ===================== FOLDERS / MONTHS UI ===================== */
.months-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:.8rem; }
.month-card {
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  border: 1px solid rgba(26,43,66,0.06);
  border-radius: 12px;
  padding: 16px;
  display:flex;flex-direction:column;gap:.6rem;
  transition: transform .18s ease, box-shadow .18s ease;
  min-height:110px;
}
.month-card:hover { transform: translateY(-6px); box-shadow: 0 16px 36px rgba(26,43,66,0.12); }
.month-icon {
  width:44px;height:44px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:1.2rem;background:linear-gradient(135deg,var(--abricot),var(--abricot-dark));color:var(--blanc);box-shadow:0 6px 18px rgba(212,133,28,0.18);
}
.month-title { font-weight:800;font-size:1rem;color:var(--texte); }
.month-sub { font-size:.85rem;color:var(--texte-doux); }
.month-actions { display:flex;gap:.5rem;width:100%; margin-top:auto; }
.month-actions .btn { flex:1; }

.days-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap:.6rem; }
.day-tile { background: #fff; border:1px solid var(--gris-bord); border-radius:10px; padding:.6rem; display:flex;flex-direction:column;align-items:center;justify-content:space-between; min-height:90px; transition:transform .14s ease, box-shadow .14s ease; }
.day-tile:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(26,43,66,0.08); }
.day-num { font-weight:800;font-size:1.05rem;color:var(--bleu); }
.day-count { font-size:.85rem;color:var(--texte-doux); }
.day-actions { display:flex;gap:.4rem;margin-top:.5rem; }

@media (max-width: 900px) {
  .month-card { padding:12px; min-height:100px; }
  .month-icon { width:40px;height:40px;font-size:1.05rem; }
  .month-title { font-size:.96rem; }
}

@media (max-width: 480px) {
  .months-grid { grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); }
  .days-grid { grid-template-columns: repeat(auto-fit, minmax(72px,1fr)); }
}

/* STAT CARDS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--blanc);
  border-radius: var(--radius);
  padding: 1.3rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gris-bord);
  display: flex; align-items: flex-start; gap: 1rem;
  transition: box-shadow .2s, transform .2s;
}
.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0,0,0,.08); }
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-icon {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
.stat-icon.abricot { background: var(--abricot-pale); }
.stat-icon.bleu    { background: var(--bleu-pale); }
.stat-icon.vert    { background: var(--vert-pale); }
.stat-icon.rouge   { background: var(--rouge-pale); }
.stat-info { flex: 1; }
.stat-label { font-size: .75rem; color: var(--texte-doux); font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-size: 1.4rem; font-weight: 800; color: var(--texte); margin-top: .15rem; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 120px; }
/* allow coloring of large stat values via balance classes */
.stat-value.balance-positive { color: #065f46; background: rgba(46,139,87,0.05); padding: .15rem .5rem; border-radius: 8px; display: inline-block; }
.stat-value.balance-negative { color: #7f1d1d; background: rgba(229,62,62,0.05); padding: .15rem .5rem; border-radius: 8px; display: inline-block; }
/* Balance visibility helpers */
.balance-positive, .balance-negative {
  display: inline-block;
  padding: .25rem .5rem;
  border-radius: 8px;
  font-weight: 800;
  font-size: 1.125rem;
  min-width: 84px;
  text-align: right;
}
.balance-positive { color: #065f46; background: rgba(46,139,87,0.06); border: 1px solid rgba(46,139,87,0.08); }
.balance-negative { color: #7f1d1d; background: rgba(229,62,62,0.06); border: 1px solid rgba(229,62,62,0.08); }
.stat-sub { font-size: .75rem; color: var(--texte-doux); margin-top: .2rem; }

/* Ensure clickable stat-card anchors don't inherit link styles */
.stat-card.clickable { text-decoration: none; color: inherit; }
.stat-card.clickable:visited { color: inherit; }

/* Tweak icon sizing to avoid line-wrapping in small widths */
.stat-icon { font-size: 1.25rem; }

/* ===================== FORMS ===================== */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-row.cols-1 { grid-template-columns: 1fr; }
.form-group { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .8rem; }
.form-label { font-size: .8rem; font-weight: 600; color: var(--texte); }
.form-control {
  padding: .75rem 1rem;
  border: 1.5px solid var(--gris-bord);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem; color: var(--texte);
  background: var(--blanc);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.form-control:focus {
  border-color: var(--bleu-mid);
  box-shadow: 0 0 0 3px rgba(61,100,148,.12);
}
select.form-control { cursor: pointer; }

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .6rem 1.15rem;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: .95rem; font-weight: 600;
  cursor: pointer; border: none;
  transition: all .2s; text-decoration: none; white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--abricot), var(--abricot-dark));
  color: var(--blanc);
  box-shadow: 0 2px 8px rgba(244,163,64,.35);
}
.btn-primary:hover { box-shadow: 0 4px 16px rgba(244,163,64,.5); transform: translateY(-1px); }
.btn-secondary {
  background: var(--bleu);
  color: var(--blanc);
  box-shadow: 0 2px 8px rgba(44,74,110,.25);
}
.btn-secondary:hover { background: var(--bleu-mid); transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--gris-bord);
  color: var(--texte-doux);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.btn-danger { background: var(--rouge); color: var(--blanc); }
.btn-danger:hover { background: #C53030; transform: translateY(-1px); }
.btn-success { background: var(--vert); color: var(--blanc); }
.btn-sm { padding: .35rem .75rem; font-size: .78rem; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: var(--radius-sm); }

/* ===================== TABLE ===================== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--gris-clair);
  color: var(--texte-doux);
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .8px;
  padding: .7rem 1rem;
  text-align: left;
  border-bottom: 2px solid var(--gris-bord);
}
tbody td {
  padding: .75rem 1rem;
  font-size: .85rem;
  border-bottom: 1px solid var(--gris-bord);
  color: var(--texte);
}
tbody tr:hover { background: var(--abricot-pale); }
tbody tr:last-child td { border-bottom: none; }

/* BADGES */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .6rem;
  border-radius: 20px;
  font-size: .72rem; font-weight: 600;
}
.badge-success { background: var(--vert-pale); color: var(--vert); }
.badge-warning { background: #FFFBEB; color: #B45309; }
.badge-danger  { background: var(--rouge-pale); color: var(--rouge); }
.badge-info    { background: var(--accent-light); color: var(--accent-dark); }

/* ===================== MODAL ===================== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(26,43,66,.5);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--blanc);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 540px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px); transition: transform .25s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--gris-bord);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title {
  font-size: 1rem; font-weight: 700; color: var(--texte);
  display: flex; align-items: center; gap: .5rem;
}
.modal-close {
  width: 30px; height: 30px;
  border: none; background: var(--gris-clair);
  border-radius: 50%; cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  color: var(--texte-doux); transition: all .15s;
}
.modal-close:hover { background: var(--rouge-pale); color: var(--rouge); }
.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gris-bord);
  display: flex; align-items: center; justify-content: flex-end; gap: .6rem;
}

/* ===================== TOAST ===================== */
.toast-container {
  position: fixed; top: 1rem; right: 1rem;
  z-index: 9999; display: flex; flex-direction: column; gap: .5rem;
}
.toast {
  background: var(--blanc);
  border-radius: var(--radius-sm);
  padding: .8rem 1.1rem;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--bleu);
  display: flex; align-items: center; gap: .6rem;
  min-width: 280px; max-width: 380px;
  font-size: .85rem; font-weight: 500;
  animation: slideIn .3s ease;
}
.toast.success { border-color: var(--vert); }
.toast.error   { border-color: var(--rouge); }
.toast.warning { border-color: var(--abricot); }

/* ===================== TABS ===================== */
.tabs { display: flex; gap: .3rem; border-bottom: 2px solid var(--gris-bord); margin-bottom: 1.2rem; }
.tab-btn {
  padding: .6rem 1.1rem;
  font-size: .85rem; font-weight: 600; color: var(--texte-doux);
  border: none; background: none; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all .2s;
}
.tab-btn.active { color: var(--accent); border-color: var(--accent); }
.tab-btn:hover:not(.active) { color: var(--texte); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ===================== MISC ===================== */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.2rem;
}
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem; font-weight: 700; color: var(--texte);
}

.section-title span { color: var(--abricot); }

.empty-state {
  text-align: center; padding: 3rem 1rem;
  color: var(--texte-doux);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: .4; }
.empty-state p { font-size: .9rem; }

.filters-bar {
  display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap;
  margin-bottom: 1.2rem;
  background: var(--blanc);
  padding: 1rem; border-radius: var(--radius);
  border: 1px solid var(--gris-bord);
  box-shadow: var(--shadow-sm);
}
.filters-bar .form-group { margin-bottom: 0; min-width: 160px; }

/* Ensure filter buttons align with inputs and have consistent sizes */
.filters-bar .btn { align-self: flex-end; height: auto; }
.filters-bar #btn-search { min-width: 110px; }
.filters-bar #btn-auto-search { min-width: 74px; padding: .45rem .7rem; }
.filters-bar .btn-sm { padding: .38rem .7rem; }

/* Active button state (used for auto-search toggle) */
.btn.active, .btn.active.btn-outline {
  background: linear-gradient(135deg, var(--abricot), var(--abricot-dark));
  color: var(--blanc);
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(212,133,28,0.18);
}


.balance-positive { color: var(--vert); font-weight: 600; }
.balance-negative { color: var(--rouge); font-weight: 600; }

/* Cash value explicit state */
.stat-value.negative { color: var(--rouge); background: rgba(229,62,62,0.04); padding: .15rem .5rem; border-radius: 8px; }
.stat-value.positive { color: var(--vert); background: rgba(46,139,87,0.04); padding: .15rem .5rem; border-radius: 8px; }

.chart-container { position: relative; }

/* ===================== ANIMATIONS ===================== */
@keyframes fadeUp { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:translateY(0); } }
@keyframes slideIn { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:translateX(0); } }
@keyframes spin { to { transform:rotate(360deg); } }

.loading-spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--gris-bord);
  border-top-color: var(--abricot);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gris-bord); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--bleu-light); }

/* RESPONSIVE */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-content { padding: 1rem; }
}

/* Responsive modal tweaks for mobile and narrow viewports */
@media (max-width: 768px) {
  .modal {
    max-width: calc(100% - 32px);
    width: auto;
    margin: 0 16px;
    border-radius: 12px;
    max-height: 92vh;
  }
  .modal-header, .modal-footer { padding: .8rem 1rem; }
  .modal-body { padding: 1rem; }
  .form-row { grid-template-columns: 1fr !important; }
  .form-row.cols-3 { grid-template-columns: 1fr !important; }
  .form-group { width: 100%; }
  .modal .modal-footer { display:flex;flex-direction:row;flex-wrap:wrap;gap:.5rem; }
  .modal .modal-footer .btn { flex: 1 1 auto; min-width: 120px; }
}

/* Slightly larger touch targets on very small screens */
@media (max-width: 480px) {
  .modal .modal-footer .btn { padding: .7rem 1rem; font-size: 1rem; }
}

/* Option: single-column modal form even on desktop for clarity */
.modal .form-row { grid-template-columns: 1fr !important; gap: .75rem; }
.modal .form-row.cols-3 { grid-template-columns: 1fr !important; }
.modal .form-group { margin-bottom: .6rem; }
.modal .form-control { width: 100%; box-sizing: border-box; }
.modal .modal-body { padding-bottom: .8rem; }

@media (min-width: 1100px) {
  /* Keep modal comfortable on wide screens but still single-column form */
  .modal { max-width: 760px; }
  .modal .modal-header, .modal .modal-footer { padding: 1rem 1.2rem; }
}
/* =========================================================
   🚀 CHEZ JOJO BORLETTE - UPGRADE UI (AJOUT FINAL)
   ========================================================= */

/* ✨ Amélioration générale hover + fluidité */
.card,
.stat-card,
.btn,
.nav-item {
  transition: all .25s ease;
}

/* 🔥 Cards plus modernes */
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0,0,0,.10);
}

/* 🔥 Stat cards plus dynamiques */
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
}

/* 🔥 Sidebar active plus visible */
.nav-item.active {
  background: linear-gradient(90deg, rgba(244,163,64,.25), rgba(244,163,64,.05));
  border-right: 4px solid var(--abricot);
}

/* ✨ Boutons plus premium */
.btn-primary {
  box-shadow: 0 4px 14px rgba(244,163,64,.35);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 24px rgba(244,163,64,.5);
}

/* 🔥 Inputs plus modernes */
.form-control:focus {
  border-color: var(--abricot);
  box-shadow: 0 0 0 4px rgba(244,163,64,.18);
}

/* ✨ Table hover plus élégant */
tbody tr:hover {
  background: linear-gradient(90deg, var(--abricot-pale), transparent);
}

/* 🔥 Scrollbar modernisée */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--bleu-light), var(--bleu));
  border-radius: 10px;
}

/* ✨ Animation légère d’entrée globale */
.page-content {
  animation: fadeUp .35s ease;
}

/* ===================== MONTH CARDS (Dossiers Mensuels) ===================== */
.month-card {
  background: linear-gradient(180deg, #ffffff, #ffffff);
  border: 1px solid var(--gris-bord);
  padding: 12px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.month-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}
.month-card .month-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: linear-gradient(135deg, var(--abricot), var(--abricot-dark));
  color: #fff;
  box-shadow: 0 8px 20px rgba(244,163,64,0.16);
  flex-shrink: 0;
}
.month-card .month-title { font-weight: 700; font-size: 1rem; color: var(--texte); }
.month-card .month-sub { color: var(--texte-doux); font-size: .9rem; }
.month-card .month-actions { display:flex; gap:.4rem; width:100%; margin-top:auto; }
.month-actions .btn { flex:1; padding:.55rem .6rem; }
.month-actions .btn-sm { padding:.38rem .6rem; }

@media (max-width: 768px) {
  #months-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* Compact day tiles for month view */
.days-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: .35rem;
}
.day-tile {
  background: var(--gris-clair);
  padding: .45rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  min-height: 56px;
  align-items: flex-start;
}
.day-num { font-weight:700; font-size:.95rem; }
.day-count { color:var(--texte-doux); font-size:.78rem; }
.day-actions { margin-top:auto; display:flex; gap:.35rem; width:100%; }
.day-actions .btn { padding:.28rem .5rem; font-size:.78rem; }
.tx-detail { display:flex;flex-direction:column;gap:.9rem; }
.tx-summary { display:grid; grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); gap:.8rem; }
.tx-metric { background:var(--gris-clair); border-radius:8px; padding:.8rem; }
.tx-label { font-size:.72rem; color:var(--texte-doux); text-transform:uppercase; letter-spacing:.5px; }
.tx-value { font-size:1.18rem; font-weight:800; margin-top:.22rem; }
.tx-meta { display:flex;justify-content:space-between;align-items:center;gap:1rem; }
.tx-status { }
.tx-user { color:var(--texte-doux); font-size:.92rem; }
.payments-history .payments-list { display:flex;flex-direction:column;gap:.45rem; }
.payment-row { display:flex;justify-content:space-between;align-items:center;padding:.6rem;border-radius:8px;background:var(--gris-clair); }
.payment-left { color:var(--texte-doux); }
.payment-right { font-weight:700;color:var(--vert); }
.payment-total { text-align:right;margin-top:.6rem;font-size:.95rem; }
.tx-payment .card-body .form-row { grid-template-columns: 1fr 140px 1fr; gap:.6rem; }
.hint { font-size:.82rem;color:var(--texte-doux);margin-top:.3rem; }

@media (max-width: 680px) {
  .tx-payment .card-body .form-row { grid-template-columns: 1fr; }
  .tx-meta { flex-direction:column;align-items:flex-start;gap:.4rem; }
}

@media (max-width: 480px) {
  .days-grid { grid-template-columns: repeat(3, 1fr); gap:.3rem; }
  .day-tile { min-height:48px; padding:.35rem; }
}

/* DASHBOARD REPORT CARD */
.dashboard-report .card-body { display:flex;align-items:center;justify-content:space-between;gap:1rem; }
.dashboard-report ul { margin:0; }
.dashboard-report button { white-space:nowrap; }
.dashboard-report { border-left: 4px solid rgba(244,163,64,0.12); }

/* =========================================================
   Extra polish for Borlette & Comptable
   - Zebra rows for easier scanning
   - Sticky table headers for long lists
   - Stronger currency typography with tabular numbers
   - Gradient card headers and subtle elevation
 ========================================================= */

/* Zebra stripes */
tbody tr:nth-child(odd) { background: #ffffff; }
tbody tr:nth-child(even) { background: rgba(243,246,250,0.8); }

/* Sticky headers */
thead th { position: sticky; top: 0; z-index: 10; background: linear-gradient(180deg,#ffffff,#f8fafc); }

/* Stronger currency visuals */
.currency-cell { font-size: 1.05rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.table-wrap table td { vertical-align: middle; }

/* Card header gradient for emphasis */
.card-header { background: linear-gradient(90deg, rgba(44,74,110,0.02), rgba(244,163,64,0.02)); border-bottom: 1px solid rgba(226,232,240,0.9); }
.card-header.accent { box-shadow: inset 0 -4px 12px rgba(124,58,237,0.04); }

/* Topbar tweaks for clearer brand */
.topbar { padding: 0 1.75rem; }
.topbar-title { font-size: 1.08rem; letter-spacing: 0.2px; }

/* Links and small accents use the new accent color */
a, .link { color: var(--accent); }
a:hover, .link:hover { text-decoration: underline; color: var(--accent-dark); }

/* Bigger nav for accessibility (accountant-friendly) */
.nav-item { padding: .85rem 1.3rem; font-size: .95rem; }
.nav-icon { width: 40px; height: 40px; border-radius: 10px; }

/* Buttons: larger targets and more rounded */
.btn { border-radius: 12px; }
.btn-primary, .btn-secondary { padding: .7rem 1.25rem; }

/* Emphasize totals and balances for accountants */
.table-wrap tfoot td, .table-wrap tfoot th { font-weight: 900; background: linear-gradient(90deg, rgba(244,163,64,0.03), rgba(44,74,110,0.02)); }

/* Increase contrast on small labels */
.form-label { color: #243244; }

/* Slightly larger modals for editing details */
.modal { max-width: 820px; }

/* Improve print visuals for reports */
@media print {
  body { background: #fff; color: #000; }
  .sidebar, .topbar, .modal-overlay, .btn, .toast-container { display: none !important; }
  .page-content { padding: 0; }
  table { page-break-inside: avoid; }
}

/* HELP MODAL tweaks */
.modal-body pre { font-family: inherit; font-size: .95rem; }

/* PRINT: hide chrome UI and modals, keep report and tables */
@media print {
  .sidebar, .topbar, .nav-item, .btn, .modal-close, .toast-container { display: none !important; }
  .page-content { padding: 0; }
  .dashboard-report, .stats-grid, .card { box-shadow: none; border: none; }
  .table-wrap { overflow: visible; }
}

/* 🔥 Badge plus visible */
.badge {
  font-weight: 700;
  letter-spacing: .3px;
}

/* ✨ Effet glass léger pour topbar */
.topbar {
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,.92);
}
