/* İŞTE Tasarım Sistemi — Emre Şekeroğlu tarafından İŞTE Büyüyelim için hazırlanmıştır. Vurgu rengi: İŞTE mavisi #0077B8 (logodan).
   Bu dosya jetonların tek kaynağıdır; projede değiştirilmez, ihtiyaç uygulama katmanında ezilir. */
/* ==========================================================================
   İŞTE Tasarım Sistemi — theme.css
   TOKEN'LARIN TEK KAYNAGI. Nötr sıcak kâğıt paleti + İŞTE mavisi vurgu (iste-buyuyelim-logo-light.svg, #0077B8).
   İlk uygulaması STD Core'dur (referans uygulama); yapı oradan gelir.

   ALTIN KURAL: Yeni CSS yazarken ham renk/piksel değeri KULLANMA.
   Her sey var(--token) üzerinden gelir. Token yoksa, onu önce buraya ekle.

   §8 tuzagi: @import her kuraldan ÖNCE gelmek zorunda.
   ========================================================================== */
@import url("brand-tokens.css");

/* --------------------------------------------------------------------------
   Yazı tipleri — YEREL. Sunucu internete kapalı olacak (Faz 0 §2.4 sapma 4);
   Google Fonts CDN yok, woff2 dosyalari fonts/ altinda durur.
   Turkce için latin-ext kapsamı sart (g-breve, dotless-i, s-cedilla).
   -------------------------------------------------------------------------- */
/* Inter — govde. latin + latin-ext ayrı yüklenir; TR harfleri (g-breve U+011F,
   s-cedilla U+015F, I-dot U+0130) latin-ext altsetinde, dotless-i U+0131 latin'de. */
