/* ============================================================
   İK Panel — Tasarım Sistemi
   Renk paleti: doğrulanmış referans paleti (light + dark)
   ============================================================ */

:root {
  color-scheme: light;

  /* Yüzeyler */
  --bg:            #f4f5f7;
  --surface-1:     #ffffff;
  --surface-2:     #fafbfc;
  --surface-3:     #f0f2f5;
  --sidebar-bg:    #101a2c;
  --sidebar-fg:    #c8d1e0;
  --sidebar-fg-dim:#7f8ca3;
  --sidebar-active:#1c2b45;

  /* Metin */
  --text-primary:  #101828;
  --text-secondary:#4a5567;
  --text-muted:    #808b9e;

  /* Çizgiler */
  --border:        #e5e8ee;
  --border-strong: #d3d9e3;

  /* Marka */
  --brand:         #2a78d6;
  --brand-strong:  #1c5cab;
  --brand-soft:    #eaf2fd;
  --accent:        #4a3aa7;

  /* Kategorik seriler (sabit sıra, asla döngüsel değil) */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;
  --series-7: #4a3aa7;
  --series-8: #e34948;

  /* Durum (sabit — asla seri rengi olarak kullanılmaz) */
  --good:     #0ca30c;
  --warning:  #fab219;
  --serious:  #ec835a;
  --critical: #d03b3b;
  --good-soft:     #e7f6e7;
  --warning-soft:  #fdf3dd;
  --critical-soft: #fbeaea;
  --info-soft:     #e8f1fc;
  --neutral-soft:  #eef0f4;

  /* Ölçüler */
  --radius-sm: 7px;
  --radius:    11px;
  --radius-lg: 16px;
  --shadow-1:  0 1px 2px rgba(16,24,40,.05);
  --shadow-2:  0 3px 12px -3px rgba(16,24,40,.10), 0 1px 3px rgba(16,24,40,.05);
  --shadow-3:  0 18px 40px -12px rgba(16,24,40,.24);
  --sidebar-w: 250px;
  --topbar-h:  70px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:            #121316;
  --surface-1:     #1a1a19;
  --surface-2:     #202124;
  --surface-3:     #26282c;
  --sidebar-bg:    #0d0e11;
  --sidebar-fg:    #b8bfcc;
  --sidebar-fg-dim:#6d7686;
  --sidebar-active:#1e2129;

  --text-primary:  #f2f3f5;
  --text-secondary:#b6bcc7;
  --text-muted:    #868e9c;

  --border:        #2c2e33;
  --border-strong: #3a3d44;

  --brand:         #3987e5;
  --brand-strong:  #5598e7;
  --brand-soft:    #16263c;
  --accent:        #9085e9;

  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #008300;
  --series-7: #9085e9;
  --series-8: #e66767;

  --good-soft:     #142a14;
  --warning-soft:  #33280c;
  --critical-soft: #331717;
  --info-soft:     #16263c;
  --neutral-soft:  #26282c;

  --shadow-1:  0 1px 2px rgba(0,0,0,.4);
  --shadow-2:  0 3px 12px -3px rgba(0,0,0,.5);
  --shadow-3:  0 18px 40px -12px rgba(0,0,0,.7);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
button { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
::selection { background: var(--brand-soft); }

/* Scrollbar */
* ::-webkit-scrollbar { width: 10px; height: 10px; }
* ::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
* ::-webkit-scrollbar-thumb:hover { background: var(--text-muted); background-clip: content-box; }

/* ============================================================ LAYOUT */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}
.sidebar__brand {
  display: flex; align-items: center; gap: 11px;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.brand-mark {
  width: 38px; height: 38px; flex: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--series-1), var(--accent));
  color: #fff; font-weight: 800; font-size: 14px;
  display: grid; place-items: center;
  letter-spacing: .02em;
}
/* Logo yuklendiginde rozet acik zemine doner: saydam PNG'ler koyu sidebar'da
   kaybolmasin diye. Gorsel kirpilmadan sigar (contain).                      */
