/* İŞ 138: Personel hareketleri ekranı, kullanıcı değiştir / kilit ekranı ve ayar kartı.
   Eski ve yeni tasarım (html.yt) ortak çalışır; renkler değişken yoksa sabit değere düşer. 390 px'te tek sütun, dokunma hedefleri >= 44 px. */

/* ---- Ekran ---------------------------------------------------------------------------------------------------------------- */
.sl { display: grid; gap: 16px; }
.sl .card { min-width: 0; }
.sl-filter { margin-bottom: 8px; }
.sl-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 4px; }
.sl-actions .csv-export-link, .sl-actions button { min-height: 44px; }

/* dikkat çeken durum kartları */
.sl-alerts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.sl-alert { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 2px 12px; align-items: center; text-align: left; cursor: pointer;
  padding: 14px 16px; min-height: 76px; border-radius: 14px; border: 1px solid var(--border-strong, #d0d5dd); background: var(--surface, #fff); color: var(--text, inherit); font: inherit; }
.sl-alert .sl-alert-n { grid-row: 1 / span 2; font-size: 1.9rem; line-height: 1; min-width: 2ch; text-align: center; color: var(--muted, #667085); font-variant-numeric: tabular-nums; }
.sl-alert .sl-alert-l { font-weight: 700; font-size: .98rem; line-height: 1.25; }
.sl-alert small { color: var(--muted, #667085); font-size: .82rem; line-height: 1.3; }
.sl-alert.hot { border-color: #fca5a5; background: #fef2f2; }
.sl-alert.hot .sl-alert-n { color: #b91c1c; }
.sl-alert.open { box-shadow: 0 0 0 3px color-mix(in srgb, #dc2626 28%, transparent); }
.sl-alert:focus-visible { outline: 3px solid var(--primary, #0f766e); outline-offset: 2px; }
.sl-alert-detail { grid-column: 1 / -1; border: 1px solid #fca5a5; border-radius: 14px; background: var(--surface, #fff); padding: 8px 12px; }
.sl-alert-detail[hidden] { display: none; }
.sl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sl-hit { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border, #e4e7ec); }
.sl-hit:last-child { border-bottom: 0; }
.sl-hit .sl-ev { flex: 1 1 280px; }
.sl-hit .secondary { min-height: 44px; }

/* sekmeler */
.sl-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; border-bottom: 1px solid var(--border, #e4e7ec); padding-bottom: 8px; }
.sl-tabs button { min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border-strong, #d0d5dd); background: var(--surface, #fff); color: var(--text, inherit); font: inherit; font-weight: 600; cursor: pointer; }
.sl-tabs button.on { background: var(--primary, #0f766e); border-color: var(--primary, #0f766e); color: #fff; }
.sl-tabs button:focus-visible { outline: 3px solid var(--primary, #0f766e); outline-offset: 2px; }

/* zaman çizelgesi */
.sl-tl { list-style: none; margin: 0; padding: 0; }
.sl-ev { display: grid; grid-template-columns: 54px 14px 1fr; gap: 0 10px; align-items: start; padding: 6px 0; position: relative; }
.sl-ev time { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--muted, #667085); font-size: .92rem; padding-top: 1px; }
.sl-ev time small { display: block; font-weight: 400; font-size: .72rem; }
.sl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--who, #667085); margin-top: 5px; justify-self: center; box-shadow: 0 0 0 3px color-mix(in srgb, var(--who, #667085) 22%, transparent); position: relative; z-index: 1; }
.sl-tl > .sl-ev::before { content: ""; position: absolute; left: calc(54px + 10px + 6px - 1px); top: 0; bottom: 0; width: 2px; background: var(--border, #e4e7ec); }
.sl-tl > .sl-ev:first-child::before { top: 14px; }
.sl-tl > .sl-ev:last-child::before { bottom: calc(100% - 14px); }
.sl-body { min-width: 0; overflow-wrap: anywhere; }
/* İŞ 297 G4: kişi rengi (sabit, tema bilmez) metin rengiyle karıştırılır: koyu temada açılır, açık temada koyulaşır; kişi ayrımı rengin tonundan okunur */
.sl-who { color: color-mix(in srgb, var(--who, var(--text)) 62%, var(--text)); }
.sl-text { color: var(--text, inherit); }
.sl-amt { color: var(--muted, #667085); font-variant-numeric: tabular-nums; }
.sl-table { display: inline-block; font-size: .78rem; padding: 1px 8px; border-radius: 999px; background: var(--surface-alt, #f2f4f7); color: var(--muted, #667085); }
.sl-reason { margin-top: 2px; font-size: .9rem; color: #7a271a; }
.sl-dev { margin-top: 1px; font-size: .76rem; color: var(--muted, #667085); }
.sl-ev.money .sl-body { box-shadow: inset 3px 0 0 #dc2626; padding-left: 8px; border-radius: 2px; }
.sl-ev.fire .sl-text { font-weight: 700; }
.sl-day { padding: 10px 0 4px 64px; font-weight: 700; font-size: .85rem; color: var(--muted, #667085); list-style: none; }
.sl-flat > .sl-ev::before { display: none; }

/* adisyon listesi */
.sl-tickets { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sl-tk { border: 1px solid var(--border, #e4e7ec); border-radius: 12px; background: var(--surface, #fff); overflow: hidden; }
.sl-tk-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; width: 100%; min-height: 52px; padding: 10px 14px; text-align: left; background: none; border: 0; font: inherit; color: inherit; cursor: pointer; }
.sl-tk-head small { color: var(--muted, #667085); }
.sl-tk-head[aria-expanded="true"] { background: var(--surface-alt, #f2f4f7); }
.sl-tk-head:focus-visible { outline: 3px solid var(--primary, #0f766e); outline-offset: -3px; }
.sl-chips, .sl-legend { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.sl-chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .82rem; font-weight: 700; color: color-mix(in srgb, var(--who, var(--text-soft, #475467)) 62%, var(--text, #101828)); background: color-mix(in srgb, var(--who, #475467) 14%, transparent); border: 1px solid color-mix(in srgb, var(--who, #475467) 40%, transparent); }
.sl-tk-body { padding: 8px 14px 14px; border-top: 1px solid var(--border, #e4e7ec); }
.sl-tk-body[hidden] { display: none; }
.sl-ticket-head h3 { margin: 4px 0 2px; font-size: 1.05rem; }
.sl-ticket-head h3 small { color: var(--muted, #667085); font-weight: 500; }
.sl-ticket-head .muted { display: block; font-size: .88rem; margin-bottom: 6px; }
.sl-ticket-foot { margin-top: 10px; }
.sl-ticket-foot .secondary { min-height: 44px; }

/* personel */
.sl-people-table .sl-pbtn { min-height: 44px; padding: 4px 14px; border-radius: 999px; font: inherit; font-weight: 700; cursor: pointer; color: var(--who, inherit); background: color-mix(in srgb, var(--who, #475467) 12%, transparent); border: 1px solid color-mix(in srgb, var(--who, #475467) 40%, transparent); }
.sl-prow.on { background: var(--surface-alt, #f2f4f7); }
.sl-pdetail { margin-top: 14px; padding: 14px; border: 1px solid var(--border, #e4e7ec); border-left: 5px solid var(--who, #667085); border-radius: 12px; }
.sl-pdetail h3 { margin: 0 0 8px; color: var(--who, inherit); }
.sl-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.sl-stats div { padding: 10px; border-radius: 10px; background: var(--surface-alt, #f2f4f7); }
.sl-stats b { display: block; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.sl-stats span { font-size: .82rem; color: var(--muted, #667085); }

@media (max-width: 600px) {
  .sl-ev { grid-template-columns: 46px 12px 1fr; gap: 0 8px; }
  .sl-tl > .sl-ev::before { left: calc(46px + 8px + 5px); }
  .sl-day { padding-left: 54px; }
  .sl-alerts { grid-template-columns: 1fr; }
  .sl-actions .csv-export-link, .sl-actions button { flex: 1 1 100%; justify-content: center; }
}

/* ---- Ayar kartı --------------------------------------------------------------------------------------------------------------- */
.staff-opts { display: grid; gap: 12px; }
.staff-opt { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border, #e4e7ec); border-radius: 12px; cursor: pointer; min-height: 52px; }
.staff-opt input { margin-top: 3px; flex: 0 0 auto; }
.staff-opt span { display: grid; gap: 2px; min-width: 0; }
.staff-opt small { color: var(--muted, #667085); font-size: .85rem; line-height: 1.35; }
.staff-opts .field small { display: block; margin-top: 4px; }
.member-name-line { font-size: .85rem; color: var(--muted, #667085); }
.staff-kvkk { margin: 8px 0 0; padding: 10px 12px; border-radius: 10px; background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; font-size: .9rem; }

/* ---- Kullanıcı değiştir / kilit ekranı ------------------------------------------------------------------------------------------- */
body.staff-lock-open { overflow: hidden; }
.staff-switch { position: fixed; inset: 0; z-index: 12000; display: grid; place-items: center; padding: 16px; background: rgba(17, 24, 39, 0.94); overflow-y: auto; outline: none; }
.staff-switch-box { width: min(420px, 100%); background: var(--surface, #fff); color: var(--text, #101828); border-radius: 22px; padding: 20px 18px 18px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6); }
.staff-switch-box.shake { animation: staff-shake .35s ease; }
@keyframes staff-shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@media (prefers-reduced-motion: reduce) { .staff-switch-box.shake { animation: none; } }
.staff-switch-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.staff-switch-head h2 { margin: 0; font-size: 1.25rem; }
.staff-x { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface-alt, #f2f4f7); font-size: 1.6rem; line-height: 1; cursor: pointer; color: inherit; }
.staff-people { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.staff-person { min-height: 64px; padding: 10px; border-radius: 14px; border: 1px solid var(--border-strong, #d0d5dd); background: var(--surface-alt, #f2f4f7); font: inherit; font-size: 1.05rem; font-weight: 700; color: inherit; cursor: pointer; overflow-wrap: anywhere; }
.staff-person:hover, .staff-person:focus-visible { border-color: var(--primary, #0f766e); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary, #0f766e) 25%, transparent); }
.staff-chosen { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; font-size: 1.1rem; }
.staff-link { background: none; border: 0; padding: 8px 4px; min-height: 44px; font: inherit; font-size: .9rem; color: var(--primary, #0f766e); text-decoration: underline; cursor: pointer; }
.staff-logout { display: block; margin: 14px auto 0; }
.staff-dots { display: flex; justify-content: center; gap: 14px; margin: 6px 0 4px; }
.staff-dots i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong, #98a2b3); }
.staff-dots i.on { background: var(--primary, #0f766e); border-color: var(--primary, #0f766e); }
.staff-msg { min-height: 24px; text-align: center; color: #b42318; font-size: .92rem; margin-bottom: 6px; }
.staff-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.staff-pad button { min-height: 62px; border-radius: 16px; border: 1px solid var(--border-strong, #d0d5dd); background: var(--surface-alt, #f2f4f7); font: inherit; font-size: 1.5rem; font-weight: 700; color: inherit; cursor: pointer; touch-action: manipulation; }
.staff-pad button:active:not(:disabled) { background: var(--primary-soft, #e0f2f1); }
.staff-pad button:disabled { opacity: .5; }

/* kitchen: iptal edilen satırlar (İPTAL · Veli) */
.kb-cancels { margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; border: 2px solid #dc2626; background: #fef2f2; }
.kb-cancels h3 { margin: 0 0 8px; color: #991b1b; font-size: 1rem; }
.kb-cancel { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 6px 0; border-top: 1px dashed #fca5a5; }
.kb-cancel:first-of-type { border-top: 0; }
.kb-cancel s { font-weight: 700; font-size: 1.05rem; color: #7f1d1d; text-decoration-thickness: 2px; }
.kb-cancel .kb-cancel-tag { font-weight: 800; color: #b91c1c; letter-spacing: .02em; }
.kb-cancel small { color: #7f1d1d; }

/* gün sonu: personel kırılımı ve kasa sayımı */
.dz-staff .table-scroll td.num, .dz-staff .table-scroll th.num { text-align: right; font-variant-numeric: tabular-nums; }
.dz-cash { display: grid; gap: 10px; }
.dz-cash-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.dz-cash-row label { flex: 1 1 160px; }
.dz-cash-diff.short { color: #b42318; font-weight: 800; }
.dz-cash-diff.over { color: #b54708; font-weight: 800; }
.dz-cash-diff.ok { color: #067647; font-weight: 800; }

@media print {
  .sl-ev.money .sl-body { box-shadow: none; border-left: 3px solid #000; }
}

/* ---- İŞ 140: Ekip ve Yetkiler ---------------------------------------------------------------------------------------- */
.ek { display: grid; gap: 16px; }
.ek .card { min-width: 0; }
.ek-add-btn { min-height: 48px; font-size: 1rem; margin: 4px 0 14px; }
.ek-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.ek-card { border: 1px solid var(--border, #d9d4cb); border-radius: 12px; padding: 14px; background: var(--surface, #fff); min-width: 0; }
.ek-card.ek-off { opacity: 0.72; }
.ek-head { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-bottom: 8px; }
.ek-name { font-size: 1.05rem; overflow-wrap: anywhere; }
.ek-meta { margin: 0 0 10px; display: grid; gap: 6px; }
.ek-meta div { display: grid; grid-template-columns: 120px 1fr; gap: 8px; font-size: 0.9rem; }
.ek-meta dt { color: var(--muted, #6b6558); }
.ek-meta dd { margin: 0; overflow-wrap: anywhere; }
.ek-perms { display: grid; gap: 8px; margin-bottom: 10px; font-size: 0.9rem; }
.ek-perms select { min-height: 44px; max-width: 100%; }
.ek-perms label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ek-perms .member-flags { display: grid; gap: 6px; }
.ek-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ek-actions button { min-height: 44px; }
.ek-form { display: grid; gap: 12px; }
.ek-form .mz-field input, .ek-form .mz-field select { min-height: 44px; width: 100%; box-sizing: border-box; }
.ek-pass-row { display: flex; gap: 8px; }
.ek-pass-row input { flex: 1; min-width: 0; }
.ek-pass-row button { min-height: 44px; white-space: nowrap; }
.ek-note { font-size: 0.88rem; min-height: 0; }
.ek-note.warn { background: #fff4d6; color: #5a4300; border-radius: 8px; padding: 8px 10px; }
.ek-note.bad { background: #fde7e4; color: #7a1f14; border-radius: 8px; padding: 8px 10px; }
fieldset.ek-perms { border: 1px solid var(--border, #d9d4cb); border-radius: 10px; padding: 10px 12px; }
.ek-cred-warn { background: #fff4d6; color: #5a4300; border-radius: 8px; padding: 10px; margin: 0 0 10px; }
.ek-cred-list { display: grid; gap: 8px; margin: 0 0 12px; }
.ek-cred-list div { display: grid; grid-template-columns: 90px 1fr; gap: 8px; }
.ek-cred-list dt { color: var(--muted, #6b6558); }
.ek-cred-list dd { margin: 0; overflow-wrap: anywhere; }
.ek-cred-list code { font-size: 1.15rem; font-weight: 700; letter-spacing: 0.02em; }
.ek-cred-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ek-cred-actions .mz-btn { min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; }
@media (max-width: 480px) {
  .ek-list { grid-template-columns: 1fr; }
  .ek-meta div { grid-template-columns: 1fr; gap: 2px; }
}

/* İŞ 347 (Paket B): "Çalışan ekle" tek pencere — personel kaydı (maaş) + "Uygulamaya giriş verilsin mi?" */
.ek-form [hidden] { display: none !important; }
.ek-secenek { align-items: flex-start; border: 1px solid var(--border, #e4e7ec); border-radius: 12px; padding: 10px 12px; min-height: 44px; }
.ek-secenek span { line-height: 1.35; }
.ek-personel, .ek-giris { display: grid; gap: 12px; padding: 0 0 0 12px; border-left: 3px solid var(--border, #e4e7ec); min-width: 0; }
.ek-personel-alan { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 12px; align-items: end; }
.ek-personel-alan .field { margin: 0; min-width: 0; }
.ek-personel-alan .field input:not([type=checkbox]) { min-height: 44px; width: 100%; box-sizing: border-box; }
.ek-personel-alan .field-checkbox label { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.emp-ekle-satir { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 16px 0 4px; }
.emp-ekle-satir .primary { min-height: 44px; }
@media (max-width: 600px) { .emp-ekle-satir .primary { width: 100%; } .ek-personel, .ek-giris { padding-left: 8px; } }