@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin.woff2") format("woff2-variations"),
       url("fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin-ext.woff2") format("woff2-variations"),
       url("fonts/inter-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* Source Serif 4 — display. Başlık, kart/panel başlığı ve BUTONLAR. */
@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/serif-latin.woff2") format("woff2-variations"),
       url("fonts/serif-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/serif-latin-ext.woff2") format("woff2-variations"),
       url("fonts/serif-latin-ext.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/serif-latin-italic.woff2") format("woff2-variations"),
       url("fonts/serif-latin-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/serif-latin-ext-italic.woff2") format("woff2-variations"),
       url("fonts/serif-latin-ext-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* Ikonlar: icons/phosphor/style.css ayrı yüklenir (§6). */

/* ==========================================================================
   1. TOKEN'LAR — acik tema
   ========================================================================== */
:root {
  /* --- Yüzeyler ve metin (nötr sıcak kâğıt, mürekkep) --- */
  --bg: #F1F0EE;
  --bg-paper: #FFFFFF;
  --surface: #FFFFFF;
  --surface-alt: #E8E6E3;
  --panel: var(--bg-paper);
  --input-bg: var(--bg);

  --text: #1D1D1B;
  --muted: rgba(29, 29, 27, .56);
  --border: rgba(29, 29, 27, .10);
  --border-strong: rgba(29, 29, 27, .16);
  --divider: rgba(29, 29, 27, .10);
  --hover: rgba(29, 29, 27, .04);
  --active-tint: rgba(29, 29, 27, .07);
  --scrollbar: rgba(29, 29, 27, .12);
  --scrollbar-hover: rgba(29, 29, 27, .20);
  --spin-border: rgba(29, 29, 27, .14);

  /* --- Vurgu (birincil) — İŞTE mavisi #0077B8 (logodan); beyaz yazı 4,85:1, hover #005A8C 7,39:1 --- */
  --accent: #0077B8;
  --accent-strong: #005A8C;
  --accent-text: #004A73;
  --accent-rgb: 0, 119, 184;
  /* 3.121.4: beyaz (--on-accent) yazı taşıyan vurgu dolgusu; açık temada vurgunun kendisi */
  --accent-fill: var(--accent);
  --accent-fill-strong: var(--accent-strong);

  /* Vurgu dolgusu ÜZERİNDEKİ içerik. Iki temada da aynı: --accent her iki
     temada beyaz metinle AA kontrast verir (ölçüldü: 5.17:1 / 4.9:1). */
  --on-accent: #FFFFFF;
  --on-accent-soft: rgba(255, 255, 255, .16);
  --on-accent-muted: rgba(255, 255, 255, .72);

  /* --- Vurgu 2 — grafit (ikinci kurumsal renk ailesi) --- */
  --accent-2: #3F3D39;
  --accent-2-strong: #1D1D1B;
  --accent-2-text: #2A2825;

  /* --- Etiket/rozet dolgulari (her zaman çift: zemin + metin) --- */
  --tag-accent-bg: #E3F1FA;
  --tag-accent-text: #005A8C;
  --tag-accent-2-bg: #EAE8E4;
  --tag-accent-2-text: #3F3D39;
  --tag-neutral-bg: #EAE8E5;
  --tag-neutral-text: #57544E;
  /* Faz 0 §2.4 sapma 3: 5 ticket durumu için turetilen ek çift */
  --tag-wait-bg: #EFEDE9;
  --tag-wait-text: #5A5651;

  /* --- Durum renkleri (üçlüler) --- */
  --danger: #8C1D18;
  --danger-bg: #FBEDEC;
  --danger-border: #DCA9A6;
  --green: #2E7D32;
  --green-bg: #E9F3E9;
  --green-border: #A8D0A8;
  --warn: #A6720A;
  --warn-bg: #FBF4E0;
  --warn-border: #E3C88A;

  /* --- Yazı tipleri (§3) --- */
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-heading: var(--font-display);

  /* --- Yaricap (§4) --- */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-pill: 999px;

  /* --- Golge (§4, ink'e gore yeniden renklendirildi) --- */
  --shadow-sm: 0 1px 2px rgba(29, 29, 27, .06);
  --shadow-md: 0 3px 10px rgba(29, 29, 27, .08);
  --shadow-lg: 0 10px 30px rgba(29, 29, 27, .12);
  --shadow-xl: 0 24px 80px rgba(29, 29, 27, .20);
  --accent-shadow: 0 2px 8px rgba(var(--accent-rgb), .25);
  --accent-shadow-strong: 0 4px 16px rgba(var(--accent-rgb), .35);

  /* --- Odak halkasi (§4) --- */
  --focus-ring: rgba(var(--accent-rgb), .12);
  --focus-ring-strong: rgba(var(--accent-rgb), .20);

  /* --- Hareket (§5) --- */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================================================
   2. TOKEN'LAR — koyu tema (ton değil, AYRI palet)
   §2.2 kurali: koyu temada --accent-strong, --accent'ten AÇIKTIR; boylece
   linear-gradient(135deg, var(--accent), var(--accent-strong)) iki temada da
   doğru okur. Gradyani elle ters çevirme.
   Hiçbir rengin TEK tanımı bu blokta olmamali — hepsi yukarıda da var.
   ========================================================================== */
html[data-theme="dark"] {
  --bg: #131211;
  --bg-paper: #1C1B19;
  --surface: #232120;
  --surface-alt: #2F2C2A;
  --input-bg: #1C1B19;

  --text: #EFEDEA;
  --muted: rgba(239, 237, 234, .56);
  --border: rgba(239, 237, 234, .12);
  --border-strong: rgba(239, 237, 234, .18);
  --divider: rgba(239, 237, 234, .12);
  --hover: rgba(239, 237, 234, .05);
  --active-tint: rgba(239, 237, 234, .08);
  --scrollbar: rgba(239, 237, 234, .14);
  --scrollbar-hover: rgba(239, 237, 234, .24);
  --spin-border: rgba(239, 237, 234, .16);

  --accent: #4AA8E0;
  --accent-strong: #7CC0EA;
  --accent-text: #CFE7F6;
  --accent-rgb: 74, 168, 224;
  /* Koyu temada vurgu yazı rengi olarak açık mavi kalır (#4AA8E0 koyu zeminde 6,66:1), beyaz yazılı dolgu logonun mavisidir:
     beyaz üstünde #0077B8 4,85:1, #0A86CC hover. Gradyan koyudan açığa. */
  --accent-fill: #0077B8;
  --accent-fill-strong: #0A86CC;

  --accent-2: #A8A49E;
  --accent-2-strong: #C6C2BB;
  --accent-2-text: #E3E0DB;

  --tag-accent-bg: #102A3A;
  --tag-accent-text: #CFE7F6;
  --tag-accent-2-bg: #322F2C;
  --tag-accent-2-text: #E3E0DB;
  --tag-neutral-bg: #332F2C;
  --tag-neutral-text: #E3E0DB;
  --tag-wait-bg: #2B2825;
  --tag-wait-text: #D8D4CE;

  --danger: #F0A0A0;
  --danger-bg: #3A2020;
  --danger-border: #7A3530;
  --green: #7CC98A;
  --green-bg: #1B2E1F;
  --green-border: #3D6B45;
  --warn: #E0A940;
  --warn-bg: #3A2F14;
  --warn-border: #7A5F23;

  /* Golgeler koyu temada renksiz siyaha döner (§2.2) */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-md: 0 3px 10px rgba(0, 0, 0, .5);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .55);
  --shadow-xl: 0 24px 80px rgba(0, 0, 0, .6);
}

/* Isim uyumluluğu — eski/alternatif adlar. Yeni kodda --accent ailesini kullan. */
:root {
  --blue: var(--accent);
  --blue-dark: var(--accent-strong);
  --blue-light: var(--tag-accent-bg);
  --blue-sel: #D6EAF6;
  --error: var(--danger);
  --danger-text: var(--danger);
  --ok: var(--green);
  --success: var(--green);
  --text-muted: var(--muted);
  --hover-tint: var(--hover);
}
html[data-theme="dark"] { --blue-sel: #15334A; }

/* ==========================================================================
   3. TABAN
   ========================================================================== */
* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: -.02em;
  margin: 0;
}
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 21px; font-weight: 600; }
h3 { font-size: 18px; font-weight: 600; }
h4 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }

