/* ==========================================================================
   İyileştirme Portalı — Tasarım Sistemi

   Renk belirteçleri (--bg, --surface, --brand …) sunucu tarafından, seçili
   temaya göre <head> içine yazılır: app/Domain/Theme.php
   Bu dosya renk KARARI vermez; yalnız yerleşim, tipografi ve bileşenleri
   tanımlar. Tek istisna: durum renkleri (rozet/uyarı) temadan bağımsızdır.

   Harici bağımlılık yoktur (font, ikon, çerçeve dahil) — sıkı CSP ile uyumlu.
   Şablonlarda `style="..."` özniteliği kullanılmaz; bkz. InlineStyle + sc().
   ========================================================================== */

/* --- Sıfırlama ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
:where(button, a, input, select, textarea):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

/* --- Temadan bağımsız belirteçler --------------------------------------- */
:root {
  /* Durum renkleri — açık mod */
  --slate:   #5d6c82;  --slate-bg:   #f1f5f9;  --slate-bd:   #e2e8f0;
  --sky:     #0369a1;  --sky-bg:     #e0f2fe;  --sky-bd:     #bae6fd;
  --emerald: #047857;  --emerald-bg: #d1fae5;  --emerald-bd: #a7f3d0;
  --amber:   #b45309;  --amber-bg:   #fef3c7;  --amber-bd:   #fde68a;
  --rose:    #be123c;  --rose-bg:    #ffe4e6;  --rose-bd:    #fecdd3;
  --violet:  #6d28d9;  --violet-bg:  #ede9fe;  --violet-bd:  #ddd6fe;
  --teal:    #0f766e;  --teal-bg:    #ccfbf1;  --teal-bd:    #99f6e4;

  --r-xs: 8px; --r-sm: 10px; --r: 14px; --r-lg: 18px; --r-xl: 24px;

  --sh-1: 0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.05);
  --sh-2: 0 2px 4px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.07);
  --sh-3: 0 4px 8px rgba(15,23,42,.05), 0 20px 48px rgba(15,23,42,.13);

  --sidebar-w: 262px;
  --tabbar-h: 62px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          "Noto Sans", Arial, "Segoe UI Emoji", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* Durum renkleri — koyu mod (kullanıcı seçimi) */
:root[data-mod="dark"] {
  --slate:   #a5b2cb;  --slate-bg:   rgba(148,163,184,.12);  --slate-bd:   rgba(148,163,184,.26);
  --sky:     #7dd3fc;  --sky-bg:     rgba(56,189,248,.13);   --sky-bd:     rgba(56,189,248,.28);
  --emerald: #6ee7b7;  --emerald-bg: rgba(16,185,129,.13);   --emerald-bd: rgba(16,185,129,.3);
  --amber:   #fcd34d;  --amber-bg:   rgba(245,158,11,.14);   --amber-bd:   rgba(245,158,11,.3);
  --rose:    #fda4af;  --rose-bg:    rgba(244,63,94,.14);    --rose-bd:    rgba(244,63,94,.3);
  --violet:  #c4b5fd;  --violet-bg:  rgba(139,92,246,.15);   --violet-bd:  rgba(139,92,246,.32);
  --teal:    #5eead4;  --teal-bg:    rgba(20,184,166,.14);   --teal-bd:    rgba(20,184,166,.3);

  --sh-1: 0 1px 2px rgba(0,0,0,.3);
  --sh-2: 0 2px 6px rgba(0,0,0,.3), 0 10px 28px rgba(0,0,0,.35);
  --sh-3: 0 6px 14px rgba(0,0,0,.4), 0 24px 56px rgba(0,0,0,.5);
}

/* Durum renkleri — koyu mod (sistem tercihi) */
@media (prefers-color-scheme: dark) {
  :root[data-mod="auto"] {
    --slate:   #a5b2cb;  --slate-bg:   rgba(148,163,184,.12);  --slate-bd:   rgba(148,163,184,.26);
    --sky:     #7dd3fc;  --sky-bg:     rgba(56,189,248,.13);   --sky-bd:     rgba(56,189,248,.28);
    --emerald: #6ee7b7;  --emerald-bg: rgba(16,185,129,.13);   --emerald-bd: rgba(16,185,129,.3);
    --amber:   #fcd34d;  --amber-bg:   rgba(245,158,11,.14);   --amber-bd:   rgba(245,158,11,.3);
    --rose:    #fda4af;  --rose-bg:    rgba(244,63,94,.14);    --rose-bd:    rgba(244,63,94,.3);
    --violet:  #c4b5fd;  --violet-bg:  rgba(139,92,246,.15);   --violet-bd:  rgba(139,92,246,.32);
    --teal:    #5eead4;  --teal-bg:    rgba(20,184,166,.14);   --teal-bd:    rgba(20,184,166,.3);

    --sh-1: 0 1px 2px rgba(0,0,0,.3);
    --sh-2: 0 2px 6px rgba(0,0,0,.3), 0 10px 28px rgba(0,0,0,.35);
    --sh-3: 0 6px 14px rgba(0,0,0,.4), 0 24px 56px rgba(0,0,0,.5);
  }
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
}

/* ==========================================================================
   Düzen
   ========================================================================== */
.shell { display: flex; min-height: 100dvh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: linear-gradient(170deg, var(--sidebar-1) 0%, var(--sidebar-2) 92%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow: hidden;
}
.sidebar::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(70% 45% at 12% -5%, color-mix(in srgb, var(--brand-2) 42%, transparent), transparent 70%),
    radial-gradient(50% 30% at 100% 100%, rgba(255,255,255,.07), transparent 70%);
  pointer-events: none;
}
.sidebar > * { position: relative; z-index: 1; }

.brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px 16px; }
.brand__mark {
  width: 42px; height: 42px; flex: 0 0 42px;
  display: grid; place-items: center;
  border-radius: 13px;
  background: rgba(255,255,255,.17);
  border: 1px solid rgba(255,255,255,.3);
  font-weight: 800; font-size: 15px; letter-spacing: .5px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}
.brand__mark--sm {
  width: 32px; height: 32px; flex-basis: 32px; font-size: 12px; border-radius: 10px;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  border-color: transparent; color: var(--brand-ink);
}
.brand__name { font-weight: 700; font-size: 15.5px; letter-spacing: -.012em; line-height: 1.25; }
.brand__slogan { font-size: 11.5px; color: rgba(255,255,255,.6); margin-top: 1px; }

.nav { flex: 1; overflow-y: auto; padding: 4px 12px 20px; scrollbar-width: thin; }
.nav__group { margin-top: 16px; }
.nav__label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255,255,255,.4); padding: 0 10px 8px;
}
.nav__link {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 11px;
  color: rgba(255,255,255,.76);
  font-size: 14px; font-weight: 500;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.nav__link:hover { background: rgba(255,255,255,.09); color: #fff; }
.nav__link .ic { flex: 0 0 20px; opacity: .82; }
.nav__link.is-active {
  background: rgba(255,255,255,.15);
  color: #fff; font-weight: 620;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.13);
}
.nav__link.is-active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--brand-2);
}
.nav__link.is-active .ic { opacity: 1; }
.nav__badge {
  margin-left: auto;
  background: var(--brand-2); color: #0b1a14;
  font-size: 11px; font-weight: 800;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; display: grid; place-items: center;
}

.sidebar__foot { padding: 14px 16px 18px; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar__user { display: flex; align-items: center; gap: 10px; border-radius: 12px; padding: 4px; transition: background .15s; }
.sidebar__user:hover { background: rgba(255,255,255,.08); }
.sidebar__user .avatar { background: rgba(255,255,255,.18); color: #fff; }
.sidebar__uname { font-size: 13.5px; font-weight: 620; }
.sidebar__urole { font-size: 11.5px; color: rgba(255,255,255,.58); }

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

/* NOT: backdrop-filter, içindeki `position: fixed` öğeler için kapsayıcı blok
   oluşturur (açılır paneller ekrana değil bu kutuya göre konumlanırdı).
   Bu yüzden bulanıklık ayrı bir ::before katmanına alınmıştır. */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: 11px 26px;
  padding-top: max(11px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
}
.topbar::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
}
.topbar__brand { display: none; }
.topbar__title {
  font-size: 16px; font-weight: 660; letter-spacing: -.014em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar__spacer { flex: 1; }

.content {
  padding: 26px;
  max-width: 1440px;
  width: 100%;
  flex: 1;
}

/* ==========================================================================
   Bileşenler
   ========================================================================== */

/* Sayfa başlığı */
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head__text { flex: 1; min-width: 240px; }
.page-head h1 { font-size: 26px; font-weight: 730; letter-spacing: -.026em; line-height: 1.2; }
.page-head p { color: var(--text-2); font-size: 14px; margin-top: 5px; }
.page-head__actions { display: flex; gap: 9px; flex-wrap: wrap; }

/* Kart */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  overflow: hidden;
}
.card__head {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 20px; border-bottom: 1px solid var(--line-soft);
  color: var(--text-2);
}
.card__head h2 { font-size: 15px; font-weight: 660; letter-spacing: -.012em; color: var(--text); }
.card__head .sub { font-size: 12.5px; color: var(--text-3); }
.card__body { padding: 20px; }
.card__body--tight { padding: 12px; }
/* Katlanabilir kart başlığı (<details><summary class="card__head card__head--summary">) */
.card__head--summary { cursor: pointer; list-style: none; }
.card__head--summary::-webkit-details-marker { display: none; }
.card__head--summary:hover { background: var(--surface-2); }
details[open] > .card__head--summary { border-bottom-color: var(--line); }
.card__foot { padding: 14px 20px; border-top: 1px solid var(--line-soft); background: var(--surface-2); }

/* Izgara */
.grid { display: grid; gap: 16px; }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--sidebar { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }

/* İstatistik kartı */
.stat {
  position: relative; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 18px 16px;
  box-shadow: var(--sh-1);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s;
}
.stat::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(90% 70% at 100% 0%, color-mix(in srgb, var(--brand) 7%, transparent), transparent 70%);
  pointer-events: none;
}
a.stat:hover, .stat:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: var(--brand-line); }
.stat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
}
.stat__top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; position: relative; }
.stat__icon {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: var(--slate-bg); color: var(--slate);
}
.stat--sky     .stat__icon { background: var(--sky-bg);     color: var(--sky); }
.stat--amber   .stat__icon { background: var(--amber-bg);   color: var(--amber); }
.stat--emerald .stat__icon { background: var(--emerald-bg); color: var(--emerald); }
.stat--violet  .stat__icon { background: var(--violet-bg);  color: var(--violet); }
.stat__label { font-size: 12.5px; font-weight: 620; color: var(--text-2); }
.stat__value { font-size: 31px; font-weight: 740; letter-spacing: -.035em; line-height: 1.05; position: relative; font-variant-numeric: tabular-nums; }
.stat__meta { margin-top: 8px; font-size: 12px; color: var(--text-3); display: flex; gap: 10px; flex-wrap: wrap; position: relative; }
.stat__meta b { color: var(--text-2); font-weight: 640; }

