/* PERSONEL EKRANLARI, RAPORLAR, BİLDİRİMLER ve küçük modüller — tek sahibi: personel modülü.
   Kullananlar: employee.js (Panom, Mesaim, mesai düzeltme), requests.js (Taleplerim, Personel Talepleri),
   reports.js (Raporlar), notifications.js (bildirim paneli), account.js, integrations.js.
   index.html'de bağlı değilse bu modüller yüklenirken bir kez eklenir (bkz. modüllerin STİL bölümü).
   Renkler yalnızca styles.css belirteçleridir; sınıf öneki ps- (personel). Açık tema. */

/* ------------------------------------------------------------------ ORTAK */
.ps-page { min-width: 0; }
/* hidden özniteliği display kuralı olan ps-* öğelerinde de gizlesin */
.ps-note[hidden], .ps-meter[hidden], .ps-leave-form [hidden], .ps-page [hidden] { display: none !important; }
.ps-ic { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.ps-ic svg { width: 18px; height: 18px; }
.ps-muted { color: var(--muted); }
.ps-sep { height: 1px; background: var(--line); margin: 14px 0; border: 0; }
.ps-note { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); line-height: 1.45; margin: 8px 0 0; }
.ps-note .ps-ic { color: var(--blue); margin-top: 1px; }
.ps-note .ps-ic svg { width: 16px; height: 16px; }

/* İki sütunlu sayfa ızgarası (sol geniş); telefonda ve dar ekranda tek sütun */
.ps-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ps-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ps-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; margin-bottom: 16px; }
.ps-grid-2 > .card { min-width: 0; }
.ps-stack { display: flex; flex-direction: column; gap: 16px; }
.ps-stack > .card, .ps-stack > .panel { margin: 0; }

