/* ==========================================================================
   Gazelli CRM — tasarım sistemi
   Elle yazılmış; Node/Tailwind derleme adımı yok, çevrimdışı da çalışır.
   Renkler Gazelli logosunun laciverdinden türetilmiştir.
   ========================================================================== */

:root {
  /* Marka — Gazelli laciverdi */
  --brand-50:  #f2f6fb;
  --brand-100: #e1e9f4;
  --brand-200: #c2d0e5;
  --brand-300: #98aecf;
  --brand-400: #6b87b1;
  --brand-500: #486593;
  --brand-600: #334c75;
  --brand-700: #26395a;
  --brand-800: #1b2e4b;   /* logo rengi */
  --brand-900: #121f33;

  /* Nötr — logoyla uyumlu soğuk gri */
  --ink-900: #0f1826;
  --ink-800: #1e293b;
  --ink-700: #334155;
  --ink-600: #475569;
  --ink-500: #64748b;
  --ink-400: #94a3b8;
  --ink-300: #cbd5e1;
  --ink-200: #e2e8f0;
  --ink-100: #f1f5f9;
  --ink-50:  #f8fafc;
  --white: #ffffff;

  /* Anlamsal */
  --success: #15803d;
  --success-bg: #e8f5ec;
  --danger: #b3261e;
  --danger-bg: #fdeceb;
  --warning: #a35a06;
  --warning-bg: #fdf3e2;
  --info: #1d4ed8;
  --info-bg: #eaf0fe;
  --muted: var(--ink-500);
  --muted-bg: var(--ink-100);

  --radius-sm: 5px;
  --radius: 9px;
  --radius-lg: 14px;

  --shadow-xs: 0 1px 2px rgba(15, 24, 38, .06);
  --shadow-sm: 0 1px 3px rgba(15, 24, 38, .09), 0 1px 2px rgba(15, 24, 38, .05);
  --shadow-md: 0 4px 14px rgba(15, 24, 38, .10), 0 1px 3px rgba(15, 24, 38, .06);
  --shadow-lg: 0 14px 40px rgba(15, 24, 38, .16);

  --sidebar-w: 244px;
  --topbar-h: 58px;

  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
}

/* --------------------------------------------------------------- temel -- */

*, *::before, *::after { box-sizing: border-box; }

/* `hidden` özniteliği display:flex sınıflarını da yensin (netbar, alert).
   Aksi halde boş bir "çevrimdışı" hapı sürekli ekranda duruyordu. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-800);
  background: var(--ink-50);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 { margin: 0; font-weight: 650; color: var(--ink-900); line-height: 1.3; }
h1 { font-size: 22px; letter-spacing: -.01em; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
h4 { font-size: 13.5px; }
p  { margin: 0 0 10px; }

a { color: var(--brand-700); text-decoration: none; }
a:hover { text-decoration: underline; }

hr { border: 0; border-top: 1px solid var(--ink-200); margin: 18px 0; }

code, kbd, .mono { font-family: var(--mono); font-size: .92em; }

::selection { background: var(--brand-200); }

/* ------------------------------------------------------------- yerleşim -- */

.layout { display: flex; min-height: 100vh; }

/* Çizgi ikonlar: renk metinden gelir, boyut bağlama göre. */
.ico {
  width: 18px; height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -3px;
}

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, #16243d 0%, var(--ink-900) 60%, #0c1420 100%);
  color: var(--ink-300);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 40;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: var(--white);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .01em;
}
.sidebar__brand:hover { text-decoration: none; }
.sidebar__brand small { display: block; font-size: 10.5px; font-weight: 600; color: var(--brand-300); letter-spacing: .08em; text-transform: uppercase; margin-top: 1px; }

/* ------------------------------------------------------------ marka ----- */

.logo-mark { display: block; flex: 0 0 auto; object-fit: contain; }
.logo-full { display: block; max-width: 100%; height: auto; margin: 0 auto; }

