/* ==========================================================================
   AIRMAX_SERVICE — Bayi Uygulaması Prototip Tasarım Sistemi
   Palet   : beyaz / siyah / gri / kırmızı
   Hedef   : Mobil uygulama içi WebView (iOS 14+, Android 8+)
   Yerleşim: Telefon (tek kolon + alt sekme) · Tablet ≥840px (rail + master-detail)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokenlar
   -------------------------------------------------------------------------- */
:root {
  /* Ham palet */
  --white: #ffffff;
  --gray-50: #f7f8f9;
  --gray-100: #f0f1f3;
  --gray-200: #e4e6e9;
  --gray-300: #d3d7db;
  --gray-400: #aab0b7;
  --gray-500: #7c838b;
  --gray-600: #565d65;
  --gray-700: #3a4047;
  --gray-800: #22262b;
  --gray-900: #14171a;
  --black: #0b0d0f;

  --red-50: #fdecec;
  --red-100: #f9d4d6;
  --red-500: #e01b22;
  --red-600: #c1141b;
  --red-700: #971015;

  /* Anlamsal (açık tema) */
  --bg: var(--gray-50);
  --surface: var(--white);
  --surface-2: var(--gray-100);
  --surface-inverse: var(--black);
  --border: var(--gray-200);
  --border-strong: var(--gray-300);
  --text: var(--gray-900);
  --text-2: var(--gray-600);
  --text-3: var(--gray-500);
  --text-inverse: var(--white);
  --brand: var(--red-500);
  --brand-hover: var(--red-600);
  --brand-soft: var(--red-50);
  --brand-soft-border: var(--red-100);
  --focus: var(--red-500);

  /* Ölçüler */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --tap: 44px;                 /* min dokunma hedefi */
  --appbar-h: 56px;
  --tabbar-h: 60px;
  --rail-w: 88px;
  --shadow-1: 0 1px 2px rgba(11, 13, 15, .06), 0 1px 3px rgba(11, 13, 15, .04);
  --shadow-2: 0 4px 16px rgba(11, 13, 15, .10);
  --shadow-up: 0 -1px 0 var(--border);

  /* Güvenli alan (çentik / gesture bar) */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* Koyu tema: sistem tercihi + elle seçim (Ayarlar ekranı) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d0f;
    --surface: #15181c;
    --surface-2: #1d2126;
    --surface-inverse: #2b3138;   /* koyu temada "ters" yüzey yükseltilir, yoksa zeminle kaynaşır */
    --border: #262b31;
    --border-strong: #343a41;
    --text: #f2f4f6;
    --text-2: #a7aeb6;
    --text-3: #858c94;
    --brand: #ff4b52;
    --brand-hover: #ff6a70;
    --brand-soft: #2a1315;
    --brand-soft-border: #45191c;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-2: 0 4px 16px rgba(0, 0, 0, .55);
  }
}

:root[data-theme="dark"] {
  --bg: #0b0d0f;
  --surface: #15181c;
  --surface-2: #1d2126;
  --surface-inverse: #2b3138;   /* koyu temada "ters" yüzey yükseltilir, yoksa zeminle kaynaşır */
  --border: #262b31;
  --border-strong: #343a41;
  --text: #f2f4f6;
  --text-2: #a7aeb6;
  --text-3: #858c94;
  --brand: #ff4b52;
  --brand-hover: #ff6a70;
  --brand-soft: #2a1315;
  --brand-soft-border: #45191c;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-2: 0 4px 16px rgba(0, 0, 0, .55);
}

/* --------------------------------------------------------------------------
   2. Reset / temel
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;   /* WebView'de yatay çevirmede punto kaymasın */
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;  /* dokunmada mavi flaş olmasın */
  overscroll-behavior-y: none;               /* WebView'de sayfa bounce/pull-refresh kapalı */
}

/* `hidden` özniteliği her zaman kazanır — .stack/.banner gibi display tanımlayan
   sınıflar tarayıcının varsayılan [hidden] kuralını ezmesin. */
[hidden] { display: none !important; }

