/* ============================================================
   Page: calisanlar — "Çalışanlar" (personel alt-defteri)
   Adaptif KPI şeridi + durum/ödeme rozetleri + detay modalı
   + ödeme geçmişi listesi. giderler/.gd-kpi görünüm dili.
   ============================================================ */

/* ── KPI şeridi (adaptif auto-fit — yetkiye/ekrana göre, CLAUDE §8) ── */
.ce-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
.ce-kpi {
  display: flex; align-items: stretch; gap: var(--space-3);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: var(--space-3) var(--space-4);
}
.ce-kpi-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); flex-shrink: 0; align-self: center; display: grid; place-items: center; }
.ce-kpi-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ce-kpi-icon.bg-green  { background: var(--green-soft); color: var(--green); }
.ce-kpi-icon.bg-red    { background: var(--red-soft);   color: var(--red); }
.ce-kpi-icon.bg-blue   { background: var(--blue-soft);  color: var(--blue); }
.ce-kpi-icon.bg-orange { background: rgba(200, 82, 30, .12); color: var(--brand); }
.ce-kpi-info { flex: 1; min-width: 0; }
.ce-kpi-label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); padding-bottom: 5px; border-bottom: 1px solid var(--border); }
.ce-kpi-value { font-size: var(--fs-lg); font-weight: 700; color: var(--text-muted); padding-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ce-kpi-sub { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); padding-top: 2px; }

/* ── Liste hücreleri ── */
.ce-name { font-weight: 700; color: var(--text); }
.ce-sub { font-size: var(--fs-xs); color: var(--text-muted); font-weight: 600; margin-top: 1px; }

/* ── Durum / bu-ay rozetleri ── */
.ce-badge { font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: var(--radius-full); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.ce-b-aktif { background: rgba(39, 174, 96, .14); color: var(--green); }
.ce-b-pasif { background: rgba(127, 140, 141, .16); color: var(--text-muted); }
.ce-b-ok    { background: rgba(39, 174, 96, .14); color: var(--green); }
.ce-b-due   { background: rgba(243, 156, 18, .16); color: var(--yellow); }
.ce-b-info  { background: rgba(53, 122, 189, .12); color: var(--blue); }

.ce-card-pasif { opacity: .68; }

/* ── Detay modalı ── */
.ce-d-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); padding-bottom: var(--space-3); border-bottom: 1px solid var(--border); }
.ce-d-title { font-weight: 800; color: var(--navy); font-size: var(--fs-md); }
.ce-d-amt { font-weight: 800; color: var(--brand); font-size: var(--fs-lg); white-space: nowrap; }
.ce-d-amt small { font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); margin-left: 2px; }
.ce-d-rows { display: flex; flex-direction: column; gap: 2px; }
.ce-d-row { display: flex; gap: var(--space-3); align-items: baseline; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.ce-d-row:last-child { border-bottom: 0; }
.ce-d-k { flex: 0 0 34%; font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); }
.ce-d-v { flex: 1; min-width: 0; font-size: var(--fs-sm); color: var(--text); font-weight: 600; word-break: break-word; }
.ce-del:hover { color: var(--red); }

/* ── Detay modal footer: ödeme aksiyonları (sol) + yönetim ikonları (sağ) ── */
.ce-d-foot-pay { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; min-width: 0; align-items: center; }
.ce-d-foot-pay .btn { flex: 1 1 120px; min-width: 118px; padding: 8px 10px; font-size: 13px; gap: 5px; white-space: nowrap; }
.ce-d-foot-pay .btn svg { width: 15px; height: 15px; }
.ce-d-foot-mng { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; flex-shrink: 0; }
.ce-d-foot-mng.has-pay { padding-left: 10px; margin-left: 4px; border-left: 1px solid var(--border); }
.ce-mng-btn {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; flex-shrink: 0;
  padding: 7px 10px; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-muted); cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.ce-mng-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ce-mng-btn:hover { background: var(--surface-alt); color: var(--navy); border-color: var(--text-muted); }
.ce-mng-btn.is-danger:hover { background: var(--red-soft); color: var(--red); border-color: var(--red); }
@media (max-width: 479px) {
  .ce-d-foot-mng { width: 100%; justify-content: flex-end; }
  .ce-d-foot-mng.has-pay { border-left: 0; padding-left: 0; margin-left: 0; margin-top: 2px; }
}

/* ── Ödeme geçmişi ── */
.ce-hist { margin-top: var(--space-4); }
.ce-hist-title { font-size: var(--fs-xs); font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: var(--space-2); }
.ce-hist-row { display: flex; align-items: center; gap: var(--space-2); padding: 8px var(--space-2); border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.ce-hist-row:last-child { border-bottom: 0; }
.ce-hist-date { flex: 0 0 auto; color: var(--text-muted); font-weight: 600; font-size: var(--fs-xs); white-space: nowrap; }
.ce-hist-kind { font-size: 10px; font-weight: 800; padding: 1px 7px; border-radius: var(--radius-full); white-space: nowrap; }
.ce-k-maas     { background: rgba(200, 82, 30, .12); color: var(--brand); }
.ce-k-avans    { background: rgba(53, 122, 189, .12); color: var(--blue); }
.ce-k-prim     { background: rgba(39, 174, 96, .14);  color: var(--green); }
.ce-k-ikramiye { background: rgba(142, 68, 173, .14); color: var(--purple); }
.ce-hist-acc { flex: 1; min-width: 0; color: var(--text-muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ce-hist-amt { font-weight: 800; color: var(--navy); white-space: nowrap; }
.ce-hist-empty { padding: var(--space-4); text-align: center; color: var(--text-muted); font-weight: 700; font-size: var(--fs-sm); }

/* ── Form alanı ipucu (datalist altı) ── */
.field-hint { font-size: var(--fs-xs); color: var(--text-muted); font-weight: 600; margin-top: 4px; }

/* ── Ödeme formu ipucu ── */
.ce-pay-hint { font-size: var(--fs-sm); color: var(--text); background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px var(--space-3); font-weight: 600; }
.ce-pay-hint b { color: var(--navy); font-weight: 800; }
.ce-pay-sub { color: var(--text-muted); font-weight: 700; font-size: var(--fs-xs); }

/* ── Detay satırı mini-açıklama (hakediş/ödenen dökümü) ── */
.ce-d-mini { display: block; font-size: var(--fs-xs); color: var(--text-muted); font-weight: 600; margin-top: 1px; }

/* ── Prim formu (satış primi) ── */
.ce-check { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 700; color: var(--navy); cursor: pointer; }
.ce-check input { width: 16px; height: 16px; accent-color: var(--brand); }
.ce-prim-box { background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--space-3); }
.ce-prim-box .form-grid { margin: 0; }

/* ── Toplu haftalık ödeme listesi ── */
.ce-bulk-list { margin-top: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.ce-bulk-row { display: flex; align-items: center; gap: var(--space-3); padding: 9px var(--space-3); border-bottom: 1px solid var(--border); cursor: pointer; }
.ce-bulk-row:last-child { border-bottom: 0; }
.ce-bulk-row input { width: 16px; height: 16px; accent-color: var(--brand); flex-shrink: 0; }
.ce-bulk-name { flex: 1; min-width: 0; font-weight: 700; color: var(--text); font-size: var(--fs-sm); }
.ce-bulk-name small { display: block; font-size: var(--fs-xs); color: var(--text-muted); font-weight: 600; }
.ce-bulk-amt { font-weight: 800; color: var(--navy); white-space: nowrap; }
