/* ─── État préparatoire de paie ──────────────────────────────────────── */

.paie-toolbar {
  flex-wrap: wrap;
  gap: 8px 10px;
}

.bs-body {
  height: calc(100vh - var(--header-h) - 52px);
  overflow: auto;
}

.bs-body .paie-wrap {
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  min-width: unset;
}

/* ─── Document ───────────────────────────────────────────────────────── */
.paie-doc {
  padding: 16px 20px;
  max-width: 960px;
  margin: 0 auto;
}

/* En-tête du document */
.paie-doc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border: 1.5px solid #1a3a5c;
  background: #fff;
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 20px;
}
.paie-doc-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a3a5c;
  margin-bottom: 3px;
}
.paie-doc-sub {
  font-size: 12px;
  color: #333;
  margin-bottom: 2px;
}
.paie-doc-mention {
  font-size: 10px;
  color: #888;
  font-style: italic;
}
.paie-doc-header-right {
  text-align: right;
}
.paie-doc-org {
  font-size: 12px;
  font-weight: 700;
  color: #1a3a5c;
}
.paie-doc-addr {
  font-size: 10px;
  color: #666;
}
.paie-doc-date {
  font-size: 10px;
  color: #888;
  font-style: italic;
  margin-top: 4px;
}

/* ─── Bloc employé ───────────────────────────────────────────────────── */
.paie-emp {
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.paie-emp-header {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1a3a5c;
  color: #fff;
  padding: 8px 14px;
  font-size: 13px;
}
.paie-emp-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,0.5);
}
.paie-emp-name {
  font-weight: 700;
  font-size: 13px;
}
.paie-emp-svc {
  font-size: 11px;
  font-weight: 400;
  color: rgba(255,255,255,0.75);
}

/* ─── Titres de sections ─────────────────────────────────────────────── */
.paie-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #1a3a5c;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #eef2f8;
  padding: 5px 14px;
  border-bottom: 1px solid var(--border);
}

.paie-no-repos {
  font-size: 11px;
  color: #aaa;
  padding: 8px 14px;
  font-style: italic;
}

/* ─── Table heures ───────────────────────────────────────────────────── */
.paie-hours-table {
  border-collapse: collapse;
  font-size: 12px;
  width: 100%;
}
.paie-hours-table th,
.paie-hours-table td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: center;
  white-space: nowrap;
}
.paie-hours-table th {
  background: var(--surface-2);
  font-weight: 600;
  color: var(--text-2);
  font-size: 11px;
}

/* ─── Table repos ────────────────────────────────────────────────────── */
.paie-repos-table {
  border-collapse: collapse;
  font-size: 12px;
  width: 100%;
}
.paie-repos-table th,
.paie-repos-table td {
  border: 1px solid var(--border);
  padding: 5px 10px;
  vertical-align: top;
}
.paie-repos-table th {
  background: var(--surface-2);
  font-weight: 600;
  color: var(--text-2);
  font-size: 11px;
  text-align: center;
}

/* ─── Cellules numériques ────────────────────────────────────────────── */
.paie-num {
  text-align: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.paie-total   { font-weight: 700; color: #1a3a5c; }
.paie-night   { color: #6a0dad; }
.paie-sunday  { color: #c0392b; }
.paie-ferie   { color: #e67e22; }
.paie-pos     { color: #27ae60; }
.paie-neg     { color: #e74c3c; }
.paie-days-count { font-size: 10px; color: #888; }
.paie-rate-badge { font-size: 10px; font-weight: 600; color: #6a0dad; white-space: nowrap; }
.paie-rate-val   { font-weight: 400; color: #6a0dad; }

/* ─── Colonnes référence mensuelle / heures sup ──────────────────────── */
.paie-col-ref  { background: #f0f4ff; color: #1a3a5c; font-weight: 600; }
.paie-col-hs   { background: #fafafa; font-weight: 600; white-space: nowrap; }
.paie-hs-pos   { color: #c0392b; }
.paie-hs-neg   { color: #888; }
.paie-hs-label { font-size: 10px; font-weight: 400; margin-right: 3px; }
.paie-ref-empty { color: #bbb; font-style: italic; font-weight: 400; font-size: 11px; }

/* ─── Cellule repos code ─────────────────────────────────────────────── */
.paie-repos-code {
  white-space: nowrap;
}
.paie-code-badge {
  display: inline-block;
  background: #1a3a5c;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 4px;
}
.paie-repos-nb {
  font-weight: 700;
  color: #1a3a5c;
}
.paie-repos-dates {
  font-size: 11px;
  color: #444;
  line-height: 1.6;
}
.paie-month-group {
  display: inline-block;
  margin-right: 12px;
  white-space: nowrap;
}
.paie-month-label {
  font-weight: 600;
  color: #1a3a5c;
  margin-right: 3px;
}

/* ─── Total général ──────────────────────────────────────────────────── */
.paie-grand-total {
  border: 2px solid #1a3a5c;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 8px;
}
.paie-gt-title {
  background: #1a3a5c;
  color: #fff;
  font-size: 12px;
}
.paie-grand-total .paie-hours-table th {
  background: #eef2f8;
}

/* ─── Impression ─────────────────────────────────────────────────────── */
@media print {
  @page { size: A4 portrait; margin: 10mm; }
  .page-header, .paie-toolbar { display: none !important; }
  .bs-body { height: auto; overflow: visible; }
  .paie-emp { page-break-inside: avoid; break-inside: avoid; }
  .paie-doc { padding: 0; max-width: 100%; }
}