/* Modül kartı (5S girişi gibi hub sayfaları) */
.module-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  overflow: hidden;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s;
}
.module-card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: var(--brand-line); }
.module-card__head {
  display: flex; align-items: center; gap: 14px;
  padding: 20px; border-bottom: 1px solid var(--line-soft);
}
.module-card__icon {
  width: 48px; height: 48px; flex: 0 0 48px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--slate-bg); color: var(--slate);
}
.module-card--sky     .module-card__icon { background: var(--sky-bg);     color: var(--sky); }
.module-card--rose    .module-card__icon { background: var(--rose-bg);    color: var(--rose); }
.module-card--amber   .module-card__icon { background: var(--amber-bg);   color: var(--amber); }
.module-card--emerald .module-card__icon { background: var(--emerald-bg); color: var(--emerald); }
.module-card--violet  .module-card__icon { background: var(--violet-bg);  color: var(--violet); }
.module-card__title { flex: 1; min-width: 0; }
.module-card__name { display: block; font-size: 16px; font-weight: 680; letter-spacing: -.015em; }
.module-card__sub { display: block; font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.module-card__arrow { color: var(--text-3); flex: 0 0 auto; transition: transform .2s var(--ease), color .2s; }
.module-card:hover .module-card__arrow { transform: translateX(3px); color: var(--brand); }
.module-card__body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.module-card__text { font-size: 13.5px; color: var(--text-2); line-height: 1.65; margin: 0; flex: 1; }
.module-card__stat { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.module-card__stat strong { font-size: 19px; font-weight: 720; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* 5S adım listesi */
.steps-5s { display: grid; gap: 10px; }
.step-5s { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: var(--r-sm); background: var(--surface-2); }
.step-5s__no {
  flex: 0 0 auto; min-width: 36px; height: 26px; padding: 0 8px;
  display: grid; place-items: center; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand); border: 1px solid var(--brand-line);
  font-size: 11.5px; font-weight: 750; letter-spacing: .03em;
}
.step-5s__text { min-width: 0; }

/* Fabrika yerleşim planı */
.layout-canvas {
  position: relative; width: 100%;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface-2); overflow: hidden;
  user-select: none;
}
.layout-canvas img { width: 100%; height: auto; display: block; }
/* Alanın görsel özellikleri editörden gelir; buradaki değerler yalnız
   yedektir (eski kayıtlarda bu alanlar boş olabilir). */
.layout-area {
  --a-stroke: currentColor;
  --a-op: .35;
  --a-text: #fff;
  --a-size: 11px;

  position: absolute;
  border: 2px solid var(--a-stroke);
  border-radius: 6px;
  display: flex; align-items: flex-start; justify-content: flex-start;
  padding: 4px 6px;
  cursor: pointer;
  transition: filter .15s, box-shadow .15s;
}
.layout-area::after {
  content: ""; position: absolute; inset: 0;
  background: currentColor; opacity: var(--a-op); border-radius: 4px;
}
.layout-area:hover { filter: brightness(1.1); box-shadow: 0 0 0 3px color-mix(in srgb, var(--a-stroke) 45%, transparent); }
.layout-area.is-active { box-shadow: 0 0 0 3px color-mix(in srgb, var(--a-stroke) 65%, transparent); }
.layout-area__label {
  position: relative; z-index: 1;
  font-size: var(--a-size); font-weight: 700; line-height: 1.3;
  color: var(--a-text); text-shadow: 0 1px 2px rgba(0,0,0,.35);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.layout-area__badge {
  position: absolute; top: -8px; right: -8px; z-index: 2;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--rose); color: #fff; border: 2px solid var(--surface);
  font-size: 10.5px; font-weight: 800; line-height: 16px; text-align: center;
}
/* Çizim kipi: fare ile yeni alan seçme */
.layout-canvas.is-drawing { cursor: crosshair; }
.layout-draft {
  position: absolute; border: 2px dashed var(--brand);
  background: color-mix(in srgb, var(--brand) 18%, transparent);
  border-radius: 6px; pointer-events: none;
}

/* ==========================================================================
   Yerleşim planı alan editörü
   ========================================================================== */
.editor { display: grid; gap: 16px; }

/* --- Araç çubuğu --- */
.editor__bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); box-shadow: var(--sh-1);
}
.editor__group { display: flex; align-items: center; gap: 6px; }
.editor__sep { width: 1px; align-self: stretch; background: var(--line); margin: 2px 4px; }
.editor__spacer { flex: 1 1 auto; }
.editor__zoom {
  min-width: 52px; text-align: center;
  font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.editor__state { font-size: 12.5px; color: var(--muted); }
.editor__state--ok   { color: var(--emerald); font-weight: 700; }
.editor__state--hata { color: var(--rose);    font-weight: 700; }

/* --- Çalışma alanı: tuval + özellik paneli --- */
.editor__work {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px;
  align-items: start;
}
.editor__work:fullscreen { background: var(--bg); padding: 14px; }

.editor__viewer {
  position: relative; overflow: auto; overscroll-behavior: contain;
  max-height: min(72vh, 780px);
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface-2);
  touch-action: none;   /* çizim ve taşıma jestleri tarayıcıya kapılmasın */
  cursor: grab;
}
.editor__viewer:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.editor__viewer.is-panning  { cursor: grabbing; }
.editor__viewer.is-drawing  { cursor: crosshair; }
.editor__work:fullscreen .editor__viewer { max-height: calc(100vh - 28px); }

.editor__canvas { position: relative; width: 100%; user-select: none; }
.editor__image  { display: block; width: 100%; height: auto; pointer-events: none; }
.editor__svg    { position: absolute; inset: 0; width: 100%; height: 100%; }

.editor__svg g[data-area-id] { cursor: move; }
.editor__svg g[data-area-id] rect { transition: fill-opacity .12s; }
.editor__svg g[data-area-id]:hover rect { fill-opacity: .55; }
.editor__svg g.is-selected rect { stroke-dasharray: 6 3; }
.editor__svg text { pointer-events: none; font-family: var(--font); font-weight: 700; }
.editor__draft {
  fill: none; stroke: var(--brand); stroke-width: 2; stroke-dasharray: 6 4;
  pointer-events: none;
}

/* --- Yeniden boyutlandırma tutamakları --- */
.editor__handles { position: absolute; inset: 0; pointer-events: none; }
.editor__handle {
  position: absolute; width: 13px; height: 13px; margin: -7px 0 0 -7px;
  border: 2px solid var(--brand); border-radius: 3px;
  background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.35);
  pointer-events: auto;
}
.editor__handle--nw, .editor__handle--se { cursor: nwse-resize; }
.editor__handle--ne, .editor__handle--sw { cursor: nesw-resize; }
.editor__handle--n,  .editor__handle--s  { cursor: ns-resize; }
.editor__handle--e,  .editor__handle--w  { cursor: ew-resize; }

/* --- Özellik paneli --- */
.editor__panel { position: sticky; top: 74px; }
.editor__fields .form-grid { gap: 12px; }
.field-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

.range {
  width: 100%; height: 22px; accent-color: var(--brand);
  background: transparent; cursor: pointer;
}
.swatch {
  flex: none; width: 15px; height: 15px; border-radius: 4px;
  border: 2px solid var(--line);
}
.data tr.is-selected { background: var(--brand-soft); }
.data tr[data-row-for] { cursor: pointer; }

/* --- Kişi rozetleri (ekip) --- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips--tight { gap: 4px; }
.chips--stack { flex-direction: column; align-items: stretch; gap: 5px; }
.chips__empty { font-size: 12.5px; color: var(--text-3); }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  max-width: 100%; padding: 3px 8px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface-2); color: var(--text-2);
  font-size: 12px; font-weight: 620; line-height: 1.5;
}
.chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip--more { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-line); }
.chip__x {
  flex: none; width: 17px; height: 17px; padding: 0;
  border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--text-3);
  font-size: 15px; line-height: 1;
}
.chip__x:hover { background: var(--rose-bg); color: var(--rose); }
.chips--stack .chip { border-radius: var(--r-xs); justify-content: space-between; padding: 5px 8px; }

/* --- Seçim penceresi --- */
.dialog {
  width: min(880px, calc(100vw - 32px));
  max-height: min(78vh, 760px);
  padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); color: var(--text);
  box-shadow: var(--sh-3);
}
.dialog::backdrop { background: rgba(15, 23, 42, .55); }
.dialog__form { display: flex; flex-direction: column; max-height: inherit; }
.dialog__head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--line-soft); color: var(--text-2);
}
.dialog__head h2 { font-size: 15px; font-weight: 660; color: var(--text); }
.dialog__bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid var(--line-soft); background: var(--surface-2);
}
.dialog__body {
  display: grid; grid-template-columns: minmax(0, 1fr) 232px;
  gap: 0; min-height: 0; overflow: hidden;
}
.dialog__list { overflow: auto; min-height: 0; max-height: 46vh; }
.dialog__bos { padding: 20px; text-align: center; }
.dialog__side {
  border-left: 1px solid var(--line-soft); background: var(--surface-2);
  padding: 12px 14px; overflow: auto; min-height: 0; max-height: 46vh;
}
.dialog__side h3 {
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 8px;
}
.dialog__foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 16px; border-top: 1px solid var(--line-soft); background: var(--surface-2);
}
.data--compact th, .data--compact td { padding: 7px 12px; }
.data--compact thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.check--only { padding: 0; }

@media (max-width: 700px) {
  .dialog__body { grid-template-columns: minmax(0, 1fr); }
  .dialog__side { border-left: 0; border-top: 1px solid var(--line-soft); max-height: 22vh; }
  .dialog__list { max-height: 40vh; }
}

@media (max-width: 1024px) {
  .editor__work { grid-template-columns: minmax(0, 1fr); }
  .editor__panel { position: static; }
  .editor__viewer { max-height: 60vh; }
}
@media (max-width: 560px) {
  .editor__bar { position: static; }
  .field-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ==========================================================================
   Kaizen — adım şeridi, araç blokları, ekip seçici, rapor
   ========================================================================== */

/* --- Adım şeridi --- */
.steps {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px;
  margin-bottom: 12px; scrollbar-width: thin;
}
.steps__item {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--text-2);
  font-size: 13px; font-weight: 620; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.steps__item:hover { background: var(--surface-2); border-color: var(--brand-line); color: var(--text); }
.steps__item.is-active {
  background: var(--brand); border-color: transparent; color: var(--brand-ink);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--brand) 35%, transparent);
}
.steps__item.is-done:not(.is-active) { border-color: var(--emerald-bd); color: var(--emerald); }
.steps__no {
  flex: none; display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: 999px;
  background: var(--surface-2); color: inherit;
  font-size: 11.5px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.steps__item.is-active .steps__no { background: color-mix(in srgb, var(--brand-ink) 22%, transparent); }
.steps__item.is-done:not(.is-active) .steps__no { background: var(--emerald-bg); }
.steps__no--lg { width: 28px; height: 28px; font-size: 13px; background: var(--brand-soft); color: var(--brand); }
.steps__ad { white-space: nowrap; }
.progress--lg { height: 8px; }

/* --- Adım içi araç bloğu --- */
.tool {
  border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  background: var(--surface-2); padding: 14px; display: grid; gap: 10px;
}
.tool__head { display: flex; align-items: center; gap: 8px; }
.tool__head h4 { font-size: 13.5px; font-weight: 700; color: var(--text); }
.tool__hint { margin-top: -4px; }
.tool__total {
  font-size: 12.5px; color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.tool__total b { color: var(--brand); }
.tool .table-wrap { background: var(--surface); border-radius: var(--r-xs); border: 1px solid var(--line-soft); }
.tool .form-grid { gap: 12px; }
.input--sm, .select--sm { min-height: 32px; padding: 4px 9px; font-size: 13px; }

/* --- Ekip seçici --- */
.team-picker { display: block; }
.team-picker__label { font-size: 13px; font-weight: 620; color: var(--text-2); }
.team-picker__list {
  margin-top: 8px; max-height: 240px; overflow: auto;
  border: 1px solid var(--line); border-radius: var(--r-xs); background: var(--surface);
}
.team-picker__row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 11px; cursor: pointer; border-bottom: 1px solid var(--line-soft);
}
.team-picker__row:last-child { border-bottom: 0; }
.team-picker__row:hover { background: var(--surface-2); }
.team-picker__row.is-owner { display: none; }
.team-picker__who { display: grid; min-width: 0; }
.team-picker__name { font-size: 13px; font-weight: 620; color: var(--text); }
.team-picker__meta { font-size: 11.5px; color: var(--text-3); }

/* --- Dosya listesi --- */
.file-list { display: grid; gap: 4px; list-style: none; margin: 0; padding: 0; }
.file-list__item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: var(--r-xs); background: var(--surface);
  border: 1px solid var(--line-soft); font-size: 13px;
}
.file-list__item a { font-weight: 620; }