.sidebar__nav { padding: 10px 12px 18px; flex: 1; }
.sidebar__section {
  padding: 16px 10px 6px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-500);
  font-weight: 700;
}
.navlink {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px 8px 12px;
  border-radius: 8px;
  color: var(--ink-300);
  font-weight: 500;
  font-size: 13.5px;
  margin-bottom: 2px;
  transition: background .12s, color .12s;
}
.navlink:hover { background: rgba(255,255,255,.06); color: var(--white); text-decoration: none; }
.navlink.is-active { background: rgba(255,255,255,.09); color: var(--white); font-weight: 600; }
.navlink.is-active::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: var(--brand-300);
}
.navlink__icon { width: 18px; height: 18px; opacity: .8; }
.navlink.is-active .navlink__icon, .navlink:hover .navlink__icon { opacity: 1; }
.navlink__text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.navlink__badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  border-radius: 20px;
  padding: 1px 6px;
  font-size: 10.5px;
  font-weight: 700;
}

.sidebar__footer {
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 12px;
}
.userchip { display: flex; align-items: center; gap: 10px; }
.userchip__meta { min-width: 0; }
.userchip__name { color: var(--white); font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userchip__role { font-size: 11px; color: var(--ink-500); }

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

.topbar {
  height: var(--topbar-h);
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--ink-200);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar__title { font-size: 15px; font-weight: 650; color: var(--ink-900); }
.topbar__spacer { flex: 1; }

/* Hızlı arama */
.topbar__search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 260px;
  height: 36px;
  padding: 0 12px;
  margin: 0;
  border: 1px solid var(--ink-200);
  border-radius: 999px;
  background: var(--ink-50);
  color: var(--ink-500);
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.topbar__search:focus-within {
  background: var(--white);
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px var(--brand-100);
  color: var(--brand-600);
}
.topbar__search .ico { width: 16px; height: 16px; }
.topbar__search input[type="search"] {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  font-size: 13px;
  color: var(--ink-800);
  box-shadow: none;
}
.topbar__search input[type="search"]:focus { outline: none; box-shadow: none; }

/* İkon düğmesi: zil, menü, çıkış */
.iconbtn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--ink-500);
  cursor: pointer;
  text-decoration: none;
  transition: background .12s, color .12s;
}
.iconbtn:hover { background: var(--ink-100); color: var(--ink-900); text-decoration: none; }
.iconbtn.is-active { color: var(--brand-700); }
.iconbtn--dark { color: var(--ink-400); }
.iconbtn--dark:hover { background: rgba(255,255,255,.08); color: var(--white); }
.iconbtn__count {
  position: absolute;
  top: 2px; right: 1px;
  background: var(--danger);
  color: #fff;
  border-radius: 20px;
  min-width: 17px;
  padding: 0 4px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  border: 2px solid var(--white);
}

.menu-toggle { display: none; color: var(--ink-700); }
.menu-toggle .ico { width: 22px; height: 22px; }

.content { padding: 22px; flex: 1; }
.content--narrow { max-width: 880px; }

.page-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-head__text { min-width: 0; flex: 1; }
.page-head h1 { font-size: 23px; letter-spacing: -.02em; }
.page-head__sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* --------------------------------------------------------------- kutu --- */

.card {
  background: var(--white);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--ink-100);
}
.card__head h2 { font-size: 15.5px; }
.card__head h3 { font-size: 14px; }
.card__head h2, .card__head h3 { margin: 0; }
.card__head .spacer { flex: 1; }
.card__body { padding: 16px; }
.card__body--flush { padding: 0; }
.card__foot {
  padding: 12px 16px;
  border-top: 1px solid var(--ink-200);
  background: var(--ink-50);
  border-radius: 0 0 var(--radius) var(--radius);
  display: flex; gap: 8px; align-items: center;
}

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