h1, h2, h3, h4, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   2.1 Kaydırma davranışı — native mobil uygulama hissi
   Kaydırma çubuğu gizlenir (işlev korunur), momentum açık, zincirleme kaydırma
   kapalı. Katalog sayfası (index.html) bu kuralı kendi içinde geri alır.
   -------------------------------------------------------------------------- */
html {
  scrollbar-width: none;        /* Firefox */
  -ms-overflow-style: none;     /* eski Edge */
}

html::-webkit-scrollbar,
body::-webkit-scrollbar { width: 0; height: 0; display: none; }

.scroll-y,
.content,
.sheet,
.split__list,
.split__detail {
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;   /* iOS momentum */
  overscroll-behavior: contain;        /* kaydırma alt/üst öğeye taşmasın */
}

.scroll-y::-webkit-scrollbar,
.content::-webkit-scrollbar,
.sheet::-webkit-scrollbar,
.split__list::-webkit-scrollbar,
.split__detail::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* İkonlar — bağlama özel kurallar bu varsayılanı ezer */
.icon { width: 20px; height: 20px; flex: none; }

/* Sadece ekran okuyucu */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------------------
   3. Uygulama iskeleti
   -------------------------------------------------------------------------- */
.app {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

.shell {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* --- Üst bar --------------------------------------------------------------- */
.appbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface-inverse);
  color: var(--white);
  padding-top: var(--safe-top);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

.appbar__inner {
  height: var(--appbar-h);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px 0 6px;
}

/* Marka işareti — ana sayfa dahil tüm ekranlarda korunur (mount() ile eklenir) */
.appbar__logo {
  flex: none;
  width: 32px; height: 32px;
  margin-left: 6px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.03em;
}

.appbar__title {
  flex: 1;
  min-width: 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -.01em;
  padding: 0 6px 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appbar__title small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, .62);
  letter-spacing: .02em;
}

.appbar__action {
  flex: none;
  width: var(--tap);
  height: var(--tap);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--white);
  cursor: pointer;
}

.appbar__action:active { background: rgba(255, 255, 255, .14); }
.appbar__action[disabled] { opacity: .35; }

.appbar--brand { background: var(--brand); }

/* --- İçerik ---------------------------------------------------------------- */
.content {
  flex: 1;
  min-width: 0;
  padding: 14px 16px calc(var(--tabbar-h) + var(--safe-bottom) + 20px);
  padding-left: max(16px, var(--safe-left));
  padding-right: max(16px, var(--safe-right));
  -webkit-overflow-scrolling: touch;
}

/* Tam ekran akışlarda (sihirbaz, form) alt sekme çubuğu yoktur */
.app[data-chrome="none"] .content { padding-bottom: calc(var(--safe-bottom) + 16px); }

.content--flush { padding-left: 0; padding-right: 0; }
.content--center {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: calc(var(--safe-bottom) + 24px);
}

/* --- Alt sekme çubuğu (telefon) -------------------------------------------- */
.tabbar {
  position: fixed;
  z-index: 40;
  left: 0; right: 0; bottom: 0;
  display: flex;
  background: var(--surface);
  box-shadow: var(--shadow-up);
  padding-bottom: var(--safe-bottom);
}

.tabbar__item {
  flex: 1;
  min-width: 0;
  height: var(--tabbar-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-3);
  background: none;
  border: 0;
  cursor: pointer;
}

.tabbar__item .icon { width: 22px; height: 22px; }
.tabbar__item:active { background: var(--surface-2); }
.tabbar__item.is-active { color: var(--brand); }

/* --- Yan rail (tablet) ----------------------------------------------------- */
.rail { display: none; }