/* ==========================================================================
   Araç diyagramları — tablo verisinden üretilen görseller
   (bkz. views/partials/tool_chart.php)

   Hepsi sunucuda üretilir: SVG öznitelikleri ya da tema belirteçlerini
   kullanan sınıflar. Satır içi renk yoktur; sıkı CSP ile uyumludur ve
   açık/koyu temanın ikisinde de okunur.
   ========================================================================== */
.tool__gorsel {
  border: 1px solid var(--line-soft); border-radius: var(--r-xs);
  background: var(--surface); overflow: hidden;
}
.tool__gorsel > summary {
  display: flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 7px 11px; list-style: none;
  font-size: 12.5px; font-weight: 650; color: var(--text-2);
}
.tool__gorsel > summary::-webkit-details-marker { display: none; }
.tool__gorsel > summary:hover { background: var(--surface-2); }
.tool__gorsel[open] > summary { border-bottom: 1px solid var(--line-soft); }

.chart { margin: 0; padding: 12px; display: grid; gap: 10px; }
.chart__svg { width: 100%; height: auto; display: block; }
.chart__scroll { overflow-x: auto; }
.chart__svg--flow { min-width: 760px; }
.chart__legend {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  font-size: 11.5px; color: var(--text-3);
}
.chart__key { display: inline-flex; align-items: center; gap: 5px; }
.chart__key::before {
  content: ""; width: 10px; height: 10px; border-radius: 3px;
  background: var(--slate); flex: none;
}
.chart__key--dogrulandi::before { background: var(--emerald); }
.chart__key--hipotez::before    { background: var(--amber); }
.chart__key--elendi::before     { background: var(--slate); }
.chart__key--bos::before        { background: transparent; border: 1px dashed var(--line); }
.chart__key--kayip::before      { background: var(--rose); }
.chart__key--mevcut::before     { background: var(--slate); }
.chart__key--hedef::before      { background: var(--brand); }
.chart__key--gercek::before     { background: var(--emerald); }
.chart__key--kd::before         { background: var(--emerald); }
.chart__key--zorunlu::before    { background: var(--amber); }
.chart__key--kdz::before        { background: var(--rose); }

/* --- Balık kılçığı (Ishikawa) --- */
.chart__spine      { stroke: var(--text-2); stroke-width: 3; }
.chart__spine-head { fill: var(--text-2); }
.chart__problem    { fill: var(--brand-soft); stroke: var(--brand); stroke-width: 1.5; }
.chart__problem-t  { fill: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: .06em; }
.chart__problem-v  { fill: var(--text); font-size: 12px; font-weight: 700; }
.chart__bone-line  { stroke: var(--text-3); stroke-width: 2; }
.chart__cat        { fill: var(--surface-2); stroke: var(--line); stroke-width: 1; }
.chart__cat-t      { fill: var(--text-2); font-size: 10.5px; font-weight: 800; letter-spacing: .04em; }
.chart__cause-t    { fill: var(--text-2); font-size: 11px; }
.chart__tick       { stroke: var(--text-3); stroke-width: 1; }
.chart__dot        { fill: var(--text-3); }

.chart__bone.is-empty .chart__bone-line { stroke-dasharray: 4 4; opacity: .45; }
.chart__bone.is-empty .chart__cat       { stroke-dasharray: 4 3; opacity: .55; }
.chart__bone.is-empty .chart__cat-t     { opacity: .55; }

.chart__cause--dogrulandi .chart__dot,
.chart__cause--dogrulandi .chart__tick { fill: var(--emerald); stroke: var(--emerald); }
.chart__cause--dogrulandi .chart__cause-t { fill: var(--emerald); font-weight: 700; }
.chart__cause--hipotez .chart__dot,
.chart__cause--hipotez .chart__tick { fill: var(--amber); stroke: var(--amber); }
.chart__cause--elendi { opacity: .5; }
.chart__cause--elendi .chart__cause-t { text-decoration: line-through; }

/* --- Süreç akış şeması --- */
.chart__shape { fill: var(--surface-2); stroke: var(--text-3); stroke-width: 1.5; }
.chart__node-t    { fill: var(--text); font-size: 11px; font-weight: 620; }
.chart__node-tur  { fill: var(--text-3); font-size: 9px; font-weight: 800; letter-spacing: .06em; }
.chart__node-sure { fill: var(--text-2); font-size: 10.5px; font-weight: 700; }
.chart__arrow      { stroke: var(--text-3); stroke-width: 1.5; fill: none; }
.chart__arrow-head { fill: var(--text-3); }

.chart__node--islem   .chart__shape { fill: var(--emerald-bg); stroke: var(--emerald); }
.chart__node--kontrol .chart__shape { fill: var(--sky-bg);     stroke: var(--sky); }
.chart__node--tasima  .chart__shape { fill: var(--amber-bg);   stroke: var(--amber); }
.chart__node--bekleme .chart__shape { fill: var(--rose-bg);    stroke: var(--rose); }
.chart__node--depo    .chart__shape { fill: var(--violet-bg);  stroke: var(--violet); }