/* --------------------------------------------------------------- buton -- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--white);
  color: var(--ink-800);
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s, box-shadow .12s, color .12s;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--brand-400); outline-offset: 2px; }
.btn:disabled, .btn.is-disabled { opacity: .55; cursor: not-allowed; }

.btn--primary {
  background: linear-gradient(180deg, var(--brand-600), var(--brand-700));
  color: #fff;
  box-shadow: 0 1px 2px rgba(18, 31, 51, .25), inset 0 1px 0 rgba(255,255,255,.12);
}
.btn--primary:hover:not(:disabled) { background: linear-gradient(180deg, var(--brand-700), var(--brand-800)); }

.btn--ghost { border-color: var(--ink-300); background: var(--white); }
.btn--ghost:hover:not(:disabled) { background: var(--ink-100); border-color: var(--ink-400); }

.btn--subtle { background: var(--ink-100); color: var(--ink-700); }
.btn--subtle:hover:not(:disabled) { background: var(--ink-200); }

.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover:not(:disabled) { filter: brightness(.92); }

.btn--success { background: var(--success); color: #fff; }
.btn--success:hover:not(:disabled) { filter: brightness(.92); }

.btn--sm { padding: 5px 10px; font-size: 12.5px; }
.btn--lg { padding: 11px 20px; font-size: 14.5px; }
.btn--block { width: 100%; }
.btn--icon { padding: 6px 9px; }

.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* --------------------------------------------------------------- form --- */

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field--full { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .label {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-700);
}
.field .req { color: var(--danger); }
.field__hint { font-size: 11.5px; color: var(--muted); }
.field__error { font-size: 11.5px; color: var(--danger); font-weight: 600; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="tel"], input[type="url"], input[type="search"],
input[type="datetime-local"], select, textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--ink-300);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink-900);
  font: inherit;
  font-size: 13.5px;
  transition: border-color .12s, box-shadow .12s;
}
textarea { resize: vertical; min-height: 78px; line-height: 1.55; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237c7364' d='M6 8.5 1.5 4h9z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(72, 101, 147, .20);
}
input:disabled, select:disabled, textarea:disabled { background: var(--ink-100); color: var(--ink-500); cursor: not-allowed; }
input.is-invalid, select.is-invalid, textarea.is-invalid { border-color: var(--danger); }

::placeholder { color: var(--ink-400); }

.check { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--brand-600); flex: 0 0 16px; }
.check span small { display: block; color: var(--muted); font-size: 11.5px; }

.form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--ink-200);
}
.form-actions .spacer { flex: 1; }

fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 22px;
  /* Tarayıcı varsayılanı `min-inline-size: min-content`; bu, içindeki geniş
     tabloların daralmasını engelleyip sayfayı yatay kaydırmaya zorluyor. */
  min-inline-size: 0;
}
fieldset > legend {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--brand-700);
  padding: 0 0 10px;
  margin-bottom: 4px;
  width: 100%;
  border-bottom: 1px solid var(--ink-200);
}

/* -------------------------------------------------------------- tablo --- */

.table-wrap { overflow-x: auto; }

table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left;
  padding: 9px 14px;
  background: var(--ink-50);
  border-bottom: 1px solid var(--ink-200);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-600);
  font-weight: 700;
  white-space: nowrap;
}
.table th a { color: inherit; }
.table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--ink-100);
  vertical-align: middle;
}
.table tbody tr:hover { background: var(--brand-50); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .nowrap { white-space: nowrap; }
.table__link { font-weight: 650; color: var(--ink-900); }
.table__link:hover { color: var(--brand-700); }
.table__sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }

.table--compact td, .table--compact th { padding: 6px 10px; }

/* ------------------------------------------------------------- rozet ---- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.6;
  white-space: nowrap;
}
.badge--success { background: var(--success-bg); color: var(--success); }
.badge--danger  { background: var(--danger-bg);  color: var(--danger); }
.badge--warning { background: var(--warning-bg); color: var(--warning); }
.badge--info    { background: var(--info-bg);    color: var(--info); }
.badge--muted   { background: var(--muted-bg);   color: var(--ink-600); }
.badge--brand   { background: var(--brand-100);  color: var(--brand-700); }
.badge--outline { background: transparent; border: 1px solid var(--ink-300); color: var(--ink-600); }

.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: currentColor; }

.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: var(--radius-sm);
  background: var(--ink-100);
  color: var(--ink-600);
  font-size: 11.5px;
  font-weight: 600;
}

/* ------------------------------------------------------------- avatar --- */

