/* ====================================================
   Chambres d'Hôtes Centre Ville Dakar – SYSCOHADA
   Style principal – Couleurs logo : beige #C9B075, brun #5A2E14
   ==================================================== */

:root {
  --primary: #1a56db;
  --primary-dark: #1240a8;
  --primary-light: #e8f0fe;
  --brand-beige: #C9B075;
  --brand-brown: #5A2E14;
  --brand-brown-light: #f5ede6;
  --secondary: #6b7280;
  --success: #059669;
  --success-light: #d1fae5;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --info: #0891b2;
  --info-light: #cffafe;
  --bg: #f3f4f6;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --sidebar-w: 260px;
  --topbar-h: 60px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --radius: 8px;
  --radius-sm: 4px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: #0f172a;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: width .25s ease;
  overflow: hidden;
}
.sidebar.collapsed { width: 64px; }
.sidebar.collapsed .sidebar-logo-text,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .sidebar-footer .company-info div,
.sidebar.collapsed .badge { display: none; }
.sidebar.collapsed .sidebar-logo-img { width: 36px; height: 36px; }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #1e293b;
  min-height: 80px;
  background: linear-gradient(135deg, #1a2540 0%, #0f172a 100%);
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}
.sidebar-logo-img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 8px;
  background: white;
  padding: 3px;
  flex-shrink: 0;
}
.sidebar-logo-text { overflow: hidden; }
.logo-name {
  font-weight: 700;
  font-size: 13px;
  display: block;
  white-space: nowrap;
  color: var(--brand-beige);
  letter-spacing: .02em;
}
.logo-sub {
  font-size: 10px;
  color: #94a3b8;
  white-space: nowrap;
  display: block;
}
/* Logo dans la topbar */
.topbar-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
  margin-right: 8px;
  display: block;
}
@media (max-width: 768px) { .topbar-logo { display: none; } }

.sidebar-toggle {
  background: transparent; border: none; color: #94a3b8;
  cursor: pointer; padding: 6px; border-radius: 6px; flex-shrink: 0;
}
.sidebar-toggle:hover { background: #1e293b; color: white; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
}
.nav-section-label {
  font-size: 9px;
  font-weight: 600;
  color: #475569;
  letter-spacing: .1em;
  padding: 14px 16px 6px;
  white-space: nowrap;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 13px;
  transition: background .15s, color .15s;
  border-radius: 0;
  white-space: nowrap;
  position: relative;
}
.nav-item i { width: 18px; text-align: center; flex-shrink: 0; font-size: 14px; }
.nav-item:hover { background: #1e293b; color: #e2e8f0; }
.nav-item.active { background: #1e3a8a; color: #fff; border-left: 3px solid var(--primary); }
.nav-item .badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--warning);
  color: white;
}
.nav-item .badge-info { background: var(--info) !important; }

