:root {
  --primary: #3E6FF3;
  --primary-dark: #2F5BD9;
  --primary-light: #EAF0FE;
  --bg: #F4F6FB;
  --card-bg: #ffffff;
  --sidebar-bg: #ffffff;
  --text: #2B2B3D;
  --text-muted: #8A8FA3;
  --border: #EEF0F5;
  --success: #22C55E;
  --success-light: #E7F8EE;
  --warning: #F59E0B;
  --warning-light: #FEF3E2;
  --danger: #EF4444;
  --danger-light: #FDEAEA;
  --info: #14B8A6;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-card: 0 4px 20px rgba(31, 41, 61, 0.06);
  --shadow-card-hover: 0 8px 28px rgba(31, 41, 61, 0.09);
  --sidebar-w: 250px;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  padding-top: 4px;
  font-size: 15px;
}

/* Fine liseré coloré en haut de l'écran */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 0px;
  background: linear-gradient(90deg, var(--primary), #8CB2FF);
  z-index: 3000;
}

a { text-decoration: none; color: var(--primary); }

/* ---------- Layout d'authentification ---------- */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #EEF3FF 0%, var(--bg) 60%);
}
.auth-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-card-hover);
}
.auth-card h1 {
  font-size: 22px;
  margin-bottom: 4px;
}
.auth-card p.subtitle {
  color: var(--text-muted);
  margin-top: 0;
  margin-bottom: 28px;
  font-size: 14px;
}

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

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--text);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease;
}
.sidebar .brand {
  padding: 24px 22px 18px;
  font-weight: 800;
  font-size: 18px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar .brand .brand-mark {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-light);
  border-radius: 9px;
  font-size: 16px;
}
.sidebar .brand .brand-logo {
  max-width: 100%;
  max-height: 52px;
  object-fit: contain;
}
.sidebar nav { padding: 6px 14px; flex: 1; overflow-y: auto; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
  font-size: 14px;
  font-weight: 600;
}
.sidebar nav a:hover { background: #F7F8FC; color: var(--text); }
.sidebar nav a.active { background: var(--primary-light); color: var(--primary); }

/* ---------- Icônes SVG (remplacent les émojis) ---------- */
.icon { width: 18px; height: 18px; flex-shrink: 0; display: inline-flex; vertical-align: middle; }
.sidebar .brand .icon { width: 26px; height: 26px; color: var(--primary); }
.topbar #menuToggle .icon { width: 22px; height: 22px; }
.topbar-logout .icon { width: 18px; height: 18px; display: block; }
.stat-icon .icon { width: 20px; height: 20px; color: var(--primary); }
.stat-icon.success .icon { color: var(--success); }
.stat-icon.warning .icon { color: #B45309; }
.stat-icon.danger .icon { color: var(--danger); }

.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 14px 28px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  gap: 14px;
}
.topbar #menuToggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  /* Zone tactile d'au moins 44x44 px (recommandation mobile). */
  padding: 0;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: -8px;
  border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.topbar #menuToggle:active { background: var(--primary-light); }
/* L'icône ne capte pas le clic : l'évènement vise toujours le <button>. */
.topbar #menuToggle .icon,
.topbar #menuToggle svg * { pointer-events: none; }
.topbar-title { display: none; font-weight: 700; font-size: 15px; }
.topbar-spacer { flex: 1; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.topbar-user-info { text-align: right; line-height: 1.25; }
.topbar-user-info .name { display: block; font-weight: 700; font-size: 13.5px; color: var(--text); }
.topbar-user-info .role { display: block; font-size: 10.5px; color: var(--text-muted); letter-spacing: .04em; }
.topbar-logout {
  color: var(--text-muted);
  font-size: 17px;
  padding: 7px;
  border-radius: 50%;
  background: #F7F8FC;
  line-height: 1;
  margin-left: 4px;
}
.topbar-logout:hover { background: var(--danger-light); color: var(--danger); }

.content { padding: 28px 32px; flex: 1; }

.app-footer {
  padding: 14px 32px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.app-footer a { color: var(--text-muted); text-decoration: underline; }
.app-footer a:hover { color: var(--primary); }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}
.page-header h1 { font-size: 22px; margin: 0; font-weight: 800; }
.page-header p { color: var(--text-muted); margin: 4px 0 0; font-size: 14px; }

/* ---------- Cartes / composants ---------- */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 22px;
  border: none;
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card-bg);
  border: none;
  box-shadow: var(--shadow-card);
  border-radius: var(--radius);
  padding: 20px;
  transition: box-shadow .15s ease, transform .15s ease;
}
a.stat-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.stat-card .label { color: var(--text-muted); font-size: 13px; }
.stat-card .value { font-size: 26px; font-weight: 800; margin-top: 4px; }
.stat-icon {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  font-size: 18px;
  margin-bottom: 12px;
  background: var(--primary-light);
}
.stat-icon.success { background: var(--success-light); }
.stat-icon.warning { background: var(--warning-light); }
.stat-icon.danger { background: var(--danger-light); }