.avatar {
  width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-600);
  color: #fff;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: .02em;
}
.avatar--sm { width: 26px; height: 26px; flex-basis: 26px; font-size: 10.5px; }
.avatar--lg { width: 52px; height: 52px; flex-basis: 52px; font-size: 18px; }
.avatar--muted { background: var(--ink-400); }

/* ------------------------------------------------------------ bildirim -- */

.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 14px;
  border-radius: var(--radius);
  font-size: 13.5px;
  margin-bottom: 14px;
  border: 1px solid transparent;
}
.alert__icon { flex: 0 0 auto; font-size: 15px; line-height: 1.35; }
.alert--success { background: var(--success-bg); color: #14532d; border-color: #bfe3cb; }
.alert--danger  { background: var(--danger-bg);  color: #7f1d1d; border-color: #f3c8c5; }
.alert--warning { background: var(--warning-bg); color: #713f12; border-color: #f0dcb8; }
.alert--info    { background: var(--info-bg);    color: #1e3a8a; border-color: #c9d8fb; }

.flashes { position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 25; }

/* ------------------------------------------------------------ istatistik */

.stat {
  position: relative;
  background: var(--white);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  padding: 16px 18px 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}
/* Renk şeridi kartın üst kenarında: yan şerit kart köşesiyle çakışıyordu. */
.stat::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: var(--ink-300);
}
.stat__label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.stat__value { font-size: 28px; font-weight: 750; color: var(--ink-900); font-variant-numeric: tabular-nums; letter-spacing: -.03em; line-height: 1.15; }
.stat__hint { font-size: 12px; color: var(--muted); }
.stat--danger::before { background: var(--danger); }
.stat--warning::before { background: var(--warning); }
.stat--success::before { background: var(--success); }
.stat--brand::before { background: linear-gradient(90deg, var(--brand-500), var(--brand-300)); }
.stat--danger .stat__value { color: var(--danger); }
.stat--success .stat__value { color: var(--success); }
/* Birden çok para birimi alt alta sığsın — tutarlar toplanmadığı için
   tek bir büyük rakam yerine kısa bir liste gösterilir. */
.stat__value--sm { font-size: 17px; line-height: 1.3; }

/* ------------------------------------------------- satır içi ilerleme -- */

.meter {
  height: 6px;
  background: var(--ink-100);
  border-radius: 3px;
  overflow: hidden;
  min-width: 60px;
}
.meter__fill { display: block; height: 100%; background: var(--brand-500); border-radius: 3px; }
.meter__fill--success { background: var(--success); }
.meter__fill--warning { background: var(--warning); }

/* --------------------------------------------- sipariş → tahsilat zinciri -- */

.chain { display: flex; align-items: stretch; gap: 4px; }
.chain__step {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-sm);
  background: var(--ink-50);
}
.chain__step.is-done { border-color: var(--brand-200); background: var(--brand-50); }
.chain__label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.chain__step strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.chain__sub { font-size: 11.5px; color: var(--muted); }
.chain__arrow { align-self: center; color: var(--ink-300); font-size: 15px; flex: 0 0 auto; }

@media (max-width: 720px) {
  .chain { flex-direction: column; }
  .chain__arrow { transform: rotate(90deg); }
}

/* ----------------------------------------------------------- boş durum -- */

.empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--muted);
}
.empty__icon { font-size: 32px; opacity: .5; margin-bottom: 10px; }
.empty__title { font-weight: 650; color: var(--ink-700); margin-bottom: 4px; font-size: 14.5px; }
.empty__text { font-size: 13px; max-width: 420px; margin: 0 auto 14px; }

