/* build: v2026-07-13 facturation module (grilles main d'oeuvre + primes + PDF client + onglets) */
/* ============================================================
   FACTURATION MODAL — master-detail layout (sidebar + panel)
   Temporary parallel manual billing UI.
   ============================================================ */

.fact-mve {
  --fact-primary: #2563eb;
  --fact-primary-dark: #1d4ed8;
  --fact-border: #e5e7eb;
  --fact-border-soft: #f1f2f4;
  --fact-bg: #f8fafc;
  --fact-text: #0f172a;
  --fact-muted: #64748b;
  --fact-success: #16a34a;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  margin: -1.5rem; /* bleed to modal-body edges */
  color: var(--fact-text);
}

/* ---- Top bar ---- */
.fact-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--fact-border);
  background: #fff;
  flex-wrap: wrap;
}
.fact-facture {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}
.fact-facture-num {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.fact-facture .fact-icon-btn {
  border: 1px solid var(--fact-border);
  background: #fff;
  border-radius: 8px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  color: var(--fact-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all 0.15s ease;
}
.fact-facture .fact-icon-btn:hover { border-color: var(--fact-primary); color: var(--fact-primary); }
.fact-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}
.fact-status.open { background: #dcfce7; color: #15803d; }
.fact-status.open::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--fact-success); }
.fact-status.closed { background: #f1f5f9; color: #64748b; }

.fact-toolbar { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.fact-toolbar .btn { white-space: nowrap; }

/* ---- Two-pane region ---- */
.fact-panes {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

/* ---- Left rail ---- */
.fact-rail {
  width: 300px;
  flex-shrink: 0;
  border-right: 1px solid var(--fact-border);
  background: var(--fact-bg);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.fact-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  font-weight: 700;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--fact-border);
}
.fact-rail-count {
  background: #e2e8f0;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
}
.fact-rail-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.fact-bon-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: all 0.12s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.fact-bon-item:hover { border-color: #cbd5e1; }
.fact-bon-item.active {
  border-color: var(--fact-primary);
  background: #eff6ff;
  box-shadow: inset 3px 0 0 var(--fact-primary), 0 1px 2px rgba(15, 23, 42, 0.04);
}
.fact-bon-item-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #e2e8f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.fact-bon-item.active .fact-bon-item-icon { background: #dbeafe; }
.fact-bon-item-main { min-width: 0; flex: 1; }
.fact-bon-item-title {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fact-bon-item.active .fact-bon-item-title { color: var(--fact-primary-dark); }
.fact-bon-item-sub { font-size: 0.78rem; color: var(--fact-muted); margin-top: 0.1rem; }
.fact-bon-item-chev { color: #cbd5e1; font-size: 1rem; flex-shrink: 0; }
.fact-rail-add {
  margin: 0.5rem;
  padding: 0.6rem;
  border: 1px dashed #94a3b8;
  border-radius: 10px;
  background: transparent;
  color: var(--fact-primary-dark);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}
.fact-rail-add:hover { background: #eff6ff; border-color: var(--fact-primary); }

/* ---- Right detail pane ---- */
.fact-detail {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
}
.fact-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--fact-border);
  flex-wrap: wrap;
}
.fact-detail-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
}
.fact-detail-tools { display: flex; align-items: center; gap: 0.75rem; }
.fact-time {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--fact-muted);
  font-weight: 600;
}
.fact-time input {
  width: 80px;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--fact-border);
  border-radius: 8px;
  font-size: 0.9rem;
}
.fact-time input:focus { outline: none; border-color: var(--fact-primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }

.fact-detail-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0.5rem 1.25rem 1.25rem;
}

/* ---- Product table ---- */
.fact-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
/* Definite column widths so the Produit column stays bounded and truncates. */
.fact-table th:nth-child(2), .fact-table td:nth-child(2) { width: 96px; }   /* Quantité */
.fact-table th:nth-child(3), .fact-table td:nth-child(3) { width: 104px; }  /* Prix unit. */
.fact-table th:nth-child(4), .fact-table td:nth-child(4) { width: 104px; }  /* Total */
.fact-table th:nth-child(5), .fact-table td:nth-child(5) { width: 44px; }   /* actions */
.fact-table thead th {
  position: sticky;
  top: 0;
  background: #fff;
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fact-muted);
  font-weight: 700;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--fact-border);
  z-index: 1;
}
.fact-table thead th.num { text-align: right; }
.fact-table tbody td { padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--fact-border-soft); vertical-align: middle; }
.fact-table tbody tr:hover { background: #f8fafc; }
.fact-prod { display: flex; align-items: center; gap: 0.75rem; min-width: 0; overflow: hidden; }
.fact-prod-img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--fact-border);
  background: #f8fafc;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fact-prod-img img { width: 100%; height: 100%; object-fit: cover; }