input, select, textarea, button { font-family: inherit; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: var(--radius-pill); border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-hover); background-clip: content-box; }

/* ==========================================================================
   4. HAREKET — ortak keyframe'ler (§5). Bunlari yeniden tanımlama.
   ========================================================================== */
@keyframes riseIn     { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn     { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp    { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes slideRight { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes scaleIn    { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
@keyframes floatY     { 0%, 100% { transform: translateY(-6px); } 50% { transform: translateY(6px); } }
@keyframes shimmer    { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes unreadPulse{ 0%, 100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .45); } 50% { box-shadow: 0 0 0 5px rgba(var(--accent-rgb), 0); } }
@keyframes sp         { to { transform: rotate(360deg); } }
@keyframes pulse-dot  { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

/* Erisilebilirlik: hareket azaltma — GLOBAL ve !important.
   Kendi bileşeninde tekrar yazma (§11). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ==========================================================================
   5. Bİ̇LEŞEN KÜTÜPHANESİ̇ (§7) — kanonik. Kopyala, yeniden icat etme.
   ========================================================================== */

/* --- 7.1 Buton. Welvo'nun imzasi: butonlar SERIF. --- */
.btn {
  border: 1.5px solid var(--divider);
  background: var(--bg-paper);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  line-height: 1.2;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: .01em;
  transition: all .2s var(--ease);
}
.btn:hover { background: var(--surface-alt); border-color: var(--accent); box-shadow: var(--shadow-sm); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover { background: var(--bg-paper); border-color: var(--divider); box-shadow: none; transform: none; }

.btn.primary {
  background: linear-gradient(135deg, var(--accent-fill), var(--accent-fill-strong));
  border-color: transparent;
  color: var(--on-accent);
  box-shadow: var(--accent-shadow);
}
/* ZORUNLU (§10 tuzak 1): hover'da gradyani YENIDEN KUR. .btn:hover'in duz zemini
   aynı özgüllükte olduğu için ezer ve buton koyu bir kutuya döner. */
.btn.primary:hover {
  background: linear-gradient(135deg, var(--accent-fill), var(--accent-fill-strong));
  border-color: transparent;
  box-shadow: var(--accent-shadow-strong);
  transform: translateY(-1px);
}
.btn.primary:active { transform: translateY(0) scale(.97); }

.btn.secondary { border-color: var(--divider); background: var(--bg-paper); color: var(--text); }

.btn.ghost {
  color: var(--accent);
  border-color: transparent;
  background: transparent;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}
.btn.ghost:hover { background: var(--hover); border-color: transparent; box-shadow: none; }

/* Yıkıcı eylem: KONTURLU, dolgusuz (Faz 0 §2.4 sapma 1).
   Ayrım hue ile değil Bİ̇Çİ̇M ile taşınır — birincil dolgulu, yıkıcı konturlu. */
.btn.danger { color: var(--danger); border-color: var(--danger-border); background: var(--bg-paper); }
.btn.danger:hover { background: var(--danger-bg); border-color: var(--danger); box-shadow: var(--shadow-sm); }

.btn.icon-only { padding: 0; width: 36px; height: 36px; justify-content: center; }
.btn-block { width: 100%; margin-top: 8px; }

/* Takma adlar — .btn ile birlikte kullanılır: class="btn btn-primary" */
.btn-primary   { background: linear-gradient(135deg, var(--accent-fill), var(--accent-fill-strong)); border-color: transparent; color: var(--on-accent); box-shadow: var(--accent-shadow); }
.btn-primary:hover { background: linear-gradient(135deg, var(--accent-fill), var(--accent-fill-strong)); border-color: transparent; box-shadow: var(--accent-shadow-strong); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0) scale(.97); }
.btn-secondary { border-color: var(--divider); background: var(--bg-paper); color: var(--text); }
.btn-ghost     { color: var(--accent); border-color: transparent; background: transparent; padding: 6px 10px; border-radius: var(--radius-sm); font-size: 12.5px; }
.btn-ghost:hover { background: var(--hover); border-color: transparent; box-shadow: none; }
.btn-danger    { color: var(--danger); border-color: var(--danger-border); background: var(--bg-paper); }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); box-shadow: var(--shadow-sm); }
.btn-icon      { padding: 0; width: 36px; height: 36px; justify-content: center; }

.btn-mini {
  border: 1px solid var(--divider);
  background: var(--surface-alt);
  color: var(--text);
  border-radius: var(--radius-pill);
  padding: 1px 10px;
  font-size: 10.5px;
  line-height: 1.5;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s var(--ease);
}
.btn-mini:hover { background: var(--hover); border-color: var(--accent); color: var(--accent); }

/* --- 7.2 Form alani --- */
.field { display: block; }
.field > label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--muted);
}
.input {
  width: 100%;
  min-height: 38px;
  padding: 9px 14px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  caret-color: var(--accent);
  background: var(--input-bg);
  border: 1.5px solid var(--divider);
  border-radius: var(--radius-md);
  transition: all .2s var(--ease);
}
.input::placeholder { color: var(--muted); }
.input:hover { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .06); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--focus-ring); outline: none; }
textarea.input { min-height: 80px; resize: vertical; line-height: 1.5; }
.hint { font-size: 11px; color: var(--muted); }
.error { color: var(--danger); font-size: 12px; }