/* --- DOE deney listesi --- */
.doe-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.doe-list__row {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) 130px 54px auto;
  align-items: center; gap: 9px;
  padding: 5px 8px; border-radius: var(--r-xs); border: 1px solid transparent;
}
.doe-list__row.is-best { background: var(--emerald-bg); border-color: var(--emerald-bd); }
.doe-list__no {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 11px; font-weight: 800; font-family: var(--mono);
}
.doe-list__faktorler { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.doe-list__bar { height: 9px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.doe-list__fill { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.doe-list__deger { font-family: var(--mono); font-weight: 750; text-align: right; font-size: 12.5px; }

/* --- Dikey çubuklar (histogram) --- */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 18px; }
.bars__item { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; height: 100%; }
.bars__value { font-size: 11px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.bars__col {
  width: 100%; max-width: 54px; margin-top: auto;
  background: linear-gradient(180deg, var(--brand), var(--brand-2, var(--brand)));
  border-radius: 5px 5px 0 0; min-height: 3px;
}
.bars__label {
  margin-top: 6px; font-size: 10.5px; color: var(--text-3); text-align: center;
  line-height: 1.25; overflow-wrap: anywhere;
}

/* --- Yatay çubuklar (spagetti) --- */
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.hbars__row { display: grid; grid-template-columns: minmax(90px, 180px) minmax(0, 1fr) 66px; gap: 10px; align-items: center; }
.hbars__label { font-size: 12px; color: var(--text-2); }
.hbars__track { height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.hbars__fill  { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.hbars__value { font-family: var(--mono); font-size: 12px; font-weight: 700; text-align: right; }

/* --- Yığılmış oran çubuğu (katma değer) --- */
.stackbar { display: flex; height: 28px; border-radius: var(--r-xs); overflow: hidden; border: 1px solid var(--line); }
.stackbar__seg {
  display: grid; place-items: center; min-width: 0;
  font-size: 11px; font-weight: 800; color: #fff;
}
.stackbar__seg--kd      { background: var(--emerald); }
.stackbar__seg--zorunlu { background: var(--amber); }
.stackbar__seg--kdz     { background: var(--rose); }

/* --- Gösterge ekseni (mevcut → hedef → gerçekleşen) --- */
.gauge { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.gauge__row { display: grid; grid-template-columns: minmax(110px, 200px) minmax(0, 1fr) 64px; gap: 12px; align-items: center; }
.gauge__ad { font-size: 12.5px; font-weight: 650; color: var(--text-2); }
.gauge__ad small { color: var(--text-3); font-weight: 500; }
.gauge__track { position: relative; height: 6px; border-radius: 999px; background: var(--surface-2); }
.gauge__mark {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  min-width: 30px; padding: 2px 6px; border-radius: 999px;
  font-size: 10.5px; font-weight: 750; text-align: center;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.gauge__mark--mevcut { background: var(--slate-bg);   color: var(--slate);   border: 1px solid var(--slate-bd); }
.gauge__mark--hedef  { background: var(--brand-soft); color: var(--brand);   border: 1px solid var(--brand-line); }
.gauge__mark--gercek { background: var(--emerald-bg); color: var(--emerald); border: 1px solid var(--emerald-bd); z-index: 1; }
.gauge__basari { text-align: right; }

/* --- Etki / uygulanabilirlik matrisi --- */
.chart--matris { grid-template-columns: minmax(0, 1fr); }
.matris { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 6px; align-items: center; }
.matris__y {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-size: 10.5px; font-weight: 700; color: var(--text-3); text-align: center;
}
.matris__grid {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px;
}
.matris__cell {
  aspect-ratio: 1.6; border-radius: 4px; display: flex; flex-wrap: wrap; gap: 3px;
  align-items: center; justify-content: center; padding: 3px;
}
.matris__cell--yap         { background: var(--emerald-bg); }
.matris__cell--degerlendir { background: var(--amber-bg); }
.matris__cell--bekle       { background: var(--surface-2); }
.matris__dot {
  display: grid; place-items: center; width: 20px; height: 20px; border-radius: 999px;
  background: var(--brand); color: var(--brand-ink);
  font-size: 10.5px; font-weight: 800;
}
.matris__x { grid-column: 2; font-size: 10.5px; font-weight: 700; color: var(--text-3); text-align: center; }
.matris__liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 12px; }
.matris__liste li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.matris__no {
  display: grid; place-items: center; width: 20px; height: 20px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand); font-size: 10.5px; font-weight: 800;
}

/* --- CTQ ağacı (İhtiyaç → Anahtar → CTQ → Spesifikasyon) --- */
.chart__svg--ctq { min-width: 700px; }
.ctq__baslik {
  fill: var(--text-3); font-size: 9px; font-weight: 800; letter-spacing: .06em;
}
.ctq__baglanti { fill: none; stroke: var(--line); stroke-width: 1.5; }
.ctq__kutu  { fill: var(--surface-2); stroke: var(--line); stroke-width: 1; }
.ctq__metin { fill: var(--text); font-size: 11px; font-weight: 620; }
/* Soldan sağa gidildikçe düğüm daha somut, daha ölçülebilir olur */
.ctq__dugum--0 .ctq__kutu { fill: var(--surface-2);  stroke: var(--line); }
.ctq__dugum--1 .ctq__kutu { fill: var(--violet-bg);  stroke: var(--violet-bd); }
.ctq__dugum--2 .ctq__kutu { fill: var(--sky-bg);     stroke: var(--sky-bd); }
.ctq__dugum--3 .ctq__kutu { fill: var(--emerald-bg); stroke: var(--emerald-bd); }
.ctq__dugum--3 .ctq__metin { fill: var(--emerald); font-weight: 750; }
.ctq__olcek     { stroke: var(--line); stroke-width: 1.5; }
.ctq__olcek-uc  { fill: var(--line); }
.ctq__olcek-t   { fill: var(--text-3); font-size: 9px; font-weight: 700; }

/* --- Yatay yayılım --- */
.yayilim { list-style: none; margin: 0; padding: 0 0 0 14px; display: grid; gap: 8px; position: relative; }
.yayilim::before {
  content: ""; position: absolute; left: 4px; top: 8px; bottom: 8px;
  width: 2px; background: var(--line);
}
.yayilim__row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 92px auto;
  gap: 10px; align-items: center; font-size: 12px; position: relative;
}
.yayilim__nokta {
  position: absolute; left: -14px; width: 10px; height: 10px; border-radius: 999px;
  background: var(--surface); border: 2px solid var(--slate);
}
.yayilim__row--devam  .yayilim__nokta { border-color: var(--sky); }
.yayilim__row--tamam  .yayilim__nokta { border-color: var(--emerald); background: var(--emerald); }
.yayilim__alan  { font-weight: 650; color: var(--text); }
.yayilim__kim, .yayilim__tarih { color: var(--text-3); }

@media (max-width: 700px) {
  .doe-list__row { grid-template-columns: 30px minmax(0, 1fr) 46px; }
  .doe-list__bar { display: none; }
  .hbars__row { grid-template-columns: minmax(0, 1fr) 58px; }
  .hbars__track { display: none; }
  .gauge__row { grid-template-columns: minmax(0, 1fr) 56px; }
  .gauge__track { grid-column: 1 / -1; margin-top: 16px; }
  .yayilim__row { grid-template-columns: minmax(0, 1fr) auto; }
  .yayilim__kim, .yayilim__tarih { grid-column: 1 / -1; font-size: 11px; }
}

/* --- Kaizen A3 raporu ---------------------------------------------------
   Görsel dil orijinal rapor panelinden alınmıştır: elektronik tablo görünümü.
   Keskin köşeler, sürekli 1 px siyah ızgara, koyu başlık şeritleri, açık mavi
   etiket hücreleri. Sayfa A3 YATAY (420 × 297 mm) için ölçülendirilmiştir;
   ekrandaki genişlik de mm cinsinden olduğu için önizleme çıktıyla örtüşür.

   Rapor, uygulamanın açık/koyu temasından BAĞIMSIZ kendi "kâğıt" paletini
   kullanır — bir belge her koşulda beyaz kâğıda siyah çizgiyle basılır.
   Yalnız başlık şeritleri marka renginden gelir, böylece beyaz etiket korunur. */
.print-body { background: var(--bg); padding: 20px 16px 60px; }
.report-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  width: min(420mm, 100%); margin: 0 auto 14px;
}

.report {
  --rp-paper:     #ffffff;
  --rp-ink:       #111827;
  --rp-rule:      #000000;   /* dış ızgara */
  --rp-rule-soft: #9ca3af;   /* tablo içi ızgara */
  --rp-rule-mini: #c7ced8;   /* etiket-değer ızgarası */
  --rp-label:     #dfe7f3;   /* etiket hücresi dolgusu */
  --rp-label-2:   #edf2f7;   /* tablo başlığı dolgusu */
  --rp-muted:     #6b7280;

  width: min(420mm, 100%);
  min-height: 297mm;
  margin: 0 auto; padding: 8mm;
  background: var(--rp-paper); color: var(--rp-ink);
  font-family: Arial, Helvetica, var(--font);
  font-size: 11px; line-height: 1.28;
  border: 1px solid var(--line);
  box-shadow: var(--sh-2);
}

/* Başlık şeridi — orijinaldeki koyu tam genişlik bant */
.report__title {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 54px; padding: 8px 16px;
  border: 2px solid var(--rp-rule);
  background: var(--brand); color: var(--brand-ink);
}
.report__title h1 { font-size: 18px; font-weight: 700; letter-spacing: .2px; }
.report__title .report__sub { font-size: 11px; opacity: .85; margin-top: 2px; }
.report__title-right { text-align: right; font-size: 11px; }
.report__title-code { font-family: var(--mono); font-size: 15px; font-weight: 700; }

/* Künye ızgarası — etiket + değer hücreleri, sürekli siyah çizgi */
.report__meta {
  display: grid; grid-template-columns: repeat(8, minmax(0, 1fr));
  border-left: 1px solid var(--rp-rule); border-top: 1px solid var(--rp-rule);
  margin-top: 6px;
}
.report__cell {
  min-height: 22px; padding: 4px 6px;
  border-right: 1px solid var(--rp-rule); border-bottom: 1px solid var(--rp-rule);
  overflow-wrap: anywhere;
}
.report__cell--label { background: var(--rp-label); font-weight: 700; font-size: 10px; }
.report__cell--w2 { grid-column: span 2; }
.report__cell--w3 { grid-column: span 3; }
.report__cell--w5 { grid-column: span 5; }
.report__cell--w7 { grid-column: span 7; }

/* Adım blokları — YATAYDA İKİ ADIM (orijinaldeki kr-x-two) */
.report__steps {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0;
  margin-top: 6px;
  border-left: 1px solid var(--rp-rule); border-top: 1px solid var(--rp-rule);
}
.report__step {
  border-right: 1px solid var(--rp-rule); border-bottom: 1px solid var(--rp-rule);
  break-inside: avoid;
}
.report__step h2 {
  padding: 4px 8px;
  border-bottom: 1px solid var(--rp-rule);
  background: var(--brand); color: var(--brand-ink);
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
}
.report__body { padding: 5px 6px; display: grid; gap: 4px; align-content: start; }
.report__text { white-space: pre-wrap; margin: 0; }
.report__bos { color: #b7c0cc; font-style: italic; }

/* Etiket-değer mini ızgarası (5N1K) */
.report__mini {
  display: grid; grid-template-columns: 96px minmax(0, 1fr);
  border-left: 1px solid var(--rp-rule-mini); border-top: 1px solid var(--rp-rule-mini);
}
.report__mini b, .report__mini span {
  min-height: 15px; padding: 2px 5px;
  border-right: 1px solid var(--rp-rule-mini); border-bottom: 1px solid var(--rp-rule-mini);
  overflow-wrap: anywhere;
}
.report__mini b { background: var(--rp-label-2); font-weight: 700; }
/* İki etiket-değer çifti yan yana — 5N1K gibi çok satırlı künyeler için */
.report__mini--2 { grid-template-columns: 84px minmax(0, 1fr) 84px minmax(0, 1fr); }

/* Araç ve aksiyon tabloları.
   Bir adımda birden fazla dar tablo varsa yan yana dizilir: A3 yatayda blok
   genişliği ~200 mm olduğu için üç analiz tablosu (spagetti, katma değer,
   histogram) rahatça sığar ve adım bloğu üç kat kısalır. Beş ve daha fazla
   sütunlu tablolar (neden-neden) tam genişlik alır. */
.report__tools {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px; align-items: start;
}
.report__tool-wrap--wide { grid-column: 1 / -1; }
.report__tool-title {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  color: var(--rp-muted); margin-bottom: 2px;
}
.report__tool-title small { font-weight: 600; text-transform: none; letter-spacing: 0; }
.report__table {
  width: 100%; border-collapse: collapse; table-layout: fixed;
  font-size: 8.5px; line-height: 1.22;
}
.report__table th, .report__table td {
  padding: 2px 4px; border: 1px solid var(--rp-rule-soft);
  vertical-align: top; text-align: left; overflow-wrap: anywhere;
}
.report__table th { background: var(--rp-label-2); font-weight: 700; }
.report__files { font-size: 10px; color: var(--rp-muted); margin: 0; }
.report__files b { color: var(--rp-ink); }


/* Fayda / maliyet */
.report__benefit {
  margin-top: 6px; break-inside: avoid;
  border-left: 1px solid var(--rp-rule); border-top: 1px solid var(--rp-rule);
}
.report__benefit-title {
  padding: 6px 9px;
  border-right: 1px solid var(--rp-rule); border-bottom: 1px solid var(--rp-rule);
  background: var(--brand); color: var(--brand-ink);
  font-size: 11px; font-weight: 700; text-align: center; text-transform: uppercase;
}
.report__benefit .report__meta { margin-top: 0; border-left: 0; border-top: 0; }

.report__foot {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 5px; font-size: 9.5px; color: var(--rp-muted);
}

@media (max-width: 900px) {
  .report { padding: 14px; min-height: 0; font-size: 12px; }
  .report__steps { grid-template-columns: minmax(0, 1fr); }
  .report__title { flex-direction: column; align-items: flex-start; gap: 6px; }
  .report__title-right { text-align: left; }
}
@media (max-width: 620px) {
  /* Dar ekranda künye ızgarası tek sütuna iner; hiçbir koşulda yatay kaymaz. */
  .report__meta { grid-template-columns: minmax(0, 1fr); }
  .report__cell--w2, .report__cell--w3, .report__cell--w5, .report__cell--w7 { grid-column: span 1; }
  .report__mini { grid-template-columns: minmax(0, 1fr); }
  .report__tool-wrap { overflow-x: auto; }
  .report__table { min-width: 360px; }
}

/* Skor rozeti */
.score-chip {
  display: inline-flex; align-items: baseline; gap: 4px;
  padding: 4px 11px; border-radius: 999px; font-weight: 720;
  font-variant-numeric: tabular-nums; font-size: 13px;
  background: var(--slate-bg); color: var(--slate); border: 1px solid var(--slate-bd);
}
.score-chip small { font-size: 10.5px; font-weight: 620; opacity: .75; }
.score-chip--emerald { background: var(--emerald-bg); color: var(--emerald); border-color: var(--emerald-bd); }
.score-chip--teal    { background: var(--teal-bg);    color: var(--teal);    border-color: var(--teal-bd); }
.score-chip--amber   { background: var(--amber-bg);   color: var(--amber);   border-color: var(--amber-bd); }
.score-chip--rose    { background: var(--rose-bg);    color: var(--rose);    border-color: var(--rose-bd); }

/* Denetim puan girişi */
.score-input { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.score-input__range { width: 100%; accent-color: var(--brand); }
.score-input__value {
  min-width: 58px; text-align: center; font-variant-numeric: tabular-nums;
  font-weight: 700; padding: 6px 8px; border-radius: var(--r-xs);
  background: var(--brand-soft); color: var(--brand); border: 1px solid var(--brand-line);
}
.score-total {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 18px; border-radius: var(--r); border: 1px solid var(--brand-line);
  background: var(--brand-soft);
}
.score-total__value { font-size: 30px; font-weight: 760; letter-spacing: -.03em; color: var(--brand); font-variant-numeric: tabular-nums; }

/* Avatar fotoğrafı */
.avatar--foto { padding: 0; overflow: hidden; background: var(--slate-bg); }
.avatar--foto img { width: 100%; height: 100%; object-fit: cover; }

/* Rozet */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 620;
  white-space: nowrap;
  background: var(--slate-bg); color: var(--slate); border: 1px solid var(--slate-bd);
}
.badge--sky     { background: var(--sky-bg);     color: var(--sky);     border-color: var(--sky-bd); }
.badge--emerald { background: var(--emerald-bg); color: var(--emerald); border-color: var(--emerald-bd); }
.badge--amber   { background: var(--amber-bg);   color: var(--amber);   border-color: var(--amber-bd); }
.badge--rose    { background: var(--rose-bg);    color: var(--rose);    border-color: var(--rose-bd); }
.badge--violet  { background: var(--violet-bg);  color: var(--violet);  border-color: var(--violet-bd); }
.badge--teal    { background: var(--teal-bg);    color: var(--teal);    border-color: var(--teal-bd); }
.badge--slate   { background: var(--slate-bg);   color: var(--slate);   border-color: var(--slate-bd); }
.badge--kod { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0; }

/* Düğme */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px;
  padding: 9px 16px; border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 620; cursor: pointer;
  transition: background .15s var(--ease), border-color .15s, transform .08s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--brand-line); }
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent; color: var(--brand-ink);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--brand) 32%, transparent);
}
/* Hover: parlaklık ARTIRMAK, açık temada degradenin açık ucunda beyaz yazının
   kontrastını AA altına düşürüyordu. Bunun yerine her iki durak da `--brand`
   veya daha koyu olacak şekilde hafifçe koyulaşır — yazı kontrastı
   brand-ink/brand oranına sabitlenir (≥ 4.5:1). */
