/* =============================================================================
   components.css — TEK bileşen sözlüğü (§3.A.1)
   Eski `main-card`/`metric-card`/`modern-table` ve `x` sonekli
   (`cardx`, `tablex`, `btnx`, `badgex`, `statx`) aileler kaldırıldı;
   yerine bu sözlük geldi. Ölçüler prototipten birebir alınmıştır.
   ============================================================================= */

/* ---------------------------------------------------------------- Eyebrow */
.eyebrow {
  font-family: var(--font-num);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.eyebrow--sm { font-size: 10px; letter-spacing: .12em; }

/* ------------------------------------------------------------------ Sayı */
/* Her sayı bu sınıfı taşır; hizalı dursunlar diye tabular-nums. */
.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}
.num--hero { font-size: clamp(36px, 8.5vw, 58px); font-weight: 500; letter-spacing: -.03em; line-height: 1; }
.num--xl   { font-size: 30px; font-weight: 500; letter-spacing: -.02em; line-height: 1.1; }
.num--lg   { font-size: 22px; font-weight: 500; }
.num--md   { font-size: 19px; font-weight: 500; }
.num--base { font-size: 14px; }
.num--sm   { font-size: 11.5px; }

.gain { color: var(--gain); }
.loss { color: var(--loss); }
.flat { color: var(--ink-3); }
.ink-2 { color: var(--ink-2); }
.ink-3 { color: var(--ink-3); }

/* ------------------------------------------------------------------ Kart */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
}
.card--lg { border-radius: var(--r-card-lg); }
.card--ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.card--ink .eyebrow { color: rgba(246, 243, 236, .55); }
.card--dashed { border-style: dashed; border-color: #C9C2B4; }
.card--pad { padding: 18px 20px; }
.card--lg.card--pad { padding: 22px 20px 20px; }
.card + .card { margin-top: 16px; }

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.card__body { padding: 18px 20px; }

/* ------------------------------------------------------------------ Pill */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: var(--r-pill);
  min-height: 38px;
  padding: 0 15px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.pill:hover { border-color: var(--ink); color: var(--ink); }
.pill--on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pill--on:hover { color: var(--paper); }
.pill--sm { min-height: 36px; padding: 0 13px; font-size: 12.5px; }

.pill-group {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--paper);
  border-radius: 10px;
}
.pill-group .pill { min-height: 32px; border: 0; background: transparent; padding: 0 12px; }
.pill-group .pill--on { background: var(--surface); color: var(--ink); }