@media (min-width: 840px) {
  .rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: none;
    width: var(--rail-w);
    background: var(--surface-inverse);
    color: rgba(255, 255, 255, .7);
    padding: 14px 8px calc(14px + var(--safe-bottom));
    padding-left: max(8px, var(--safe-left));
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
  }

  .rail__logo {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: var(--brand);
    color: #fff;
    border-radius: 11px;
    font-weight: 800; font-size: 18px;
    margin-bottom: 10px;
    flex: none;
  }

  .rail__item {
    width: 100%;
    padding: 10px 4px;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    background: none; border: 0; border-radius: var(--radius);
    color: inherit; font-size: 11px; font-weight: 600; cursor: pointer;
  }

  .rail__item .icon { width: 22px; height: 22px; }
  .rail__item:active { background: rgba(255, 255, 255, .1); }
  .rail__item.is-active { background: rgba(255, 255, 255, .12); color: #fff; }
  .rail__item.is-active .icon { color: var(--brand); }
  .rail__spacer { flex: 1; }

  .tabbar { display: none; }

  /* Tablette rail zaten logoyu taşır — app bar'da tekrar etmesin */
  .app:not([data-chrome="none"]) .appbar__logo { display: none; }
  .app:not([data-chrome="none"]) .appbar__title { padding-left: 12px; }

  .content {
    padding: 20px 24px 32px;
    max-width: 1180px;
  }

  .content--wide { max-width: none; }
}

/* --- Master-detail (tablet) ------------------------------------------------ */
.split { display: block; }
.split__detail { display: none; }

@media (min-width: 840px) {
  .split {
    display: grid;
    grid-template-columns: minmax(300px, 360px) 1fr;
    gap: 20px;
    align-items: start;
  }

  /* İki panel de kendi içinde kaydırılır — sayfa bütünü kaymaz (master-detail) */
  .split__list,
  .split__detail {
    position: sticky;
    top: 0;
    max-height: calc(100vh - var(--appbar-h) - var(--safe-top) - 52px);
    max-height: calc(100dvh - var(--appbar-h) - var(--safe-top) - 52px);
    overflow-y: auto;
    padding-bottom: 4px;
  }

  .split__detail { display: block; }
}

/* --------------------------------------------------------------------------
   4. Tipografi / yardımcılar
   -------------------------------------------------------------------------- */
.h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.h2 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.h3 { font-size: 15px; font-weight: 650; }

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 4px 0 2px;
}

.section-title .icon { width: 15px; height: 15px; color: var(--brand); }
.section-title__action { margin-left: auto; font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--brand); }

.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.strong { font-weight: 650; }
.mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; letter-spacing: -.01em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-brand { color: var(--brand); }
.text-center { text-align: center; }