/* --------------------------------------------------------------- filtre - */

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.filters .field { flex: 1 1 160px; min-width: 140px; }
.filters .field--wide { flex: 2 1 260px; }
.filters__actions { display: flex; gap: 8px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 6px 3px 10px;
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  color: var(--brand-800);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.chip a { color: var(--brand-700); font-weight: 700; line-height: 1; padding: 0 3px; }
.chip a:hover { text-decoration: none; color: var(--danger); }

/* --------------------------------------------------------------- sekme -- */

.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--ink-200);
  overflow-x: auto;
  margin-bottom: 18px;
}
.tab {
  padding: 9px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-600);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.tab:hover { color: var(--ink-900); text-decoration: none; background: var(--ink-50); }
.tab.is-active { color: var(--brand-700); border-bottom-color: var(--brand-600); }
.tab__count {
  background: var(--ink-200); color: var(--ink-600);
  border-radius: 20px; padding: 0 6px; font-size: 11px; font-weight: 700;
}
.tab.is-active .tab__count { background: var(--brand-100); color: var(--brand-700); }

/* -------------------------------------------------------- tanım listesi - */

.dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 9px 14px; font-size: 13.5px; }
.dl dt { color: var(--muted); font-weight: 600; }
.dl dd { margin: 0; color: var(--ink-800); min-width: 0; word-break: break-word; }
.dl--tight { gap: 6px 14px; }

/* ------------------------------------------------------------- sayfalama */

.pagination { display: flex; gap: 4px; align-items: center; justify-content: center; padding: 14px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ink-200);
  background: var(--white);
  color: var(--ink-700);
  font-size: 13px; font-weight: 600;
}
.pagination a:hover { background: var(--ink-100); text-decoration: none; }
.pagination .is-current { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.pagination .is-disabled { opacity: .45; }

/* --------------------------------------------------------------- giriş -- */

.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 8%, rgba(27,46,75,.13), transparent 44%),
    radial-gradient(circle at 88% 88%, rgba(72,101,147,.14), transparent 46%),
    var(--ink-50);
}
.auth__box { width: 100%; max-width: 410px; }
.auth__brand { text-align: center; margin-bottom: 26px; }
.auth__title { font-size: 19px; font-weight: 700; }
.auth__sub { color: var(--muted); font-size: 12.5px; margin-top: 14px; }
.auth__card { background: var(--white); border: 1px solid var(--ink-200); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-md); }
.auth__foot { text-align: center; margin-top: 16px; font-size: 12px; color: var(--muted); }

/* ----------------------------------------------------------- yardımcı --- */

.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 650; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-brand { color: var(--brand-700); }
.num { font-variant-numeric: tabular-nums; }

.row { display: flex; align-items: center; gap: 10px; }
.row--top { align-items: flex-start; }
.row--wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.spacer { flex: 1; }

.mt-0 { margin-top: 0; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; }

.divider { height: 1px; background: var(--ink-200); margin: 16px 0; }

/* --------------------------------------------------- görüşme notları ---- */

.notes { display: flex; flex-direction: column; }

.note { display: flex; gap: 14px; position: relative; padding-bottom: 18px; }
.note::before {
  content: "";
  position: absolute;
  left: 16px; top: 34px; bottom: 0;
  width: 2px;
  background: var(--ink-200);
}
.note:last-child::before { display: none; }

.note__rail { flex: 0 0 34px; }
.note__icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-100);
  color: var(--brand-700);
  border: 1px solid var(--brand-200);
  font-size: 14px;
  position: relative;
  z-index: 1;
}

.note__body {
  flex: 1;
  min-width: 0;
  background: var(--white);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-xs);
}