.brand-mark--logo { background: #fff; padding: 4px; }
.brand-mark--logo img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 6px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text strong { color: #fff; font-size: 15px; }
.brand-text span { color: var(--sidebar-fg-dim); font-size: 11.5px; }
.sidebar__close { display: none; margin-left: auto; color: var(--sidebar-fg); }

.nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.nav__label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--sidebar-fg-dim); padding: 14px 10px 7px; font-weight: 700;
}
.nav__item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 9px 11px; margin-bottom: 2px;
  background: none; border: 0; border-radius: 9px;
  color: var(--sidebar-fg); font-size: 13.5px; font-weight: 500;
  cursor: pointer; text-align: left;
  transition: background .14s, color .14s;
}
.nav__item svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav__item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav__item.is-active { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.nav__item.is-active svg { opacity: 1; color: var(--brand-strong); }
.nav__item .pill {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: var(--critical); color: #fff;
  border-radius: 999px; padding: 1px 7px; min-width: 20px; text-align: center;
}

/* Açılır alt menü (Ayarlar → Departmanlar / Lokasyonlar) */
.nav__item--parent .chev { margin-left: auto; display: grid; place-items: center; transition: transform .18s ease; opacity: .55; }
.nav__item--parent .chev svg { width: 14px; height: 14px; }
.nav__item--parent.is-open .chev { transform: rotate(180deg); opacity: .9; }
.nav__item--parent.has-active { color: #fff; }
.nav__item--parent.has-active svg { color: var(--brand-strong); opacity: 1; }
.nav__sub { position: relative; margin: 1px 0 5px; padding-left: 22px; }
.nav__sub::before {
  content: ""; position: absolute; left: 20px; top: 3px; bottom: 3px;
  width: 1.5px; background: rgba(255,255,255,.12); border-radius: 2px;
}
.nav__sub .nav__item { padding: 7px 11px; font-size: 13px; gap: 9px; }
.nav__sub .nav__item::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%; flex: none;
  background: currentColor; opacity: .4;
}
.nav__sub .nav__item.is-active::before { opacity: 1; background: var(--brand-strong); }

.sidebar__foot { padding: 12px 10px 14px; border-top: 1px solid rgba(255,255,255,.07); }
.demo-badge {
  display: flex; gap: 9px; align-items: center;
  background: rgba(255,255,255,.05); border-radius: 9px;
  padding: 9px 11px; margin-bottom: 10px;
}
.demo-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px rgba(12,163,12,.2); flex: none; }
.demo-badge strong { display: block; font-size: 12px; color: #fff; }
.demo-badge small { font-size: 10.5px; color: var(--sidebar-fg-dim); }
.user-chip {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: 0; border-radius: 9px; padding: 7px 8px; cursor: pointer;
  transition: background .14s;
}
.user-chip:hover { background: rgba(255,255,255,.06); }
.user-chip__text { display: flex; flex-direction: column; line-height: 1.3; text-align: left; min-width: 0; }
.user-chip__text strong { font-size: 12.5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip__text small { font-size: 11px; color: var(--sidebar-fg-dim); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h); flex: none;
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.topbar__burger { display: none; }
.topbar__title h1 { font-size: 19px; }
.topbar__title p { font-size: 12.5px; color: var(--text-muted); margin-top: 1px; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 9px; position: relative; }
.topbar__today {
  font-size: 12.5px; color: var(--text-secondary); font-weight: 550;
  background: var(--surface-3); border-radius: 8px; padding: 7px 12px;
  white-space: nowrap;
}

.search { position: relative; display: flex; align-items: center; }
.search__icon {
  position: absolute; left: 11px; width: 15px; height: 15px; opacity: .55;
  background: currentColor; color: var(--text-muted);
  -webkit-mask: var(--search-mask) center/contain no-repeat;
  mask: var(--search-mask) center/contain no-repeat;
  --search-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='m20 20-3.2-3.2'/></svg>");
}
.search input {
  width: 236px; padding: 9px 34px 9px 33px;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface-2); color: var(--text-primary);
  font-size: 13px; outline: none; transition: border-color .15s, box-shadow .15s, width .18s;
}
.search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); width: 280px; background: var(--surface-1); }
.search kbd {
  position: absolute; right: 9px; font-family: var(--font); font-size: 11px;
  color: var(--text-muted); background: var(--surface-3);
  border: 1px solid var(--border); border-radius: 5px; padding: 0 5px; pointer-events: none;
}
.search-results {
  position: absolute; top: calc(100% + 8px); right: 0; width: 340px; z-index: 60;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-3);
  max-height: 380px; overflow-y: auto; padding: 6px;
}
.search-results .sr-item {
  display: flex; gap: 10px; align-items: center; width: 100%;
  padding: 8px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left;
}
.search-results .sr-item:hover { background: var(--surface-3); }
.search-results .sr-empty { padding: 16px; text-align: center; color: var(--text-muted); font-size: 13px; }

