/* ============================================================
   ComptaV v4.0 — Feuille de style principale
   ============================================================ */

:root {
  --bleu:        #1F4981;
  --bleu-clair:  #2563a8;
  --bleu-bg:     #eff6ff;
  --sidebar-w:   230px;
  --topbar-h:    52px;
  --sidebar-bg:  #0f2444;
  --nav-active:  #2563a8;
  --nav-hover:   rgba(255,255,255,.08);
  --border:      #e2e8f0;
  --text-muted:  #64748b;
  --success:     #16a34a;
  --danger:      #dc2626;
  --warning:     #d97706;
}

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', Arial, sans-serif;
       font-size: 13px; color: #1e293b; background: #f1f5f9; }

/* ── Topbar ── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--topbar-h); background: var(--bleu);
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.topbar-brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 16px; }
.topbar-brand .version { font-size: 11px; opacity: .6; font-weight: 400; }

/* ── Layout wrapper ── */
.wrapper { display: flex; margin-top: var(--topbar-h); min-height: calc(100vh - var(--topbar-h)); }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w); min-height: 100%; flex-shrink: 0;
  background: var(--sidebar-bg); overflow-y: auto;
  padding: 8px 0 24px;
}
.nav-section {
  font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  color: rgba(255,255,255,.35); padding: 16px 16px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 16px; color: rgba(255,255,255,.78);
  text-decoration: none; font-size: 12.5px; transition: all .15s;
}
.nav-item:hover  { background: var(--nav-hover); color: #fff; }
.nav-item.active { background: var(--nav-active); color: #fff; font-weight: 600; }
.nav-item .fa    { width: 16px; text-align: center; font-size: 13px; }

/* ── Main content ── */
.main-content { flex: 1; min-width: 0; overflow-x: auto; }
.page-header  { border-bottom: 1px solid var(--border); background: #fff; }
.page-title   { font-size: 18px; font-weight: 700; color: var(--bleu); }

/* ── Cards ── */
.form-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 8px; padding: 20px; margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.form-section-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--bleu); font-weight: 700; padding-bottom: 8px;
  border-bottom: 2px solid var(--bleu-bg); margin-bottom: 16px;
}

/* ── Table card ── */
.table-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 16px;
}
.tc-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: #fafbfe;
}
.tc-title { font-weight: 700; color: var(--bleu); font-size: 13px; }
.tc-actions { display: flex; gap: 8px; }

/* ── Stat card ── */
.stat-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 8px; padding: 14px 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.stat-lbl { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.stat-val  { font-size: 24px; font-weight: 700; color: var(--bleu); margin-top: 2px; }

/* ── Tables ── */
.table { font-size: 12.5px; }
.table th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
            color: var(--text-muted); font-weight: 600; background: #f8fafc; }
.table-hover tbody tr:hover { background: var(--bleu-bg); }
.font-monospace { font-family: 'Courier New', monospace; }

/* ── Badges statut ── */
.badge-statut { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.bs-en_attente, .bs-emise      { background: #fef3c7; color: #92400e; }
.bs-paye, .bs-apparie_complet  { background: #d1fae5; color: #065f46; }
.bs-partiel                    { background: #dbeafe; color: #1e40af; }
.bs-annule                     { background: #f1f5f9; color: #64748b; }
.bs-confirme                   { background: #d1fae5; color: #065f46; }
.bs-brouillon                  { background: #fef9c3; color: #713f12; }

/* ── Boutons ── */
.btn-xs { padding: 2px 6px; font-size: 11px; }

/* ── Formulaires ── */
.form-label { font-weight: 600; font-size: 12px; margin-bottom: 4px; }
.form-control, .form-select { font-size: 13px; }
.form-control:focus, .form-select:focus {
  border-color: var(--bleu-clair); box-shadow: 0 0 0 3px rgba(37,99,168,.15);
}

/* ── GL picker (codes analytiques) ── */
.gl-picker-group { display: flex; align-items: stretch; gap: 4px; }
.gl-col-analytique { font-family: monospace; text-align: center; letter-spacing: 2px; }

/* ── Hover card ── */
.hover-card:hover {
  background: var(--bleu-bg) !important;
  border-color: var(--bleu-clair) !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(37,99,168,.12);
}

/* ── Responsive mobile ── */
@media (max-width: 768px) {
  .sidebar { position: fixed; z-index: 999; left: -100%; transition: left .25s; }
  .sidebar.open { left: 0; }
  .main-content { margin-left: 0 !important; }
}

/* ── Print ── */
@media print {
  .sidebar, #topbar, .btn, .modal, .alert { display: none !important; }
  .main-content { margin: 0 !important; padding: 0 !important; }
}