.note__head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 4px; }
.note__kind { font-weight: 650; color: var(--ink-900); font-size: 14px; }
.note__seq { color: var(--muted); font-size: 12px; }
.note__meta { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.note__subject { font-weight: 650; margin-bottom: 6px; }

.note__content { display: flex; flex-direction: column; gap: 9px; }
.note__field { font-size: 13.5px; }
.note__label {
  display: block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 1px;
}
.note__field--warn { border-left: 2px solid var(--warning); padding-left: 9px; }
.note__field--next { border-left: 2px solid var(--info); padding-left: 9px; }

.note__foot {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 10px; padding-top: 9px;
  border-top: 1px dashed var(--ink-200);
}

/* Düzeltilmiş not: silinmez, üstü çizilir. */
.note--superseded .note__body { background: var(--ink-50); }
.note--superseded .note__subject,
.note--superseded .note__content { text-decoration: line-through; opacity: .62; }
.note--superseded .note__icon { background: var(--ink-100); color: var(--ink-500); border-color: var(--ink-200); }

.note--correction .note__body { border-left: 3px solid var(--info); }

.immutable-banner {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--ink-900);
  color: var(--ink-200);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-size: 12.5px;
  margin-bottom: 16px;
}
.immutable-banner strong { color: #fff; }

/* --------------------------------------------------------------- huni --- */

.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(255px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
  align-items: start;
}

.board__col {
  background: var(--ink-100);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  min-height: 120px;
  display: flex;
  flex-direction: column;
}
.board__col.is-target { border-color: var(--brand-500); background: var(--brand-50); }
.board__col--won { background: var(--success-bg); border-color: #bfe3cb; }

.board__head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--ink-200);
  border-top: 3px solid var(--brand-400);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--white);
  display: flex; align-items: center; gap: 8px;
}
.board__col--won .board__head { border-top-color: var(--success); }
.board__title { font-size: 12.5px; font-weight: 700; color: var(--ink-800); text-transform: uppercase; letter-spacing: .04em; }
.board__count {
  background: var(--brand-100); color: var(--brand-700);
  border-radius: 20px; padding: 0 7px; font-size: 11px; font-weight: 700;
}
.board__sum { font-size: 11.5px; color: var(--muted); padding: 6px 12px; border-bottom: 1px solid var(--ink-200); }
.board__body { padding: 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.board__empty { font-size: 12px; color: var(--ink-400); text-align: center; padding: 14px 6px; }

.deal {
  background: var(--white);
  border: 1px solid var(--ink-200);
  border-left: 3px solid var(--brand-400);
  border-radius: var(--radius-sm);
  padding: 10px 11px;
  box-shadow: var(--shadow-xs);
  cursor: grab;
  display: block;
  color: inherit;
}
.deal:hover { text-decoration: none; box-shadow: var(--shadow-sm); border-color: var(--brand-300); }
.deal:active { cursor: grabbing; }
.deal.is-dragging { opacity: .45; }
.deal--overdue { border-left-color: var(--danger); }
.deal--today { border-left-color: var(--warning); }
.deal--won { border-left-color: var(--success); }

.deal__title { font-weight: 650; font-size: 13.5px; color: var(--ink-900); margin-bottom: 2px; }
.deal__company { font-size: 12px; color: var(--muted); margin-bottom: 7px; }
.deal__row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.deal__amount { font-weight: 700; color: var(--ink-900); font-variant-numeric: tabular-nums; }
.deal__prob { color: var(--muted); }
.deal__action {
  margin-top: 7px; padding-top: 7px;
  border-top: 1px dashed var(--ink-200);
  font-size: 12px; color: var(--ink-600);
}

/* Aşama ilerleme şeridi */
.stage-track { display: flex; gap: 3px; flex-wrap: wrap; }
.stage-step {
  flex: 1 1 0;
  min-width: 62px;
  padding: 6px 8px;
  background: var(--ink-100);
  color: var(--ink-500);
  font-size: 11px;
  font-weight: 650;
  text-align: center;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stage-step.is-done { background: var(--brand-200); color: var(--brand-800); }
.stage-step.is-current { background: var(--brand-600); color: #fff; }
.stage-step.is-lost { background: var(--danger-bg); color: var(--danger); }

/* Yatay çubuk (huni ve rapor görselleri) */
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.bar-row__label { flex: 0 0 130px; color: var(--ink-700); }
.bar-row__track { flex: 1; height: 20px; background: var(--ink-100); border-radius: 4px; overflow: hidden; }
.bar-row__fill { height: 100%; background: var(--brand-500); border-radius: 4px; }
.bar-row__fill--danger { background: var(--danger); }
.bar-row__value { flex: 0 0 auto; font-weight: 650; font-variant-numeric: tabular-nums; min-width: 46px; text-align: right; }

/* ------------------------------------------------------------- overlay -- */

.backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 24, 38, .45);
  z-index: 35;
  display: none;
}
.backdrop.is-open { display: block; }

/* ------------------------------------------------------------- yazdır --- */

@media print {
  .sidebar, .topbar, .page-head__actions, .btn, .filters { display: none !important; }
  body { background: #fff; }
  .card { border: 1px solid #ddd; box-shadow: none; }
  .content { padding: 0; }
}

/* ---------------------------------------------------------------- mobil - */

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

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

@media (max-width: 760px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: translateX(0); }
  .menu-toggle { display: inline-flex; }
  .topbar__search { display: none; }   /* telefonda arama: Firmalar sekmesindeki kutu */
  .tabbar__icon .ico { width: 21px; height: 21px; }
  .tabbar__item--primary .tabbar__icon .ico { width: 22px; height: 22px; stroke-width: 2.4; }
  .content { padding: 14px; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
  .form-grid, .form-grid--3 { grid-template-columns: minmax(0, 1fr); }
  .dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .dl dt { margin-top: 8px; }
  .page-head { gap: 10px; }
  h1 { font-size: 19px; }
  .topbar { padding: 0 14px; }
  /* Mobilde tablolar kart görünümüne dönüşür */
  .table--stack thead { display: none; }
  .table--stack tbody tr {
    display: block;
    border: 1px solid var(--ink-200);
    border-radius: var(--radius);
    margin-bottom: 10px;
    padding: 4px 0;
  }
  .table--stack tbody td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border: 0;
    padding: 5px 12px;
    text-align: right;
  }
  /* Uzun içerik (alt satır notu) hücreden taşmasın: esnek öğeler daralabilsin */
  .table--stack tbody td > * { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
  .table--stack tbody td::before {
    content: attr(data-label);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    font-weight: 700;
    text-align: left;
    flex: 0 0 auto;
  }
  .table--stack tbody td[data-label=""]::before { content: none; }
}

/* ------------------------------------------------- ağ durumu / kuyruk -- */

.netbar {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100vw - 24px);
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--ink-900);
  color: var(--white);
  font-size: 12.5px;
  font-weight: 550;
  box-shadow: var(--shadow-lg);
}
.netbar__dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-300);
}
.netbar--offline { background: var(--warning); }
.netbar--offline .netbar__dot { background: var(--white); }
.netbar__text { min-width: 0; }
.netbar__link {
  flex: 0 0 auto;
  color: var(--white);
  text-decoration: underline;
  opacity: .85;
}
.netbar__link:hover { opacity: 1; color: var(--white); }