/* États financiers – style spécial */
.etats-fin-header {
  background: linear-gradient(135deg, var(--brand-brown) 0%, #8B4513 100%);
  color: white;
  padding: 20px 24px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.etats-fin-header img { width: 60px; height: 60px; object-fit: contain; background: white; border-radius: 8px; padding: 4px; }
.etats-fin-header h2 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.etats-fin-header p { font-size: 12px; opacity: .85; }

/* Table états financiers OHADA */
table.ohada-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.ohada-table th {
  background: var(--brand-brown);
  color: white;
  padding: 8px 10px;
  text-align: center;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .04em;
}
table.ohada-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
table.ohada-table .section-header td {
  background: var(--brand-beige);
  color: var(--brand-brown);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
table.ohada-table .sous-total td {
  background: #f8f3ec;
  font-weight: 600;
  border-top: 1px solid var(--brand-beige);
}
table.ohada-table .total-final td {
  background: var(--brand-brown);
  color: white;
  font-weight: 700;
  font-size: 13px;
  border-top: 2px solid #3d1f0d;
}
table.ohada-table .ref-col {
  font-family: monospace;
  font-size: 11px;
  color: var(--text-muted);
  width: 60px;
}
table.ohada-table .amount-col {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  width: 120px;
}
table.ohada-table tbody tr:hover { background: #fdf8f3; }

/* Période card */
.periode-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface);
  transition: border-color .2s, box-shadow .2s;
  cursor: pointer;
  position: relative;
}
.periode-card:hover { border-color: var(--primary); box-shadow: 0 4px 12px rgba(26,86,219,.12); }
.periode-card.actif { border-color: var(--success); }
.periode-card.vide { border-style: dashed; background: #fafafa; }
.periode-card.locked { border-color: var(--brand-beige); background: #fdf9f0; }
.periode-badge {
  position: absolute; top: 10px; right: 10px;
  font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 700;
}
.periode-card .periode-month { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.periode-card .periode-year { font-size: 11px; color: var(--text-muted); }
.periode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }

/* Import zone */
.import-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: #fafafa;
}
.import-zone:hover { border-color: var(--primary); background: var(--primary-light); }
.import-zone i { font-size: 36px; color: var(--text-muted); margin-bottom: 12px; display: block; }
.import-zone p { color: var(--text-secondary); font-size: 13px; }
.import-zone input[type=file] { display: none; }

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid #1e293b;
}
.company-info { display: flex; align-items: center; gap: 8px; }
.company-info i { color: #64748b; font-size: 12px; flex-shrink: 0; }
.company-info small { display: block; color: #64748b; font-size: 10px; }

/* ── MAIN WRAPPER ── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left .25s ease;
}
.main-wrapper.collapsed { margin-left: 64px; }

/* ── TOPBAR ── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.mobile-toggle { display: none; background: none; border: none; cursor: pointer; font-size: 18px; color: var(--text-secondary); }
.breadcrumb-nav { font-size: 14px; font-weight: 600; color: var(--text); }
.breadcrumb-nav span { color: var(--text-secondary); }
.breadcrumb-nav span.current { color: var(--text); }

.topbar-right { display: flex; align-items: center; gap: 16px; }
.period-selector { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.period-selector label { color: var(--text-secondary); display: flex; align-items: center; gap: 5px; }
.period-selector select {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 5px 8px; font-size: 13px; background: var(--bg); cursor: pointer;
}
.topbar-user { display: flex; align-items: center; gap: 6px; color: var(--text-secondary); font-size: 13px; }
.topbar-user i { font-size: 20px; color: var(--primary); }

/* ── PAGE CONTENT ── */
.page-content {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

/* ── PAGE HEADER ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title h1 { font-size: 20px; font-weight: 700; color: var(--text); }
.page-title p { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 500;
  cursor: pointer; border: none; transition: all .15s; text-decoration: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #047857; }
.btn-warning { background: var(--warning); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 7px; border-radius: var(--radius-sm); }

/* ── CARDS ── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.card-header h2 { font-size: 15px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.card-header h2 i { color: var(--primary); }
.card-body { padding: 20px; }
.card-footer { padding: 12px 20px; background: var(--bg); border-top: 1px solid var(--border); }

/* ── KPI CARDS ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--kpi-color, var(--primary));
}
.kpi-icon {
  width: 38px; height: 38px;
  border-radius: 8px;
  background: var(--kpi-bg, var(--primary-light));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--kpi-color, var(--primary));
  margin-bottom: 10px;
}
.kpi-label { font-size: 11px; color: var(--text-secondary); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.kpi-value { font-size: 20px; font-weight: 700; color: var(--text); margin: 4px 0; }
.kpi-sub { font-size: 11px; color: var(--text-muted); }
.kpi-trend { font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; margin-top: 2px; }
.kpi-trend.up { color: var(--success); }
.kpi-trend.down { color: var(--danger); }

/* ── GRID LAYOUTS ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; }

/* ── TABLES ── */
.table-wrapper { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data-table thead th {
  background: #f8fafc;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
table.data-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data-table tbody tr:hover { background: #f8fafc; }
table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table .td-amount { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
table.data-table .td-debit { color: var(--danger); text-align: right; font-weight: 600; }
table.data-table .td-credit { color: var(--success); text-align: right; font-weight: 600; }
table.data-table tfoot td {
  padding: 10px 12px;
  font-weight: 700;
  border-top: 2px solid var(--border);
  background: #f8fafc;
}

/* ── FILTERS ── */
.filters-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.filters-bar input, .filters-bar select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  min-width: 140px;
}
.filters-bar input:focus, .filters-bar select:focus { outline: 2px solid var(--primary); border-color: var(--primary); }
.search-input { position: relative; }
.search-input i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-input input { padding-left: 32px; }

/* ── BADGES / STATUS ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-secondary { background: #f3f4f6; color: var(--text-secondary); }

/* ── FORMS ── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .04em; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,.1);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  width: 100%; max-width: 680px;
  max-height: 90vh;
  display: flex; flex-direction: column;
}
.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 18px; }
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: #1e293b; color: white;
  padding: 12px 20px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  z-index: 999;
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; gap: 8px;
  animation: slideIn .2s ease;
}
.toast.hidden { display: none; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }
@keyframes slideIn { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── CHARTS ── */
.chart-container { position: relative; }

/* ── MISC ── */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state i { font-size: 40px; margin-bottom: 12px; display: block; }
.empty-state p { font-size: 14px; }

/* ── ALERT ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 16px;
}
.alert i { flex-shrink: 0; margin-top: 1px; }
.alert-info { background: var(--info-light); color: var(--info); border: 1px solid #a5f3fc; }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid #fde68a; }
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid #a7f3d0; }
.alert-danger { background: var(--danger-light); color: var(--danger); border: 1px solid #fecaca; }

/* ── PROGRESS BAR ── */
.progress-bar-wrap { background: var(--border); border-radius: 4px; height: 8px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 4px; transition: width .4s ease; }

/* ── TABS ── */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab-nav { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 0; flex-wrap: wrap; }
.tab-btn {
  padding: 10px 18px;
  background: none; border: none; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color .15s; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  display: flex; align-items: center; gap: 6px;
}
.tab-btn.active {
  color: var(--primary); border-bottom-color: var(--primary);
  background: var(--primary-light);
}
.tab-btn:hover { color: var(--primary); background: var(--primary-light); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── GRID 4 COLONNES ── */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ── FILTER BAR ── */
.filter-bar {
  background: white; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
}

/* ── PAGE SUBTITLE ── */
.page-subtitle { color: var(--text-secondary); font-size: 13px; margin-top: 2px; }

/* ── FORM GRID (2 cols in modals) ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: #374151; margin-bottom: 4px; }

/* ── MODAL FOOTER ── */
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-2-1 { grid-template-columns: 1fr; }
  .grid-1-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .main-wrapper.collapsed { margin-left: 0; }
  .mobile-toggle { display: block; }
  .page-content { padding: 16px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .period-selector label { display: none; }
}

/* ── IMPORT EXCEL – STEPPER ── */
.stepper-dot {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; transition: all .3s;
}

/* ── ALERT BOXES ── */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13px; }
.alert-danger  { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.alert-warning { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }
.alert-success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.alert-info    { background: #eff6ff; border: 1px solid #93c5fd; color: #1e40af; }

/* ── BADGE PDG ── */
.badge-pdg { background: #f3e8ff; color: #7c3aed; }

/* ── TOPBAR USER (avec logout) ── */
.topbar-user { display: flex; align-items: center; gap: 8px; }

/* ── CODE INLINE ── */
code { font-family: monospace; }

/* ── AUDIT TABLE ── */
.audit-row-login td:first-child { border-left: 3px solid var(--success); }
.audit-row-error td:first-child { border-left: 3px solid var(--danger); }

/* ── PERMISSIONS MATRIX ── */
.perm-check { color: var(--success); font-size: 14px; font-weight: 700; }
.perm-cross  { color: #e5e7eb; font-size: 14px; }

/* ── LOGIN PAGE ── */
#page-content:has(.login-card) { padding: 0; }
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 16px; }
}

/* ── STYLES DONNÉES TABLE (section-header, sous-total) ── */
table.data-table .section-header td {
  background: linear-gradient(90deg, #1e3a8a, #1a56db);
  color: white;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 8px 12px;
}
table.data-table .sous-total td {
  background: #f0f4ff;
  font-weight: 600;
  border-top: 1px solid #bfdbfe;
  border-bottom: 1px solid #bfdbfe;
}
.ref-col { font-family: monospace; font-size: 11px; color: var(--text-muted); width: 50px; }
.amount-col { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── TOOLTIP ── */
[title] { cursor: help; }

/* ── SCROLLABLE CARD BODY ── */
.card-body-scroll { max-height: 400px; overflow-y: auto; }

/* ── ÉTATS FINANCIERS BILAN TABLE ── */
.print-zone { }
.print-only { display: none; }
@media print { .print-only { display: block !important; } }

/* ── LABEL COLORED ── */
.label-section {
  font-size: 12px; font-weight: 700; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: .06em;
  margin: 16px 0 8px;
  display: flex; align-items: center; gap: 8px;
}

/* ── ECRITURE LINE ── */
.ecriture-line { transition: background .15s; }
.ecriture-line:hover { background: #f8fafc; }

/* ── PERIODE CARD HOVER ── */
.periode-card { transition: all .2s ease; }

/* ── SPINNER ── */
.spinner { display: inline-block; width:18px; height:18px; border:2px solid #e5e7eb; border-top-color:var(--primary); border-radius:50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── STYLES IMPRESSION ── */
@media print {
  .sidebar, .topbar, .page-actions, .btn, .tabs, .filters-bar,
  .modal-overlay, #toast, .sidebar-footer { display: none !important; }
  .main-wrapper { margin-left: 0 !important; }
  .page-content { padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; }
  .etats-fin-header { background: #5A2E14 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  table.ohada-table th { background: #5A2E14 !important; color: white !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .total-final td { background: #5A2E14 !important; color: white !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .section-header td { background: #C9B075 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