.icon-btn {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border: 1px solid transparent; border-radius: 9px;
  background: transparent; cursor: pointer; position: relative;
  color: var(--text-secondary); transition: background .14s, color .14s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text-primary); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .badge {
  position: absolute; top: 3px; right: 3px;
  min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--critical); color: #fff;
  border-radius: 999px; font-size: 10.5px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--surface-1);
}

.content { padding: 22px; flex: 1; max-width: 1560px; width: 100%; outline: none; }

.scrim { display: none; }

/* ============================================================ BİLEŞENLER */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}
.card__head {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--border);
}
.card__head h3 { font-size: 14.5px; }
.card__head p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.card__head .spacer { margin-left: auto; }
.card__body { padding: 18px; }
.card__body--flush { padding: 0; }
.card__foot { padding: 12px 18px; border-top: 1px solid var(--border); }

.grid { display: grid; gap: 16px; }
.grid--kpi { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid--kpi3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid--kpi5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid--2-1 { grid-template-columns: minmax(0,1.75fr) minmax(0,1fr); }
.grid--1-2 { grid-template-columns: minmax(0,1fr) minmax(0,1.9fr); }
.mt16 { margin-top: 16px; }

/* KPI */
.kpi { padding: 17px 18px; display: flex; flex-direction: column; gap: 12px; }
.kpi__top { display: flex; align-items: flex-start; gap: 12px; }
.kpi__ico {
  width: 40px; height: 40px; border-radius: 11px; flex: none;
  display: grid; place-items: center; color: #fff;
}
.kpi__ico svg { width: 20px; height: 20px; }
.kpi__label { font-size: 12.5px; color: var(--text-muted); font-weight: 550; }
.kpi__value { font-size: 27px; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; margin-top: 3px; }
.kpi__value small { font-size: 14px; font-weight: 600; color: var(--text-muted); margin-left: 2px; }
.kpi__foot { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-muted); }
.trend { display: inline-flex; align-items: center; gap: 3px; font-weight: 650; }
.trend svg { width: 13px; height: 13px; }
.trend--up { color: var(--good); }
.trend--down { color: var(--critical); }
.trend--flat { color: var(--text-muted); }