/* --- 7.3 Etiket / rozet --- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .01em;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}
.tag-accent   { background: var(--tag-accent-bg);   color: var(--tag-accent-text); }
.tag-accent-2 { background: var(--tag-accent-2-bg); color: var(--tag-accent-2-text); }
.tag-neutral  { background: var(--tag-neutral-bg);  color: var(--tag-neutral-text); }
.tag-wait     { background: var(--tag-wait-bg);     color: var(--tag-wait-text); }
.tag-outline  { border: 1px solid var(--accent); color: var(--accent); }
.tag-success  { background: var(--green-bg);  color: var(--green); }
.tag-warning  { background: var(--warn-bg);   color: var(--warn); }
.tag-error    { background: var(--danger-bg); color: var(--danger); }
.badge        { background: var(--tag-accent-bg); color: var(--tag-accent-text); display: inline-flex; align-items: center; font-size: 11px; font-weight: 500; padding: 3px 10px; border-radius: var(--radius-pill); }

.count-chip {
  background: var(--surface-alt);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  color: var(--muted);
}
.count-chip:empty { display: none; }

/* Okunmamış rozeti — Faz 0 §2.4 sapma 2: --accent (kırmızı) kullanir. */
.unread-badge {
  background: var(--accent-fill);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.unread-badge:empty { display: none; }
.unread-dot {
  /* display sart: satir içi elemanda width/height yok sayılır ve nokta
     küçük bir kareye döner (ekran görüntüsünde ölçüldü). */
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: unreadPulse 2s ease-in-out infinite;
}

/* --- 7.4 Segmentli denetim --- */
.seg {
  display: inline-flex;
  overflow: hidden;
  background: var(--surface-alt);
  border: 1.5px solid var(--divider);
  border-radius: var(--radius-md);
}
.seg-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: var(--text);
  border: none;
  font-family: inherit;
  transition: all .2s var(--ease);
}
.seg-opt + .seg-opt { border-left: 1px solid var(--divider); }
.seg-opt.active { background: linear-gradient(135deg, var(--accent-fill), var(--accent-fill-strong)); color: var(--on-accent); }
.seg-opt:not(.active):hover { background: var(--hover); }

