/* ============================================================
   Vitaminsan Panel - tasarım sistemi
   Marka renkleri vitaminsan.com logosundan: #018164 / #004236
   Tek tema (açık), tek vurgu rengi, yeşil tonlu tek nötr aile.
   ============================================================ */

@font-face {
  font-family: 'Geist';
  src: url('/fonts/geist-latin-ext.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Mono';
  src: url('/fonts/geist-mono-latin-ext.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Yüzeyler: yeşile çalan tek nötr aile.
     Derinlik sırası: kenar çubuğu (en koyu) > sayfa > kartlar (beyaz). */
  --sidebar-bg: #e4ece8;
  --bg: #f1f5f3;
  --surface: #ffffff;
  --surface-2: #f7faf8;
  --surface-3: #eaf0ed;
  --line: #e0e8e4;
  --line-strong: #ccd8d2;

  /* Metin */
  --text: #0f231c;
  --text-2: #55635c;
  --text-3: #8b968f;

  /* Marka */
  --accent: #018164;
  --accent-hover: #016a52;
  --accent-deep: #004236;
  --accent-soft: #e4f1ec;
  --accent-line: #b5d9c9;

  /* Durum renkleri, aynı doygunlukta */
  --danger: #b3352b;
  --danger-soft: #fbeceb;
  --danger-line: #eccbc8;
  --warn: #8a5b0c;
  --warn-soft: #fbf2e2;
  --warn-line: #ead9b8;
  --info: #2f5478;
  --info-soft: #eaf0f6;

  /* Yarıçap sistemi: kapsayıcı 12, etkileşim 8, küçük 6, hap 999 */
  --r-lg: 12px;
  --r: 8px;
  --r-sm: 6px;

  /* Gölgeler yeşile boyalı, saf siyah değil */
  --shadow-sm: 0 1px 2px rgba(0, 66, 54, 0.05);
  --shadow: 0 1px 2px rgba(0, 66, 54, 0.04), 0 6px 18px rgba(0, 66, 54, 0.05);
  --shadow-lg: 0 18px 50px rgba(0, 66, 54, 0.14);

  --sidebar-w: 244px;
  --font: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
/* hidden özniteliği her zaman kazanmalı: .btn gibi display taşıyan sınıflar onu eziyordu */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

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

a { color: var(--accent); text-decoration: none; transition: color 0.15s var(--ease); }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.015em; font-weight: 600; }

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

/* Erişilebilirlik: içeriğe atla */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--r);
  font-weight: 600;
}
.skip-link:focus { left: 8px; text-decoration: none; color: #fff; }

/* ============================================================
   Yerleşim
   ============================================================ */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line-strong);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  padding: 20px 20px 18px;
  border-bottom: 1px solid rgba(0, 66, 54, 0.09);
  margin-bottom: 10px;
}
.sidebar-brand img { width: 148px; height: auto; display: block; }
.sidebar-brand .mark {
  width: 30px; height: 30px;
  border-radius: var(--r);
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  margin-right: 10px;
}

.nav-group { padding: 4px 12px; }
.nav-group + .nav-group { margin-top: 14px; }
.nav-group-title {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(15, 35, 28, 0.42);
  padding: 0 10px 7px;
  font-weight: 600;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border-radius: var(--r);
  color: #3d4c46;
  font-weight: 500;
  font-size: 13.5px;
  margin-bottom: 1px;
  position: relative;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.nav-link:hover { background: rgba(255, 255, 255, 0.62); color: var(--text); text-decoration: none; }
.nav-link:hover svg { opacity: 0.9; }
.nav-link.is-active {
  background: var(--surface);
  color: var(--accent-deep);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.nav-link svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.62; transition: opacity 0.15s var(--ease), color 0.15s var(--ease); }
.nav-link.is-active svg { opacity: 1; color: var(--accent); }
.nav-link.is-active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.sidebar-foot {
  margin-top: auto;
  padding: 14px 20px;
  border-top: 1px solid rgba(0, 66, 54, 0.09);
  font-size: 12.5px;
  color: var(--text-2);
}

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

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  height: 62px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar h1 { font-size: 16.5px; font-weight: 600; color: var(--text); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar .user { font-size: 12.5px; color: var(--text-3); text-align: right; line-height: 1.35; }
.topbar .user strong { display: block; color: var(--text); font-weight: 600; font-size: 13.5px; }

.menu-toggle { display: none; }
.content { padding: 24px 28px 56px; max-width: 1480px; width: 100%; }

/* ============================================================
   Sayfa başlığı ve araç çubuğu
   ============================================================ */
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 21px; font-weight: 650; letter-spacing: -0.02em; }
.page-head .spacer { margin-left: auto; }
.page-head .desc { color: var(--text-2); font-size: 13.5px; width: 100%; max-width: 68ch; margin-top: -4px; }

/* Filtre çubuğu tek yüzeyde toplanır, dağınık durmaz */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.toolbar .grow { flex: 1; min-width: 200px; }
.toolbar form.inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; flex: 1; }
.toolbar .input, .toolbar .select { width: auto; }
.toolbar .input.grow { flex: 1; min-width: 200px; width: auto; }
.toolbar > .btn:last-child { margin-left: auto; }

