/* ===== AracımX — tasarım sistemi =====
   Sıcak nötr zemin, grafit kenar çubuğu, tek vurgu rengi (petrol yeşili-mavi).
   Yazı: IBM Plex Sans (+ kodlar için IBM Plex Mono), Türkçe karakter destekli.
   Renkler YALNIZCA aşağıdaki token bloklarında tanımlanır; bileşenler var(--…) kullanır. */

/* ---- Tokenlar: aydınlık tema ---- */
:root {
  /* Zemin ve yüzeyler */
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #f1efea;
  --surface-3: #e9e6df;
  --border: #e3e0d8;
  --border-strong: #cdc9bf;

  /* Yazı */
  --text: #1c1b18;
  --text-2: #3b3833;
  --muted: #67635a;

  /* Vurgu (petrol) */
  --primary: #1e5a61;
  --primary-hover: #174a50;
  --primary-active: #123d42;
  --primary-soft: #e2eded;
  --primary-border: #b7d0d1;
  --on-primary: #ffffff;
  --ring: rgba(30, 90, 97, 0.22);

  /* Durum renkleri (paletle uyumlu, kısık) */
  --success: #2d6a3e;
  --success-hover: #245632;
  --success-soft: #e4eee5;
  --success-border: #bcd5c0;
  --warn: #875709;
  --warn-soft: #f6ebd3;
  --warn-border: #e5cf9f;
  --danger: #a33a2b;
  --danger-hover: #8a3023;
  --danger-soft: #f7e3de;
  --danger-border: #e8bfb6;

  /* Kenar çubuğu (her iki temada koyu grafit) */
  --sidebar: #1f1e1b;
  --sidebar-text: #b9b4a8;
  --sidebar-strong: #f4f2ed;
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active: rgba(255, 255, 255, 0.09);
  --sidebar-border: rgba(255, 255, 255, 0.09);
  --sidebar-accent: #86c3c7;

  /* Rozet, tablo, iskelet, grafik */
  --badge-gray-bg: #ebe8e1;
  --badge-gray-text: #48443d;
  --row-warn: #fbf4e4;
  --skeleton-a: #ebe8e1;
  --skeleton-b: #f4f2ed;
  --bar-track: #eeebe5;
  --bar-revenue: #8fb8bb;

  /* Katmanlar */
  --backdrop: rgba(28, 27, 24, 0.45);
  --shadow: 0 1px 0 rgba(28, 27, 24, 0.03);
  --shadow-pop: 0 1px 2px rgba(28, 27, 24, 0.06), 0 2px 6px rgba(28, 27, 24, 0.05);
  --modal-shadow: 0 1px 3px rgba(28, 27, 24, 0.08), 0 16px 40px rgba(28, 27, 24, 0.16);
  --auth-shadow: 0 1px 2px rgba(28, 27, 24, 0.05);
  --auth-glow: transparent; /* eski isim; artık kullanılmıyor */

  /* Tema seçici önizlemeleri (temadan bağımsız, her temanın kendi renkleri) */
  --swatch-light-a: #ffffff;
  --swatch-light-b: #f6f5f2;
  --swatch-dark-a: #1e1d1a;
  --swatch-dark-b: #161513;

  /* Yazı tipleri */
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Ölçüler */
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 10px;
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --control-h: 36px;
  --control-h-sm: 30px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-1: 120ms;
  --dur-2: 180ms;
  --dur-3: 220ms;

  color-scheme: light;
  accent-color: var(--primary);
}

/* ---- Tokenlar: karanlık tema ----
   <html data-theme="dark">. Seçim localStorage("theme") ile saklanır; seçim yoksa
   index.html'deki script sistem tercihini (prefers-color-scheme) uygular.
   Ters çevrilmiş değil: sıcak kömür zemin, yükseldikçe açılan yüzeyler, kısık durum renkleri. */
:root[data-theme="dark"] {
  --bg: #161513;
  --surface: #1e1d1a;
  --surface-2: #272623;
  --surface-3: #302e2a;
  --border: #34322e;
  --border-strong: #46433d;

  --text: #ecebe6;
  --text-2: #d3d0c8;
  --muted: #a39f95;

  --primary: #72b4b9;
  --primary-hover: #8cc4c8;
  --primary-active: #a3d1d4;
  --primary-soft: #2b3432;
  --primary-border: #3c5654;
  --on-primary: #0f1d1e;
  --ring: rgba(114, 180, 185, 0.3);

  --success: #82bf8c;
  --success-hover: #9bcfa3;
  --success-soft: #2d352b;
  --success-border: #3f5640;
  --warn: #d8a54f;
  --warn-soft: #3a3122;
  --warn-border: #5a4826;
  --danger: #e2826f;
  --danger-hover: #ea9a8a;
  --danger-soft: #3b2c27;
  --danger-border: #5e3a31;

  --sidebar: #121110;
  --sidebar-text: #aaa59a;
  --sidebar-strong: #f1efe9;
  --sidebar-hover: rgba(255, 255, 255, 0.05);
  --sidebar-active: rgba(255, 255, 255, 0.08);
  --sidebar-border: rgba(255, 255, 255, 0.07);
  --sidebar-accent: #86c3c7;

  --badge-gray-bg: #302e2a;
  --badge-gray-text: #d0ccc2;
  --row-warn: #2b271e;
  --skeleton-a: #272623;
  --skeleton-b: #302e2a;
  --bar-track: #2a2926;
  --bar-revenue: #4a8a8f;

  --backdrop: rgba(0, 0, 0, 0.6);
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
  --shadow-pop: 0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.25);
  --modal-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 16px 40px rgba(0, 0, 0, 0.45);
  --auth-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);

  color-scheme: dark;
}