/* --- 7.5 Kart --- */
.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--surface-alt);
  border: 1.5px solid var(--divider);
}
.card-title { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--text); letter-spacing: -.01em; }
.card-body  { margin: 0; font-size: 13px; color: var(--muted); }

.settings-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--surface-alt);
  border: 1.5px solid var(--divider);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: inherit;
  color: var(--text);
  transition: all .2s var(--ease);
}
.settings-menu-item:hover {
  background: var(--hover);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.settings-menu-item .title   { display: block; font-family: var(--font-display); font-size: 13.5px; font-weight: 600; }
.settings-menu-item .desc    { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.settings-menu-item .chevron { color: var(--muted); font-size: 14px; transition: transform .2s var(--ease); }
.settings-menu-item:hover .chevron { transform: translateX(3px); color: var(--accent); }

/* --- 7.6 Modal / dialog --- */
.dialog-backdrop, .modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(26, 25, 23, .5);
  backdrop-filter: blur(8px) saturate(1.2);
  display: grid;
  place-items: center;
  padding: 16px;
  animation: fadeIn .15s ease;
}
.dialog, .modal {
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 32px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--divider);
  box-shadow: var(--shadow-xl);
  max-height: 92vh;
  overflow-y: auto;
  animation: scaleIn .2s var(--ease-bounce);
}
.modal { width: min(480px, 100%); }
.modal.wide, .dialog.wide { width: min(720px, 100%); }
.dialog-title { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -.02em; }
.dialog-body  { font-size: 13px; line-height: 1.6; color: var(--muted); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 12px; }

/* --- 7.7 Popover / açılır menu --- */
.ctx-menu {
  position: fixed;
  z-index: 300;
  min-width: 220px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: riseIn .1s ease-out;
}
.ctx-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  font-size: 12.5px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text);
  white-space: nowrap;
  transition: all .15s var(--ease);
}
.ctx-item:hover  { background: var(--hover); transform: translateX(2px); }
.ctx-item:active { transform: scale(.98) translateX(2px); }
.ctx-item.danger { color: var(--danger); }
.ctx-item.danger:hover { background: var(--danger-bg); }
.ctx-item.icon { display: flex; align-items: center; gap: 10px; }
.ctx-item.icon .ph-duotone { flex-shrink: 0; color: var(--accent); font-size: 15px; }
.ctx-divider { height: 1px; background: var(--divider); margin: 4px 6px; }

/* --- 7.8 Tooltip. Native title= KULLANMA (§10 tuzak 10). --- */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;                       /* sağa yasli — dar panelde kirpilmasin */
  width: max-content;
  max-width: 240px;
  padding: 7px 11px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  font-size: 11.5px;
  line-height: 1.4;
  text-align: left;
  white-space: normal;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
}
[data-tooltip]:hover::after, [data-tooltip]:focus-visible::after { opacity: 1; }

/* §7.8'den TÜRETİ̇LDİ̇: ipucu AŞAĞİ.
   §7.8 ipucunu her zaman üstte konumlandirir; §10 tuzak 9 yalnız YATAY taşmayı
   cozuyor (sağa yasli). 56px'lik header'daki bir butonda üstü PENCERE DİŞİ
   kalır ve ipucu tamamen kaybolur — ölçüldü. Üstte yeri olmayan ogeler bu
   varyanti kullanir. Kuyruk yönü dışında §7.8 ile aynı. */
[data-tooltip][data-tooltip-pos="below"]::after {
  top: calc(100% + 8px);
  bottom: auto;
}

/* Sola yasli varyant: pencerenin SOL kenarindaki ogeler için
   (sağa yasli ipucu sol kenarda soldan taşar). */
[data-tooltip][data-tooltip-align="left"]::after {
  left: 0;
  right: auto;
}

/* --- 7.9 Bos durum --- */
.empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: fadeIn .4s ease;
}
.empty .empty-ico {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  font-size: 34px;
  color: var(--accent);
  background: linear-gradient(135deg, var(--surface-alt), var(--bg-paper));
  border: 2px solid var(--divider);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: floatY 3s ease-in-out infinite;
}
.empty .empty-title { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--text); }