.btn--primary:hover {
  background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 82%, #000));
  border-color: transparent;
  box-shadow: 0 4px 16px color-mix(in srgb, var(--brand) 40%, transparent);
}
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--danger { color: var(--rose); border-color: var(--rose-bd); background: var(--rose-bg); }
.btn--danger:hover { filter: brightness(.97); border-color: var(--rose); }
.btn--sm { min-height: 32px; padding: 5px 11px; font-size: 13px; border-radius: var(--r-xs); }
.btn--block { width: 100%; }
.btn--soft { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-line); }
.btn--soft:hover { background: var(--brand-soft); filter: brightness(.97); }
.btn--icon { min-width: 36px; padding: 6px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
/* Gönderim sürüyor — düğmenin özgün içeriği (ikon + metin) korunur, başına
   dönen bir gösterge eklenir. Sınıf JavaScript'te verilir; bkz. app.js
   bindSubmitGuard. */
.btn.is-loading { pointer-events: none; }
.btn.is-loading::before {
  content: ""; flex: none; width: 15px; height: 15px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 999px;
  animation: btn-spin .6s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .btn.is-loading::before { animation: none; border-right-color: currentColor; opacity: .55; }
}

/* İkon düğmesi */
.icon-btn {
  width: 40px; height: 40px; border-radius: var(--r-sm);
  display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
  cursor: pointer; position: relative;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--brand-line); }
.icon-btn__dot {
  position: absolute; top: 5px; right: 5px;
  min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--rose); color: var(--surface);
  font-size: 10.5px; font-weight: 800; line-height: 17px; text-align: center;
  border-radius: 999px; border: 2px solid var(--surface);
}
:root[data-mod="dark"] .icon-btn__dot { color: #1a0710; }
@media (prefers-color-scheme: dark) { :root[data-mod="auto"] .icon-btn__dot { color: #1a0710; } }

/* Avatar */
.avatar {
  width: 36px; height: 36px; flex: 0 0 36px;
  border-radius: 12px; display: grid; place-items: center;
  background: var(--slate-bg); color: var(--slate);
  font-size: 13px; font-weight: 700; letter-spacing: .3px;
}
.avatar--sm { width: 28px; height: 28px; flex-basis: 28px; font-size: 11px; border-radius: 9px; }
.avatar--lg { width: 62px; height: 62px; flex-basis: 62px; font-size: 21px; border-radius: 20px; }
.avatar--brand { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--brand-ink); }

/* Tablo */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th {
  text-align: left; padding: 11px 16px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-3); background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-title { font-weight: 620; color: var(--text); }
.cell-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }

/* Boş durum */
.empty { text-align: center; padding: 52px 24px; }
.empty__art {
  width: 76px; height: 76px; margin: 0 auto 16px;
  border-radius: 24px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--brand-soft), color-mix(in srgb, var(--brand-2) 18%, transparent));
  border: 1px solid var(--brand-line);
  color: var(--brand);
}
:root[data-mod="dark"] .empty__art { color: var(--brand); }
.empty h3 { font-size: 16.5px; font-weight: 660; margin-bottom: 6px; }
.empty p { color: var(--text-2); font-size: 14px; max-width: 430px; margin: 0 auto 18px; }

/* Form */
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid--1 { grid-template-columns: minmax(0, 1fr); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 620; color: var(--text-2); }
.field label .req { color: var(--rose); }
.field .hint { font-size: 12px; color: var(--text-3); }
.input, .select, .textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--brand-line); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--brand) 18%, transparent);
}
.textarea { min-height: 108px; resize: vertical; line-height: 1.6; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23808e96' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 36px;
}
.input.is-error, .select.is-error, .textarea.is-error { border-color: var(--rose); }
.field__error { font-size: 12.5px; color: var(--rose); font-weight: 560; }
.file-input {
  padding: 10px 13px; border: 1px dashed var(--line); border-radius: var(--r-sm);
  background: var(--surface-2); font-size: 13.5px; color: var(--text-2); width: 100%;
}
.file-input:hover { border-color: var(--brand-line); }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); flex: 0 0 18px; }

/* Filtre çubuğu */
.filters { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.filters .input, .filters .select { width: auto; min-width: 150px; }
.search-field { position: relative; flex: 1; min-width: 200px; max-width: 340px; }
.search-field .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search-field .input { padding-left: 38px; }

/* Bildirim şeridi */
.alert {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 13px 16px; border-radius: var(--r);
  border: 1px solid var(--slate-bd); background: var(--slate-bg); color: var(--slate);
  font-size: 14px; font-weight: 530; margin-bottom: 14px;
}
.alert .ic { flex: 0 0 20px; margin-top: 1px; }
.alert--success { background: var(--emerald-bg); border-color: var(--emerald-bd); color: var(--emerald); }
.alert--error   { background: var(--rose-bg);    border-color: var(--rose-bd);    color: var(--rose); }
.alert--warning { background: var(--amber-bg);   border-color: var(--amber-bd);   color: var(--amber); }
.alert--info    { background: var(--sky-bg);     border-color: var(--sky-bd);     color: var(--sky); }
.alert a { text-decoration: underline; font-weight: 660; }
.alert { transition: opacity .2s ease, transform .2s ease, margin .2s ease; }
.alert.is-dismissing { opacity: 0; transform: translateY(-6px); pointer-events: none; }

/* İlerleme */
.progress { height: 8px; border-radius: 999px; background: var(--slate-bg); overflow: hidden; }
.progress__bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .5s var(--ease); }
.progress--emerald .progress__bar { background: linear-gradient(90deg, var(--emerald), var(--teal)); }

/* Zaman çizelgesi */
.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -24px; top: 5px;
  width: 11px; height: 11px; border-radius: 999px;
  background: var(--surface); border: 2.5px solid var(--brand);
}
.tl-item--muted::before { border-color: var(--slate-bd); }
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; }
.tl-who { font-weight: 640; }
.tl-when { font-size: 12px; color: var(--text-3); }
.tl-body { font-size: 13.5px; color: var(--text-2); margin-top: 4px; white-space: pre-line; }

/* Tanım listesi */
.dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 11px 16px; font-size: 14px; }
.dl dt { color: var(--text-3); font-size: 12px; font-weight: 640; text-transform: uppercase; letter-spacing: .045em; padding-top: 2px; }
.dl dd { color: var(--text); font-weight: 520; }

/* Metin bloğu */
.prose { font-size: 14.5px; line-height: 1.72; color: var(--text-2); white-space: pre-line; }
.prose strong { color: var(--text); }

/* Çubuk grafik */
.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: minmax(84px, 30%) 1fr auto; gap: 12px; align-items: center; font-size: 13.5px; }
.bar-row__label { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row__track { height: 9px; border-radius: 999px; background: var(--slate-bg); overflow: hidden; }
.bar-row__fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.bar-row__value { font-variant-numeric: tabular-nums; font-weight: 660; color: var(--text); min-width: 30px; text-align: right; }

/* Sütun grafik */
.columns { display: flex; align-items: flex-end; gap: 10px; height: 152px; padding-top: 10px; }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.col__bar {
  width: 100%; max-width: 46px; border-radius: 9px 9px 4px 4px; min-height: 4px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  transition: filter .15s;
}
.col:hover .col__bar { filter: brightness(1.14); }
.col__value { font-size: 12px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.col__label { font-size: 11.5px; color: var(--text-3); }

/* Liste öğesi */
.list { display: flex; flex-direction: column; }
.list__item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line-soft);
  transition: background .12s;
}
.list__item:last-child { border-bottom: 0; }
a.list__item:hover { background: var(--surface-2); }
.list__main { flex: 1; min-width: 0; }
.list__title { font-size: 14px; font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.list__sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; display: block; }
.list__item--unread { background: var(--brand-soft); }

/* Sekmeler */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tab { padding: 9px 15px; font-size: 14px; font-weight: 620; color: var(--text-3); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; }
.tab:hover { color: var(--text-2); }
.tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }

/* Sayfalama */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pager__info { font-size: 13px; color: var(--text-3); }
.pager__links { display: flex; gap: 6px; }

/* Yetki matrisi */
.matrix { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.matrix th, .matrix td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.matrix th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); background: var(--surface-2); }
.matrix tr.group-row td { background: var(--surface-2); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
/* Yetki seviyesi seçimi — her seviyenin kendi rengi vardır.
   Renkler durum belirteçlerinden gelir, dolayısıyla dört temada da
   (açık ve koyu modda) okunaklı kalır. */
.level-pick { display: flex; gap: 5px; flex-wrap: wrap; }
.level-pick input { position: absolute; opacity: 0; width: 0; height: 0; }
.level-pick label {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 640;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-3); cursor: pointer;
  transition: background .14s, border-color .14s, color .14s, box-shadow .14s;
  user-select: none;
}
.level-pick label::before {
  content: ""; width: 8px; height: 8px; border-radius: 999px;
  background: currentColor; opacity: .38; transition: opacity .14s, transform .14s;
}
.level-pick label:hover { border-color: var(--brand-line); color: var(--text-2); }
.level-pick input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; }

.level-pick input:checked + label { box-shadow: inset 0 0 0 1px currentColor; }
.level-pick input:checked + label::before { opacity: 1; transform: scale(1.15); }