/* ---- Temel ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scrollbar-color: var(--border-strong) transparent;
}
::selection { background: var(--primary-soft); color: var(--text); }
a { color: var(--primary); text-decoration: none; text-underline-offset: 2px; }
a:hover { text-decoration: underline; }
code { font-family: var(--font-mono); font-size: 0.88em; background: var(--surface-2); border: 1px solid var(--border); padding: 0 5px; border-radius: 4px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.012em; line-height: 1.25; color: var(--text); }
p { margin: 0 0 var(--s-2); }
strong { font-weight: 600; }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--s-4) 0; }

/* Odak halkası: yalnızca klavye ile gezinirken */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---- Simgeler (satır içi SVG) ----
   <svg class="icon" viewBox="0 0 24 24">…</svg> — çizgi simgeler, rengi metinden alır. */
.icon { width: 18px; height: 18px; flex-shrink: 0; display: inline-block; vertical-align: middle; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 20px; height: 20px; }
.icon-fill { fill: currentColor; stroke: none; }

/* ---- Yerleşim ---- */
.shell { display: flex; min-height: 100vh; min-height: 100dvh; }
.sidebar { width: 248px; background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; padding: var(--s-4) var(--s-3); position: sticky; top: 0; height: 100vh; height: 100dvh; flex-shrink: 0; overflow-y: auto; border-right: 1px solid var(--sidebar-border); scrollbar-color: var(--sidebar-border) transparent; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15.5px; letter-spacing: -0.01em; color: var(--sidebar-strong); padding: 4px 8px 20px; min-width: 0; }
/* Logo (public/logo.svg) — kendi koyu zemini olduğu için her temada aynı görünür */
.brand-logo { display: block; width: 30px; height: 30px; flex-shrink: 0; border-radius: 7px; }
.auth-aside .brand-logo { width: 34px; height: 34px; border-radius: 8px; }
.topbar .brand-logo { width: 26px; height: 26px; border-radius: 6px; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item { position: relative; display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--sidebar-text); font-size: 14.5px; font-weight: 500; transition: background-color 0.12s var(--ease), color 0.12s var(--ease); }
.nav-item:hover { background: var(--sidebar-hover); color: var(--sidebar-strong); text-decoration: none; }
.nav-item.active { background: var(--sidebar-active); color: var(--sidebar-strong); }
.nav-item.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 2px 2px 0; background: var(--sidebar-accent); }
.nav-item.active .nav-icon { color: var(--sidebar-accent); opacity: 1; }
.nav-item:focus-visible { outline-color: var(--sidebar-accent); outline-offset: -2px; }
.nav-icon { display: inline-grid; place-items: center; width: 20px; height: 20px; flex-shrink: 0; text-align: center; font-size: 15px; line-height: 1; opacity: 0.8; }
.sidebar-footer { border-top: 1px solid var(--sidebar-border); padding-top: var(--s-3); margin-top: var(--s-3); display: flex; flex-direction: column; gap: 6px; }
.user-email { font-size: 12.5px; padding: 0 8px 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer .btn-ghost { color: var(--sidebar-text); border-color: var(--sidebar-border); background: transparent; justify-content: flex-start; }
.sidebar-footer .btn-ghost:not(:disabled):hover { background: var(--sidebar-hover); color: var(--sidebar-strong); border-color: var(--sidebar-border); }
.sidebar-footer .btn-ghost:focus-visible { outline-color: var(--sidebar-accent); }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; align-items: center; gap: 10px; height: 54px; padding: 0 var(--s-3); background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar-title { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-btn { font-size: 16px; }
.main { padding: var(--s-8) 40px 56px; max-width: 1280px; width: 100%; margin: 0 auto; }
.sidebar-backdrop { display: none; }

/* ---- Sayfa başlığı ---- */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-6); flex-wrap: wrap; }
.page-title { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.page-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.page-actions { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: var(--s-2); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text); }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: var(--s-4); flex-wrap: wrap; }
.toolbar .input { max-width: 240px; }
.input-search { max-width: 380px !important; }
.section-title { font-size: 12px; margin: var(--s-5) 0 var(--s-2); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }

/* ---- Kartlar ve ızgaralar ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: var(--s-5); min-width: 0; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 10px var(--s-5); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-title { font-size: 15px; font-weight: 600; letter-spacing: -0.005em; }
.card-actions { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }
.card-body { padding: var(--s-4) var(--s-5) var(--s-5); }
.card-body > :last-child { margin-bottom: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); }
.grid-2 .card, .grid-3 .card { margin-bottom: 0; }
.grid-2, .grid-3 { margin-bottom: var(--s-5); }

/* ---- İstatistik kutuları (etiket üstte, değer altta) ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s-3); margin-bottom: var(--s-6); }
.stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px var(--s-4) var(--s-4); box-shadow: var(--shadow); min-width: 0; }
.stat-value { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-label { color: var(--muted); font-size: 12.5px; font-weight: 500; line-height: 1.3; }
.stat.tone-blue .stat-value { color: var(--primary); }
.stat.tone-amber .stat-value { color: var(--warn); }
.stat.tone-green .stat-value { color: var(--success); }
.stat.tone-red .stat-value { color: var(--danger); }

/* ---- Tablolar ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; padding: 8px 12px; border-bottom: 1px solid var(--border-strong); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text); }
.table th:first-child, .table td:first-child { padding-left: 4px; }
.table th:last-child, .table td:last-child { padding-right: 4px; }
.table tbody tr:last-child td { border-bottom: none; }
.table td strong { font-weight: 600; }
.row-link { cursor: pointer; }
.row-link td { transition: background-color 0.1s var(--ease); }
.row-link:hover td { background: var(--surface-2); }
.row-warn td { background: var(--row-warn); }
.row-warn.row-link:hover td { background: var(--warn-soft); }
.cell-actions { display: flex; gap: 4px; justify-content: flex-end; white-space: nowrap; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding-top: var(--s-4); font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- Tanım listeleri ---- */
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.dl-amounts { grid-template-columns: 1fr max-content; }
.dl-amounts dd { text-align: right; }
.dl .total { font-weight: 600; font-size: 16px; color: var(--text); padding-top: 10px; margin-top: 2px; border-top: 1px solid var(--border-strong); }
.prewrap { white-space: pre-wrap; margin: 0; }
.muted { color: var(--muted); }

/* ---- Rozetler ---- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 4px; font-size: 12px; font-weight: 600; line-height: 1.45; white-space: nowrap; font-variant-numeric: tabular-nums; border: 1px solid transparent; }
.badge-blue { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-border); }
.badge-amber { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }
.badge-green { background: var(--success-soft); color: var(--success); border-color: var(--success-border); }
.badge-red { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }
.badge-gray { background: var(--badge-gray-bg); color: var(--badge-gray-text); border-color: var(--border); }
a.badge:hover { text-decoration: none; filter: brightness(0.97); }

/* ---- Düğmeler ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--control-h); padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid transparent; font: inherit; font-weight: 500; font-size: 14px; line-height: 1.2; letter-spacing: -0.003em; cursor: pointer; transition: background-color 0.12s var(--ease), border-color 0.12s var(--ease), color 0.12s var(--ease), box-shadow 0.12s var(--ease); white-space: nowrap; text-decoration: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn-primary:not(:disabled):hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-primary:not(:disabled):active { background: var(--primary-active); border-color: var(--primary-active); }
.btn-success { background: var(--success); color: var(--on-primary); border-color: var(--success); }
.btn-success:not(:disabled):hover { background: var(--success-hover); border-color: var(--success-hover); }
.btn-danger { background: var(--danger); color: var(--on-primary); border-color: var(--danger); }
.btn-danger:not(:disabled):hover { background: var(--danger-hover); border-color: var(--danger-hover); }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: var(--danger-border); }
.btn-danger-ghost:not(:disabled):hover { background: var(--danger-soft); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:not(:disabled):hover { background: var(--surface-2); }
.btn-ghost:not(:disabled):active { background: var(--surface-3); }
.btn-sm { min-height: var(--control-h-sm); padding: 0 10px; font-size: 13px; }
.btn-icon { padding: 0; width: var(--control-h); min-width: var(--control-h); }
.btn-sm.btn-icon { width: var(--control-h-sm); min-width: var(--control-h-sm); }
.btn-block { width: 100%; }
.btn-block.btn-primary { min-height: 40px; }

/* ---- Formlar ---- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form .alert { margin-bottom: 0; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s-3); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; min-width: 0; }
.field-label { color: var(--text-2); font-size: 13px; font-weight: 500; }
.input { width: 100%; min-height: var(--control-h); padding: 7px 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit; font-size: 14px; line-height: 1.4; background: var(--surface); color: var(--text); transition: border-color 0.12s var(--ease), box-shadow 0.12s var(--ease); }
.input::placeholder { color: var(--muted); opacity: 0.75; }
.input:hover:not(:disabled):not(:focus) { border-color: var(--muted); }
.input:focus, .input:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.input:disabled, .input[readonly] { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
textarea.input { resize: vertical; min-height: 72px; }
select.input { cursor: pointer; }
select.input[size] { padding: 4px; }
.form-actions { display: flex; justify-content: flex-end; gap: var(--s-2); margin-top: 6px; flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: var(--s-2); overflow-x: auto; scrollbar-width: none; }
.tab { background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 8px 12px; font: inherit; font-size: 14px; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap; transition: color 0.12s var(--ease), border-color 0.12s var(--ease); }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--primary); }
.tab:focus-visible { outline-offset: -2px; border-radius: 4px 4px 0 0; }
.add-item { border-top: 1px dashed var(--border-strong); margin-top: var(--s-4); padding-top: var(--s-4); }

/* ---- Uyarılar ve boş durum ---- */
.alert { padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid transparent; font-size: 14px; line-height: 1.45; margin-bottom: var(--s-3); overflow-wrap: anywhere; }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }
.alert-success { background: var(--success-soft); color: var(--success); border-color: var(--success-border); }
.alert-info { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-border); }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty h3 { color: var(--text); margin-bottom: 4px; font-size: 15px; }
.empty p { margin: 0; font-size: 14px; }