@media (max-width: 560px) {
  .netbar { left: 12px; right: 12px; transform: none; max-width: none; }
}

/* ------------------------------------------------------------ fuar modu -- */

/* Tek elle, ayakta, kalabalıkta doldurulacak form: alanlar geniş ve
   parmak boyutunda. Masaüstünde de aynı ekran kullanılır. */
.fair { max-width: 640px; margin: 0 auto; }
.fair .field input,
.fair .field select,
.fair .field textarea { font-size: 16px; padding: 11px 12px; }  /* 16px: iOS yakınlaştırmasın */
.fair__submit { position: sticky; bottom: 0; padding: 12px 0; background: var(--ink-50); }
.fair__submit .btn { width: 100%; padding: 14px; font-size: 15px; }

.queue-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--ink-200);
}
.queue-item:last-child { border-bottom: 0; }
.queue-item__body { flex: 1; min-width: 0; }
.queue-item__title { font-weight: 650; }
.queue-item__meta { font-size: 12px; color: var(--muted); }

/* ------------------------------------------------ mobil: alt sekme çubuğu -- */

/* Telefonda başparmak menüsü: en sık kullanılan dört ekran ve menü.
   Masaüstünde görünmez; kenar çubuğu orada zaten açık. */
.tabbar { display: none; }
.filters__toggle { display: none; }   /* yalnız telefonda; masaüstünde filtreler zaten açık */

