/* Varsayılan AÇIK tema. Koyu tema yalnız kullanıcı seçerse açılır (üstteki düğme). */
:root {
  --brand: #1f4e79; --brandAcik: #e8eff6;
  --ok: #1e7d3a; --bad: #b3261e; --warn: #9a6700;
  --bg: #eef1f5; --card: #fff; --text: #1b1f24; --muted: #5b6570; --line: #d5dbe1; --row: #f4f6f9;
  --sorunBg: #fdeeed; --dikkatBg: #fdf6e6; --yan: #fbfcfd;
}
:root[data-tema="koyu"] {
  --brandAcik: #24313d;
  --bg: #111418; --card: #1b2026; --text: #e8ecf0; --muted: #9aa5b1; --line: #2e3640; --row: #161a1f;
  --sorunBg: #2b1a19; --dikkatBg: #2a2417; --yan: #171c22;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, "Segoe UI", Roboto, sans-serif; }
header { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; background: var(--brand); color: #fff; }
.brand { font-weight: 700; display: flex; align-items: center; gap: 10px; }
/* Logo beyaz zeminli bir görsel; lacivert başlıkta beyaz bir alanın içine oturtulur */
.logo { height: 26px; background: #fff; border-radius: 6px; padding: 3px 7px; display: block; }
.logoBuyuk { display: block; width: 190px; max-width: 70%; margin: 0 auto 20px; }
.user { display: flex; gap: 12px; align-items: center; }
button.link { background: none; border: 0; color: #fff; text-decoration: underline; cursor: pointer; font: inherit; }

/* Sol gruplu menü + içerik */
.duzen { display: grid; grid-template-columns: 236px 1fr; align-items: start; }
.yan { background: var(--yan); border-right: 1px solid var(--line); padding: 14px 10px 40px;
  position: sticky; top: 0; max-height: 100vh; overflow-y: auto; }
.menuGrup { margin-bottom: 18px; }
.menuGrup h4 { margin: 0 0 6px 10px; font-size: 12px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.yan button { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  width: 100%; font: inherit; text-align: left; padding: 10px 12px; margin-bottom: 2px;
  border: 0; border-radius: 8px; background: none; color: var(--text); cursor: pointer; }
.yan button:hover { background: var(--brandAcik); }
.yan button.on { background: var(--brand); color: #fff; font-weight: 600; }
main { min-width: 0; padding: 20px 24px 64px; }
@media (max-width: 860px) {
  .duzen { grid-template-columns: 1fr; }
  .yan { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--line);
    display: flex; gap: 14px; overflow-x: auto; padding: 10px 12px; }
  .menuGrup { margin: 0; min-width: 150px; }
  main { padding: 16px; }
}
.login { max-width: 360px; margin: 64px auto; padding: 0 16px; }
h1 { font-size: 22px; } h2 { font-size: 17px; margin: 24px 0 8px; } h2 small { color: var(--muted); font-weight: 400; }
h3 { margin: 0 0 12px; font-size: 16px; }
form { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--text); font-weight: 500; }
.checks { display: flex; gap: 20px; flex-wrap: wrap; }
.checks label { flex-direction: row; align-items: center; gap: 6px; color: var(--text); font-size: 14px; }
label.checks { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
input, select { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--brand); }
input:focus, select:focus, .btn:focus-visible { outline: 3px solid #4a90d9; outline-offset: 1px; }
.btn { font: inherit; font-weight: 600; padding: 10px 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.bad { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.badge { background: var(--bad); color: #fff; border-radius: 10px; padding: 1px 8px; font-size: 12px; font-weight: 700; }
.bar { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; margin-bottom: 12px; }
.grow { flex: 1; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
/* Bugün özetindeki sayı kutuları */
#bugun-kutular { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); margin-bottom: 16px; }
.okText { color: var(--ok); } .badText { color: var(--bad); } .warnText { color: var(--warn); }
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
/* Sayı, tutar ve rozetler satır ortasında bölünmesin */
td .num, td .tag, td b, tfoot td { white-space: nowrap; }
#report-table tbody td, #adv-table tbody td { white-space: nowrap; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: var(--row); }
tbody tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); padding: 12px 0; }

/* Kaydırılabilir tablo kutusu: başlık satırı üstte, ad sütunu solda sabit kalır. */
.genis { overflow: auto; max-height: 74vh; border: 1px solid var(--line); border-radius: 12px; }
.genis table { border: 0; border-radius: 0; }
#leave-table table { min-width: 1500px; }
.genis td .small { line-height: 1.5; white-space: nowrap; }
thead th { position: sticky; top: 0; z-index: 2; box-shadow: inset 0 -1px 0 var(--line); }
table.sabitAd thead th:first-child { left: 0; z-index: 3; }
table.sabitAd tbody td:first-child { position: sticky; left: 0; z-index: 1; background: var(--card);
  box-shadow: inset -1px 0 0 var(--line); }
/* Fare hangi satırda ise o satır boydan boya belirginleşir (geniş tabloda satır kaybolmasın) */
tbody tr:hover > td, table.sabitAd tbody tr:hover > td:first-child { background: var(--row); }

/* Satır renklendirme: sorunlu kırmızı, dikkat isteyen sarı şeritli */
tbody tr.sorun > td, table.sabitAd tbody tr.sorun > td:first-child { background: var(--sorunBg); }
tbody tr.dikkat > td, table.sabitAd tbody tr.dikkat > td:first-child { background: var(--dikkatBg); }
tbody tr.soluk > td { color: var(--muted, #6b7580); }   /* kapanmış kayıt (ör. ödenen icra) */
tbody tr.sorun > td:first-child { box-shadow: inset 4px 0 0 var(--bad); }
tbody tr.dikkat > td:first-child { box-shadow: inset 4px 0 0 var(--warn); }
table.sabitAd tbody tr.sorun > td:first-child { box-shadow: inset 4px 0 0 var(--bad), inset -1px 0 0 var(--line); }
table.sabitAd tbody tr.dikkat > td:first-child { box-shadow: inset 4px 0 0 var(--warn), inset -1px 0 0 var(--line); }

/* Toplam satırı: tablonun altında sabit durur */
tfoot td { position: sticky; bottom: 0; z-index: 2; background: var(--row); font-weight: 700;
  border-top: 2px solid var(--line); border-bottom: 0; box-shadow: inset 0 1px 0 var(--line); }
table.sabitAd tfoot td:first-child { left: 0; z-index: 3; }
.filtreNot { color: var(--muted); font-size: 14px; margin: 6px 0 0; }

/* Yönetici onayı bekleyen iş: sayfanın en üstünde, dikkat çeken kutu */
.uyariKart { background: var(--dikkatBg); border: 2px solid var(--warn); }
.uyariKart h3 { color: var(--warn); }
.uyariKart table { background: var(--card); }

/* Panel kullanıcıları: yetki kutucukları */
.yetkiListe { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; margin: 8px 0 14px; }
.yetkiSatir { flex-direction: row; align-items: flex-start; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-weight: 400; }
.yetkiSatir input { margin-top: 3px; flex: none; }
.yetkiSatir:has(input:checked) { border-color: var(--brand); background: var(--brandAcik); }

/* Telefon numarası tek satırda kalsın (0505 681 19 89) */
#emp-table tbody td:nth-child(2) { white-space: nowrap; }

/* Satıra tıklayınca o kişinin gün gün dökümü açılır */
tbody tr[data-kisi] { cursor: pointer; }
tbody tr[data-kisi] td:first-child::after { content: " ›"; color: var(--muted); font-weight: 700; }

/* Sütun seçici kutusu */
.sutunKutu { background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 12px; }
.sutunKutu .liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px 16px; margin: 10px 0 12px; }
.sutunKutu .liste label { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
td[hidden], th[hidden] { display: none; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; border: 1px solid var(--line); }
.tag.ok { color: var(--ok); border-color: var(--ok); } .tag.bad { color: var(--bad); border-color: var(--bad); } .tag.warn { color: var(--warn); border-color: var(--warn); }
.small { font-size: 13px; color: var(--muted); margin: 0; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
#toast { position: fixed; right: 20px; bottom: 20px; max-width: 420px; padding: 12px 16px; border-radius: 10px; background: #1b1f24; color: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
#toast.err { background: var(--bad); }
input.prim { width: 110px; text-align: right; font-variant-numeric: tabular-nums; padding: 6px 8px; }
input.saat { width: 78px; text-align: center; font-variant-numeric: tabular-nums; padding: 6px; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 1000; }
.modal-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; max-width: 420px; box-shadow: 0 12px 40px rgba(0,0,0,.3); }
.modal-card p { margin: 0 0 16px; }
.modal-card p.satirli { white-space: pre-line; }   /* onay metnindeki \n satır başı olsun */
.modal-card .actions { justify-content: flex-end; }
.btn.kucuk { padding: 2px 8px; font-size: 12px; min-height: 0; }
.xbtn { border: 0; background: none; cursor: pointer; padding: 0 0 0 4px; color: inherit; font-size: 12px; }
#map { height: 560px; border-radius: 12px; border: 1px solid var(--line); cursor: crosshair; }
form.inline { display: block; }
#radius-wrap span { display: flex; align-items: center; gap: 8px; color: var(--text); }
.vertex { background: #e8710a; border: 2px solid #fff; border-radius: 50%; width: 12px !important; height: 12px !important; margin: -6px 0 0 -6px !important; }
[hidden] { display: none !important; }
@media (max-width: 700px) { th, td { padding: 6px; font-size: 13px; } }