.level-pick input:checked + .lvl--yok  { background: var(--rose-bg);    border-color: var(--rose-bd);    color: var(--rose); }
.level-pick input:checked + .lvl--gor  { background: var(--sky-bg);     border-color: var(--sky-bd);     color: var(--sky); }
.level-pick input:checked + .lvl--tam  { background: var(--emerald-bg); border-color: var(--emerald-bd); color: var(--emerald); }
.level-pick input:checked + .lvl--rol  { background: var(--violet-bg);  border-color: var(--violet-bd);  color: var(--violet); }

/* Seçili olmayanlarda da rengin ipucu verilsin */
.level-pick .lvl--yok:hover { color: var(--rose); }
.level-pick .lvl--gor:hover { color: var(--sky); }
.level-pick .lvl--tam:hover { color: var(--emerald); }
.level-pick .lvl--rol:hover { color: var(--violet); }

/* Matris satırında etkin seviyeyi solda gösteren renkli şerit */
.matrix tbody tr { position: relative; }
.lvl-key { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 620; }
.lvl-key__dot { width: 9px; height: 9px; border-radius: 999px; }
.lvl-key--yok .lvl-key__dot { background: var(--rose); }
.lvl-key--gor .lvl-key__dot { background: var(--sky); }
.lvl-key--tam .lvl-key__dot { background: var(--emerald); }
.lvl-key--yok { color: var(--rose); }
.lvl-key--gor { color: var(--sky); }
.lvl-key--tam { color: var(--emerald); }

/* ==========================================================================
   Açılır menü ve tema seçici
   ========================================================================== */
details.dropdown { position: relative; }
details.dropdown > summary { list-style: none; cursor: pointer; }
details.dropdown > summary::-webkit-details-marker { display: none; }
details.dropdown > .dropdown__panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40;
  min-width: 272px; max-width: min(94vw, 340px);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--sh-3);
  overflow: hidden;
  animation: pop .16s var(--ease);
}
.dropdown__panel--wide { min-width: 296px; }
/* Yalnız saydamlık: geometriyi canlandırmak, animasyonun donduğu ortamlarda
   paneli yanlış konumda bırakabiliyor. */
@keyframes pop { from { opacity: 0; } to { opacity: 1; } }
.dropdown__head { padding: 12px 15px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dropdown__head b { font-size: 13.5px; }
.dropdown__scroll { max-height: 336px; overflow-y: auto; }
.dropdown__foot { display: block; padding: 10px 15px; border-top: 1px solid var(--line-soft); background: var(--surface-2); text-align: center; font-size: 13px; font-weight: 620; color: var(--brand); }
.dropdown__note { padding: 10px 15px; border-top: 1px solid var(--line-soft); background: var(--surface-2); font-size: 11.5px; color: var(--text-3); line-height: 1.5; }

.theme-modes { display: flex; gap: 6px; padding: 12px 15px 4px; }
.theme-mode {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 9px 4px; border-radius: var(--r-xs); cursor: pointer;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--text-3); font-size: 11.5px; font-weight: 620;
  transition: all .14s;
}
.theme-mode:hover { border-color: var(--brand-line); color: var(--text-2); }
.theme-mode.is-active { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand); }

.theme-list { padding: 8px; display: flex; flex-direction: column; gap: 3px; }
.theme-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 10px; border-radius: var(--r-xs);
  border: 1px solid transparent; background: transparent; cursor: pointer;
  text-align: left; transition: background .14s, border-color .14s;
}
.theme-item:hover { background: var(--surface-2); }
.theme-item.is-active { background: var(--brand-soft); border-color: var(--brand-line); }
.theme-item__swatches { display: flex; flex: 0 0 auto; border-radius: 7px; overflow: hidden; border: 1px solid var(--line); }
.theme-swatch { width: 13px; height: 26px; display: block; }
.theme-item__text { flex: 1; min-width: 0; }
.theme-item__name { display: block; font-size: 13.5px; font-weight: 640; color: var(--text); }
.theme-item__meta { display: block; font-size: 11.5px; color: var(--text-3); }
.theme-item__check { color: var(--brand); flex: 0 0 auto; }

/* Uyarı şeridi */
.banner-warn {
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  padding: 11px 26px; font-size: 13.5px; font-weight: 550;
  background: var(--amber-bg); color: var(--amber);
  border-bottom: 1px solid var(--amber-bd);
}

/* ==========================================================================
   Giriş ekranı
   ========================================================================== */
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1.05fr .95fr; background: var(--bg); }
.auth__side {
  position: relative; overflow: hidden;
  background: linear-gradient(155deg, var(--sidebar-1) 0%, var(--sidebar-2) 90%);
  color: #fff; padding: 54px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth__side::before {
  content: ""; position: absolute; width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand-2) 52%, transparent), transparent 66%);
  top: -200px; right: -180px;
}
.auth__side::after {
  content: ""; position: absolute; width: 440px; height: 440px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.09), transparent 68%);
  bottom: -170px; left: -120px;
}
.auth__side > * { position: relative; z-index: 1; }
.auth__headline { font-size: 34px; font-weight: 750; letter-spacing: -.035em; line-height: 1.16; max-width: 12ch; }
.auth__lead { margin-top: 14px; font-size: 15px; color: rgba(255,255,255,.76); max-width: 40ch; line-height: 1.65; }
.auth__points { margin-top: 30px; display: flex; flex-direction: column; gap: 13px; }
.auth__point { display: flex; align-items: center; gap: 11px; font-size: 14px; color: rgba(255,255,255,.9); }
.auth__point-ic {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.2);
}
.auth__foot { font-size: 12.5px; color: rgba(255,255,255,.5); }

.auth__panel { display: grid; place-items: center; padding: 40px 28px; position: relative; }
.auth__tools { position: absolute; top: 18px; right: 18px; z-index: 5; }
.auth__box { width: 100%; max-width: 396px; }
.auth__box h1 { font-size: 25px; font-weight: 730; letter-spacing: -.026em; }
.auth__box .sub { color: var(--text-2); font-size: 14px; margin: 6px 0 26px; }
.auth__demo {
  margin-top: 22px; padding: 13px 15px; border-radius: var(--r);
  border: 1px dashed var(--brand-line); background: var(--brand-soft);
  font-size: 12.5px; color: var(--text-2); line-height: 1.65;
}
.auth__demo code {
  font-family: var(--mono);
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  padding: 1px 6px; font-size: 12px; color: var(--text);
}

/* Hata sayfası */
.errpage { min-height: 100dvh; display: grid; place-items: center; padding: 40px 24px; }
.errpage__box { text-align: center; max-width: 480px; }
.errpage__code { font-size: 72px; font-weight: 790; letter-spacing: -.055em; background: linear-gradient(135deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.errpage h1 { font-size: 21px; font-weight: 690; margin: 6px 0 10px; }
.errpage p { color: var(--text-2); margin-bottom: 22px; }
.errpage pre {
  text-align: left; font-size: 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px; overflow: auto; max-height: 280px; color: var(--text-2);
}

/* ==========================================================================
   Mobil alt gezinme
   ========================================================================== */
.tabbar { display: none; }
.sheet { display: none; }

/* ==========================================================================
   CSP uyumlu yardımcı sınıflar
   Şablonlarda `style="..."` özniteliği KULLANILMAZ (nonce style özniteliklerini
   kapsamaz). Tekrar eden stiller burada; dinamik değerler için sc().
   ========================================================================== */
.m-0 { margin: 0; }
.mb-0 { margin-bottom: 0; }
.mt-2px { margin-top: 2px; }
.mt-8 { margin-top: 8px; }
.p-12 { padding: 12px; }
.text-center { text-align: center; }
.d-block { display: block; }
.row--wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.flex-1-min0 { flex: 1; min-width: 0; }
.min-w-0 { min-width: 0; }
.block { display: block; }
.ta-center { text-align: center; }
.ta-left { text-align: left; }
.row--tight { flex-wrap: nowrap; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-11 { gap: 11px; }
.label-caps { text-transform: uppercase; letter-spacing: .05em; }
.text-strong { color: var(--text); }
.brand--flush { padding: 0; }

.textarea--xs { min-height: 70px; }
.textarea--sm { min-height: 80px; }
.textarea--md { min-height: 88px; }
.textarea--lg { min-height: 100px; }
.textarea--xl { min-height: 110px; }
.input--color { height: 42px; padding: 4px; }

.col-42 { width: 42%; }
.col-min-120 { min-width: 120px; }
.col-min-130 { min-width: 130px; }
.dl--120 { grid-template-columns: 120px minmax(0, 1fr); }
.dl--130 { grid-template-columns: 130px minmax(0, 1fr); }
.dl--220 { grid-template-columns: 220px minmax(0, 1fr); }

.row-muted { opacity: .62; }
.card__body--divided { border-top: 1px solid var(--line-soft); }
.empty--compact { padding: 32px 20px; }
.empty--inline { padding: 26px 0; }
.empty__art--sm { width: 56px; height: 56px; border-radius: 18px; }
.step-row { padding: 12px 13px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); transition: border-color .14s; }
.step-row:hover { border-color: var(--brand-line); }
.stat-unit { font-size: 15px; font-weight: 620; }
.errpage--inline { min-height: auto; padding: 60px 24px; }
.mail-frame { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.dropdown__empty { padding: 26px 16px; text-align: center; color: var(--text-3); font-size: 13.5px; }
.dropdown__logout { padding: 10px 12px; border-top: 1px solid var(--line-soft); }

/* Genel yardımcılar */
.stack { display: flex; flex-direction: column; }
.stack--sm { gap: 10px; } .stack--md { gap: 16px; } .stack--lg { gap: 22px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.strong { font-weight: 660; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.text-rose { color: var(--rose); } .text-emerald { color: var(--emerald); } .text-amber { color: var(--amber); }
.divider { height: 1px; background: var(--line-soft); margin: 18px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ==========================================================================
   Duyarlılık
   ========================================================================== */
@media (max-width: 1180px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--sidebar { grid-template-columns: minmax(0, 1fr); }
}

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

/* ---- Mobil / tablet ---------------------------------------------------- */
@media (max-width: 900px) {
  :root { --tabbar-h: 62px; }

  .sidebar { display: none; }
  .topbar { padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); gap: 8px; }
  .topbar__brand { display: block; }
  .topbar__title { font-size: 15.5px; }

  .content {
    padding: 16px 14px;
    padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 20px);
  }

  .grid--3, .grid--2 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .page-head h1 { font-size: 22px; }
  .page-head { margin-bottom: 18px; }
  .page-head__actions { width: 100%; }
  .page-head__actions .btn { flex: 1; }

  .auth { grid-template-columns: 1fr; }
  .auth__side { display: none; }

  .dl { grid-template-columns: minmax(0, 1fr); gap: 3px 0; }
  .dl dd { margin-bottom: 12px; }

  .card { border-radius: var(--r); }
  .card__body { padding: 16px; }
  .card__head, .card__foot { padding: 13px 16px; }

  .banner-warn { padding: 11px 14px; }

  /* Dokunma hedefleri */
  .btn { min-height: 44px; padding: 11px 16px; }
  .btn--sm { min-height: 36px; }
  .icon-btn { width: 42px; height: 42px; }
  .input, .select, .textarea { min-height: 46px; font-size: 16px; } /* iOS yakınlaştırmasını önler */
  .filters .input, .filters .select { width: 100%; min-width: 0; }
  .search-field { max-width: none; flex-basis: 100%; }
  .filters { gap: 8px; }
  .filters .btn { flex: 1; }

  /* Açılır menüler tam genişlik */
  details.dropdown > .dropdown__panel {
    position: fixed; left: 8px; right: 8px; top: auto; max-width: none; min-width: 0;
    box-shadow: var(--sh-3);
  }

  /* --- Alt gezinme çubuğu ---------------------------------------------- */
  /* Bulanıklık ::before katmanında: backdrop-filter doğrudan .tabbar üzerinde
     olsaydı, içindeki menü sayfası ve karartma katmanı (position: fixed)
     ekrana değil çubuğa göre konumlanırdı. */
  .tabbar {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(1.6) blur(16px);
    -webkit-backdrop-filter: saturate(1.6) blur(16px);
  }
  .tabbar__item {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    height: var(--tabbar-h); padding: 6px 2px;
    color: var(--text-3); font-size: 10.5px; font-weight: 620;
    background: none; border: 0; cursor: pointer;
    list-style: none;
    transition: color .15s;
    position: relative;
  }
  .tabbar__item::-webkit-details-marker { display: none; }
  .tabbar__item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar__item.is-active { color: var(--brand); }
  .tabbar__item.is-active::before {
    content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand);
  }
  .tabbar__dot {
    position: absolute; top: 9px; right: 50%; margin-right: -16px;
    width: 8px; height: 8px; border-radius: 999px; background: var(--rose);
    border: 2px solid var(--surface);
  }
  .tabbar__more { position: static; }
  .tabbar__more > summary { list-style: none; }

  /* --- Menü sayfası (alt sayfa / sheet) --------------------------------- */
  .sheet {
    display: flex; flex-direction: column;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    max-height: 86dvh;
    background: var(--surface);
    border-top: 1px solid var(--line);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    box-shadow: var(--sh-3);
    padding-bottom: calc(env(safe-area-inset-bottom) + 8px);
    /* Yalnız saydamlık canlandırılır. `transform` ile kaydırma denendi ancak
       animasyon çalışmayan/donduran ortamlarda panel ilk karede takılıp
       ekranın dışına 16px taşıyordu; konumun animasyona bağlı olmaması
       için geometriye dokunan özellik canlandırılmaz. */
    animation: sheet-in .2s var(--ease);
  }
  .tabbar__more[open] > summary::after {
    content: ""; position: fixed; inset: 0; z-index: 65;
    background: rgba(0,0,0,.45); backdrop-filter: blur(2px);
  }
  @keyframes sheet-in { from { opacity: 0; } to { opacity: 1; } }
  .sheet::before {
    content: ""; display: block; width: 40px; height: 4px; border-radius: 999px;
    background: var(--line); margin: 10px auto 4px;
  }
  .sheet__head { display: flex; align-items: center; gap: 11px; padding: 10px 18px 14px; border-bottom: 1px solid var(--line-soft); }
  .sheet__body { overflow-y: auto; padding: 14px 14px 4px; }
  .sheet__label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 6px 4px 9px; }
  .sheet__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
  .sheet__tile {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 13px; border-radius: var(--r-sm);
    border: 1px solid var(--line); background: var(--surface-2);
    font-size: 13.5px; font-weight: 600; color: var(--text-2);
    min-height: 52px;
  }
  .sheet__tile span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sheet__tile.is-active { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand); }
  .sheet__foot { padding: 10px 18px 6px; border-top: 1px solid var(--line-soft); }
}

/* ---- Tabloları kart görünümüne çevir ----------------------------------- */
@media (max-width: 720px) {
  table.data thead { display: none; }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data tr {
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--surface);
    margin-bottom: 10px;
    padding: 6px 2px;
    box-shadow: var(--sh-1);
  }
  table.data tbody tr:hover { background: var(--surface); }
  table.data td {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--line-soft);
    text-align: left;
  }
  table.data tr td:last-child { border-bottom: 0; }
  table.data td::before {
    content: attr(data-label);
    flex: 0 0 38%;
    font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
    color: var(--text-3); padding-top: 2px;
  }
  table.data td:empty { display: none; }
  table.data td[data-label=""]::before { display: none; }
  table.data td > * { min-width: 0; }
  table.data .num { text-align: right; }
  .table-wrap { overflow-x: visible; }

  /* Aksiyon hücresi tam genişlik düğme */
  table.data td.cell-actions { justify-content: stretch; }
  table.data td.cell-actions::before { display: none; }
  table.data td.cell-actions .btn { flex: 1; }
}