/* ---- Modal ---- */
.modal-backdrop { position: fixed; inset: 0; background: var(--backdrop); display: grid; place-items: center; padding: var(--s-4); z-index: 50; animation: fade-in 0.14s var(--ease); }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); width: 100%; max-width: 620px; max-height: 92vh; max-height: 92dvh; overflow: auto; box-shadow: var(--modal-shadow); animation: modal-in 0.16s var(--ease); }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: 12px var(--s-5); border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-title { font-size: 16px; font-weight: 600; }
.modal-body { padding: var(--s-5); }
.modal-body > p { margin: 0 0 var(--s-4); }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(6px) scale(0.99); } }

/* ---- Fotoğraf galerisi ---- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--s-3); }
.photo { margin: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; cursor: zoom-in; }
.photo-placeholder { width: 100%; aspect-ratio: 4 / 3; background: linear-gradient(90deg, var(--skeleton-a) 0%, var(--skeleton-b) 50%, var(--skeleton-a) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.photo figcaption { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 8px; font-size: 12px; color: var(--text-2); border-top: 1px solid var(--border); background: var(--surface); }
.photo-full { max-width: 100%; max-height: 75vh; display: block; margin: 0 auto; border-radius: var(--radius-sm); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ---- Yükleniyor ---- */
.spinner-wrap { display: grid; place-items: center; padding: var(--s-8); }
.spinner { width: 22px; height: 22px; border: 2px solid var(--border-strong); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Giriş ekranları (ortak kabuk) ---- */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: var(--s-4); background: var(--bg); position: relative; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--auth-shadow); }
.auth-card .brand { color: var(--text); padding: 0 0 2px; }
.auth-title { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.auth-lead { margin: -8px 0 2px; font-size: 14px; }
.auth-note { margin: 0; font-size: 13px; }
.auth-theme-toggle { position: absolute; top: 14px; right: 14px; z-index: 2; }

/* İki sütun: solda sakin marka paneli, sağda form (geniş ekran) */
.auth-split { display: grid; grid-template-columns: clamp(340px, 36vw, 500px) minmax(0, 1fr); place-items: stretch; padding: 0; }
.auth-aside { display: flex; flex-direction: column; gap: var(--s-8); padding: 36px 44px; background: var(--sidebar); color: var(--sidebar-text); border-right: 1px solid var(--sidebar-border); position: sticky; top: 0; align-self: start; height: 100vh; height: 100dvh; overflow-y: auto; }
.auth-aside .brand { padding: 0; color: var(--sidebar-strong); }
.auth-aside-body { margin-top: auto; margin-bottom: auto; max-width: 380px; }
.auth-aside-kicker { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--sidebar-accent); margin: 0 0 var(--s-3); }
.auth-aside-title { font-size: 28px; font-weight: 600; line-height: 1.2; letter-spacing: -0.025em; color: var(--sidebar-strong); margin-bottom: var(--s-3); }
.auth-aside-text { font-size: 15px; line-height: 1.6; margin: 0 0 var(--s-6); }
.auth-aside-list { list-style: none; margin: 0; padding: 0; counter-reset: aside; border-top: 1px solid var(--sidebar-border); }
.auth-aside-list li { counter-increment: aside; display: flex; gap: 14px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--sidebar-border); font-size: 14px; color: var(--sidebar-strong); }
.auth-aside-list li::before { content: counter(aside, decimal-leading-zero); font-family: var(--font-mono); font-size: 12px; color: var(--sidebar-text); min-width: 18px; }
.auth-aside-foot { font-size: 12.5px; margin: 0; }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 72px 40px 48px; background: var(--surface); min-width: 0; }
.auth-split .auth-card { border-color: transparent; box-shadow: none; background: transparent; padding: 0; gap: var(--s-4); }
.auth-split .auth-card-brand { display: none; }
.auth-split .entry-switch { margin-bottom: var(--s-3); }

/* ---- Profil: fiş önizlemesi ----
   Kasıtlı olarak her temada kâğıt beyazı: yazdırılan PDF'i temsil eder (temadan bağımsız renkler). */