/* --- 7.10 Ilerleme --- */
.progress-bar {
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--surface-alt);
  position: relative;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transition: width .8s var(--ease);
}
.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .3), transparent);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}
.spin {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid var(--spin-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: sp .7s linear infinite;
  vertical-align: -2px;
}

/* --- 7.11 Durum noktasi --- */
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-gray   { background: var(--muted); }
.dot-red    { background: var(--danger); }
.dot-green  { background: var(--green); }
.dot-orange { background: var(--warn); }
.dot-accent { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.dot-accent.spin-dot { animation: pulse-dot 1.4s ease-in-out infinite; }

/* --- 7.12 Toast --- */
.toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--marka-murekkep);   /* iki temada da aynı */
  color: var(--marka-kagit);
  padding: 11px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  z-index: 100;
  box-shadow: var(--shadow-xl);
  opacity: 0;
  transition: opacity .2s;
}
.toast.show { opacity: 1; }

/* --- 7.13 Klavye tusu --- */
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: var(--bg-paper);
  border: 1px solid var(--divider);
  border-radius: 5px;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* --- 7.14 Thread balonu — §7.14'ten TÜRETİ̇LDİ̇ (Faz 0 §2.4 sapma 5) --- */
.bubble-row { display: flex; gap: 8px; align-items: flex-end; }
.bubble-row.mine { justify-content: flex-end; }
.bubble { min-width: 0; }         /* §10 tuzak 2 */

.bubble-mine {
  max-width: 82%;
  padding: 11px 16px;
  line-height: 1.55;
  font-size: 13.5px;
  border-radius: 16px 16px 4px 16px;
  background: linear-gradient(135deg, var(--accent-fill), var(--accent-fill-strong));
  color: var(--on-accent);
  box-shadow: 0 2px 8px rgba(var(--accent-rgb), .15);
  animation: slideUp .2s ease;
}
.bubble-theirs {
  max-width: 82%;
  padding: 11px 16px;
  line-height: 1.55;
  font-size: 13.5px;
  border-radius: 16px 16px 16px 4px;
  background: var(--surface);
  border: 1.5px solid var(--divider);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  animation: slideUp .25s ease;
}
/* Sistem olayi: balon değil, ortalanmis çip */
.bubble-system {
  align-self: center;
  background: var(--tag-neutral-bg);
  color: var(--tag-neutral-text);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  animation: fadeIn .2s ease;
}
.bubble-meta { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.bubble-mine .bubble-meta { color: var(--on-accent-muted); }

.send-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  padding: 0;
  background: linear-gradient(135deg, var(--accent-fill), var(--accent-fill-strong));
  color: var(--on-accent);
  font-size: 16px;
  box-shadow: var(--accent-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .2s var(--ease);
}
.send-btn:hover  { transform: scale(1.1); box-shadow: var(--accent-shadow-strong); }
.send-btn:active { transform: scale(.9); }
.send-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  flex: none;
  background: linear-gradient(135deg, var(--accent-fill), var(--accent-fill-strong));
  color: var(--on-accent);
  box-shadow: var(--accent-shadow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

/* Avatar (§2.4 deterministik palet JS/Python tarafinda atanir) */
.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--on-accent);
  font-size: 10.5px;
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.avatar.lg { width: 38px; height: 38px; font-size: 13px; }

/* ==========================================================================
   6. DÜZEN DESENLERI (§8)
   ========================================================================== */
.app-shell { display: flex; flex-direction: column; height: 100%; overflow: hidden; }

.app-header {
  height: 56px;
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  background: var(--bg-paper);
  border-bottom: 1px solid var(--divider);
}
.app-header::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), var(--accent), transparent);
  opacity: .4;
  pointer-events: none;
}
.app-main { flex: 1; display: grid; grid-template-columns: 300px 380px 1fr; min-height: 0; }
.app-statusbar {
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: var(--bg-paper);
  border-top: 1px solid var(--divider);
  font-size: 12px;
  color: var(--muted);
}

.panel {
  background: var(--panel);
  border-right: 1px solid var(--divider);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;                  /* §10 tuzak 2 */
}
.panel:last-child { border-right: none; }
.panel.nav {
  background: linear-gradient(180deg, var(--bg-paper) 0%, rgba(var(--accent-rgb), .03) 100%);
}
.scroll { flex: 1; overflow-y: auto; min-height: 0; }   /* body ASLA kaydırmaz */