@media (max-width: 560px) {
  .grid--4 { grid-template-columns: minmax(0, 1fr); }
  .columns { height: 128px; gap: 6px; }
  .col__label { font-size: 10.5px; }
  .bar-row { grid-template-columns: minmax(70px, 38%) 1fr auto; font-size: 13px; }
  .sheet__grid { grid-template-columns: minmax(0, 1fr); }
  .theme-modes { flex-wrap: wrap; }
}

@media print {
  .sidebar, .topbar, .tabbar, .sheet, .page-head__actions, .btn, .no-print { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ddd; break-inside: avoid; }
  .content { padding: 0; }

  /* Kaizen raporu: A3 YATAY, çerçevesiz, adım blokları bölünmeden.
     Kenar boşluğu @page'e verilir; kâğıdın kendisi zaten 420 × 297 mm. */
  @page { size: A3 landscape; margin: 10mm; }

  .print-body { padding: 0; background: #fff; }
  .report {
    width: 100%; min-height: 0; margin: 0; padding: 0;
    border: 0; box-shadow: none;
  }
  /* İki sütunlu adım düzeni yazdırmada da korunur; bir adım ortadan bölünmez. */
  .report__steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report__step, .report__benefit { break-inside: avoid; }

  /* Yazdırmada renkler solmasın — ızgara ve başlık şeritleri raporun
     okunurluğunun parçasıdır. */
  .report, .report * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---- Parola politikası geri bildirimi --------------------------------- */
.password-rules {
  display: grid; gap: 5px; margin: 10px 0 0; padding: 0; list-style: none;
  color: var(--text-3); font-size: 12px;
}
.password-rules li::before { content: "○"; display: inline-block; width: 18px; font-weight: 800; }
.password-rules li.is-ok { color: var(--emerald); }
.password-rules li.is-ok::before { content: "✓"; }
.password-rules li.is-bad { color: var(--rose); }
.password-rules li.is-bad::before { content: "×"; }
.password-match.is-ok { color: var(--emerald); }
.password-match.is-bad { color: var(--rose); }

.password-input { position: relative; }
.password-input .input { padding-right: 48px; }
.password-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 40px; height: 40px;
  padding: 0; border: 0; border-radius: 8px; background: transparent;
  color: var(--text-3); cursor: pointer;
}
.password-toggle:hover, .password-toggle:focus-visible { background: var(--surface-2); color: var(--text); }
.password-toggle span { display: grid; place-items: center; }
.password-toggle span[hidden] { display: none; }

/* ---- Uzun form taslağı: zorunlu alan ilerleme göstergesi ------------- */
/* Kabuk JavaScript ile kurulur (public/assets/js/draft.js). Çubuk genişliği
   JS'te CSSOM ile (el.style.width) yazılır; sıkı CSP satır içi `style`
   özniteliğini engellediği için gösterge burada yalnız sınıflarla biçimlenir.
   Çubuğun kendisi ortak .progress / .progress__bar bileşenini kullanır. */
.draft-hint {
  display: grid; gap: 7px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-2);
}
.draft-hint__row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  font-size: 12px;
}
.draft-hint__progress { color: var(--text-2); font-weight: 620; font-variant-numeric: tabular-nums; }
.draft-hint__status { color: var(--text-3); }
@media (max-width: 900px) { .draft-hint { padding: 12px 16px; } }

/* ==========================================================================
   Faz 1 — Anlık geri bildirim
   ========================================================================== */

/* --- Tema/mod değişiminde renk geçişi (yalnız istemci değişimi) --------- */
@media (prefers-reduced-motion: no-preference) {
  body { transition: background-color .25s var(--ease), color .25s var(--ease); }
}

/* --- Sayfa geçişi ilerleme şeridi ------------------------------------- */
/* Genişlik JS'te CSSOM ile yazılır (bkz. app.js setupRouteProgress). */
.route-progress {
  position: fixed; left: 0; top: 0; z-index: 100;
  width: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  box-shadow: 0 0 10px color-mix(in srgb, var(--brand) 55%, transparent);
  opacity: 0; pointer-events: none;
  transition: width .2s var(--ease), opacity .3s var(--ease);
}
.route-progress.is-active { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .route-progress { transition: opacity .12s linear; }
}

/* --- Köşe bildirimleri (toast) -------------------------------------------
   Geçici olumlu mesajlar içeriği aşağı itmeden burada görünür; hata ve
   uyarılar akış içinde (.content başında) satır içi kalır. */
.toaster {
  position: fixed; z-index: 95;
  top: max(14px, env(safe-area-inset-top)); right: 14px;
  width: min(360px, calc(100vw - 28px));
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toaster .alert {
  margin-bottom: 0;
  box-shadow: var(--sh-2);
  pointer-events: auto;
  cursor: pointer;
}
@media (prefers-reduced-motion: no-preference) {
  .toaster .alert { animation: toast-in .22s var(--ease); }
}
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) {
  .toaster {
    top: auto; left: 14px; right: 14px; width: auto;
    bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px);
  }
}

/* --- Onay penceresi (window.confirm yerine) ---------------------------- */
.dialog--confirm { width: min(420px, calc(100vw - 32px)); }
.dialog__msg { padding: 16px 18px; font-size: 14px; color: var(--text-2); line-height: 1.6; }
.dialog__msg p { margin: 0; }

/* ==========================================================================
   Faz 2 — Form deneyimi
   ========================================================================== */

/* Karakter sayacı — .field içinde, kontrolün hemen altında sağa yaslı */
.field__count {
  align-self: flex-end;
  font-size: 12px; color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.field__count.is-low { color: var(--amber); }

/* Hata özeti — form başında, hatalı alanlara çapa bağlantılarıyla */
.form-error-summary { display: block; }
/* Kart formlarında başlık ile gövde arasına otururken kenar boşluğu */
form.card > .form-error-summary,
.card > .form-error-summary { margin: 16px 20px 0; }
.form-error-summary > span { font-weight: 620; }
.form-error-summary__list {
  margin: 6px 0 0; padding-left: 18px;
  display: grid; gap: 2px;
}
.form-error-summary__list a { text-decoration: underline; font-weight: 620; color: inherit; }

/* Dosya eki önizlemesi (istemci ön kontrolü — bkz. app.js bindFileInput) */
.file-preview {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 6px;
}
/* `display:flex` tarayıcının [hidden] varsayılanını ezmesin */
.file-preview[hidden] { display: none; }
.file-preview__img {
  width: 56px; height: 56px; flex: none;
  object-fit: cover; border-radius: var(--r-xs);
  border: 1px solid var(--line);
}
.file-preview__name { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }

/* ==========================================================================
   Faz 3 — Erişilebilirlik temeli
   ========================================================================== */

/* "İçeriğe atla" — yalnız klavye odağında görünür */
.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 200;
  padding: 10px 16px; border-radius: var(--r-sm);
  background: var(--brand); color: var(--brand-ink);
  font-size: 14px; font-weight: 640;
  transform: translateY(calc(-100% - 14px));
  transition: transform .15s var(--ease);
}
.skip-link:focus {
  transform: none;
  outline: 2px solid var(--brand-ink); outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) { .skip-link { transition: none; } }