.invoice-preview { border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 16px 18px; background: #ffffff; color: #1c1b18; max-width: 420px; font-family: var(--font); }
.invoice-preview-name { font-size: 20px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.invoice-preview-title { font-size: 13px; color: #67635a; margin: 2px 0 6px; }
.invoice-preview-line { font-size: 12px; color: #3b3833; overflow-wrap: anywhere; white-space: pre-line; }

/* ---- Cari ---- */
.row-selected td { background: var(--primary-soft); }
.row-selected.row-link:hover td { background: var(--primary-soft); }
.cari-bar-cell { width: 22%; min-width: 120px; }
.cari-bar { position: relative; height: 10px; background: var(--bar-track); border-radius: 3px; overflow: hidden; }
.cari-bar-revenue, .cari-bar-profit { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; }
.cari-bar-revenue { background: var(--bar-revenue); }
.cari-bar-profit { background: var(--success); top: 3px; bottom: 3px; border-radius: 2px; }
.cari-legend { font-size: 13px; margin: var(--s-3) 0 0; white-space: pre-wrap; }
.cari-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; }
.cari-dot-revenue { background: var(--bar-revenue); }
.cari-dot-profit { background: var(--success); }
.cost-missing { margin-left: 6px; }
.cost-view { display: flex; align-items: center; gap: 4px; }
.cost-edit { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.input-sm { min-height: var(--control-h-sm); padding: 4px 8px; font-size: 13px; width: 110px; }
.input-sm.input-wide { width: 100%; min-width: 160px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.row-editing td { background: var(--primary-soft); }
.check-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; user-select: none; }
.check-toggle input { width: 16px; height: 16px; margin: 0; cursor: pointer; }
.cost-summary { display: flex; gap: var(--s-4); flex-wrap: wrap; margin: 10px 0 0; font-size: 14px; font-variant-numeric: tabular-nums; }

/* ---- Stok: ürün fotoğrafı ---- */
.thumb-cell { width: 56px; }
.thumb { width: 44px; height: 44px; border-radius: var(--radius-sm); object-fit: cover; display: block; border: 1px solid var(--border); background: var(--surface-2); cursor: zoom-in; }
.thumb-empty { width: 44px; height: 44px; border-radius: var(--radius-sm); border: 1px dashed var(--border-strong); display: grid; place-items: center; color: var(--muted); font-size: 18px; background: var(--surface-2); }
.photo-pick { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.photo-pick img { width: 96px; height: 96px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); }
.photo-pick .thumb-empty { width: 96px; height: 96px; font-size: 28px; border-radius: var(--radius); }
.photo-pick-actions { display: flex; flex-direction: column; gap: 6px; }

/* ---- Stok: kategori rozeti ve OEM ---- */
.badge-btn { cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; transition: border-color 0.12s var(--ease); }
.badge-btn:hover { border-color: currentColor; }
.oem-cell { font-family: var(--font-mono); font-size: 12.5px; max-width: 260px; overflow-wrap: anywhere; }
/* OEM kodu: tıklanınca o koda sahip tüm markalar aranır */
.oem-chip { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 4px; padding: 0 6px; margin: 1px 4px 1px 0; line-height: 1.6; cursor: pointer; transition: border-color 0.12s var(--ease), color 0.12s var(--ease); }
.oem-chip:hover { border-color: var(--primary); color: var(--primary); }

/* ---- Müşteri araçları: plaka ---- */
.plate-badge { margin: 1px 4px 1px 0; font-family: var(--font-mono); font-weight: 500; letter-spacing: 0.02em; }

/* ---- Tema (aydınlık / karanlık) ---- */
body, .card, .stat, .input, .topbar, .modal, .auth-card, .auth-main, .photo { transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease); }
.theme-toggle { font-size: 15px; line-height: 1; }
.sidebar-footer .theme-toggle { justify-content: flex-start; width: 100%; }
.theme-options { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.theme-option { display: flex; align-items: center; gap: var(--s-3); padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; min-width: 170px; text-align: left; transition: border-color 0.12s var(--ease), background-color 0.12s var(--ease); }
.theme-option:hover { background: var(--surface-2); }
.theme-option.active { border-color: var(--primary); background: var(--primary-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--primary); }
.theme-swatch { width: 30px; height: 22px; border-radius: 4px; border: 1px solid var(--border-strong); flex-shrink: 0; }
.theme-swatch-light { background: linear-gradient(135deg, var(--swatch-light-a) 50%, var(--swatch-light-b) 50%); }
.theme-swatch-dark { background: linear-gradient(135deg, var(--swatch-dark-a) 50%, var(--swatch-dark-b) 50%); }

/* ---- Duyarlı yerleşim (tablet / telefon) ---- */
@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .main { padding: 20px var(--s-4) 40px; }
  .topbar { display: flex; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 40; width: min(280px, 84vw); transform: translateX(-100%); transition: transform 0.2s var(--ease); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; background: var(--backdrop); z-index: 30; animation: fade-in 0.14s var(--ease); }
  .page-header { align-items: flex-start; margin-bottom: var(--s-5); }
  .page-title { font-size: 20px; }
  .card-header { padding: 10px var(--s-4); }
  .card-body { padding: 14px var(--s-4) var(--s-4); }

  /* Giriş: tek sütun, marka paneli gizli, kart içi marka görünür */
  .auth-split { display: grid; grid-template-columns: minmax(0, 1fr); place-items: start center; padding: 64px var(--s-4) var(--s-6); }
  .auth-aside { display: none; }
  .auth-main { width: 100%; padding: 0; background: transparent; }
  .auth-split .auth-card { border: 1px solid var(--border); background: var(--surface); box-shadow: var(--auth-shadow); padding: var(--s-6) 20px; }
  .auth-split .auth-card-brand { display: flex; }
}
@media (max-width: 600px) {
  /* iOS odakta yakınlaştırmasın */
  .input { font-size: 16px; }
  .input-sm { font-size: 14px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px 14px 14px; }
  .stat-value { font-size: 19px; }
  .toolbar .input, .input-search { max-width: none !important; }
  /* Telefonda tablo hücreleri sarılmaz; tablo .table-wrap içinde yatay kayar */
  .table td { white-space: nowrap; padding-top: 10px; padding-bottom: 10px; }
  .modal-backdrop { padding: 10px; }
  .modal-header { padding: 10px var(--s-4); }
  .modal-body { padding: var(--s-4); }
  .auth-split .auth-card { padding: 20px var(--s-4); }
}

/* ---- Giriş seçimi ve müşteri "Aracımı sorgula" ---- */
.entry-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
.entry-option { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 6px 8px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: none; text-align: center; line-height: 1.25; transition: color 0.12s var(--ease), background-color 0.12s var(--ease); }
.entry-option:hover { color: var(--text); text-decoration: none; }
.entry-option.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); }
:root[data-theme="dark"] .entry-option.active { background: var(--surface-3); }
.auth-card.lookup-card { max-width: 640px; }
.lookup-form { display: flex; flex-direction: column; gap: var(--s-4); }
.lookup-intro { font-size: 14px; line-height: 1.6; margin: 0; }
.lookup-input { text-transform: uppercase; font-family: var(--font-mono); letter-spacing: 0.06em; font-size: 16px; }
.lookup-input::placeholder { letter-spacing: 0.06em; }
.lookup-result { display: flex; flex-direction: column; gap: var(--s-4); }
.lookup-vehicle { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.lookup-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; }
.lookup-vehicle-name { font-weight: 600; font-size: 16px; overflow-wrap: anywhere; }
.lookup-list { display: flex; flex-direction: column; gap: var(--s-2); }
.lookup-hint { font-size: 13px; margin: 0 0 2px; }
.lookup-item { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color 0.12s var(--ease), background-color 0.12s var(--ease); }
.lookup-item:hover { border-color: var(--primary-border); background: var(--surface-2); }
.lookup-item:hover .lookup-item-arrow { color: var(--primary); transform: translateX(2px); }
.lookup-item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lookup-item-date { font-size: 12px; font-weight: 600; color: var(--primary); font-variant-numeric: tabular-nums; }
.lookup-item-title { font-weight: 600; overflow-wrap: anywhere; }
.lookup-item-meta { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.lookup-item-side { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.lookup-item-total { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lookup-item-arrow { font-size: 20px; line-height: 1; color: var(--muted); transition: transform 0.12s var(--ease), color 0.12s var(--ease); }
.lookup-detail { display: flex; flex-direction: column; gap: var(--s-3); align-items: stretch; }
.lookup-detail > .btn { align-self: flex-start; }
.lookup-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.lookup-detail-title { font-size: 18px; margin: 0; }
.lookup-subtitle { font-size: 14px; margin: 4px 0 0; }
.lookup-amounts { margin-top: 4px; }
@media (max-width: 520px) {
  .lookup-item { flex-direction: column; align-items: stretch; }
  .lookup-item-side { justify-content: space-between; }
  .lookup-item-arrow { display: none; }
}

/* Sorgu ekranındaki servis fişi (fatura PDF ile aynı içerik) */
.lookup-detail-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.receipt { display: flex; flex-direction: column; gap: 18px; padding: var(--s-5); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-variant-numeric: tabular-nums; }
.auth-split .receipt { box-shadow: var(--shadow-pop); }
.receipt-head { display: flex; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; padding-bottom: var(--s-4); border-bottom: 1px solid var(--border-strong); }
.receipt-biz { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.receipt-biz-name { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.receipt-biz-title { font-size: 13px; margin-bottom: 4px; }
.receipt-small { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.receipt-small.muted { color: var(--muted); }
.receipt-no { display: flex; flex-direction: column; gap: 2px; text-align: right; }
.receipt-parties { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); font-size: 14px; }
.receipt-parties > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.receipt-label { font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 4px; }
.receipt-job { display: flex; flex-direction: column; gap: 2px; }
.receipt-job-title { font-weight: 600; font-size: 16px; }
.receipt-notes p { margin: 0; font-size: 14px; }
.receipt-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 6px; }
.receipt-photo { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--muted); }
.receipt-photo:hover { text-decoration: none; color: var(--text); }
.receipt-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); }
.receipt-photo-cap { font-size: 12px; }
@media (max-width: 520px) {
  .receipt { padding: 14px; }
  .receipt-no { text-align: left; }
  .receipt-parties { grid-template-columns: 1fr; }
}


/* ---- İkonlar ---- */
.tab { display: inline-flex; align-items: center; gap: 6px; }
.lookup-item-arrow .icon { display: block; }

/* ---- Hareket: küçük animasyonlar ----
   Kısa (120–220 ms), yumuşak bitişli, 4–8 px mesafe. Yalnızca yerleşimi etkilemeyen
   opacity/transform kullanılır; tablo satırları tek tek canlandırılmaz (yalnızca hover). */
@keyframes rise-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes drop-in { from { opacity: 0; transform: translateY(-3px); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(0.985); } }
@keyframes bar-in { from { opacity: 0; transform: scaleY(0.4); } }
/* Aynı kare dizisinin iki adı: tema değişince ad değişir, animasyon yeniden oynar */
@keyframes icon-swap-a { from { opacity: 0; transform: rotate(-40deg) scale(0.85); } }
@keyframes icon-swap-b { from { opacity: 0; transform: rotate(-40deg) scale(0.85); } }

/* Sayfa açılışı: sayfanın üst düzey blokları (başlık, kutular, kartlar) hafif kademeli belirir.
   "backwards": animasyon bitince transform kalmaz (içerideki fixed modal etkilenmez). */
.main > * > * { animation: rise-in var(--dur-3) var(--ease-out) backwards; }
.main > * > :nth-child(2) { animation-delay: 30ms; }
.main > * > :nth-child(3) { animation-delay: 60ms; }
.main > * > :nth-child(4) { animation-delay: 90ms; }
.main > * > :nth-child(n + 5) { animation-delay: 120ms; }
/* Veri yüklenince tablo yerine oturur (yalnızca saydamlık, tek katman) */
.card-body > .table-wrap { animation: fade-in var(--dur-2) var(--ease-out) backwards; }

/* Giriş ve sorgu ekranları: bir kez belirir */
.auth-aside-body { animation: fade-in 320ms var(--ease-out) backwards; }
.auth-aside-list li { animation: rise-in var(--dur-3) var(--ease-out) backwards; }
.auth-aside-list li:nth-child(1) { animation-delay: 120ms; }
.auth-aside-list li:nth-child(2) { animation-delay: 160ms; }
.auth-aside-list li:nth-child(3) { animation-delay: 200ms; }
.auth-aside-list li:nth-child(n + 4) { animation-delay: 240ms; }
.auth-card { animation: rise-in var(--dur-3) var(--ease-out) 40ms backwards; }
.lookup-result { animation: rise-in var(--dur-3) var(--ease-out) backwards; }
.lookup-list, .lookup-detail { animation: fade-in var(--dur-2) var(--ease-out) backwards; }

/* Uyarılar */
.alert { animation: drop-in var(--dur-2) var(--ease-out) backwards; }

/* Düğmeler: renk geçişi + hafif basılma */
.btn { transition: background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease), transform var(--dur-1) var(--ease-out); }
.btn:not(:disabled):active { transform: translateY(1px); }
.theme-option { transition: border-color var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease-out); }
.theme-option:active { transform: translateY(1px); }