/* ----------------------------------------------------------------- Buton */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--r-btn);
  min-height: 44px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: var(--ink);
  white-space: nowrap;
}
.btn--ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--ink:hover { color: var(--paper); opacity: .9; }
.btn--line { border-color: var(--line); background: var(--surface); }
.btn--line:hover { border-color: var(--ink); }
.btn--gain { background: var(--gain); color: #fff; border-color: var(--gain); font-weight: 600; }
.btn--gain:hover { color: #fff; }
.btn--loss { background: var(--loss); color: #fff; border-color: var(--loss); font-weight: 600; }
.btn--loss:hover { color: #fff; }
.btn--danger-line { border-color: var(--loss-line); color: var(--loss); background: var(--surface); }
.btn--danger-line:hover { background: var(--loss-bg); color: var(--loss); }
.btn--paper { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn--paper:hover { color: var(--ink); }
.btn--sm { min-height: 40px; padding: 0 15px; font-size: 13px; border-radius: 9px; }
.btn--lg { min-height: 48px; font-size: 15px; }
.btn--xl { min-height: 50px; font-size: 15px; }
.btn--block { display: flex; width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ------------------------------------------------------------------ Etiket */
.tag {
  font-family: var(--font-num);
  font-size: 10px;
  letter-spacing: .1em;
  border-radius: var(--r-tag);
  padding: 3px 6px;
  border: 1px solid var(--line);
  flex: none;
}
.tag--al { color: var(--gain); border-color: var(--gain-line); }
.tag--sat { color: var(--loss); border-color: var(--loss-line); }

/* ------------------------------------------------------------------ Nokta */
.dot {
  width: 7px;
  height: 7px;
  border-radius: var(--r-pill);
  flex: none;
  display: inline-block;
}
.dot--hisse { background: var(--ink); }
.dot--altin { background: var(--gold); }
.dot--doviz { background: var(--fx); }
.dot--on { background: var(--gain); width: 6px; height: 6px; }
.dot--off { background: var(--ink-3); width: 6px; height: 6px; }

/* ----------------------------------------------------------------- Defter */
/* Tablo yok; defter satırları var (K15). */
.ledger { display: block; }
.ledger__row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line-2);
  background: transparent;
  border-left: 0; border-right: 0; border-top: 0;
  text-align: left;
  color: inherit;
}
.ledger__row:last-child { border-bottom: 0; }
.ledger__row--btn { cursor: pointer; }
.ledger__row--btn:hover { background: var(--surface-2); color: inherit; }
.ledger__row--tall { padding: 14px 18px; }

.ledger__main { flex: 1; min-width: 0; }
.ledger__end { text-align: right; flex: none; }
.ledger__pnl { text-align: right; flex: none; min-width: 88px; }

.ledger__group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-2);
}

.ledger__expand {
  background: var(--surface-2);
  padding: 4px 18px 18px;
}

.ledger__title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.ledger__symbol { font-family: var(--font-num); font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }
.ledger__name {
  font-size: 12.5px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ledger__sub { font-family: var(--font-num); font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.ledger__date { font-family: var(--font-num); font-size: 11.5px; color: var(--ink-3); width: 44px; flex: none; }
.ledger__warn { font-family: var(--font-num); font-size: 11.5px; color: var(--gold); padding: 0 20px 10px; }

/* ----------------------------------------------------------------- Hücre */
.cells {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
}
.cells > * { background: var(--surface); padding: 14px 16px; }
.cells--period { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.cells--strip { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.cells--detail { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* ---------------------------------------------------------------- Banner */
.banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 12px;
  padding: 12px 14px;
}
.banner--warn { border-color: var(--gold-line); background: var(--gold-bg); }
.banner--warn .dot { background: var(--gold); margin-top: 6px; }
.banner--error { border-color: var(--loss-line); background: var(--loss-bg); }
.banner--error .dot { background: var(--loss); margin-top: 6px; }
.banner__body { flex: 1; min-width: 0; }
.banner__title { font-size: 13.5px; font-weight: 600; margin-bottom: 2px; }
.banner__text { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.banner__close {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  flex: none;
}
.banner + .banner { margin-top: 10px; }

/* ------------------------------------------------------------------ Çubuk */
.bar {
  display: flex;
  height: 12px;
  border-radius: var(--r-pill);
  overflow: hidden;
  gap: 2px;
}
.bar__seg { height: 100%; border-radius: var(--r-pill); }
.bar__seg--hisse { background: var(--ink); }
.bar__seg--altin { background: var(--gold); }
.bar__seg--doviz { background: var(--fx); }

/* ------------------------------------------------------------------- Alan */
.field { display: block; }
.field + .field { margin-top: 14px; }
.field__label {
  display: block;
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.field__input,
.field select,
.field input,
.field textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  background: var(--surface-2);
  color: var(--ink);
  padding: 0 14px;
  font-size: 15px;
}
.field textarea { padding: 12px 14px; min-height: 80px; }
.field__input.num, .field input.num { font-family: var(--font-num); }
.field__error { font-size: 12.5px; color: var(--loss); margin-top: 5px; }
.field__hint { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }
.field--invalid .field__input,
.field--invalid input { border-color: var(--loss); }

/* ---------------------------------------------------------------- İstatistik */
.stat { min-width: 0; }
.stat__label {
  font-family: var(--font-num);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 5px;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

/* ------------------------------------------------------------------ Toast */
#toast-region {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 1080;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--r-pill);
  padding: 12px 20px;
  font-size: 14px;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 26px rgba(25, 24, 19, .22);
}
.toast--error { background: var(--loss); }
.toast__close {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
}

/* ------------------------------------------------------------ Durumlar */
.skeleton > span {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: var(--line-2);
  margin-bottom: 10px;
}
.skeleton > span:nth-child(2) { width: 80%; }
.skeleton > span:nth-child(3) { width: 55%; }

.empty {
  text-align: center;
  padding: 36px 20px;
}
.empty__text { font-size: 14px; color: var(--ink-2); margin-bottom: 16px; }

/* ------------------------------------------------------- Yardımcı sınıflar */
.row-flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.push-right { margin-left: auto; }
.divider { border-top: 1px solid var(--line); margin: 16px 0; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12.5px; }
.footnote { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.mt-gap { margin-top: 16px; }

/* ------------------------------------------------- Aralık ve vurgu yardımcıları */
/* Şablonlarda inline `style=""` yazılmaz (§0.1); ölçüler buradan gelir.
   Tek istisna veriden gelen değerler (dağılım çubuğunun `width:%`si). */
.u-mb-xs { margin-bottom: 6px; }
.u-mb-sm { margin-bottom: 8px; }
.u-mb-md { margin-bottom: 12px; }
.u-mb-lg { margin-bottom: 14px; }
.u-mb-xl { margin-bottom: 16px; }
.u-mb-2xl { margin-bottom: 20px; }

.u-mt-xs { margin-top: 2px; }
.u-mt-sm { margin-top: 6px; }
.u-mt-md { margin-top: 10px; }
.u-mt-lg { margin-top: 12px; }
.u-mt-xl { margin-top: 14px; }
.u-mt-2xl { margin-top: 16px; }
.u-mt-3xl { margin-top: 18px; }

.u-section-gap { margin: 20px 0 12px; }
.u-link-gap { margin: 10px 0 14px; }

.u-flex-1 { flex: 1; }
.u-flex-1-min { flex: 1; min-width: 0; }
.u-w500 { font-weight: 500; }
.u-w600 { font-weight: 600; }
.u-dim { opacity: .8; }
.u-dim-strong { opacity: .75; }
.u-muted-control { opacity: .45; }
.u-center { justify-content: center; }
.u-right { text-align: right; }

.u-symbol-lg { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.u-cell-value { font-size: 16.5px; font-weight: 500; }
.u-cell-pct { font-size: 12px; opacity: .8; }
.u-total { font-size: 15px; font-weight: 500; }
.u-body { font-size: 15px; }
.u-pad-lg { padding: 20px; }

.u-pnl-col { min-width: 96px; text-align: right; }
.u-chart-box { height: 260px; }
.u-filter-select { flex: 0 0 160px; min-width: 140px; }
.u-filter-wide { flex: 0 0 180px; min-width: 150px; }
.u-row-56 { min-height: 56px; width: 100%; }
.u-form-row { width: 100%; }

.u-card-head-block { padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.u-card-foot { border-top: 1px solid var(--line); }
.u-cells-flush {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  grid-template-columns: repeat(3, 1fr);
}
.u-pad-row { padding: 14px 20px; }
.u-footnote-inset { margin-top: 12px; padding: 0 4px; }
.u-date-wide { width: 72px; }
.u-row-divider { border-bottom: 1px solid var(--line-2); }
.u-value { font-size: 14.5px; font-weight: 500; }
.u-value-sm { font-size: 13.5px; }
.u-stale { color: var(--gold); }
.u-row-symbol { font-size: 14px; font-weight: 500; }
.u-row-symbol--strong { font-size: 14px; font-weight: 600; flex: 1; }
.u-modal-card { border-radius: var(--r-card-lg); }
.u-modal-foot { border-top: 1px solid var(--line); justify-content: flex-end; }
.u-cells-150 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.u-check { margin-top: 3px; }
.u-lh { line-height: 1.5; }
.u-linkish { border: 0; background: transparent; color: var(--fx); padding: 0; cursor: pointer; }
.u-mb-10 { margin-bottom: 10px; }
.u-summary-row { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: baseline; }
.u-usd-sm { font-size: 12px; color: var(--ink-2); }
.u-rate-row { font-size: 12.5px; }
.u-baseline { align-items: baseline; }
.u-gap-6 { gap: 6px; }
.u-text-center { text-align: center; }
.ledger__row--on { background: var(--surface-2); }