/* Atlama hedefi — tıklamada odak halkası çizme (etkileşimli öğe değil) */
#main:focus { outline: none; }

/* Dokunma hedefi: görsel boyut korunur, tıklama alanı ≥ 24 px */
.chip__x { position: relative; }
.chip__x::before {
  content: ""; position: absolute; inset: -5px;
}

/* ==========================================================================
   Faz 4 — Gezinme ve algılanan hız
   ========================================================================== */

/* --- Arama kısayol ipucu --- */
.kbd-hint {
  flex: none;
  min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 5px;
  font-family: var(--mono); font-size: 11px; font-weight: 700; line-height: 1;
  color: var(--text-3); background: var(--surface-2);
}
.topbar__search:focus-within .kbd-hint { opacity: 0; }

/* --- Kırıntı yolu --- */
.crumbs {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin-bottom: 14px;
  font-size: 12.5px; color: var(--text-3);
}
.crumbs a { color: var(--text-3); }
.crumbs a:hover { color: var(--brand); text-decoration: underline; }
.crumbs [aria-current="page"] { color: var(--text-2); font-weight: 600; }
.crumbs__sep { color: var(--text-3); opacity: .6; }
@media (max-width: 900px) { .crumbs { margin-bottom: 12px; } }

/* --- Kenar çubuğu daraltma --- */
.nav-collapse {
  display: flex; align-items: center; gap: 10px; width: 100%;
  margin-bottom: 8px; padding: 8px 10px;
  border: 0; border-radius: 10px;
  background: transparent; color: rgba(255,255,255,.62);
  font: inherit; font-size: 13px; font-weight: 560; cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.nav-collapse:hover { background: rgba(255,255,255,.09); color: #fff; }
.nav-collapse .ic { flex: none; transition: transform .2s var(--ease); }

:root[data-sidebar="collapsed"] .sidebar {
  width: 68px; flex-basis: 68px;
}
:root[data-sidebar="collapsed"] .brand__name,
:root[data-sidebar="collapsed"] .brand__slogan,
:root[data-sidebar="collapsed"] .nav__label,
:root[data-sidebar="collapsed"] .nav__link span,
:root[data-sidebar="collapsed"] .nav__badge,
:root[data-sidebar="collapsed"] .sidebar__user span,
:root[data-sidebar="collapsed"] .nav-collapse span { display: none; }
:root[data-sidebar="collapsed"] .brand { justify-content: center; padding: 20px 0 14px; }
:root[data-sidebar="collapsed"] .nav { padding: 4px 10px 20px; }
:root[data-sidebar="collapsed"] .nav__link { justify-content: center; padding: 10px; }
:root[data-sidebar="collapsed"] .nav__link.is-active::before { left: -10px; }
:root[data-sidebar="collapsed"] .sidebar__foot { padding: 12px 10px 16px; }
:root[data-sidebar="collapsed"] .sidebar__user { justify-content: center; }
:root[data-sidebar="collapsed"] .nav-collapse { justify-content: center; padding: 8px; }
:root[data-sidebar="collapsed"] .nav-collapse .ic { transform: rotate(180deg); }
/* Daraltılmışken üzerine gelince etiket ipucu (title özniteliği) tarayıcıdan gelir */
@media (max-width: 900px) { :root[data-sidebar="collapsed"] .sidebar { width: var(--sidebar-w); } }

/* --- Komut paleti (Ctrl/Cmd-K) --- */
.cmdp {
  width: min(560px, calc(100vw - 32px));
  max-height: min(70vh, 520px);
  padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); color: var(--text);
  box-shadow: var(--sh-3);
}
.cmdp::backdrop { background: rgba(15, 23, 42, .5); }
.cmdp__box { display: flex; flex-direction: column; max-height: inherit; }
.cmdp__input {
  width: 100%; border: 0; border-bottom: 1px solid var(--line-soft);
  padding: 15px 18px; font-size: 15px; background: transparent; color: var(--text);
  outline: none;
}
.cmdp__list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.cmdp__item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--r-sm);
  font-size: 14px; color: var(--text); cursor: pointer;
}
.cmdp__item small { color: var(--text-3); margin-left: auto; font-size: 12px; }
.cmdp__item.is-active, .cmdp__item:hover { background: var(--brand-soft); }
.cmdp__empty { padding: 24px 18px; text-align: center; color: var(--text-3); font-size: 13.5px; }

/* ==========================================================================
   Faz 5 — Mobil incelikler
   ========================================================================== */

/* Mobil açılır arama — masaüstünde gizli, topbar araması görünür */
.topbar__searchmob { display: none; }

/* Mobilde katlanır filtre paneli (app.js enhanceMobileFilters ile kurulur) */
.filters__toggle { display: none; }
.filters__panel { display: contents; }

@media (max-width: 900px) {
  .topbar__searchmob { display: block; }

  /* Filtre çubuğu: arama + gönder görünür kalır; select/onay kutuları
     "Filtreler (N)" düğmesinin ardında katlanır. */
  .filters.is-collapsible { flex-wrap: wrap; }
  .filters .filters__toggle {
    display: inline-flex; align-items: center; gap: 7px;
    order: 2; flex: 1 1 auto; min-height: 44px;
    padding: 9px 14px; border-radius: var(--r-sm);
    border: 1px solid var(--line); background: var(--surface); color: var(--text);
    font: inherit; font-size: 14px; font-weight: 620; cursor: pointer;
  }
  .filters .filters__toggle[aria-expanded="true"] { border-color: var(--brand-line); background: var(--surface-2); }
  .filters__toggle__count {
    min-width: 20px; height: 20px; padding: 0 6px;
    display: grid; place-items: center; border-radius: 999px;
    background: var(--brand-soft); color: var(--brand);
    font-size: 11px; font-weight: 800;
  }
  .filters__toggle__count[hidden] { display: none; }
  .filters__panel {
    display: none; order: 5; flex-basis: 100%;
    flex-direction: column; gap: 8px;
  }
  .filters__panel.is-open { display: flex; }
  .filters__panel .input,
  .filters__panel .select { width: 100%; min-width: 0; }
}

/* ── Günlük yönetim panosu (Faz 5 — pano) ───────────────────────────── */
.board { max-width: 1600px; margin: 0 auto; padding: 20px; }
.board__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.board__head h1 { margin: 0; display: flex; align-items: center; gap: 8px; }
.board__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.board--tv { max-width: none; }
.board--tv .board__grid { grid-template-columns: repeat(2, 1fr); }
.board--tv .board__head h1 { font-size: 2rem; }
.board--tv .board__col .list__title { font-size: 1.15rem; }
@media (max-width: 720px) { .board__grid { grid-template-columns: 1fr; } }

/* ============================================================ *
 *  Faz 6 — Katılım, stratejik hizalama, arama, takvim          *
 * ============================================================ */

.topbar__search{display:flex;align-items:center;gap:.4rem;padding:.3rem .6rem;border:1px solid var(--line);
  border-radius:var(--r-sm);background:var(--surface);color:var(--muted);max-width:16rem;flex:0 1 16rem}
.topbar__search input{border:0;background:transparent;color:var(--text);font:inherit;width:100%;outline:none}
@media (max-width:900px){.topbar__search{display:none}}

.chips{display:flex;flex-wrap:wrap;gap:.4rem;margin:.6rem 0}
.panel{border:1px solid var(--line);border-radius:var(--r-sm);padding:.75rem}
tr.is-me{background:var(--brand-soft)}

/* Takvim */
.cal{display:flex;flex-direction:column;gap:2px;padding:.5rem}
.cal__row{display:grid;grid-template-columns:repeat(7,1fr);gap:2px}
.cal__row--head .cal__hd{padding:.35rem .5rem;font-size:.75rem;font-weight:600;color:var(--muted);text-align:center}
.cal__cell{min-height:6.5rem;border:1px solid var(--line);border-radius:var(--r-xs);padding:.3rem;display:flex;
  flex-direction:column;gap:.2rem;background:var(--surface)}
.cal__cell--empty{background:transparent;border-color:transparent}
.cal__cell--today{border-color:var(--brand);box-shadow:inset 0 0 0 1px var(--brand)}
.cal__day{font-size:.8rem;font-weight:600;color:var(--muted)}
.cal__event{display:block;font-size:.72rem;line-height:1.25;padding:.15rem .35rem;border-radius:var(--r-xs);
  border:1px solid var(--line);color:var(--text);text-decoration:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cal__event--amber{background:var(--amber-bg);border-color:var(--amber-bd)}
.cal__event--violet{background:var(--violet-bg);border-color:var(--violet-bd)}
.cal__event--sky{background:var(--sky-bg);border-color:var(--sky-bd)}
.cal__event--emerald{background:var(--emerald-bg);border-color:var(--emerald-bd)}
.cal__event--rose{background:var(--rose-bg);border-color:var(--rose-bd)}
@media (max-width:720px){.cal__cell{min-height:4.5rem}.cal__event{white-space:normal}}

/* Takdir belgesi */
.cert{max-width:52rem;margin:2rem auto;padding:2.5rem;border:1px solid var(--line);border-radius:var(--r);background:var(--surface)}
.cert__head{text-align:center;border-bottom:2px solid var(--brand);padding-bottom:1rem;margin-bottom:1.5rem}
.cert__brand{font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--brand);font-size:.85rem}
.cert__head h1{margin:.4rem 0 .2rem;font-size:2rem}
.cert__sub{color:var(--muted);margin:0}
.cert__body{font-size:1.05rem;line-height:1.7;text-align:center;margin:1.5rem 0}
.cert__badges{display:flex;justify-content:center;flex-wrap:wrap;gap:.4rem;margin:1rem 0 1.5rem}
.cert__table{width:100%;margin:1rem 0}
.cert__foot{display:flex;justify-content:space-between;color:var(--muted);font-size:.85rem;border-top:1px solid var(--line);padding-top:1rem;margin-top:1.5rem}
.cert__print{margin-top:1.5rem}
@media print{.cert__print{display:none}.cert{border:0;margin:0}}

/* Kişisel pano bloğu */
.mypanel{display:grid;grid-template-columns:repeat(auto-fit,minmax(9rem,1fr));gap:.75rem}
.mypanel__item{border:1px solid var(--line);border-radius:var(--r-sm);padding:.7rem;background:var(--surface)}
.mypanel__num{font-size:1.5rem;font-weight:700;line-height:1}
.mypanel__lbl{font-size:.78rem;color:var(--muted)}

/* ============================================================ *
 *  Faz 7 — Entegrasyon                                          *
 * ============================================================ */

.codeblock{display:block;font-family:var(--mono,ui-monospace,monospace);font-size:.82rem;
  background:var(--surface);border:1px solid var(--line);border-radius:var(--r-sm);
  padding:.6rem .8rem;margin:.5rem 0;overflow-x:auto;white-space:pre-wrap;word-break:break-all}
textarea.mono{font-family:var(--mono,ui-monospace,monospace);font-size:.82rem;line-height:1.5;tab-size:2}
[data-workflow-sonuc] ul{margin:.4rem 0 0;padding-left:1.1rem}
[data-workflow-sonuc] li{font-size:.85rem;color:var(--rose)}