/* Tema düğmesindeki simge geçişte döner ve belirir */
.theme-toggle .icon { transform-origin: 50% 50%; }
:root[data-theme="light"] .theme-toggle .icon { animation: icon-swap-a var(--dur-3) var(--ease-out); }
:root[data-theme="dark"] .theme-toggle .icon { animation: icon-swap-b var(--dur-3) var(--ease-out); }

/* Menü: renk geçişleri ve etkin çubuğun büyüyerek gelmesi */
.nav-item, .nav-icon { transition: background-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease), opacity var(--dur-2) var(--ease); }
.nav-item.active::before { transform-origin: 50% 50%; animation: bar-in var(--dur-3) var(--ease-out); }

/* Sekmeler: alt çizgi ortadan açılır */
.tab { position: relative; }
.tab, .tab.active { border-bottom-color: transparent; }
.tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; border-radius: 1px; background: var(--primary); transform: scaleX(0); opacity: 0; transition: transform var(--dur-2) var(--ease-out), opacity var(--dur-1) var(--ease); }
.tab.active::after { transform: scaleX(1); opacity: 1; }

/* Tıklanabilir satırlar ve öğeler */
.row-link td { transition: background-color var(--dur-1) var(--ease); }
.lookup-item { transition: border-color var(--dur-2) var(--ease), background-color var(--dur-2) var(--ease), transform var(--dur-2) var(--ease-out); }
.lookup-item:hover { transform: translateY(-1px); }
.lookup-item:active { transform: translateY(0); }
.lookup-item-arrow { transition: transform var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease); }
.photo img { transition: transform var(--dur-3) var(--ease-out); }
.photo:hover img { transform: scale(1.02); }
.receipt-photo img { transition: border-color var(--dur-2) var(--ease); }
.receipt-photo:hover img { border-color: var(--primary-border); }