.fact-prod-img .placeholder { font-size: 1.2rem; opacity: 0.5; }
.fact-prod-info { min-width: 0; flex: 1; overflow: hidden; }
.fact-prod-code {
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--fact-primary-dark);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.fact-prod-desc {
  font-size: 0.8rem;
  color: var(--fact-muted);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.fact-table td.num, .fact-table th.num { text-align: right; }
.fact-qty, .fact-price {
  display: inline-block;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  padding: 0.2rem 0.4rem;
}
.fact-table td:nth-child(2), .fact-table td:nth-child(3), .fact-table td:nth-child(4) { text-align: right; }
.fact-qty:hover, .fact-price:hover { background: #eff6ff; color: var(--fact-primary-dark); }
.fact-price.empty { color: #dc2626; font-style: italic; font-weight: 500; }
.fact-line-total {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--fact-text);
}
.fact-fh-tag {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #b45309;
  background: #fef3c7;
  border-radius: 4px;
  padding: 0.05rem 0.3rem;
  margin-left: 0.35rem;
  vertical-align: middle;
}
.fact-total-row td { border-top: 2px solid var(--fact-border); padding-top: 0.7rem; }
.fact-total-label { text-align: right; font-weight: 600; color: var(--fact-muted); }
.fact-total-value { font-weight: 800; font-size: 1rem; font-variant-numeric: tabular-nums; }
.fact-grand-total {
  margin-left: 0.4rem;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--fact-success);
  font-variant-numeric: tabular-nums;
}
.fact-qty:hover { background: #eff6ff; color: var(--fact-primary-dark); }
.fact-qty .unit { color: var(--fact-muted); font-weight: 500; margin-left: 0.2rem; }
.fact-row-remove {
  border: none;
  background: transparent;
  color: #cbd5e1;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.3rem;
  border-radius: 6px;
  transition: all 0.12s ease;
}
.fact-row-remove:hover { background: #fef2f2; color: #dc2626; }
.fact-col-actions { width: 44px; text-align: right; }

/* ---- Empty states ---- */
.fact-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 240px;
  text-align: center;
  color: var(--fact-muted);
  gap: 0.75rem;
  padding: 2rem;
}
.fact-empty-icon { font-size: 2.5rem; opacity: 0.5; }
.fact-empty-title { font-weight: 600; color: #475569; }

@media (max-width: 860px) {
  .fact-panes { flex-direction: column; }
  .fact-rail { width: auto; border-right: none; border-bottom: 1px solid var(--fact-border); max-height: 40%; }
  .fact-table th:nth-child(3), .fact-table td:nth-child(3),
  .fact-table th:nth-child(4), .fact-table td:nth-child(4) { width: 84px; }
}

/* ============================================================
   COMPARISON VIEW (Design 2 — visual bar diff)
   ============================================================ */
.fact-cmp {
  --cmp-transfere: #2563eb;
  --cmp-facture: #16a34a;
  --cmp-border: #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.fact-cmp-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.fact-cmp-filters { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.fact-cmp-chip {
  border: 1px solid var(--cmp-border);
  background: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.12s ease;
}
.fact-cmp-chip:hover { border-color: #2563eb; color: #1d4ed8; }
.fact-cmp-chip.active { background: #2563eb; border-color: #2563eb; color: #fff; }
.fact-cmp-search {
  flex: 1;
  min-width: 220px;
  max-width: 420px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--cmp-border);
  border-radius: 8px;
  font-size: 0.9rem;
}
.fact-cmp-search:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }

.fact-cmp-legend {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: #334155;
  padding: 0.5rem 0.15rem;
  border-top: 1px solid var(--cmp-border);
  border-bottom: 1px solid var(--cmp-border);
}
.fact-cmp-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; margin-right: 0.3rem; }
.fact-cmp-swatch.transfere { background: var(--cmp-transfere); }
.fact-cmp-swatch.facture { background: var(--cmp-facture); }
.fact-cmp .transfere { color: var(--cmp-transfere); }
.fact-cmp .facture { color: var(--cmp-facture); }
.fact-cmp-legend-eq { margin-left: auto; color: #64748b; }

.fact-cmp-list { display: flex; flex-direction: column; }

.fact-cmp-row {
  display: grid;
  grid-template-columns: 48px minmax(160px, 230px) 1fr 116px;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.25rem;
  border-bottom: 1px solid #f1f2f4;
}
.fact-cmp-row:hover { background: #f8fafc; }
.fact-cmp-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 1px solid var(--cmp-border);
  background: #f8fafc;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fact-cmp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.fact-cmp-thumb .placeholder { font-size: 1.3rem; opacity: 0.5; }
.fact-cmp-info { min-width: 0; overflow: hidden; }
.fact-cmp-code { font-weight: 700; font-size: 0.85rem; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fact-cmp-desc { font-size: 0.78rem; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.fact-cmp-bars { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.fact-cmp-bar-line { display: grid; grid-template-columns: 68px 1fr 64px; align-items: center; gap: 0.5rem; }
.fact-cmp-bar-label { font-size: 0.72rem; font-weight: 700; }
.fact-cmp-track { height: 12px; background: #eef1f5; border-radius: 999px; overflow: hidden; }
.fact-cmp-fill { display: block; height: 100%; border-radius: 999px; min-width: 2px; transition: width 0.2s ease; }
.fact-cmp-fill.transfere { background: var(--cmp-transfere); }
.fact-cmp-fill.facture { background: var(--cmp-facture); }
.fact-cmp-bar-val { font-size: 0.82rem; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; color: #334155; }

.fact-cmp-ecart {
  justify-self: end;
  min-width: 108px;
  text-align: center;
  font-weight: 800;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  white-space: nowrap;
}
.fact-cmp-ecart.pos { background: #fef3c7; color: #b45309; }   /* transféré > facturé */
.fact-cmp-ecart.neg { background: #fee2e2; color: #dc2626; }   /* facturé > transféré */
.fact-cmp-ecart.match { background: #dcfce7; color: #15803d; }

@media (max-width: 780px) {
  .fact-cmp-row { grid-template-columns: 40px 1fr; grid-template-areas: 'thumb info' 'bars bars' 'ecart ecart'; }
  .fact-cmp-thumb { grid-area: thumb; }
  .fact-cmp-info { grid-area: info; }
  .fact-cmp-bars { grid-area: bars; }
  .fact-cmp-ecart { grid-area: ecart; justify-self: stretch; }
}

/* ProductSelector "Ce projet" scope chip */
.ps-command-chip--project.active {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
  font-weight: 700;
}

/* ============================================================
   Labor grid selector (top bar)
   ============================================================ */
.fact-grid-select {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--fact-muted);
  font-weight: 600;
}
.fact-grid-dropdown {
  border: 1px solid var(--fact-border);
  border-radius: 8px;
  padding: 0.3rem 0.5rem;
  font-size: 0.82rem;
  background: #fff;
  color: var(--fact-text);
  max-width: 200px;
}
.fact-grid-none { font-weight: 500; font-style: italic; }
.fact-grid-none a { color: var(--fact-primary); }

/* ============================================================
   Detail: section titles, subtotals, labor table, grand total
   ============================================================ */
.fact-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--fact-text);
  margin: 0.25rem 0 0.5rem;
}
.fact-section-title-labor { margin-top: 1.25rem; }

.fact-subtotal-row td {
  border-top: 1px solid var(--fact-border);
  font-weight: 700;
  color: var(--fact-text);
  background: var(--fact-bg);
}

.fact-labor-table select.fact-labor-type {
  width: 100%;
  border: 1px solid var(--fact-border);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
  background: #fff;
  color: var(--fact-text);
}
.fact-labor-input {
  width: 66px;
  border: 1px solid var(--fact-border);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.fact-labor-rate { display: inline-flex; align-items: center; justify-content: flex-end; gap: 0.25rem; white-space: nowrap; }
.fact-labor-unit { color: var(--fact-muted); font-size: 0.78rem; }

/* Prime (premium) picker under a labor line's type */
.fact-prime-picker {
  display: block;
  margin-top: 0.35rem;
  max-width: 100%;
  border: 1px dashed #f59e0b;
  color: #b45309;
  background: #fffbeb;
  border-radius: 8px;
  padding: 0.2rem 0.4rem;
  font-size: 0.78rem;
  cursor: pointer;
}
/* Prime sub-rows billed under their labor line */
.fact-prime-line td { background: #fffdf5; border-bottom: 1px solid var(--fact-border-soft); }
.fact-prime-name { color: #92400e; font-size: 0.82rem; padding-left: 1rem !important; }
.fact-prime-rate { color: #b45309; font-size: 0.8rem; white-space: nowrap; }

/* Labor table gets its own column layout: narrower Type, roomier rate column
   so the input + "$/h" suffix never spills into the Total column. */
.fact-labor-table th:nth-child(2), .fact-labor-table td:nth-child(2) { width: 84px; }   /* Heures */
.fact-labor-table th:nth-child(3), .fact-labor-table td:nth-child(3) { width: 128px; }  /* Tarif de vente */
.fact-labor-table th:nth-child(4), .fact-labor-table td:nth-child(4) { width: 104px; }  /* Total */
.fact-labor-table th:nth-child(5), .fact-labor-table td:nth-child(5) { width: 44px; }   /* actions */

.fact-grandtotal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}
.fact-grandtotal-label { font-weight: 800; color: var(--fact-text); }
.fact-grandtotal-value {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--fact-primary-dark);
  font-variant-numeric: tabular-nums;
}
.fact-empty-sm { min-height: 80px; padding: 1rem; }

/* Detail tabs (Produits / Main d'oeuvre) */
.fact-tabs {
  display: inline-flex;
  gap: 0.25rem;
  background: var(--fact-bg);
  border: 1px solid var(--fact-border);
  border-radius: 10px;
  padding: 0.2rem;
}
.fact-tab {
  border: none;
  background: transparent;
  color: var(--fact-muted);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.fact-tab:hover { color: var(--fact-text); }
.fact-tab.active { background: #fff; color: var(--fact-primary-dark); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.fact-tab-count {
  font-size: 0.72rem;
  font-weight: 800;
  background: #e5e7eb;
  color: #475569;
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
}
.fact-tab.active .fact-tab-count { background: #dbeafe; color: var(--fact-primary-dark); }
.fact-panel-actions { display: flex; justify-content: flex-end; margin-bottom: 0.6rem; }

/* ============================================================
   Admin: Grilles de main d'oeuvre
   ============================================================ */
.labor-admin { padding: 1.25rem; max-width: 1200px; margin: 0 auto; }
.labor-admin-head h1 { margin: 0 0 0.25rem; font-size: 1.4rem; }
.labor-admin-head .text-muted { margin: 0 0 1rem; }
.labor-admin-body { display: grid; grid-template-columns: 240px 1fr; gap: 1.25rem; align-items: start; }

.labor-admin-rail {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.labor-admin-rail-head { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #94a3b8; }
.labor-admin-rail-list { display: flex; flex-direction: column; gap: 0.35rem; }
.labor-admin-rail-item {
  text-align: left;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.labor-admin-rail-item:hover { background: #f8fafc; }
.labor-admin-rail-item.active { border-color: #2563eb; background: #eff6ff; }
.labor-admin-rail-name { font-weight: 700; color: #0f172a; }
.labor-admin-rail-meta { font-size: 0.75rem; color: #64748b; display: flex; gap: 0.4rem; align-items: center; }
.btn-block { width: 100%; }

.labor-admin-badge {
  display: inline-block;
  background: #dcfce7;
  color: #15803d;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
}

.labor-admin-main { border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; padding: 1rem; min-width: 0; }
.labor-admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.labor-admin-title { font-size: 1.1rem; font-weight: 800; display: flex; align-items: center; gap: 0.5rem; }
.labor-admin-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.labor-admin-table-wrap { overflow-x: auto; }
.labor-admin-table { width: 100%; border-collapse: collapse; }
.labor-admin-table th, .labor-admin-table td { padding: 0.4rem 0.5rem; border-bottom: 1px solid #f1f2f4; vertical-align: middle; }
.labor-admin-table th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: #94a3b8; }
.labor-admin-table th.num, .labor-admin-table td.num { text-align: right; }
.labor-admin-row-header td { background: #eff6ff; }
.labor-admin-input {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
}
.labor-admin-input.num { text-align: right; width: 90px; font-variant-numeric: tabular-nums; }
.labor-admin-header-input { font-weight: 800; background: transparent; border-color: transparent; }
.labor-admin-header-input:focus { background: #fff; border-color: #bfdbfe; }
.labor-admin-rate { display: inline-flex; align-items: center; gap: 0.2rem; justify-content: flex-end; }
.labor-admin-unit { color: #94a3b8; font-size: 0.78rem; }
.labor-admin-select {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.3rem 0.4rem;
  font-size: 0.82rem;
  background: #fff;
}
.labor-admin-rowtools { white-space: nowrap; text-align: right; }
.labor-admin-move, .labor-admin-del {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  font-size: 0.75rem;
  color: #64748b;
}
.labor-admin-del:hover { border-color: #fca5a5; color: #dc2626; }
.labor-admin-add { display: flex; gap: 0.5rem; margin-top: 0.75rem; flex-wrap: wrap; }
.labor-admin-empty { padding: 1.5rem; text-align: center; color: #94a3b8; }

/* Prime (premium) rows in the admin grid */
.labor-admin-row-prime td { background: #fffbeb; }
.labor-admin-prime-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #92400e;
  background: #fde68a;
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  margin-right: 0.4rem;
  vertical-align: middle;
}
.labor-admin-prime-config { display: inline-flex; align-items: center; gap: 0.5rem; }
.labor-admin-row-prime td:first-child { display: flex; align-items: center; }
.labor-admin-row-prime td:first-child .labor-admin-input { flex: 1; }

@media (max-width: 860px) {
  .labor-admin-body { grid-template-columns: 1fr; }
}