table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.table th, table.table td {
  padding: 12px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
table.table th { color: var(--text-muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
table.table tbody tr:hover { background: #FAFBFD; }
.table-responsive { overflow-x: auto; }

.badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge-nouveau { background: var(--primary-light); color: var(--primary-dark); }
.badge-en-cours { background: var(--warning-light); color: #B45309; }
.badge-resolu { background: var(--success-light); color: #15803D; }
.badge-ferme { background: #F1F2F6; color: #5B5F73; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  transition: background .15s ease;
}
.btn:hover { background: var(--primary-dark); color: #fff; }
.btn-outline { background: var(--primary-light); border-color: transparent; color: var(--primary-dark); }
.btn-outline:hover { background: #DCE6FE; color: var(--primary-dark); }
.btn-filter : { margin-bottom: 10px; }
.btn-sm { padding: 7px 15px; font-size: 13px; }
.btn-success { background: var(--success); }
.btn-success:hover { background: #16A34A; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #DC2626; }
.btn-block { width: 100%; justify-content: center; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13.5px; font-weight: 700; color: var(--text); }
.form-control, select.form-control, textarea.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  background: #FAFBFD;
  color: var(--text);
}
.form-control:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px var(--primary-light); }

/* ---------- Listes déroulantes (select) : flèche personnalisée ---------- */
select.form-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A8FA3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6,9 12,15 18,9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
  cursor: pointer;
}
select.form-control:focus {
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233E6FF3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6,9 12,15 18,9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
}

/* ---------- Cases à cocher ---------- */
input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
  cursor: pointer;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ---------- Champs de date / heure ---------- */
input[type="date"].form-control,
input[type="datetime-local"].form-control,
input[type="time"].form-control {
  color-scheme: light;
  cursor: pointer;
}
input[type="date"].form-control::-webkit-calendar-picker-indicator,
input[type="datetime-local"].form-control::-webkit-calendar-picker-indicator,
input[type="time"].form-control::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(0.5) sepia(1) saturate(4) hue-rotate(190deg);
  border-radius: 4px;
  padding: 3px;
}
input[type="date"].form-control::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"].form-control::-webkit-calendar-picker-indicator:hover,
input[type="time"].form-control::-webkit-calendar-picker-indicator:hover {
  background: var(--primary-light);
}

.search-input-wrap { position: relative; }
.search-input-wrap .search-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  display: flex;
  pointer-events: none;
}
.search-input-wrap .form-control { padding-left: 38px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }

/* ---------- Sélecteur de lots (recherche + sélection multiple) ---------- */
.lot-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.lot-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 20px;
  padding: 5px 6px 5px 12px;
  font-size: 12.5px;
  font-weight: 700;
}
.lot-chip button {
  background: rgba(0,0,0,0.08);
  border: none;
  color: var(--primary-dark);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.lot-dropdown-list {
  max-height: 100px;
  overflow-y: auto;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  background: #FAFBFD;
}
.lot-dropdown-list .cf-lot-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 2px;
  font-weight: 400;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.lot-dropdown-list .cf-lot-item:last-child { border-bottom: none; }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 14px; }
.alert-success { background: var(--success-light); color: #15803D; }
.alert-danger { background: var(--danger-light); color: #B91C1C; }
.alert-info { background: var(--primary-light); color: var(--primary-dark); }

.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }

.tag-priorite { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.tag-basse { background: #F1F2F6; color: #5B5F73; }
.tag-normale { background: var(--primary-light); color: var(--primary-dark); }
.tag-haute { background: var(--warning-light); color: #B45309; }
.tag-urgente { background: var(--danger-light); color: #B91C1C; }

.thread-item { border-left: 3px solid var(--primary-light); padding: 10px 0 10px 16px; margin-bottom: 4px; }
.thread-item .meta { font-size: 12.5px; color: var(--text-muted); margin-bottom: 3px; }

.receipt-box {
  max-width: 640px;
  margin: 0 auto;
  background-color: #fff;
  background-image: none;
  background-repeat: no-repeat;
  background-position: center 55%;
  background-size: 65% auto;
  border: none;
  box-shadow: var(--shadow-card);
  border-radius: var(--radius);
  padding: 36px;
  position: relative;
}
.receipt-box .r-header { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--text); padding-bottom: 16px; margin-bottom: 20px; }
.receipt-box .r-title { font-size: 20px; font-weight: 800; }
.receipt-box table { width: 100%; border-collapse: collapse; margin: 18px 0; }
.receipt-box table td { padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14.5px; }
.receipt-box .r-total { font-size: 18px; font-weight: 800; text-align: right; margin-top: 10px; }

.receipt-cachet-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-top: 22px;
}
.receipt-cachet-row > div:first-child { flex: 1; }
.receipt-cachet { text-align: center; flex-shrink: 0; }
.receipt-cachet img { width: 120px; height: auto; transform: rotate(-6deg); opacity: 0.9; }
.receipt-cachet-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 2px;
  transform: rotate(-6deg);
}

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  body::before { display: none; }
  .receipt-box { border: none; box-shadow: none; }
}

/* ---------- Cartes copropriétaires (mobile) ---------- */
.desktop-only-table { display: block; }
.coowner-cards { display: none; }

.coowner-card {
  background: var(--card-bg);
  border: none;
  box-shadow: var(--shadow-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.coowner-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.coowner-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #8CB2FF);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}
.coowner-card-name { font-weight: 700; font-size: 15.5px; line-height: 1.3; }
.coowner-card-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 1px; }
.coowner-card-header .badge { margin-left: auto; flex-shrink: 0; }

.coowner-card-amount {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
}
.coowner-card-amount .label { font-size: 12.5px; color: var(--text-muted); }
.coowner-card-amount .amount { font-size: 18px; font-weight: 800; }

.coowner-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
  margin-bottom: 14px;
}
.coowner-card-grid .item-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.coowner-card-grid .item-value { font-size: 13.5px; word-break: break-word; }
.coowner-card-grid .item-value.full { grid-column: 1 / -1; }

/* ---------- Cartes mobiles génériques (lots, dépenses, demandes, paiements, annonces) ---------- */
.mobile-cards { display: none; }

.mcard {
  background: var(--card-bg);
  border: none;
  box-shadow: var(--shadow-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.mcard-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.mcard-title { font-weight: 700; font-size: 15px; line-height: 1.35; }
.mcard-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.mcard-header .badge, .mcard-header .tag-priorite { flex-shrink: 0; }

.mcard-body { font-size: 13.5px; color: var(--text); margin: 8px 0; }

.mcard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 10px 0; font-size: 13.5px; }
.mcard-grid .item-label { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); margin-bottom: 2px; }
.mcard-grid .item-value { word-break: break-word; }
.mcard-grid .item-value.full { grid-column: 1 / -1; }

.mcard-amount {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 10px 0;
}
.mcard-amount .label { font-size: 12.5px; color: var(--text-muted); }
.mcard-amount .amount { font-size: 17px; font-weight: 800; }

.mcard-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.mcard-actions > a, .mcard-actions > form, .mcard-actions > button { flex: 1; min-width: 100px; }
.mcard-actions form { display: flex; }
.mcard-actions .btn { width: 100%; }

/* ---------- Photo de profil ---------- */
.avatar-photo {
  width: 44px; height: 44px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0; background: var(--primary-light);
}
.avatar-photo.lg { width: 96px; height: 96px; }
.avatar-upload-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

/* ---------- Fenêtres modales ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 35, 55, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(20,20,50,0.22);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-header h3 { margin: 0; font-size: 17px; }
.modal-close { background: none; border: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--text-muted); padding: 4px; }
.modal-close:hover { color: var(--text); }
.modal-error { display: none; }
.modal-error.show { display: block; }

/* ---------- Tableau de bord financier : graphiques en barres CSS ---------- */
.finance-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 24px; }
.finance-kpi { background: var(--card-bg); border: none; box-shadow: var(--shadow-card); border-radius: var(--radius); padding: 20px; }
.finance-kpi .label { color: var(--text-muted); font-size: 13px; }
.finance-kpi .value { font-size: 24px; font-weight: 800; margin-top: 4px; }
.finance-kpi .variation { font-size: 12.5px; font-weight: 700; margin-top: 6px; display: inline-flex; align-items: center; gap: 4px; }
.finance-kpi .variation.up { color: var(--success); }
.finance-kpi .variation.down { color: var(--danger); }
.finance-kpi .variation.neutral { color: var(--text-muted); }
.variation-arrow { width: 11px; height: 11px; vertical-align: middle; }

.bar-legend { display: flex; gap: 18px; font-size: 12.5px; color: var(--text-muted); margin-bottom: 14px; flex-wrap: wrap; }
.bar-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }

/* ---------- Calendrier des travaux ---------- */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.calendar-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  padding-bottom: 6px;
}
.calendar-day {
  min-height: 84px;
  background: #FAFBFD;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  overflow: hidden;
}
.calendar-day.empty { background: transparent; border: none; }
.calendar-day.today { border-color: var(--primary); background: var(--primary-light); }
.calendar-day-num { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; }
.calendar-day.today .calendar-day-num { color: var(--primary); }
.calendar-event {
  font-size: 10.5px;
  font-weight: 600;
  color: #fff;
  border-radius: 5px;
  padding: 2px 5px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.calendar-event-a_faire { background: #94a3b8; }
.calendar-event-en_cours { background: var(--primary); }
.calendar-event-termine { background: var(--success); }
.calendar-event-more { font-size: 10px; color: var(--text-muted); }

@media (max-width: 700px) {
  .calendar-grid { grid-template-columns: repeat(7, 1fr); gap: 3px; }
  .calendar-day { min-height: 56px; padding: 3px; }
  .calendar-weekday { font-size: 9px; }
  .calendar-day-num { font-size: 10px; }
  .calendar-event { font-size: 8.5px; padding: 1px 3px; }
}

.bar-chart-wrap { overflow-x: auto; }
.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding: 10px 4px 0; }
.bar-chart.days { gap: 4px; min-width: 620px; }
.bar-group { flex: 1; min-width: 22px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar-pair { display: flex; align-items: flex-end; gap: 3px; height: 100%; width: 100%; justify-content: center; }
.bar-pair .bar { width: 12px; border-radius: 4px 4px 0 0; min-height: 2px; }
.bar-chart.days .bar-pair .bar { width: 6px; }
.bar-pair .bar.current { background: var(--primary); }
.bar-pair .bar.previous { background: var(--primary-light); }
.bar-pair .bar.depenses { background: var(--danger); }
.bar-group .bar-label { font-size: 10.5px; color: var(--text-muted); margin-top: 6px; white-space: nowrap; }

@media (max-width: 700px) {
  .desktop-only-table { display: none; }
  .mobile-cards { display: block; }
  .coowner-cards { display: block; }
  .finance-kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .bar-chart { min-width: 520px; }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    z-index: 1000;
    height: 100vh;
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .topbar #menuToggle { display: inline-flex; }
  .topbar-title { display: block; }
  .topbar-user-info { display: none; }
  .content { padding: 18px; }
  .app-footer { padding: 14px 18px; }
  .page-header h1 { font-size: 19px; }
  .page-header { flex-direction: column; align-items: stretch; }
  .page-header > a.btn, .page-header > div + a.btn { align-self: stretch; text-align: center; }
  .card { padding: 16px; }
}

/* Tableaux -> cartes empilées sur petit écran (utiliser class="table responsive-cards") */
@media (max-width: 700px) {
  table.responsive-cards thead { display: none; }
  table.responsive-cards, table.responsive-cards tbody,
  table.responsive-cards tr, table.responsive-cards td { display: block; width: 100%; }
  table.responsive-cards tr {
    margin-bottom: 14px;
    border: none;
    box-shadow: var(--shadow-card);
    border-radius: var(--radius-sm);
    padding: 4px 14px;
    background: #fff;
  }
  table.responsive-cards td {
    border: none;
    border-bottom: 1px solid #F1F2F6;
    padding: 9px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    text-align: right;
    font-size: 14px;
  }
  table.responsive-cards td:last-child { border-bottom: none; }
  table.responsive-cards td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-align: left;
    flex-shrink: 0;
  }
  table.responsive-cards td:empty::before { content: none; }
  table.responsive-cards td[data-label=""] { justify-content: center; }
  table.responsive-cards td[data-label=""]::before { content: none; }

  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .btn { width: 100%; justify-content: center; }
  .btn.btn-sm { width: auto; }
  form[style*="display:inline"] { display: inline-block !important; }
}

/* =====================================================================
   Autocomplétion (assets/js/autocomplete.js)
   ===================================================================== */
.ac-panel {
  position: fixed;
  z-index: 3500;
  display: none;
  overflow-y: auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 34px rgba(31, 41, 61, 0.16);
  padding: 6px;
  min-width: 220px;
}
.ac-panel.open { display: block; }

.ac-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.35;
}
.ac-item.active, .ac-item:hover { background: var(--primary-light); }
.ac-item-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ac-item-label { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-item-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}
.ac-item-tag {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-dark);
  background: var(--primary-light);
  border-radius: 20px;
  padding: 3px 9px;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ac-item mark { background: rgba(62, 111, 243, 0.18); color: inherit; border-radius: 3px; padding: 0 1px; }
.ac-item.active mark { background: rgba(62, 111, 243, 0.3); }
.ac-empty { padding: 14px 12px; font-size: 13.5px; color: var(--text-muted); text-align: center; }

/* =====================================================================
   Calendrier / sélecteur de date (assets/js/datepicker.js)
   ===================================================================== */
.dp-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A8FA3' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='3' y='4.5' width='18' height='16' rx='2'/%3E%3Cline x1='3' y1='9.5' x2='21' y2='9.5'/%3E%3Cline x1='8' y1='2.5' x2='8' y2='6.5'/%3E%3Cline x1='16' y1='2.5' x2='16' y2='6.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 17px 17px;
  padding-right: 40px;
}