/* Modal: arka plan solar, pencere hafifçe yükselerek gelir */
.modal-backdrop { animation: fade-in var(--dur-2) var(--ease-out); }
.modal { animation: dialog-in var(--dur-3) var(--ease-out); }
/* Sayfanın üst düzeyinde açılan modal, sayfa kademelendirmesinden etkilenmesin */
.main > * > .modal-backdrop { animation: fade-in var(--dur-2) var(--ease-out); animation-delay: 0s; }

/* Mobil menü: yumuşak kayma */
@media (max-width: 900px) {
  .sidebar { transition: transform var(--dur-3) var(--ease-out); }
  .sidebar-backdrop { animation: fade-in var(--dur-2) var(--ease-out); }
}

/* ---- Hareket azaltma tercihi ----
   Tüm geçiş ve animasyonlar kapanır (gecikmeler dahil); hover/basılma kaymaları uygulanmaz. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .btn:active, .theme-option:active, .lookup-item:hover, .lookup-item:hover .lookup-item-arrow, .photo:hover img { transform: none !important; }
  /* Yükleniyor göstergesi durmasın, yalnızca yavaşlasın */
  .spinner { animation-duration: 1.6s !important; animation-iteration-count: infinite !important; }
  .photo-placeholder { animation: none !important; }
}