/* Rozet / durum */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 650; line-height: 1;
  padding: 5px 9px; border-radius: 999px;
  background: var(--neutral-soft); color: var(--text-secondary);
  white-space: nowrap;
}
.tag svg { width: 12px; height: 12px; }
.tag--good     { background: var(--good-soft);     color: var(--good); }
.tag--warning  { background: var(--warning-soft);  color: #8a6100; }
:root[data-theme="dark"] .tag--warning { color: var(--warning); }
.tag--critical { background: var(--critical-soft); color: var(--critical); }
.tag--info     { background: var(--info-soft);     color: var(--brand); }
.tag--dot::before { content:""; width:6px; height:6px; border-radius:50%; background: currentColor; }

/* Avatar */
.avatar {
  width: 36px; height: 36px; flex: none;
  border-radius: 50%; display: grid; place-items: center;
  background: var(--av, var(--brand)); color: #fff;
  font-size: 12px; font-weight: 700; letter-spacing: .01em;
  border: 2px solid var(--surface-1);
}
.avatar--sm { width: 30px; height: 30px; font-size: 10.5px; }
.avatar--lg { width: 66px; height: 66px; font-size: 21px; border-width: 3px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -9px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person__text { min-width: 0; }
.person__name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person__sub { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Butonlar */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: 9px; border: 1px solid var(--border-strong);
  background: var(--surface-1); color: var(--text-primary);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .14s, border-color .14s, opacity .14s;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { background: var(--surface-3); }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn--good { background: var(--good); border-color: var(--good); color: #fff; }
.btn--good:hover { opacity: .88; background: var(--good); }
.btn--danger { background: var(--critical); border-color: var(--critical); color: #fff; }
.btn--danger:hover { opacity: .88; background: var(--critical); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn--ghost:hover { background: var(--surface-3); }
.btn--sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* Filtre çubuğu — grafiklerin üstünde tek sıra */
.toolbar {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar .spacer { margin-left: auto; }
.field { position: relative; display: flex; align-items: center; }
.field select, .field input[type="text"], .field input[type="search"], .field input[type="date"], .field input[type="month"] {
  appearance: none;
  padding: 8px 30px 8px 12px;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface-1); color: var(--text-primary);
  font-size: 13px; font-weight: 500; outline: none; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.field input[type="text"], .field input[type="search"] { cursor: text; padding-right: 12px; min-width: 230px; }
.field select { padding-right: 32px; }
.field select:focus, .field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field__caret {
  position: absolute; right: 11px; pointer-events: none;
  width: 9px; height: 9px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted);
  transform: translateY(-2px) rotate(45deg); border-radius: 1px;
}

.segmented {
  display: inline-flex; background: var(--surface-3);
  border-radius: 9px; padding: 3px; gap: 2px;
}
.segmented button {
  border: 0; background: none; cursor: pointer;
  padding: 6px 13px; border-radius: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--text-secondary);
  transition: background .14s, color .14s;
}
.segmented button:hover { color: var(--text-primary); }
.segmented button.is-active { background: var(--surface-1); color: var(--text-primary); box-shadow: var(--shadow-1); }
.segmented button .cnt { color: var(--text-muted); font-weight: 600; margin-left: 4px; }
/* İkonlu segment düğmeleri (takvimdeki ‹ › okları): SVG'nin boyut kuralı yoktu,
   ikon görünmüyordu — .btn svg kuralı buraya uygulanmıyor.                    */
.segmented button svg { width: 16px; height: 16px; display: block; }
.segmented button.segmented__ico { display: inline-flex; align-items: center; justify-content: center; padding: 6px 10px; }

/* Tablo */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.tbl th {
  text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-muted);
  padding: 11px 16px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
table.tbl th.sortable { cursor: pointer; user-select: none; }
table.tbl th.sortable:hover { color: var(--text-primary); }
table.tbl th .sort { opacity: .4; margin-left: 4px; }
table.tbl th.is-sorted .sort { opacity: 1; color: var(--brand); }
table.tbl td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl tbody tr { transition: background .12s; }
table.tbl tbody tr:hover { background: var(--surface-2); }
table.tbl tbody tr.is-clickable { cursor: pointer; }
table.tbl tbody tr.is-pasif .avatar { filter: grayscale(1); opacity: .7; }
table.tbl tbody tr.is-pasif .person__name { color: var(--text-secondary); font-weight: 550; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.actions { text-align: right; white-space: nowrap; }
td.actions .btn { margin-left: 5px; }
.muted { color: var(--text-muted); }
.mono { font-family: var(--mono); font-size: 12.5px; }

.empty {
  padding: 46px 20px; text-align: center; color: var(--text-muted);
}
.empty svg { width: 34px; height: 34px; opacity: .35; margin-bottom: 10px; }
.empty strong { display: block; color: var(--text-secondary); font-size: 14px; margin-bottom: 3px; }

.pager { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.pager__info { font-size: 12.5px; color: var(--text-muted); }
.pager__btns { display: flex; gap: 5px; }

/* Liste satırı */
.rowlist { display: flex; flex-direction: column; }
.rowlist__item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .12s;
}
.rowlist__item:hover { background: var(--surface-2); }
.rowlist__item:last-child { border-bottom: 0; }
.rowlist__item.is-pasif .avatar { filter: grayscale(1); opacity: .7; }
.rowlist__item.is-pasif .rowlist__title { color: var(--text-secondary); font-weight: 550; }
.rowlist__main { min-width: 0; flex: 1; }
.rowlist__title { font-size: 13.5px; font-weight: 600; }
.rowlist__sub { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.rowlist__side { text-align: right; font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* Çubuk (ilerleme) */
.meter { height: 7px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 999px; background: var(--series-1); }

/* ============================================================ GRAFİK */
.chart { width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis-text { fill: var(--text-muted); font-size: 11px; font-family: var(--font); }
.chart .axis-text--strong { fill: var(--text-secondary); font-weight: 600; }
.chart .val-text { fill: var(--text-secondary); font-size: 11px; font-weight: 650; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .bar { transition: opacity .12s; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .bargroup.is-dim { opacity: .38; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 0 18px 16px; }
.legend__item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); font-weight: 550; }
.legend__swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }

.tooltip {
  position: fixed; z-index: 200; pointer-events: none;
  background: var(--surface-1); border: 1px solid var(--border-strong);
  border-radius: 9px; box-shadow: var(--shadow-3);
  padding: 9px 11px; font-size: 12.5px; min-width: 120px;
  transform: translate(-50%, calc(-100% - 12px));
}
.tooltip__title { font-weight: 700; margin-bottom: 5px; font-size: 12.5px; }
.tooltip__row { display: flex; align-items: center; gap: 7px; justify-content: space-between; }
.tooltip__row + .tooltip__row { margin-top: 3px; }
.tooltip__key { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); }
.tooltip__val { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ============================================================ TAKVİM */
.cal { padding: 0; }
.cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); }
.cal__dow {
  padding: 10px 6px; text-align: center;
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-muted); background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.cal__cell {
  min-height: 116px; padding: 7px 8px 8px;
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface-1); position: relative;
}
.cal__cell:nth-child(7n) { border-right: 0; }
.cal__cell--out { background: var(--surface-2); }
.cal__cell--out .cal__day { color: var(--text-muted); opacity: .55; }
.cal__cell--weekend { background: var(--surface-2); }
.cal__cell--today { box-shadow: inset 0 0 0 2px var(--brand); z-index: 1; }
.cal__day {
  font-size: 12.5px; font-weight: 650; color: var(--text-secondary);
  width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px;
}
.cal__cell--today .cal__day { background: var(--brand); color: #fff; }
.cal__ev {
  display: flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 550;
  padding: 3px 6px; border-radius: 6px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--neutral-soft); color: var(--text-secondary);
  border-left: 3px solid var(--text-muted);
}
.cal__ev i { width: 6px; height: 6px; border-radius: 50%; flex: none; background: currentColor; }
.cal__ev--holiday  { background: var(--critical-soft); color: var(--critical); border-left-color: var(--critical); }
.cal__ev--leave    { background: var(--info-soft);     color: var(--brand);    border-left-color: var(--brand); }
.cal__ev--birthday { background: #fdeef4;              color: #b23a6a;         border-left-color: var(--series-5); }
:root[data-theme="dark"] .cal__ev--birthday { background: #331b26; color: var(--series-5); }
.cal__ev--event    { background: #e9f7f1;              color: #0d7a54;         border-left-color: var(--series-3); }
:root[data-theme="dark"] .cal__ev--event { background: #12291f; color: var(--series-3); }
.cal__ev--anniv    { background: #f0edfb;              color: #4a3aa7;         border-left-color: var(--series-7); }
:root[data-theme="dark"] .cal__ev--anniv { background: #221d3d; color: var(--series-7); }
.cal__more { font-size: 11px; color: var(--text-muted); font-weight: 600; cursor: pointer; padding-left: 6px; }
.cal__more:hover { color: var(--brand); }

/* ============================================================ DRAWER */
.drawer { position: fixed; inset: 0; z-index: 100; }
.drawer__scrim { position: absolute; inset: 0; background: rgba(16,24,40,.42); backdrop-filter: blur(2px); animation: fade .18s ease; }
.drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(560px, 96vw);
  background: var(--surface-1); border-left: 1px solid var(--border);
  box-shadow: var(--shadow-3);
  display: flex; flex-direction: column;
  animation: slideIn .22s cubic-bezier(.22,.8,.3,1);
}
.drawer__head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--border); flex: none;
}
.drawer__head h2 { font-size: 16px; }
.drawer__head .icon-btn { margin-left: auto; }
.drawer__body { padding: 18px; overflow-y: auto; flex: 1; }
@keyframes fade { from { opacity: 0 } }
@keyframes slideIn { from { transform: translateX(24px); opacity: .4 } }

.profile-head { display: flex; gap: 15px; align-items: center; margin-bottom: 18px; }
.profile-head h3 { font-size: 18px; }
.profile-head p { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs button {
  border: 0; background: none; cursor: pointer;
  padding: 9px 13px; font-size: 13px; font-weight: 600; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button:hover { color: var(--text-primary); }
.tabs button.is-active { color: var(--brand); border-bottom-color: var(--brand); }

.deflist { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px 18px; }
.deflist > div { min-width: 0; }
.deflist dt { font-size: 11.5px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.deflist dd { margin: 3px 0 0; font-size: 13.5px; font-weight: 550; word-break: break-word; }
.section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin: 20px 0 10px; }

.balance-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.balance {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px;
}
.balance b { display: block; font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.balance span { font-size: 11.5px; color: var(--text-muted); }

/* Bordro tablosu — 22 sütun, ilk iki sütun sabit */
.tbl--bordro { min-width: 1680px; font-size: 13px; }
.tbl--bordro th, .tbl--bordro td { padding: 10px 12px; white-space: nowrap; }
.tbl--bordro .col-no { width: 52px; min-width: 52px; position: sticky; left: 0; z-index: 2; background: var(--surface-1); }
.tbl--bordro .col-ad { width: 220px; min-width: 220px; position: sticky; left: 52px; z-index: 2; background: var(--surface-1);
  box-shadow: 1px 0 0 var(--border); }
.tbl--bordro .col-net {
  position: sticky; right: 0; z-index: 2; background: var(--surface-1);
  box-shadow: -1px 0 0 var(--border);
}
.tbl--bordro thead .col-no, .tbl--bordro thead .col-ad, .tbl--bordro thead .col-net { z-index: 4; background: var(--surface-2); }
.tbl--bordro tbody tr:hover .col-no, .tbl--bordro tbody tr:hover .col-ad, .tbl--bordro tbody tr:hover .col-net { background: var(--surface-2); }
.tbl--bordro tfoot .tbl__toplam td {
  background: var(--surface-2); border-top: 2px solid var(--border-strong);
  padding: 12px; font-variant-numeric: tabular-nums; position: sticky; bottom: 0;
}
.tbl--bordro tfoot .col-no, .tbl--bordro tfoot .col-ad, .tbl--bordro tfoot .col-net { z-index: 3; background: var(--surface-2); }

/* Raporlama zinciri */
.yn-zincir {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 14px; padding: 11px 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 12.5px;
}
.yn-ok { color: var(--text-muted); font-weight: 700; }

/* Listeler — üç sütunlu tek ekran */
.liste-izgara { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; }
.liste-sutun { display: flex; flex-direction: column; }
.liste-sutun .card__head { gap: 10px; }
.liste-sutun .card__head h3 { font-size: 14px; }
.liste-govde { display: flex; flex-direction: column; }
.liste-satir {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .12s;
}
.liste-satir:last-child { border-bottom: 0; }
.liste-satir:hover { background: var(--surface-2); }
.liste-nokta { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.liste-ad { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.liste-ad b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.liste-ad .mono { font-size: 11px; }
.liste-alt { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.liste-alt svg { width: 11px; height: 11px; flex: none; }
.liste-alt--uyari { color: var(--warning); }
.liste-sayi {
  flex: none; min-width: 26px; text-align: center;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  padding: 2px 7px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-secondary);
}
.liste-sayi.is-sifir { background: var(--warning-soft); color: #8a6100; }
:root[data-theme="dark"] .liste-sayi.is-sifir { color: var(--warning); }
.liste-islem { flex: none; display: flex; gap: 2px; opacity: .45; transition: opacity .12s; }
.liste-satir:hover .liste-islem, .liste-satir:focus-within .liste-islem { opacity: 1; }
.icon-btn--kilitli { color: var(--text-muted); }
.icon-btn--kilitli:hover { background: var(--critical-soft); color: var(--critical); }
.liste-islem .icon-btn { width: 28px; height: 28px; border-radius: 7px; }
.liste-islem .icon-btn svg { width: 14px; height: 14px; }
.liste-sutun .card__foot { padding: 10px 12px; }

@media (max-width: 1500px) { .liste-izgara { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .liste-izgara { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px)  { .liste-izgara { grid-template-columns: minmax(0, 1fr); } }

/* İçe aktarma */
.ia-adim { margin: 0 0 16px; padding-left: 20px; font-size: 13px; color: var(--text-secondary); line-height: 1.65; }
.ia-adim li { margin-bottom: 4px; }
.ia-adim b { color: var(--text-primary); }
.ia-hata {
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 16px; padding: 13px;
  background: var(--critical-soft); border: 1px solid var(--critical);
  border-radius: var(--radius); font-size: 13px; color: var(--critical);
}
.ia-hata svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.ia-hata b { display: block; margin-bottom: 2px; }

.ia-yeni {
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 12px; padding: 12px;
  background: var(--info-soft); border: 1px solid var(--brand);
  border-radius: var(--radius); font-size: 12.5px; color: var(--text-secondary);
}
.ia-yeni svg { width: 17px; height: 17px; flex: none; color: var(--brand); margin-top: 1px; }
.ia-yeni b { display: block; color: var(--text-primary); margin-bottom: 5px; }
.ia-yeni > div > div { margin-top: 4px; }
.ia-yeni .tag { margin-right: 3px; }

/* Bordro — hücre içi giriş */
.tbl--bordro .th--elle { color: var(--text-primary); }
.tbl--bordro .th--elle::after {
  content: "✎"; margin-left: 5px; font-size: 10px; opacity: .55; font-weight: 400;
}
.tbl--bordro td.cell-edit { padding: 4px 6px; }
.cell-input {
  width: 100%; min-width: 96px;
  font: inherit; font-size: 13px; font-variant-numeric: tabular-nums;
  text-align: right; padding: 6px 9px;
  border: 1px solid transparent; border-radius: 7px;
  background: var(--surface-2); color: var(--text-primary);
  outline: none; transition: border-color .12s, background .12s, box-shadow .12s;
}
.cell-input:hover { border-color: var(--border-strong); }
.cell-input:focus {
  border-color: var(--brand); background: var(--surface-1);
  box-shadow: 0 0 0 3px var(--brand-soft); position: relative; z-index: 1;
}
td.cell-edit.is-elle .cell-input {
  background: var(--warning-soft); border-color: var(--warning); font-weight: 650;
}
td.cell-edit.is-elle .cell-input:focus { background: var(--surface-1); border-color: var(--brand); }
tr.is-pasif .cell-input { opacity: .8; }

/* Evrak (özlük belgeleri) */
.doc-list { display: flex; flex-direction: column; gap: 10px; }
.doc {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-1); overflow: hidden;
}
.doc--eksik { border-style: dashed; }
.doc__head { display: flex; align-items: center; gap: 11px; padding: 12px 13px; }
.doc__ico {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-secondary);
}
.doc__ico svg { width: 17px; height: 17px; }
.doc__ico--ok { background: var(--good-soft); color: var(--good); }
.doc__ico--warn { background: var(--warning-soft); color: #8a6100; }
:root[data-theme="dark"] .doc__ico--warn { color: var(--warning); }
.doc__ico--bad { background: var(--critical-soft); color: var(--critical); }
.doc__title { min-width: 0; flex: 1; }
.doc__title strong { display: block; font-size: 13.5px; font-weight: 650; }
.doc__title small { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }

.doc__file {
  display: flex; align-items: center; gap: 10px;
  margin: 0 13px 13px; padding: 10px 11px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px;
}
.doc__ext {
  flex: none; font-size: 9.5px; font-weight: 800; letter-spacing: .04em;
  padding: 5px 6px; border-radius: 5px; background: var(--brand); color: #fff;
}
.doc__meta { min-width: 0; flex: 1; }
.doc__meta strong { display: block; font-size: 12.5px; font-weight: 600; word-break: break-all; }
.doc__meta small { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.doc__acts { display: flex; gap: 5px; flex: none; }
.doc__acts .icon-btn { width: 30px; height: 30px; border-radius: 7px; }
.doc__acts .icon-btn svg { width: 15px; height: 15px; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; text-align: center; cursor: pointer;
  margin: 0 13px 13px; padding: 16px 12px;
  border: 1.5px dashed var(--border-strong); border-radius: 10px;
  background: var(--surface-2); color: var(--text-secondary);
  transition: border-color .15s, background .15s, color .15s;
}
.dropzone svg { width: 20px; height: 20px; opacity: .65; margin-bottom: 2px; }
.dropzone span { font-size: 12.5px; }
.dropzone span b { color: var(--brand); font-weight: 650; }
.dropzone small { font-size: 11px; color: var(--text-muted); }
.dropzone:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--text-primary); }
.dropzone.is-over { border-color: var(--brand); background: var(--brand-soft); border-style: solid; }
.dropzone.is-busy { opacity: .6; pointer-events: none; }

.doc-summary {
  display: flex; align-items: center; gap: 12px;
  padding: 13px; margin-bottom: 14px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
}
.doc-summary__val { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.doc-summary__val small { font-size: 13px; color: var(--text-muted); font-weight: 600; }

/* Form (ayarlar drawer'ları) */
.form { display: flex; flex-direction: column; gap: 14px; }
.form__row { display: flex; flex-direction: column; gap: 6px; }
.form__row > span {
  font-size: 12px; font-weight: 650; color: var(--text-secondary);
  letter-spacing: .01em;
}
.form__row input[type="text"], .form__row input[type="date"], .form__row input[type="time"], .form__row select, .form__row textarea {
  width: 100%; font: inherit; font-size: 13.5px;
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface-1); color: var(--text-primary);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.form__row textarea { resize: vertical; line-height: 1.5; }
.form__row select { appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.form__check {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; cursor: pointer;
  font-size: 13px; line-height: 1.45; color: var(--text-secondary);
}
.form__check input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--brand); flex: none; cursor: pointer; }
.form__check:hover { border-color: var(--border-strong); }
.form__row input:focus, .form__row select:focus, .form__row textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.form__row input::placeholder, .form__row textarea::placeholder { color: var(--text-muted); opacity: .8; }

/* Toast */
.toast-wrap { position: fixed; bottom: 20px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 9px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-1); border: 1px solid var(--border-strong);
  border-left: 3px solid var(--brand);
  border-radius: 10px; box-shadow: var(--shadow-3);
  padding: 11px 15px; font-size: 13px; font-weight: 550;
  min-width: 250px; animation: toastIn .2s ease;
}
.toast svg { width: 17px; height: 17px; flex: none; }
.toast--good { border-left-color: var(--good); }
.toast--good svg { color: var(--good); }
.toast--critical { border-left-color: var(--critical); }
.toast--critical svg { color: var(--critical); }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0 } }

/* ============================================================ RESPONSIVE */
@media (max-width: 1200px) {
  .grid--kpi { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid--kpi3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid--kpi5 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .grid--2-1, .grid--1-2, .grid--3 { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 900px) {
  .search input { width: 150px; }
  .search input:focus { width: 190px; }
  .topbar__today { display: none; }
  .grid--2 { grid-template-columns: minmax(0,1fr); }
  .content { padding: 16px; }
}
@media (max-width: 640px) {
  /* Yan menü yalnızca TELEFONDA gizlenir; hamburger (☰) ve kapatma (✕)
     düğmeleri de yalnızca burada görünür. Masaüstü/dar pencerede menü
     sabittir, o iki düğme çıkmaz.                                        */
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%); transition: transform .22s cubic-bezier(.22,.8,.3,1);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(16,24,40,.45); z-index: 39; }
  .sidebar__close { display: grid; }
  .topbar__burger { display: grid; }
  .grid--kpi, .grid--kpi3, .grid--kpi5 { grid-template-columns: minmax(0,1fr); }
  .deflist, .balance-grid { grid-template-columns: minmax(0,1fr); }
  .topbar__title p { display: none; }
  .search { display: none; }
  .cal__cell { min-height: 78px; }
}


/* ---------- Ayarlar ekrani ---------- */
.ayar-izgara { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.marka-onizleme {
  display: flex; align-items: center; gap: 11px;
  padding: 14px; border-radius: var(--radius);
  background: var(--sidebar-bg, #16202e);
}
.marka-onizleme__mark {
  width: 38px; height: 38px; flex: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--series-1), var(--accent));
  color: #fff; font-weight: 800; font-size: 14px; display: grid; place-items: center;
}
.marka-onizleme__mark.is-logo { background: #fff; padding: 4px; }
.marka-onizleme__mark img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 6px; }
.marka-onizleme__yazi { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.marka-onizleme__yazi strong { color: #fff; font-size: 15px; }
.marka-onizleme__yazi span { color: var(--sidebar-fg-dim, rgba(255,255,255,.6)); font-size: 11.5px; }


/* ---------- Yüklenen dosya önizlemesi ---------- */
.dosya-onizleme { margin-top: 10px; }
.dosya-onizleme img {
  display: block; max-width: 100%; max-height: 60vh; margin: 0 auto;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
}
.dosya-onizleme iframe {
  width: 100%; height: 62vh; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface-2);
}
.dosya-onizleme__alt { display: flex; align-items: center; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