.dp-panel {
  position: fixed;
  z-index: 3600;
  width: 300px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 18px 44px rgba(31, 41, 61, 0.22);
  overflow: hidden;
  user-select: none;
}

.dp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--border);
}
.dp-title { font-size: 15.5px; font-weight: 700; color: var(--text); }
.dp-nav {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border: none;
  border-radius: 12px;
  background: #F4F6FB;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.dp-nav:hover { background: var(--primary-light); color: var(--primary-dark); }

.dp-body { padding: 12px 12px 6px; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-wd {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 4px 0 8px;
}
.dp-day {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  height: 34px;
  border-radius: 11px;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.dp-day:hover { background: var(--primary-light); color: var(--primary-dark); }
.dp-day.dp-out { color: #C7CBD8; font-weight: 500; }
.dp-day.dp-today { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.dp-day.dp-selected,
.dp-day.dp-selected:hover {
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(62, 111, 243, 0.4);
}

.dp-foot {
  display: flex;
  gap: 6px;
  padding: 10px 12px 14px;
  border-top: 1px solid var(--border);
}
.dp-btn {
  flex: 1;
  border: none;
  background: #F4F6FB;
  color: var(--text);
  border-radius: 12px;
  padding: 9px 4px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.dp-btn:hover { background: var(--primary-light); color: var(--primary-dark); }

/* =====================================================================
   Statuts de paiement : en cours (orange), réglé (vert), rejeté (rouge)
   ===================================================================== */
.badge-pay-encours { background: var(--warning-light); color: #B45309; }
.badge-pay-regle   { background: var(--success-light); color: #15803D; }
.badge-pay-rejete  { background: var(--danger-light);  color: #B91C1C; }

/* Petite pastille de couleur en tête de ligne / de carte */
.pay-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.pay-dot-encours { background: var(--warning); }
.pay-dot-regle   { background: var(--success); }
.pay-dot-rejete  { background: var(--danger); }

tr.pay-row-rejete td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
tr.pay-row-encours td:first-child { box-shadow: inset 3px 0 0 var(--warning); }
tr.pay-row-regle td:first-child { box-shadow: inset 3px 0 0 var(--success); }
tr.pay-row-rejete { opacity: .75; }

/* Pied de liste « Voir plus » */
.list-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 16px;
  text-align: center;
}
.list-more .list-more-info { font-size: 13px; color: var(--text-muted); }

/* Barre de filtres compacte */
.filter-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; align-items: end; }
.filter-bar .form-group { margin-bottom: 0; }

@media (max-width: 480px) {
  .dp-panel { width: calc(100vw - 24px); max-width: 320px; }
  .filter-bar { grid-template-columns: 1fr; }
}

/* Choix du statut de paiement dans le formulaire (boutons radio stylés) */
.statut-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.statut-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 6px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #FAFBFD;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.statut-choice input { margin: 0 6px 0 0; width: 15px; height: 15px; flex-shrink: 0; }
.statut-choice-encours input { accent-color: var(--warning); }
.statut-choice-regle input   { accent-color: var(--success); }
.statut-choice-rejete input  { accent-color: var(--danger); }
.statut-choice-encours:has(input:checked) { border-color: var(--warning); background: var(--warning-light); color: #B45309; }
.statut-choice-regle:has(input:checked)   { border-color: var(--success); background: var(--success-light); color: #15803D; }
.statut-choice-rejete:has(input:checked)  { border-color: var(--danger);  background: var(--danger-light);  color: #B91C1C; }
/* Repli pour les navigateurs sans :has() */
.statut-choice.is-checked.statut-choice-encours { border-color: var(--warning); background: var(--warning-light); color: #B45309; }
.statut-choice.is-checked.statut-choice-regle   { border-color: var(--success); background: var(--success-light); color: #15803D; }
.statut-choice.is-checked.statut-choice-rejete  { border-color: var(--danger);  background: var(--danger-light);  color: #B91C1C; }

@media (max-width: 480px) {
  .statut-choices { grid-template-columns: 1fr; }
}

/* Libellés masqués sur très petits écrans (ex: navigation du calendrier). */
@media (max-width: 520px) {
  .hide-xs { display: none; }
}

/* =====================================================================
   Barre de filtres et tri des tableaux (page Lots)
   ===================================================================== */
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 14px;
  align-items: end;
}
.filter-grid .form-group { margin-bottom: 0; }

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.filter-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
}
.filter-check input { accent-color: var(--primary); }
.filter-resume {
  margin: 14px 0 0;
  font-size: 13.5px;
  color: var(--text-muted);
}

/* En-têtes de colonnes cliquables */
.th-sort { padding: 0 !important; }
.th-sort a {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 14px 16px;
  color: inherit;
  white-space: nowrap;
}
.th-sort a:hover { color: var(--primary); }
.th-sort.is-sorted a { color: var(--primary); }
.th-arrow { font-size: 9px; letter-spacing: -.05em; }

/* Colonnes de montants : chiffres alignés */
.table-lots td.num, .table-lots th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.table-lots tfoot td {
  border-top: 2px solid var(--border);
  background: var(--bg);
  font-size: 13.5px;
}

@media (max-width: 720px) {
  .filter-grid { grid-template-columns: 1fr; }
  .filter-actions { flex-direction: column; align-items: stretch; }
}

/* =====================================================================
 * PILOTAGE DES DÉPENSES (admin/pilotage_depenses.php)
 * ===================================================================== */
.badge-nature-charge  { background: var(--primary-light); color: var(--primary-dark); }
.badge-nature-imprevu { background: var(--warning-light); color: #B45309; }
.badge-nature-travaux { background: #E6F7F5; color: #0F766E; }

/* Choix de la nature dans le formulaire de dépense (réutilise .statut-choice) */
.nature-choice-charge_courante input { accent-color: var(--primary); }
.nature-choice-imprevu input { accent-color: var(--warning); }
.nature-choice-travaux input { accent-color: var(--info); }
.nature-choice-charge_courante:has(input:checked) { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); }
.nature-choice-imprevu:has(input:checked) { border-color: var(--warning); background: var(--warning-light); color: #B45309; }
.nature-choice-travaux:has(input:checked) { border-color: var(--info); background: #E6F7F5; color: #0F766E; }

.pilot-kpis { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.kpi-sub { color: var(--text-muted); font-size: 12px; margin-top: 4px; }
.nature-kpi { color: var(--text); border: 2px solid transparent; transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease; }
.nature-kpi:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.nature-kpi.is-active { border-color: var(--nature); }
.variation-inline { font-weight: 700; display: inline-flex; align-items: center; gap: 3px; }
.variation-inline.up { color: var(--success); }
.variation-inline.down { color: var(--danger); }

.pilot-title { margin: 0 0 14px; font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.pilot-sub { margin: 4px 0 0; font-size: 12.5px; color: var(--text-muted); }
.pilot-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.pilot-grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.pilot-grid-2 > .card { margin-bottom: 20px; }
.aging-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
.pilot-scroll { max-height: 420px; overflow-y: auto; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Sélecteur segmenté */
.seg { display: inline-flex; background: #F4F6FB; border-radius: 999px; padding: 4px; gap: 2px; }
.seg a { padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--text-muted); }
.seg a.active { background: #fff; color: var(--primary-dark); box-shadow: 0 1px 4px rgba(31,41,61,.08); }

/* Barres de progression */
.progress { position: relative; height: 8px; background: #EEF0F5; border-radius: 999px; }
.progress-fill { height: 100%; border-radius: 999px; background: var(--primary); max-width: 100%; }
.progress-marker { position: absolute; top: -4px; width: 2px; height: 16px; background: var(--text); opacity: .55; border-radius: 2px; transform: translateX(-1px); }
.progress-inline { display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 700; }
.progress-inline .progress { flex: 1; min-width: 90px; }

/* Barres horizontales + anneau */
.pilot-split { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.hbar-row { display: grid; grid-template-columns: 150px 1fr 80px; gap: 12px; align-items: center; margin-bottom: 10px; font-size: 13px; }
.hbar-label { text-align: right; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 22px; background: #F4F6FB; border-radius: 6px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 6px; min-width: 3px; }
.hbar-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: center; }
.donut { width: 190px; height: 190px; border-radius: 50%; position: relative; flex-shrink: 0; }
.donut-center { position: absolute; inset: 24%; background: #fff; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-center span { font-size: 18px; font-weight: 800; }
.donut-center small { font-size: 11px; color: var(--text-muted); }
.donut-legend { display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; min-width: 170px; }
.donut-legend > div { display: flex; align-items: center; gap: 8px; }
.donut-legend .lg-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.bar-legend .dot.dash { width: 16px; height: 0; border-top: 2px dashed var(--text-muted); border-radius: 0; }

/* Tableau « payé par prestataire » */
.heat-table td.num { border-bottom: 2px solid #fff; }
.mini-kpi { border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 8px 16px; text-align: center; }
.mini-kpi span { display: block; font-size: 12px; color: var(--text-muted); }
.mini-kpi strong { font-size: 19px; font-weight: 800; }

/* Trésorerie */
.treso-table td { padding: 10px 4px; font-size: 13.5px; }
.treso-table tr.treso-sub td { background: #FAFBFD; border-bottom: 1.5px solid var(--border); }
.treso-cover { margin-top: 14px; background: var(--primary-light); border-radius: var(--radius-sm); padding: 12px 16px; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; }
.treso-cover span { font-size: 13px; font-weight: 700; color: var(--primary-dark); }
.treso-cover strong { font-size: 20px; color: var(--primary-dark); grid-row: span 2; }
.treso-cover small { font-size: 11.5px; color: var(--text-muted); }
.vbars { display: flex; gap: 16px; align-items: flex-end; height: 150px; }
.vbar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.vbar-val { font-size: 11.5px; font-weight: 700; margin-bottom: 4px; }
.vbar-track { flex: 1; width: 100%; max-width: 46px; display: flex; align-items: flex-end; }
.vbar { width: 100%; background: linear-gradient(180deg, #6C8EF5, var(--primary)); border-radius: 6px 6px 0 0; min-height: 2px; }

/* Budget */
.budget-table tfoot td, .aging-table tfoot td { font-weight: 800; border-top: 2px solid var(--border); border-bottom: none; }
.budget-reprise { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #FAFBFD; border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 14px; font-size: 13px; font-weight: 600; }
.budget-section-title { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.budget-line { display: grid; grid-template-columns: 1fr 170px; gap: 10px; align-items: center; margin-bottom: 8px; }
.budget-line label { font-size: 13.5px; font-weight: 600; }
.budget-line .form-control { padding: 8px 12px; }
.budget-total { text-align: right; margin: 6px 0 14px; font-size: 14px; }

/* Évolution mensuelle (barres empilées) */
.stack-chart { position: relative; display: flex; align-items: flex-end; gap: 8px; height: 270px; padding-top: 10px; min-width: 420px; }
.stack-group { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.stack-col { width: 70%; max-width: 30px; display: flex; flex-direction: column-reverse; border-radius: 5px 5px 0 0; overflow: hidden; min-height: 2px; background: #EEF0F5; }
.stack-col > div { width: 100%; }
.stack-budget-line { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--text-muted); opacity: .6; pointer-events: none; }
.stack-group .bar-label, .vbar-col .bar-label { height: 16px; font-size: 10.5px; color: var(--text-muted); margin-top: 6px; white-space: nowrap; }
.vbar-col .bar-label { font-size: 12px; font-weight: 600; }

/* Imprévus */
.imp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.imp-stats > div { background: var(--warning-light); border-radius: var(--radius-sm); padding: 10px; text-align: center; }
.imp-stats span { display: block; font-size: 11px; color: #B45309; }
.imp-stats strong { font-size: 16px; }
.imp-list { max-height: 300px; overflow-y: auto; }
.imp-item { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.imp-item:last-child { border-bottom: none; }
.imp-title { font-weight: 700; font-size: 13.5px; }
.imp-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.imp-amount { font-weight: 800; font-size: 13.5px; margin-bottom: 3px; white-space: nowrap; }

/* Analyse automatique */
.insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; }
.insight { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13.5px; line-height: 1.45; }
.insight-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.insight-danger  { background: var(--danger-light); color: #991B1B; }
.insight-danger .insight-dot { background: var(--danger); }
.insight-warning { background: var(--warning-light); color: #92400E; }
.insight-warning .insight-dot { background: var(--warning); }
.insight-info    { background: var(--primary-light); color: var(--primary-dark); }
.insight-info .insight-dot { background: var(--primary); }
.insight-success { background: var(--success-light); color: #166534; }
.insight-success .insight-dot { background: var(--success); }

/* Échéancier (aging) */
.aging-table th { background: #F7F8FC; }
.aging-table td.aging-zero { color: #C3C7D4; }
.aging-table td.aging-courant { color: var(--text); font-weight: 600; }
.aging-table td.aging-1_30 { color: #B45309; font-weight: 700; }
.aging-table td.aging-31_60, .aging-table td.aging-61_90 { color: #DC2626; font-weight: 700; }
.aging-table td.aging-90_plus { color: #fff; background: var(--danger); font-weight: 800; }

@media (max-width: 1100px) {
  .pilot-grid-2, .aging-grid, .pilot-split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .pilot-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pilot-kpis .finance-kpi { padding: 14px; }
  .pilot-kpis .finance-kpi .value { font-size: 16px; }
  .pilot-kpis .stat-icon { width: 32px; height: 32px; margin-bottom: 8px; }
  .pilot-kpis .kpi-sub { font-size: 11px; }
  .hbar-row { grid-template-columns: 100px 1fr 64px; gap: 8px; font-size: 12px; }
  .imp-stats { grid-template-columns: repeat(2, 1fr); }
  .budget-line { grid-template-columns: 1fr 130px; }
  .donut { width: 160px; height: 160px; }
  .aging-table td.aging-90_plus { background: var(--danger-light); color: #B91C1C; }
  .heat-table td.num { border-bottom: 1px solid #F1F2F6; background: none !important; color: var(--text) !important; }
  table.responsive-cards tfoot, table.responsive-cards tfoot tr { display: block; width: 100%; }
  table.responsive-cards tfoot tr { background: var(--primary-light); box-shadow: none; }
  table.responsive-cards tfoot td { display: flex; width: 100%; border-top: none; }
  .pilot-scroll { max-height: none; }
}