/* ---- Düzeltmeler: tablo işlem hücresi, kart başlığı, OEM, özet kutuları ---- */
/* İşlem hücresi tablo hücresi olarak kalır (flex olunca çizgiler ve satır rengi kopuyordu) */
.table td.cell-actions { display: table-cell; text-align: right; white-space: normal; min-width: 170px; }
.table td.cell-actions > * { margin: 2px 0 2px 4px; vertical-align: middle; }
/* Kart başlığındaki seçim kutusu tam genişlik olmasın */
.card-actions .input { width: auto; min-width: 120px; }
/* OEM kodu tek satırda kalsın */
.oem-chip { white-space: nowrap; }
/* Genel bakıştaki 7 kutu geniş ekranda tek satıra sığsın */
.stat-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
@media (max-width: 600px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- iOS / Android uygulaması: çentik, durum ve gezinme çubukları ----
   index.html viewport-fit=cover kullanır; env(safe-area-inset-*) yalnızca gereken cihazlarda 0'dan büyüktür,
   masaüstü tarayıcıda bu blok hiçbir şeyi değiştirmez. */
:root {
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
}
.content { padding: 0 var(--sar) var(--sab) var(--sal); }
.sidebar { padding-top: calc(var(--s-4) + var(--sat)); padding-bottom: calc(var(--s-4) + var(--sab)); padding-left: calc(var(--s-3) + var(--sal)); }
.modal-backdrop { padding: calc(var(--s-4) + var(--sat)) calc(var(--s-4) + var(--sar)) calc(var(--s-4) + var(--sab)) calc(var(--s-4) + var(--sal)); }
.auth-wrap { padding: calc(var(--s-4) + var(--sat)) calc(var(--s-4) + var(--sar)) calc(var(--s-4) + var(--sab)) calc(var(--s-4) + var(--sal)); }
.auth-split { padding: 0 var(--sar) var(--sab) var(--sal); }
.auth-aside { padding-top: calc(36px + var(--sat)); }
.auth-main { padding-top: calc(72px + var(--sat)); }
.auth-theme-toggle { top: calc(14px + var(--sat)); right: calc(14px + var(--sar)); }
@media (min-width: 901px) {
  .content { padding-top: var(--sat); }
}
@media (max-width: 900px) {
  .topbar { height: calc(54px + var(--sat)); padding-top: var(--sat); }
  .auth-split { padding: calc(64px + var(--sat)) calc(var(--s-4) + var(--sar)) calc(var(--s-6) + var(--sab)) calc(var(--s-4) + var(--sal)); }
}
@media (max-width: 600px) {
  .modal-backdrop { padding: calc(10px + var(--sat)) calc(10px + var(--sar)) calc(10px + var(--sab)) calc(10px + var(--sal)); }
}
/* Uygulamada metin seçimi / dokunma vurgusu ve sayfanın "lastik" kaydırması kapalı (formlar hariç) */
html.native { -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
html.native body { overscroll-behavior: none; }
html.native .nav-item, html.native .btn, html.native .tab, html.native .entry-option { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* ---- Yapay zeka asistanı: sağ kenarda sürüklenebilir "+" sekmesi ve açılır panel ----
   Modal'ların (z 50) altında kalır; düğme panelin üstündedir, panel düğmenin solunda açılır. */
.ai-fab { position: fixed; right: var(--sar); z-index: 46; width: 44px; height: 52px; display: grid; place-items: center; padding: 0; border: 1px solid var(--primary-active); border-right: none; border-radius: 14px 0 0 14px; background: var(--primary); color: var(--on-primary); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; transition: background-color var(--dur-2) var(--ease), width var(--dur-2) var(--ease-out); }
.ai-fab:hover { background: var(--primary-hover); width: 48px; }
.ai-fab:active { cursor: grabbing; }
.ai-fab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ai-fab .icon { width: 22px; height: 22px; stroke-width: 2.2; transition: transform var(--dur-2) var(--ease-out); }
.ai-fab.open .icon { transform: rotate(45deg); }

.ai-panel { position: fixed; z-index: 45; right: calc(var(--sar) + 54px); width: min(400px, calc(100vw - var(--sal) - var(--sar) - 70px)); max-height: calc(100dvh - var(--sat) - var(--sab) - 16px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22); overflow: hidden; animation: dialog-in var(--dur-2) var(--ease-out); }
.ai-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; border-bottom: 1px solid var(--border); }
.ai-head-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary); flex-shrink: 0; }
.ai-head-text { flex: 1; min-width: 0; }
.ai-title { font-weight: 600; font-size: 14.5px; }
.ai-sub { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.ai-empty p { margin: 0 0 12px; font-size: 13.5px; line-height: 1.5; }
.ai-suggestions { display: flex; flex-direction: column; gap: 6px; }
.ai-chip { text-align: left; padding: 8px 11px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; transition: border-color 0.12s var(--ease), background-color 0.12s var(--ease); }
.ai-chip:hover { border-color: var(--primary-border); background: var(--primary-soft); }
.ai-msg { max-width: 92%; padding: 9px 12px; border-radius: 12px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.ai-msg-user { align-self: flex-end; background: var(--primary); color: var(--on-primary); border-bottom-right-radius: 4px; white-space: pre-wrap; }
.ai-msg-assistant { align-self: flex-start; background: var(--surface-2); color: var(--text); border-bottom-left-radius: 4px; }
.ai-msg-assistant p { margin: 0 0 8px; }
.ai-msg-assistant > :last-child { margin-bottom: 0; }
.ai-msg-assistant ul, .ai-msg-assistant ol { margin: 0 0 8px; padding-left: 20px; }
.ai-msg-assistant li { margin: 2px 0; }
.ai-msg-assistant .ai-h { font-weight: 600; }
.ai-msg-assistant code { font-family: var(--font-mono); font-size: 12.5px; }
.ai-table-wrap { overflow-x: auto; margin: 0 0 8px; }
.ai-table { border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ai-table th, .ai-table td { padding: 4px 8px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.ai-table th { font-weight: 600; color: var(--muted); }
.ai-typing { display: flex; gap: 4px; padding: 12px 14px; }
.ai-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: ai-dot 1.1s infinite ease-in-out; }
.ai-typing span:nth-child(2) { animation-delay: 0.15s; }
.ai-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes ai-dot { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.ai-input { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--border); }
.ai-input textarea.input { min-height: var(--control-h); max-height: 120px; resize: none; field-sizing: content; }
@media (max-width: 600px) {
  .ai-panel { left: calc(var(--sal) + 8px); right: calc(var(--sar) + 50px); width: auto; }
  .ai-input textarea.input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .ai-typing span { animation: none; }
  .ai-panel { animation: none; }
}