.stack { display: flex; flex-direction: column; gap: 10px; }
.stack--sm { gap: 6px; }
.stack--lg { gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row--between { justify-content: space-between; }
.row--top { align-items: flex-start; }
.spacer { flex: 1; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

@media (min-width: 700px) {
  .grid-2--wide3 { grid-template-columns: repeat(3, 1fr); }
}

.divider { height: 1px; background: var(--border); margin: 10px 0; border: 0; }

/* --------------------------------------------------------------------------
   5. Kart & liste
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-1);
}

.card--flat { box-shadow: none; }
.card--pad-0 { padding: 0; overflow: hidden; }
.card--brand { background: var(--brand-soft); border-color: var(--brand-soft-border); }
.card--inverse { background: var(--surface-inverse); border-color: transparent; color: var(--white); }
.card--inverse .muted, .card--inverse .dim { color: rgba(255, 255, 255, .66); }

.card__title { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.card__sub { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }

/* Dokunulabilir liste satırı */
.tile {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  min-height: var(--tap);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  box-shadow: var(--shadow-1);
  cursor: pointer;
  transition: border-color .12s ease, background-color .12s ease;
}

.tile:active { background: var(--surface-2); }
.tile.is-selected { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.tile__body { flex: 1; min-width: 0; }
.tile__title { font-size: 15px; font-weight: 650; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.tile__meta { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }
.tile__chev { flex: none; width: 18px; height: 18px; color: var(--text-3); }

/* Avatar / seri no rozeti */
.avatar {
  flex: none;
  width: 42px; height: 42px;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  border: 1px solid var(--border);
}

.avatar--brand { background: var(--brand); border-color: transparent; color: #fff; }
.avatar--dark { background: var(--surface-inverse); border-color: transparent; color: #fff; }
.avatar .icon { width: 20px; height: 20px; }

/* Anahtar-değer satırı (özet ekranları) */
.kv { display: flex; gap: 12px; padding: 7px 0; font-size: 13.5px; }
.kv + .kv { border-top: 1px dashed var(--border); }
.kv__k { flex: none; width: 42%; color: var(--text-3); }
.kv__v { flex: 1; min-width: 0; font-weight: 600; }

/* --------------------------------------------------------------------------
   6. Chip / rozet  (durum ayrımı renk yerine dolgu+kontur ile)
   -------------------------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-2);
}

.chip .icon { width: 12px; height: 12px; }
.chip--stock { border-color: var(--border-strong); background: var(--surface-2); color: var(--text-2); }
.chip--sold { background: var(--surface-inverse); border-color: transparent; color: #fff; }
.chip--warn { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.chip--expired { background: var(--brand); border-color: transparent; color: #fff; }
.chip--ghost { background: transparent; }

.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--text-3); }
.dot--brand { background: var(--brand); }
.dot--dark { background: var(--text); }

/* --------------------------------------------------------------------------
   7. Butonlar
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 11px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.01em;
  cursor: pointer;
  user-select: none;
  transition: background-color .12s ease, opacity .12s ease;
}

.btn .icon { width: 18px; height: 18px; }
.btn:active { background: var(--brand-hover); }
.btn[disabled], .btn.is-disabled {
  background: var(--surface-2);
  color: var(--text-3);
  border-color: var(--border);
  cursor: not-allowed;
}

.btn--block { display: flex; width: 100%; }
.btn--dark { background: var(--surface-inverse); }
.btn--dark:active { background: var(--gray-800); }
.btn--outline { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn--outline:active { background: var(--surface-2); }
.btn--soft { background: var(--brand-soft); border-color: var(--brand-soft-border); color: var(--brand); }
.btn--soft:active { background: var(--brand-soft-border); }
.btn--sm { min-height: 36px; padding: 7px 13px; font-size: 13.5px; border-radius: var(--radius-sm); }
.btn--lg { min-height: 52px; font-size: 16px; }

.icon-btn {
  flex: none;
  width: var(--tap); height: var(--tap);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-2);
  cursor: pointer;
}

.icon-btn:active { background: var(--surface-2); }
.icon-btn .icon { width: 20px; height: 20px; }

/* Sayfa altına sabitlenen aksiyon barı (form/sihirbaz ekranları) */
.actionbar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  gap: 10px;
  margin: 18px -16px 0;
  padding: 12px 16px calc(12px + var(--safe-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.actionbar .btn { flex: 1; }
.actionbar--floating { border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: 0 -4px 20px rgba(11, 13, 15, .07); }

/* İçerik kısa kaldığında aksiyon barı boşlukta asılı kalmasın, ekranın altına insin */
.content--fill { display: flex; flex-direction: column; }
.content--fill > .stack,
.content--fill > form { flex: 1; }
.content--fill .actionbar { margin-top: auto; }

@media (min-width: 840px) {
  .actionbar { margin: 18px 0 0; border-radius: var(--radius-lg); border: 1px solid var(--border); padding-bottom: 12px; }
  .actionbar .btn { flex: none; min-width: 160px; }
  .actionbar .btn--grow { flex: 1; }
}

/* --------------------------------------------------------------------------
   8. Form elemanları
   -------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 5px; }

.field__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-3);
}

.field__label .req { color: var(--brand); }
.field__hint { font-size: 11.5px; color: var(--text-3); }
.field__error { font-size: 11.5px; color: var(--brand); font-weight: 600; display: none; }
.field.has-error .field__error { display: block; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--brand); }

.input, .select, .textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 16px;              /* iOS'ta odaklanınca otomatik zoom olmasın */
  color: var(--text);
  appearance: none;
  -webkit-appearance: none;
}

.textarea { min-height: 88px; resize: vertical; line-height: 1.4; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.input[readonly] { background: var(--surface-2); color: var(--text-2); }

.select {
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.input-group { position: relative; }
.input-group .input { padding-right: 46px; }
.input-group__btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; color: var(--text-3); cursor: pointer;
}
.input-group__btn .icon { width: 20px; height: 20px; }

/* Arama */
.search { position: relative; }
.search .icon--search {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--text-3); pointer-events: none;
}
.search .input { padding-left: 40px; border-radius: var(--radius-pill); }
.search__scan {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 0; color: var(--text-2); cursor: pointer;
}
.search__scan .icon { width: 19px; height: 19px; }

/* Segment (sekme) */
.segment {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border-radius: var(--radius);
}

.segment__item {
  flex: 1;
  min-height: 38px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  font-size: 13.5px; font-weight: 600;
  cursor: pointer;
}

.segment__item.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.segment__count {
  font-size: 11px; font-weight: 700;
  background: var(--border); color: var(--text-2);
  border-radius: var(--radius-pill); padding: 1px 7px;
}
.segment__item.is-active .segment__count { background: var(--brand); color: #fff; }

/* Onay kutusu satırı */
.check {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13.5px;
  line-height: 1.4;
}

.check:active { background: var(--surface-2); }
.check input { position: absolute; opacity: 0; pointer-events: none; }

.check__box {
  flex: none;
  width: 22px; height: 22px;
  margin-top: 1px;
  border: 2px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  color: transparent;
  transition: background-color .12s ease, border-color .12s ease;
}

.check__box .icon { width: 14px; height: 14px; }
.check input:checked + .check__box { background: var(--brand); border-color: var(--brand); color: #fff; }
.check input:focus-visible + .check__box { outline: 2px solid var(--focus); outline-offset: 2px; }
.check.is-checked { border-color: var(--brand-soft-border); background: var(--brand-soft); }
.check__text { flex: 1; min-width: 0; }
.check__text b { font-weight: 650; }

/* Seçim kartları (radyo) */
.choice-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.choice {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  min-height: 64px; padding: 10px 6px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 13px; font-weight: 600; color: var(--text-2);
  cursor: pointer; text-align: center;
}

.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .icon { width: 20px; height: 20px; }
.choice.is-active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.choice.is-active .icon { color: var(--brand); }

/* Fotoğraf ızgarası */
.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

@media (min-width: 700px) { .photo-grid { grid-template-columns: repeat(4, 1fr); } }

.photo {
  position: relative;
  aspect-ratio: 4 / 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-3);
  font-size: 11.5px; font-weight: 600; text-align: center; padding: 6px;
  cursor: pointer;
}

.photo .icon { width: 22px; height: 22px; }
.photo:active { background: var(--surface-2); }
.photo.is-filled {
  border-style: solid;
  border-color: var(--border);
  color: var(--text);
  background: var(--surface-2);
}

/* Seçilen görselin önizlemesi — yuvayı tamamen kaplar. */
.photo__thumb {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
}

/* Fotoğraf varken başlık okunabilir kalsın diye alt karartma. */
.photo.is-filled .photo__caption {
  color: #fff;
  z-index: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .8);
}

.photo__remove {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  width: 28px; height: 28px; border-radius: 50%;
  border: 0; padding: 0;
  background: var(--black); color: #fff;
  display: none; align-items: center; justify-content: center;
  cursor: pointer;
}
.photo.is-filled .photo__remove { display: flex; }
.photo__remove .icon { width: 14px; height: 14px; }

/* Görsel 28px ama dokunma hedefi 46px (WebView kuralı: >=44px). */
.photo__remove::after { content: ''; position: absolute; inset: -9px; }

/* Yükleme sırasında yuva tıklanamaz. */
.photo.is-busy { opacity: .6; pointer-events: none; }

.photo__badge {
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.photo__badge .icon { width: 13px; height: 13px; }
.photo__caption { position: absolute; bottom: 6px; left: 6px; right: 6px; font-size: 10.5px; color: var(--text-2); }

/* Telefon girişi: ülke kodu seçimi + yalnızca rakam alan numara kutusu ------ */
.phone-row { display: grid; grid-template-columns: minmax(96px, 34%) 1fr; gap: 8px; }

/* Ülke adı uzun olabilir; seçim kutusu taşmadan kısalır. */
.phone-row .select {
  min-width: 0;
  text-overflow: ellipsis;
}

/* Numara kutusu sabit genişlikli rakam görünümü — hane saymak kolaylaşır. */
.phone-row .input { font-variant-numeric: tabular-nums; letter-spacing: .02em; }

/* --------------------------------------------------------------------------
   9. KPI / istatistik
   -------------------------------------------------------------------------- */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

@media (min-width: 700px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }

.kpi {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px 13px;
  box-shadow: var(--shadow-1);
  cursor: pointer;
  transition: border-color .12s ease, transform .12s ease;
}

.kpi:active { background: var(--surface-2); transform: scale(.985); }

.kpi__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.kpi__icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
}

.kpi__icon .icon { width: 18px; height: 18px; }
.kpi__chev { width: 16px; height: 16px; color: var(--text-3); opacity: .5; }

.kpi__n {
  display: block;
  font-size: 30px;
  font-weight: 750;
  letter-spacing: -.035em;
  line-height: 1.02;
  font-variant-numeric: tabular-nums;
}

.kpi__l {
  display: block;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-2);
  margin-top: 3px;
}

.kpi__foot {
  display: block;
  font-size: 11px;
  color: var(--text-3);
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid var(--border);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Vurgulu döşeme — dikkat isteyen metrik */
.kpi--alert { border-color: var(--brand-soft-border); background: var(--brand-soft); }
.kpi--alert .kpi__icon { background: var(--brand); color: #fff; }
.kpi--alert .kpi__n { color: var(--brand); }
.kpi--alert .kpi__l { color: var(--brand); }
.kpi--alert .kpi__chev { color: var(--brand); opacity: .6; }
.kpi--alert .kpi__foot { color: var(--brand); border-top-color: var(--brand-soft-border); opacity: .85; }

/* Hızlı işlemler — telefonda alt alta, tablette yan yana */
.quick-actions { display: grid; gap: 10px; }
@media (min-width: 840px) { .quick-actions { grid-template-columns: 1fr 1fr; } }

/* Koyu döşeme — birincil metrik */
.kpi--dark { background: var(--surface-inverse); border-color: transparent; color: #fff; }
.kpi--dark .kpi__icon { background: rgba(255, 255, 255, .14); color: #fff; }
.kpi--dark .kpi__l { color: rgba(255, 255, 255, .72); }
.kpi--dark .kpi__chev { color: rgba(255, 255, 255, .5); }
.kpi--dark .kpi__foot { color: rgba(255, 255, 255, .6); border-top-color: rgba(255, 255, 255, .14); }
.kpi--dark:active { background: var(--gray-800); }

/* --------------------------------------------------------------------------
   10. Sihirbaz adım göstergesi
   -------------------------------------------------------------------------- */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 2px 0;
}

.stepper__dot {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text-3);
  font-size: 11.5px; font-weight: 700;
}

.stepper__dot .icon { width: 14px; height: 14px; }
.stepper__dot.is-done { background: var(--surface-inverse); border-color: transparent; color: #fff; }
.stepper__dot.is-current { background: var(--brand); border-color: transparent; color: #fff; box-shadow: 0 0 0 4px var(--brand-soft); }
.stepper__line { flex: 1; height: 2px; background: var(--border); }
.stepper__line.is-done { background: var(--text); }

.step-head { display: flex; align-items: baseline; gap: 8px; }
.step-head__n { font-size: 12px; font-weight: 700; color: var(--brand); letter-spacing: .04em; }

/* İlerleme çubuğu */
.progress { height: 6px; border-radius: var(--radius-pill); background: var(--surface-2); overflow: hidden; }
.progress__bar { height: 100%; background: var(--brand); border-radius: inherit; transition: width .25s ease; }

/* --------------------------------------------------------------------------
   11. Zaman çizelgesi (servis geçmişi)
   -------------------------------------------------------------------------- */
.timeline { position: relative; padding-left: 26px; }

.timeline::before {
  content: "";
  position: absolute; left: 8px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border);
}

.timeline__item { position: relative; padding: 0 0 12px; }
.timeline__item:last-child { padding-bottom: 0; }

.timeline__marker {
  position: absolute; left: -26px; top: 12px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
}

.timeline__marker .icon { width: 10px; height: 10px; }
.timeline__marker--brand { border-color: var(--brand); color: var(--brand); }
.timeline__marker--dark { background: var(--surface-inverse); border-color: var(--surface-inverse); color: #fff; }

/* --------------------------------------------------------------------------
   12. Boş durum / uyarı / bildirim
   -------------------------------------------------------------------------- */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center;
  padding: 40px 20px;
  color: var(--text-3);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.empty .icon { width: 30px; height: 30px; }
.empty__title { font-size: 15px; font-weight: 650; color: var(--text-2); }

.banner {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 13px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12.5px; line-height: 1.4; color: var(--text-2);
}

.banner .icon { flex: none; width: 17px; height: 17px; margin-top: 1px; color: var(--text-3); }
.banner--alert { background: var(--brand-soft); border-color: var(--brand-soft-border); color: var(--brand); }
.banner--alert .icon { color: var(--brand); }
.banner--dark { background: var(--surface-inverse); border-color: transparent; color: rgba(255, 255, 255, .8); }
.banner--dark .icon { color: var(--brand); }
.banner b { font-weight: 700; }

/* Toast */
.toast-host {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 14px);
  z-index: 60;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}

@media (min-width: 840px) { .toast-host { bottom: calc(var(--safe-bottom) + 20px); } }

.toast {
  max-width: 460px;
  display: flex; align-items: center; gap: 9px;
  padding: 11px 15px;
  background: var(--surface-inverse);
  color: #fff;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-2);
  font-size: 13.5px; font-weight: 600;
  animation: toast-in .2s ease;
}

.toast .icon { width: 17px; height: 17px; color: var(--brand); flex: none; }

@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   13. Alt sayfa (bottom sheet) / modal
   -------------------------------------------------------------------------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(11, 13, 15, .5);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade-in .15s ease;
}

.sheet-backdrop[hidden] { display: none; }

.sheet {
  width: 100%; max-width: 560px;
  max-height: 86vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 8px 16px calc(18px + var(--safe-bottom));
  animation: sheet-up .22s ease;
}

@media (min-width: 840px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: var(--radius-lg); max-height: 80vh; padding-bottom: 18px; }
}

.sheet__grabber { width: 38px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 6px auto 12px; }
.sheet__title { font-size: 16px; font-weight: 700; margin-bottom: 10px; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(18px); } to { transform: none; } }

/* --------------------------------------------------------------------------
   14. Başarı ekranı
   -------------------------------------------------------------------------- */
.success {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 10px; padding: 28px 18px;
}

.success__mark {
  width: 76px; height: 76px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 10px var(--brand-soft);
  animation: pop .28s ease;
}

.success__mark .icon { width: 38px; height: 38px; }

@keyframes pop { 0% { transform: scale(.7); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* --------------------------------------------------------------------------
   15. Prototip kataloğu (index.html)
   -------------------------------------------------------------------------- */
.catalog { max-width: 1400px; margin: 0 auto; padding: 28px 20px 60px; }
.catalog__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }

.catalog__card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  box-shadow: var(--shadow-1);
}

.catalog__card:active { background: var(--surface-2); }
.catalog__code { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--brand); }
.catalog__name { font-size: 15px; font-weight: 650; }
.catalog__desc { font-size: 12.5px; color: var(--text-2); }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 64px; }
.swatch__box { height: 44px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.swatch__label { font-size: 10.5px; color: var(--text-3); margin-top: 4px; text-align: center; }

/* --------------------------------------------------------------------------
   16. Hareket tercihi
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