/* 8.2 Panel başlığı — iki tip, karıştırılmaz */
.panel-title {
  padding: 12px 14px;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.panel-title.content {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -.01em;
  text-transform: none;
  color: var(--text);
}

/* 8.4 Liste satiri — kanonik etkileşim */
.msg-row {
  display: grid;
  grid-template-columns: 16px 30px 1fr auto;
  column-gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
  align-items: center;
  position: relative;
  overflow: hidden;
  transition: background .2s var(--ease);
}
.msg-row::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  transition: width .2s var(--ease);
}
.msg-row:hover { background: var(--hover); }
.msg-row:hover::before { width: 3px; }
.msg-row.active { background: linear-gradient(90deg, var(--tag-accent-bg), transparent); }
.msg-row.active::before { width: 3px; }
.msg-row .row-title { font-size: 13.5px; font-weight: 500; color: var(--text); min-width: 0; }
.msg-row .row-meta  { font-size: 11.5px; color: var(--muted); min-width: 0; }
.msg-row .row-date  { font-size: 10.5px; color: var(--muted); }

.row-action { opacity: 0; transition: opacity .12s, color .12s; background: none; border: none; cursor: pointer; color: var(--muted); }
.msg-row:hover .row-action, .row-action:focus-visible, .row-action.on { opacity: 1; }
.row-action.on { color: var(--accent); }

/* 8.3 Tek kart (auth / hata / kurulum sayfasi) */
.single-card-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--bg);
}
.single-card-page .wrap { max-width: 420px; width: 100%; }
.single-card-page .brand { height: 40px; margin: 0 auto 22px; display: block; }
.single-card-page .card {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  animation: scaleIn .25s var(--ease-bounce);
}
.single-card-page .foot { font-size: 11.5px; color: var(--muted); text-align: center; margin-top: 18px; }

/* 8.5 Duyarlılık — masaustu. Dar pencerede süsleme düşer, işlev kalır. */
@media (max-width: 1400px) { .app-statusbar .company { display: none; } }
@media (max-width: 1150px) { .app-statusbar .site-link { display: none; } }
@media (max-width: 1050px) { .app-statusbar .status-label { display: none; } }

/* ==========================================================================
   7. TEMA DUGMESI (§9)
   Ikon degisimi CSS ile yapılır, JS ile DEĞİ̇L.
   §9 yalnız iki "display: inline" kuralini veriyor ama ikisini gizleyen TABAN
   kurali yok — o yüzden her iki ikon birden gorunuyordu (ekran görüntüsünde
   yakalandi). Taban önce gelmek zorunda.
   Mantık: koyu temada güneş gösterilir (tıklayınca aydinlanir), acik temada ay.
   ========================================================================== */
#theme-toggle #icon-sun,
#theme-toggle #icon-moon { display: none; }

html[data-theme="dark"]       #theme-toggle #icon-sun  { display: inline; }
html:not([data-theme="dark"]) #theme-toggle #icon-moon { display: inline; }

/* --------------------------------------------------------------------------
   Marka lockup'i (§1 deseni)
   Her iki tema icin de iki dosya sayfada bulunur, biri CSS ile gizlenir.
   Koyu tema için logonun ayrı bir varyantı yoksa iki img de aynı dosyayı
   gösterir (İŞTE logosu tek renk mavi, iki temada da okunur). Proje logosu
   (ör. İŞTE Nakit) verildiğinde #brand-light / #brand-dark ona çevrilir.
   -------------------------------------------------------------------------- */
/* Lockup: İŞTE Büyüyelim yatay logosu, en/boy 5,89:1.
   56px'lik başlıkta 28px yükseklik = ~165px genişlik, üstte / altta 14px hava.
   Daha dikey bir proje logosunda yükseklik 32–36px'e çıkarılabilir. */
.brand-lockup {
  height: 28px;
  width: auto;
  flex: none;
  display: block;
}

#brand-dark { display: none; }
html[data-theme="dark"] #brand-light { display: none; }
html[data-theme="dark"] #brand-dark  { display: block; }

/* Ikonografi hizalamasi (§6) */
.ph-duotone { vertical-align: -0.125em; }