/* ============================================================
   Kartlar
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card + .card, .card + .table-wrap, .table-wrap + .card { margin-top: 16px; }
.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.card-head h2 { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.card-head .spacer { margin-left: auto; }
.card-body { padding: 18px; }
.card-body.tight { padding: 12px 18px; }

/* KPI kutuları */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(198px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.kpi:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kpi .label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.kpi .value {
  font-family: var(--mono);
  font-size: 23px;
  font-weight: 600;
  margin-top: 4px;
  letter-spacing: -0.025em;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
}
.kpi .sub { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.kpi.is-warn .value { color: var(--warn); }
.kpi.is-danger .value { color: var(--danger); }
.kpi.is-accent .value { color: var(--accent); }

/* ============================================================
   Tablolar
   ============================================================ */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
  font-weight: 600;
  padding: 11px 15px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
.table td { padding: 10px 15px; border-bottom: 1px solid var(--line); vertical-align: middle; }

/* Uzun listelerde başlık satırı kaydırmayı takip etsin.
   Yapışkanlık en yakın kaydırılan kapsayıcıya göre çalıştığından,
   tablo kendi içinde kaydırılır ve başlık onun üstüne sabitlenir. */
.table-wrap.sabit-baslik { max-height: calc(100dvh - 232px); overflow: auto; }
.table-wrap.sabit-baslik .table th { top: 0; z-index: 3; box-shadow: 0 1px 0 var(--line-strong); }
.table-wrap.sabit-baslik .table .grp td { position: sticky; top: 37px; z-index: 2; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background 0.12s var(--ease); }
.table tbody tr:hover { background: var(--surface-2); }
.table .num, .table th.num { text-align: right; }
.table .num { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 13px; }
.table .muted { color: var(--text-3); }

/* Marka grubu başlığı (depo dökümü) */
.table .grp td {
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.01em;
  border-bottom: 1px solid var(--accent-line);
  border-top: 1px solid var(--accent-line);
}
.table .grp:hover td { background: var(--accent-soft); }

.table a.rowlink { color: var(--text); font-weight: 550; }
.table a.rowlink:hover { color: var(--accent); }

/* Tıklanabilir satır: tamamı tıklanır, butonlar kendi işini yapar */
.table tr[data-href] { cursor: pointer; }
.table tr[data-href]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ============================================================
   Boş durumlar: kendi yüzeyinde, kompozisyonlu
   ============================================================ */
.empty {
  padding: 56px 24px;
  text-align: center;
  color: var(--text-2);
  font-size: 13.5px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
}
.empty strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
  letter-spacing: -0.01em;
}
.empty > div { margin-top: 18px; }
/* Kart veya tablo içinde ikinci yüzey oluşturmaz */
.card .empty, .table-wrap .empty { background: none; border: none; border-radius: 0; padding: 44px 22px; }

/* ============================================================
   Form
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.field .error { font-size: 12px; color: var(--danger); font-weight: 500; }

.input, .select, .textarea {
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  padding: 8px 11px;
  width: 100%;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.textarea { min-height: 92px; resize: vertical; line-height: 1.6; }
.input.num, .input.tnum, td .input.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.input[readonly], .select:disabled, .input:disabled { background: var(--surface-3); color: var(--text-2); cursor: not-allowed; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%2355635c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 32px;
}

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(226px, 1fr)); gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 9px; font-size: 13.5px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* ============================================================
   Butonlar
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: inherit;
  font-weight: 600;
  font-size: 13.5px;
  padding: 8px 16px;
  border-radius: var(--r);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease),
              box-shadow 0.15s var(--ease), transform 0.08s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); color: #fff; text-decoration: none; box-shadow: var(--shadow); }

.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); border-color: var(--text-3); text-decoration: none; }

.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--danger-line); }
.btn-danger:hover:not(:disabled) { background: var(--danger); color: #fff; border-color: var(--danger); text-decoration: none; }

.btn-sm { padding: 5px 11px; font-size: 12.5px; }

/* ============================================================
   Rozetler
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--r-sm);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.005em;
}
/* Bağlantılı rozet (ör. sitedeki ürün sayfası): altı çizilmez, rengi korunur */
a.badge { transition: filter 0.15s var(--ease), box-shadow 0.15s var(--ease); }
a.badge:hover { text-decoration: none; filter: brightness(0.96); box-shadow: 0 0 0 2px rgba(1, 129, 100, 0.16); }

.badge-green { background: var(--accent-soft); color: var(--accent-deep); }
.badge-gray { background: var(--surface-3); color: var(--text-2); }
.badge-red { background: var(--danger-soft); color: var(--danger); }
.badge-yellow { background: var(--warn-soft); color: var(--warn); }
.badge-blue { background: var(--info-soft); color: var(--info); }

/* ============================================================
   Bildirimler
   ============================================================ */
.flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r);
  margin-bottom: 18px;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid;
  animation: flash-in 0.3s var(--ease);
}
@keyframes flash-in {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: none; }
}
.flash-success { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-deep); }
.flash-error { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.flash-warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.flash ul { margin: 5px 0 0; padding-left: 18px; font-weight: 400; }

/* ============================================================
   Sayfalama
   ============================================================ */
.pager { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.pager-btn {
  padding: 6px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
  font-weight: 550;
  font-size: 13px;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.pager-btn:hover { background: var(--surface-2); border-color: var(--text-3); text-decoration: none; }
.pager-btn.is-disabled { opacity: 0.4; pointer-events: none; }
.pager-info { color: var(--text-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* ============================================================
   Ticimax kopyalama kartı
   ============================================================ */
.copy-row { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line); }
.copy-row:last-child { border-bottom: none; }
.copy-row .k { width: 168px; flex-shrink: 0; font-size: 12.5px; font-weight: 600; color: var(--text-2); padding-top: 4px; }
.copy-row .v { flex: 1; min-width: 0; font-size: 13.5px; word-break: break-word; white-space: pre-wrap; }
.copy-row .v.html {
  max-height: 220px;
  overflow-y: auto;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 11px;
  font-size: 12.5px;
  line-height: 1.6;
}
.copy-btn { flex-shrink: 0; }
.copy-btn.copied { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ============================================================
   Hızlı giriş tablosu (mal kabul)
   ============================================================ */
.entry-table td { padding: 5px 6px; }
.entry-table .input, .entry-table .select { padding: 6px 9px; font-size: 13px; }
.entry-table td.st { font-size: 12px; white-space: nowrap; }

/* ============================================================
   Izgaralar
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }

/* Yan yana kartların alt kenarı hizalansın (içerik boyu farklı olsa da) */
.grid-2.esit, .grid-3.esit { align-items: stretch; }
.grid-2.esit > *, .grid-3.esit > * { height: 100%; display: flex; flex-direction: column; }
.grid-2.esit > * > .table-wrap, .grid-3.esit > * > .table-wrap { flex: 1; }

/* ============================================================
   Karmatik hesap satırları
   ============================================================ */
.calc-result { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.calc-line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.calc-line:last-child { border-bottom: none; }
.calc-line .k { color: var(--text-2); }
.calc-line .v { font-family: var(--mono); font-weight: 550; font-variant-numeric: tabular-nums; }
.calc-line.total { font-size: 15px; padding-top: 12px; border-top: 1px solid var(--line-strong); margin-top: 4px; }
.calc-line.total .v { font-weight: 650; color: var(--accent-deep); }

/* ============================================================
   Giriş sayfası
   ============================================================ */
.login-wrap {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(1100px 620px at 18% -10%, rgba(1, 129, 100, 0.55), transparent 62%),
    radial-gradient(900px 520px at 100% 110%, rgba(1, 129, 100, 0.32), transparent 58%),
    var(--accent-deep);
}
.login-card {
  width: 100%;
  max-width: 392px;
  background: var(--surface);
  border-radius: 16px;
  padding: 34px 32px 30px;
  box-shadow: var(--shadow-lg);
}
.login-card .brand { margin-bottom: 26px; }
.login-card .brand img { width: 172px; height: auto; display: block; }
.login-card .brand .sub {
  display: block;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-3);
  letter-spacing: 0.02em;
}
.login-card .brand .mark {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 19px;
}

/* ============================================================
   Adım akışı şeridi (Ticimax dosya süreci)
   ============================================================ */
.akis { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.akis-adim { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 168px; }
.akis-adim strong { font-size: 13px; font-weight: 600; display: block; }
.akis-adim .sub { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.akis-no {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.akis-ok { color: var(--line-strong); font-size: 15px; flex-shrink: 0; }

@media (max-width: 1100px) {
  .akis { flex-direction: column; align-items: stretch; gap: 8px; }
  .akis-ok { display: none; }
}

/* ============================================================
   Uzun süren işlem: ilerleme çubuğu ve canlı kayıt
   ============================================================ */
.progress {
  height: 7px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
  margin: 14px 0 10px;
}
.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.35s var(--ease);
}

.run-log {
  max-height: 230px;
  overflow-y: auto;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
}
.run-line { color: var(--text-2); word-break: break-word; }
.run-line.is-ok { color: var(--accent-deep); }
.run-line.is-hata { color: var(--danger); }
.run-line.is-bitti { color: var(--text); font-weight: 600; }

/* ============================================================
   Özet ekranı bileşenleri
   ============================================================ */

/* Bento ızgara: eşit kutu dizisi yerine ağırlıklı yerleşim */
.bento { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; align-items: stretch; margin-bottom: 16px; }
.bento-stack { display: grid; gap: 16px; grid-auto-rows: 1fr; }

/* Öne çıkan tek metrik */
.hero-stat {
  background: linear-gradient(150deg, var(--accent-deep) 0%, #075a45 55%, var(--accent) 165%);
  border-radius: var(--r-lg);
  padding: 22px 24px 20px;
  color: #eaf3ef;
  box-shadow: var(--shadow);
}
.hero-stat .label { font-size: 12.5px; font-weight: 500; color: #a8c9bb; letter-spacing: 0.01em; }
.hero-stat .value {
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #fff;
  margin: 4px 0 2px;
  line-height: 1.1;
}
.hero-stat .sub { font-size: 12.5px; color: #a8c9bb; }
.hero-stat a { color: #d6e9df; text-decoration: underline; text-underline-offset: 2px; }
.hero-stat a:hover { color: #fff; }

/* Depo dağılımı: yığılmış yatay çubuk */
.split-bar { display: flex; height: 9px; border-radius: 99px; overflow: hidden; margin: 18px 0 11px; background: rgba(255,255,255,0.14); }
.split-bar span { display: block; height: 100%; }
.split-bar span:nth-child(1) { background: #7fd4b0; }
.split-bar span:nth-child(2) { background: #3d9d77; }
.split-bar span:nth-child(3) { background: #cfe8dc; }

.split-key { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.split-key div { font-size: 12px; color: #c5ddd2; display: flex; align-items: center; gap: 7px; }
.split-key i { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; font-style: normal; }
.split-key div:nth-child(1) i { background: #7fd4b0; }
.split-key div:nth-child(2) i { background: #3d9d77; }
.split-key div:nth-child(3) i { background: #cfe8dc; }
.split-key strong { color: #fff; font-family: var(--mono); font-weight: 600; }

/* Küçük istatistik kutusu */
.mini-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.mini-stat .label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.mini-stat .value {
  font-family: var(--mono);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--accent-deep);
  margin-top: 2px;
}
.mini-stat .sub { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }

/* Bekleyen işler listesi */
.task-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s var(--ease);
}
.task-row:last-child { border-bottom: none; }
.task-row:hover { background: var(--surface-2); }
.task-count {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 650;
  min-width: 58px;
  text-align: right;
  letter-spacing: -0.02em;
}
.task-row.is-danger .task-count { color: var(--danger); }
.task-row.is-warn .task-count { color: var(--warn); }
.task-row.is-info .task-count { color: var(--info); }
.task-text { flex: 1; min-width: 0; font-size: 13.5px; }
.task-text .sub { font-size: 12px; color: var(--text-3); margin-top: 1px; }
/* Butonlar aynı genişlikte olsun ki sağ kenar tırtıklı durmasın */
.task-row .btn { min-width: 116px; }

/* Sıralı liste: marka bazlı stok değeri */
.rank-row { display: flex; align-items: center; gap: 11px; padding: 8px 0; }
.rank-row + .rank-row { border-top: 1px solid var(--line); }
.rank-name { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-bar { width: 96px; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; flex-shrink: 0; }
.rank-bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.rank-val { font-family: var(--mono); font-size: 12.5px; font-weight: 550; color: var(--text-2); min-width: 88px; text-align: right; }

@media (max-width: 980px) {
  .bento { grid-template-columns: 1fr; }
}

/* ============================================================
   Ticimax kartı: 16 adımlık kopyalama listesi
   ============================================================ */
.step-row {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.step-row:last-child { border-bottom: none; }
.step-row.is-empty { opacity: 0.72; }

.step-no {
  flex-shrink: 0;
  width: 30px;
  height: 24px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.step-row.is-empty .step-no { background: var(--warn-soft); color: var(--warn); }

.step-body { flex: 1; min-width: 0; }
.step-label { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 3px; }
.step-value {
  font-size: 13.5px;
  color: var(--text);
  word-break: break-word;
  white-space: pre-wrap;
  line-height: 1.55;
}
.step-value.is-empty { color: var(--warn); font-weight: 550; font-style: italic; }
.step-value.html {
  max-height: 190px;
  overflow-y: auto;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px 11px;
  font-size: 12.5px;
  font-family: var(--mono);
  line-height: 1.6;
}
.step-note { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.step-action { flex-shrink: 0; padding-top: 1px; }

@media (max-width: 700px) {
  .step-row { flex-wrap: wrap; }
  .step-action { width: 100%; padding-left: 43px; }
}

/* ============================================================
   Sekmeler (uzun formları tek ekrana sığdırmak için)
   ============================================================ */
.tabs {
  display: flex;
  gap: 2px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  font: inherit;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--text-2);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 12px 14px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--accent-deep); border-bottom-color: var(--accent); font-weight: 650; }

/* Sekmedeki alanlarda doğrulama hatası varsa işaretle */
.tab .tab-err {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
  flex-shrink: 0;
}

.tab-panel { display: none; padding: 18px; }
.tab-panel.is-active { display: block; }
/* Sekme içi alanlar daha sıkışık */
.tab-panel .field { margin-bottom: 13px; }
.tab-panel .card-sub {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
  font-weight: 600;
  margin: 4px 0 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}
.tab-panel .card-sub:not(:first-child) { margin-top: 22px; }

/* Onay kutusu ızgarası (kategoriler) */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 4px 18px; }
.check-grid .check { padding: 3px 0; font-size: 13px; }
.check-grid .check.is-child { padding-left: 20px; color: var(--text-2); }
/* Dar kolonlu sıkışık varyant: az sayıda kısa etiket için */
.check-grid.sik { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 2px 14px; }
.check-grid.sik .check { padding: 2px 0; font-size: 12.5px; }

/* ------------------------------------------------------------
   Kategori seçici: 80+ kategori için arama, seçili rozetler ve
   sütun akışlı liste. Izgara kullanılmaz çünkü ızgarada her satır
   en uzun hücre kadar yükselip aralarda büyük boşluk bırakıyordu.
   ------------------------------------------------------------ */
.kat-secici { border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); }
.kat-ust { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.kat-ust .input { flex: 1; }
.kat-sayac { font-size: 12px; color: var(--text-3); white-space: nowrap; }

.kat-secili { display: flex; flex-wrap: wrap; gap: 6px; padding: 9px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.kat-secili:empty { display: none; }
.kat-rozet {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-soft); color: var(--accent-deep);
  border: 1px solid var(--accent-line); border-radius: var(--r-sm);
  padding: 3px 6px 3px 9px; font-size: 12px; font-weight: 550;
}
.kat-rozet button {
  border: none; background: none; cursor: pointer; color: inherit;
  font-size: 14px; line-height: 1; padding: 0 2px; opacity: 0.6;
}
.kat-rozet button:hover { opacity: 1; }

/* Yükseklik SINIRLANMAZ: sütun akışına yükseklik verilirse taşan içerik
   yeni sütunlar açıp sağa doğru kayar. Liste yerine katlanır yapılır. */
.kat-liste { column-count: 4; column-gap: 20px; padding: 10px 12px; }
.kat-liste[hidden] { display: none; }
.kat-grup { break-inside: avoid; margin-bottom: 9px; }
.kat-grup .check { padding: 2px 0; font-size: 13px; }
.kat-grup .check.is-child { padding-left: 19px; color: var(--text-2); font-size: 12.5px; }
.kat-grup.gizli, .kat-grup .check.gizli { display: none; }
.kat-bos { padding: 16px 12px; color: var(--text-3); font-size: 13px; }

@media (max-width: 1200px) { .kat-liste { column-count: 3; } }
@media (max-width: 900px) { .kat-liste { column-count: 2; } }
@media (max-width: 640px) { .kat-liste { column-count: 1; } }

/* Formun altındaki eylem çubuğu ekranda sabit kalır */
.form-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  z-index: 10;
}
.form-actions .spacer { margin-left: auto; }

/* ============================================================
   Onay kutusu (tarayıcının window.confirm penceresi yerine)
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(9, 34, 27, 0.42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: modal-fade 0.18s var(--ease);
}
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  max-width: 428px;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 24px 24px 20px;
  animation: modal-rise 0.22s var(--ease);
}
@keyframes modal-rise {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.modal-title {
  font-size: 16.5px;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0 0 7px;
}
.modal-text { font-size: 13.5px; color: var(--text-2); line-height: 1.6; margin: 0; white-space: pre-line; }
.modal-actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 22px; }

/* Yıkıcı işlemler için uyarı şeridi */
.modal.is-danger { border-top: 3px solid var(--danger); }
.modal.is-danger .modal-title { color: var(--danger); }

/* ============================================================
   Bildirim balonları (alert yerine)
   ============================================================ */
.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: min(384px, calc(100vw - 36px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 15px;
  border-radius: var(--r);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.5;
  border: 1px solid;
  background: var(--surface);
  box-shadow: var(--shadow);
  pointer-events: auto;
  animation: toast-in 0.24s var(--ease);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: none; }
}
.toast.is-out { opacity: 0; transform: translateX(14px); transition: opacity 0.22s var(--ease), transform 0.22s var(--ease); }
.toast-success { border-color: var(--accent-line); color: var(--accent-deep); background: var(--accent-soft); }
.toast-error { border-color: var(--danger-line); color: var(--danger); background: var(--danger-soft); }
.toast-warn { border-color: var(--warn-line); color: var(--warn); background: var(--warn-soft); }
.toast-info { border-color: var(--line-strong); color: var(--text); }

@media (max-width: 560px) {
  .toast-stack { right: 12px; left: 12px; bottom: 12px; max-width: none; }
}

/* ============================================================
   Yardımcılar
   ============================================================ */
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.text-danger { color: var(--danger); }
.text-warn { color: var(--warn); }
.text-accent { color: var(--accent); }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.w-100 { width: 100%; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.right { margin-left: auto; }
.small { font-size: 12.5px; }
.tnum { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.prod-thumb {
  width: 38px; height: 38px;
  object-fit: cover;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface-3);
  display: block;
}

/* ============================================================
   Mobil
   ============================================================ */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.25s var(--ease);
    height: 100dvh;
  }
  .sidebar.is-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--r);
    padding: 7px 10px;
    cursor: pointer;
    color: var(--text);
    font-size: 15px;
  }
  .backdrop { position: fixed; inset: 0; background: rgba(9, 34, 27, 0.45); z-index: 50; display: none; }
  .backdrop.is-open { display: block; }
  .content { padding: 16px 14px 44px; }
  .topbar { padding: 0 14px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .copy-row { flex-wrap: wrap; }
  .copy-row .k { width: 100%; padding-top: 0; }
  .toolbar > .btn:last-child { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .sidebar, .topbar, .toolbar, .pager, .btn, .backdrop { display: none !important; }
  .content { padding: 0; max-width: none; }
  .card, .table-wrap, .kpi { box-shadow: none; }
  body { background: #fff; }
}