/* Kart başlığı simgesi (renkli kare) */
.ps-head-ic { width: 32px; height: 32px; border-radius: var(--radius-sm); background: var(--tone-soft); color: var(--tone); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.ps-head-ic svg { width: 18px; height: 18px; }
.card-head h3 .ps-head-ic svg { color: var(--tone); width: 18px; height: 18px; }
.ps-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* Satır listesi (görevler, toplantılar, talepler) */
.ps-list { display: flex; flex-direction: column; }
.ps-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; min-height: 52px; border-top: 1px solid var(--line); }
.ps-row:first-child { border-top: 0; }
.ps-row.clickable { cursor: pointer; }
.ps-row.clickable:hover .ps-row-title { color: var(--primary-d); }
.ps-row-ic { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--tone-soft); color: var(--tone); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.ps-row-ic svg { width: 18px; height: 18px; }
.ps-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ps-row-title { font-size: 14px; font-weight: 600; color: var(--heading); overflow-wrap: anywhere; }
.ps-row-sub { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.ps-row-side { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: 0 0 auto; }
.ps-empty { font-size: 13px; color: var(--muted); padding: 6px 0 2px; margin: 0; }

/* Düğmelerde simge */
.btn .ps-ic svg, .mini-btn .ps-ic svg { width: 16px; height: 16px; }
.mini-btn { gap: 6px; }

/* ------------------------------------------------------------------ PANOM */
.ps-today { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ps-state { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1 1 280px; }
.ps-state-ic { width: 48px; height: 48px; border-radius: var(--radius-lg); background: var(--tone-soft); color: var(--tone); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.ps-state-ic svg { width: 26px; height: 26px; }
.ps-state-title { font-size: 17px; font-weight: 700; color: var(--tone-ink, var(--tone)); line-height: 1.3; }
.ps-state-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.ps-state.tone-orange .ps-state-title { color: var(--tone-orange-ink); }
.ps-state.tone-teal .ps-state-title { color: var(--tone-teal-ink); }
.ps-state.tone-gray .ps-state-title { color: var(--tone-gray-ink); }
.ps-mesai-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.ps-mesai-nums > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; min-width: 0; }
.ps-mesai-nums b { display: block; font-size: 18px; color: var(--heading); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-mesai-nums span { font-size: 12px; color: var(--muted); }

/* Görev özeti: üç küçük sayı */
.ps-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.ps-count { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--panel); min-width: 0; }
.ps-count b { display: block; font-size: 22px; line-height: 1.15; color: var(--heading); font-variant-numeric: tabular-nums; }
.ps-count span { font-size: 12px; color: var(--muted); }
.ps-count.warn b { color: var(--danger); }

/* Atölye kartı (atolye yeteneği olan çalışan) */
.ps-cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ps-cta-ic { width: 52px; height: 52px; border-radius: var(--radius-lg); background: var(--tone); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.ps-cta-ic svg { width: 28px; height: 28px; }
.ps-cta-text { flex: 1 1 180px; min-width: 0; }
.ps-cta-text b { display: block; font-size: 15px; color: var(--heading); }
.ps-cta-text span { font-size: 13px; color: var(--muted); }

/* ------------------------------------------------------------------ İZİN TALEBİ FORMU (Panom kutusu + pencere) */
.ps-leave-form .field { margin-bottom: 12px; }
.ps-leave-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.ps-leave-type { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--panel); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-align: left; }
.ps-leave-type:hover { border-color: var(--line-hover); background: var(--surface-2); }
.ps-leave-type .ps-ic { width: 28px; height: 28px; border-radius: var(--radius-sm); background: var(--tone-soft); color: var(--tone); }
.ps-leave-type .ps-ic svg { width: 16px; height: 16px; }
.ps-leave-type.active { border-color: var(--tone); background: var(--tone-soft); color: var(--heading); box-shadow: inset 0 0 0 1px var(--tone); }
.ps-leave-info { font-size: 12.5px; margin: -4px 0 10px; }
.ps-leave-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* ------------------------------------------------------------------ MESAİM */
.ps-month { display: inline-flex; align-items: center; gap: 6px; }
.ps-month-label { font-weight: 700; color: var(--heading); min-width: 116px; text-align: center; }
.ps-month .btn { min-width: 44px; }
.att-day.izin { border-color: #A5DDE3; background: var(--tone-teal-soft); color: var(--tone-teal-ink); }
.att-day.planned { border-style: dashed; }
.ps-days { display: flex; flex-wrap: wrap; gap: 6px; }
.ps-days .att-day { font-size: 12px; padding: 5px 9px; }
.ps-day-btn { min-height: 36px; }
.ps-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin-top: 10px; }
.ps-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; border: 1px solid var(--line-strong); }
.ps-legend i.remote { background: #EFF6FF; border-color: #BFDBFE; }
.ps-legend i.sick { background: #F5F3FF; border-color: #DDD6FE; }
.ps-legend i.izin { background: var(--tone-teal-soft); border-color: #A5DDE3; }
.ps-flags { display: flex; flex-wrap: wrap; gap: 4px; }

/* ------------------------------------------------------------------ TALEPLER */
.ps-req-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.ps-req-card + .ps-req-card { margin-top: 12px; }
.ps-req-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.ps-req-head b { color: var(--heading); font-size: 15px; }
.ps-req-when { font-size: 13.5px; color: var(--ink); }
.ps-req-reason { font-size: 13.5px; color: var(--ink); overflow-wrap: anywhere; }
.ps-req-warn { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; color: var(--amber-ink); background: var(--tone-orange-soft); border-radius: var(--radius-sm); padding: 6px 10px; }
.ps-req-warn .ps-ic svg { width: 15px; height: 15px; }
.ps-req-meta { font-size: 12px; color: var(--muted); }
.ps-req-decide { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 2px; }
.ps-req-decide .input { flex: 1 1 240px; min-width: 0; }
.ps-req-decide .btn { min-height: 44px; }
.ps-req-note { font-size: 12.5px; color: var(--ink); background: var(--surface-2); border-radius: var(--radius-sm); padding: 6px 10px; margin-top: 4px; overflow-wrap: anywhere; }
.ps-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 16px; }
.ps-tile { display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px 16px; min-height: 76px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; font: inherit; box-shadow: var(--shadow); }
.ps-tile:hover { border-color: var(--tone); }
.ps-tile .ps-tile-ic { width: 48px; height: 48px; border-radius: var(--radius-lg); background: var(--tone-soft); color: var(--tone); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.ps-tile .ps-tile-ic svg { width: 24px; height: 24px; }
.ps-tile b { display: block; font-size: 15px; color: var(--heading); }
.ps-tile small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.ps-hr-thumb-pdf { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 600; }
.ps-hr-thumb-pdf svg { width: 40px; height: 40px; }
.ps-upload-ic { display: flex; color: var(--muted); }
.ps-upload-ic svg { width: 34px; height: 34px; }

/* ------------------------------------------------------------------ RAPORLAR */
.ps-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.ps-toolbar .input { width: auto; min-width: 160px; }
.ps-toolbar .ps-gen { margin-left: auto; font-size: 12px; color: var(--muted); }
.ps-kpis { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.ps-nowrap, .ps-nowrap b { white-space: nowrap; }
.ps-chart-card .card-body { padding-top: 4px; }
.ps-chart-card .chart svg { max-height: 340px; }
.ps-chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.week-legend b.c-created { background: var(--blue); opacity: 0.6; }
.week-legend b.c-done { background: var(--primary); }
.week-legend b.c-ontime { background: var(--orange); }
.ps-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ps-code { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 26px; padding: 0 6px; border-radius: var(--radius-sm); background: var(--tone-navy-soft); color: var(--navy); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ps-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--tone-green-soft); color: var(--primary-d); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: 0 0 auto; }
.ps-bar-cell { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.ps-bar-cell .progress { flex: 1; min-width: 60px; }
.ps-chev { display: inline-flex; color: var(--muted); margin-right: 4px; transition: transform 0.15s; vertical-align: -3px; }
.ps-chev svg { width: 16px; height: 16px; }
tr.ps-open .ps-chev { transform: rotate(90deg); }
.ps-table-foot { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

/* ------------------------------------------------------------------ BİLDİRİM PANELİ (zil) */
.ps-notif-modal .modal-body { padding-top: 6px; }
.ps-notif-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.ps-notif-list { display: flex; flex-direction: column; max-height: min(62vh, 560px); overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.ps-notif { display: flex; gap: 12px; align-items: flex-start; padding: 12px 10px; border-radius: var(--radius-sm); border-bottom: 1px solid var(--line); position: relative; }
.ps-notif:last-child { border-bottom: 0; }
.ps-notif.clickable { cursor: pointer; }
.ps-notif.clickable:hover { background: var(--surface-2); }
.ps-notif.unread { background: #F4FBF7; }
.ps-notif.unread.clickable:hover { background: var(--tone-green-soft); }
.ps-notif.unread::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 2px; background: var(--primary); }
.ps-notif-ic { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--tone-soft); color: var(--tone); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.ps-notif-ic svg { width: 18px; height: 18px; }
.ps-notif-main { flex: 1; min-width: 0; }
.ps-notif-title { font-weight: 700; font-size: 14px; color: var(--heading); line-height: 1.35; overflow-wrap: anywhere; }
.ps-notif-body { font-size: 13px; color: var(--ink); margin-top: 2px; white-space: pre-line; overflow-wrap: anywhere; }
.ps-notif-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.ps-notif-meta .pill { font-size: 11px; padding: 1px 8px; }
.ps-notif-go { color: var(--muted); align-self: center; display: inline-flex; }
.ps-notif-go svg { width: 16px; height: 16px; }
.ps-toast-ic { display: inline-flex; vertical-align: -3px; margin-right: 6px; }
.ps-toast-ic svg { width: 16px; height: 16px; }

/* ------------------------------------------------------------------ HESAP (şifre) */
.ps-meter { display: flex; align-items: center; gap: 10px; margin: -6px 0 10px; }
.ps-meter-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.ps-meter-bar > i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--danger); transition: width 0.2s; }
.ps-meter-bar > i.orta { background: var(--orange); }
.ps-meter-bar > i.guclu { background: var(--primary); }
.ps-meter span { font-size: 12px; color: var(--muted); min-width: 120px; text-align: right; }
.ps-check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; cursor: pointer; }
.ps-check input { width: 18px; height: 18px; accent-color: var(--primary); }

/* ------------------------------------------------------------------ ENTEGRASYONLAR */
.ps-int-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 4px 0 14px; }
.ps-int-box { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); padding: 12px 14px; min-width: 0; }
.ps-int-box h4 { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--heading); display: flex; align-items: center; gap: 8px; }
.ps-int-box h4 .ps-ic svg { width: 16px; height: 16px; color: var(--primary); }
.ps-int-box dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; font-size: 12.5px; }
.ps-int-box dt { font-weight: 600; color: var(--ink); white-space: nowrap; }
.ps-int-box dd { margin: 0; color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.ps-int-box p { margin: 0; font-size: 12.5px; color: var(--muted); }
.ps-code-inline, .ps-int-box code, .ps-int code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 12px; background: var(--tone-navy-soft); color: var(--navy); padding: 1px 6px; border-radius: 4px; overflow-wrap: anywhere; }
.ps-pre { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 12px; background: var(--navy); color: #E2E8F0; border-radius: var(--radius-sm); padding: 12px 14px; margin: 0; white-space: pre-wrap; word-break: break-all; user-select: all; }
.ps-scope { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 6px; cursor: pointer; min-height: 44px; }
.ps-scope:hover { background: var(--surface-2); }
.ps-scope input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--primary); flex: 0 0 auto; }
.ps-scope span { font-size: 13px; color: var(--ink); }
.ps-int-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.ps-int-row:first-child { border-top: 0; }
.ps-int-row-main { min-width: 0; flex: 1 1 260px; }
.ps-int-row-title { font-weight: 600; color: var(--heading); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ps-int-row-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ DAR EKRAN / TELEFON */
@media (max-width: 1100px) {
  .ps-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .ps-grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .ps-leave-types { grid-template-columns: minmax(0, 1fr); }
  .ps-mesai-nums b { font-size: 16px; }
  .ps-row { flex-wrap: wrap; }
  .ps-row-side { width: 100%; justify-content: flex-start; padding-left: 48px; }
  .ps-row.no-ic .ps-row-side { padding-left: 0; }
  .ps-toolbar .input { flex: 1 1 100%; min-width: 0; }
  .ps-reports .ps-name { white-space: nowrap; }   /* tablo satırları üç satıra bölünmesin; .table-wrap yatay kayar */
  .ps-toolbar .ps-gen { margin-left: 0; width: 100%; }
  .ps-month { width: 100%; justify-content: space-between; }
  .ps-month-label { flex: 1; min-width: 0; }
  .ps-req-decide .btn { flex: 1 1 auto; }
  .ps-notif { padding: 12px 6px; }
  .ps-meter span { min-width: 0; }
  .mini-btn, .ps-day-btn { min-height: 44px; }
}