@media (max-width: 760px) {
  .tabbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 55;
    display: flex;
    align-items: stretch;
    height: calc(60px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--white);
    border-top: 1px solid var(--ink-200);
    box-shadow: 0 -4px 14px rgba(15, 24, 38, .06);
  }
  .tabbar__item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    padding: 6px 2px;
    border: 0;
    background: none;
    font: inherit;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--ink-500);
    text-decoration: none;
    position: relative;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar__item:hover { text-decoration: none; color: var(--ink-700); }
  .tabbar__item.is-active { color: var(--brand-700); }
  .tabbar__icon { font-size: 19px; line-height: 1; }
  .tabbar__item--primary .tabbar__icon {
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--brand-800);
    color: var(--white);
    font-size: 24px;
    margin-top: -14px;
    box-shadow: var(--shadow-md);
  }
  .tabbar__badge {
    position: absolute;
    top: 4px; left: calc(50% + 6px);
    min-width: 17px; height: 17px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--danger);
    color: var(--white);
    font-size: 10.5px;
    line-height: 17px;
    text-align: center;
  }

  /* İçerik ve yüzen öğeler çubuğun altında kalmasın. */
  .content { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .netbar { bottom: calc(70px + env(safe-area-inset-bottom)); }
  .fair__submit { bottom: calc(60px + env(safe-area-inset-bottom)); }

  /* Sayfa başlığı: düğmeler başlığın yanına sıkışmasın, altına insin. */
  .page-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .page-head__actions { width: 100%; }
  .page-head__actions .btn { flex: 1 1 auto; justify-content: center; }

  /* KPI kartları: telefonda 2 sütun, daha sıkı. Tek sütun 6 kartta bir ekran
     boyu kaydırma istiyordu ve asıl iş listesi görünmüyordu. */
  .grid:has(> .stat) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .grid:has(> .stat) .stat { padding: 12px 12px 10px; }
  .grid:has(> .stat) .stat__value { font-size: 21px; }
  .grid:has(> .stat) .stat__label { font-size: 10.5px; }

  /* Filtreler: yalnız arama kutusu açık, gerisi "Filtreler" ile açılır.
     Yedi açılır kutu telefonda listenin kendisini ekran dışına itiyordu. */
  .filters > .field { flex: 1 1 100%; }
  .filters:not(.is-open) > .field:not(:has(input[type=search])),
  .filters:not(.is-open) > .filters__actions { display: none; }
  .filters__toggle {
    flex: 1 1 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 12px;
    border: 1px dashed var(--ink-300);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--ink-600);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
  }
  .filters__toggle.has-active { border-style: solid; border-color: var(--brand-400); color: var(--brand-700); }
  .filters.is-open > .filters__toggle { display: none; }
}

@media print {
  .tabbar, .installbar { display: none !important; }
}

/* ------------------------------------------------- mobil: kurulum ipucu -- */

.installbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--brand-800);
  color: var(--white);
  font-size: 12.5px;
}
.installbar__text { flex: 1; min-width: 0; }
.installbar__text strong { display: block; font-size: 13px; }
.installbar .btn { flex: 0 0 auto; }
.installbar__close {
  flex: 0 0 auto;
  border: 0; background: none; color: var(--white); opacity: .7;
  font-size: 18px; line-height: 1; padding: 4px; cursor: pointer;
}
