/* ==========================================================================
   Bilesenler
   ========================================================================== */

/* --- Sayfa basligi ------------------------------------------------------- */

.page-head {
  display: flex; align-items: flex-end; gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-5);
}
.page-head__title { font-size: var(--fs-xl); color: var(--ink-900); letter-spacing: -.2px; }
.page-head__sub { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 2px; }
.page-head__actions { margin-left: auto; display: flex; gap: var(--sp-2); flex-wrap: wrap; }

.crumbs { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--text-faint); margin-bottom: 4px; }
.crumbs a { color: var(--text-muted); }
.crumbs a:hover { color: var(--brand-600); }
.crumbs span:last-child { color: var(--brand-600); font-weight: 600; }

/* --- Butonlar ------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 var(--sp-4);
  border: 1px solid transparent; border-radius: var(--radius);
  background: var(--brand-500); color: #fff;
  font-size: var(--fs-base); font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background var(--transition), border-color var(--transition),
              color var(--transition), box-shadow var(--transition);
}
.btn:hover { background: var(--brand-600); color: #fff; box-shadow: var(--shadow-brand); }
.btn:active { background: var(--brand-700); }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

.btn--ghost { background: var(--surface); border-color: var(--border-strong); color: var(--ink-700); }
.btn--ghost:hover { background: var(--brand-50); border-color: var(--brand-300); color: var(--brand-700); box-shadow: none; }

.btn--soft { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-700); }
.btn--soft:hover { background: var(--brand-100); color: var(--brand-800); box-shadow: none; }

.btn--danger { background: var(--err-500); }
.btn--danger:hover { background: #b91c1c; box-shadow: 0 6px 18px rgba(220, 38, 38, .25); }

.btn--sm { height: 31px; padding: 0 var(--sp-3); font-size: var(--fs-sm); }
.btn--icon { width: 34px; height: 34px; padding: 0; }
.btn--block { width: 100%; }

/* --- Kartlar / paneller ------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card__head {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
}
.card__title {
  font-size: var(--fs-sm); font-weight: 700; color: var(--ink-800);
  text-transform: uppercase; letter-spacing: .06em;
}
.card__actions { margin-left: auto; display: flex; gap: var(--sp-2); }
.card__body { padding: var(--sp-5); }
.card__body--flush { padding: 0; }
.card__foot {
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--border);
  background: var(--surface-muted);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  font-size: var(--fs-sm); color: var(--text-muted);
}

/* --- Izgara ------------------------------------------------------------- */

.grid { display: grid; gap: var(--sp-4); }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(238px, 1fr)); }
.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)); }
.stack { display: grid; gap: var(--sp-4); }

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

/* --- Sayac karti -------------------------------------------------------- */

.stat {
  position: relative;
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat::after {
  content: ""; position: absolute; inset: 0 auto 0 0;
  width: 4px; background: var(--brand-500);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat__icon {
  width: 52px; height: 52px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--radius-lg);
  background: var(--brand-50);
  color: var(--brand-600);
  border: 1px solid var(--brand-100);
}
.stat__icon .ic { width: 26px; height: 26px; }

.stat__body { min-width: 0; margin-left: auto; text-align: right; }
.stat__label {
  font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .07em;
}
.stat__value {
  display: flex; align-items: center; justify-content: flex-end; gap: 6px;
  font-size: var(--fs-2xl); font-weight: 700; color: var(--ink-900);
  letter-spacing: -.6px; font-variant-numeric: tabular-nums;
}
.stat__trend { color: var(--ok-500); }
.stat__trend .ic { width: 18px; height: 18px; stroke-width: 2.4; }

/* --- Veri tablosu ------------------------------------------------------- */

.table-wrap { width: 100%; overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }

.table thead th {
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
  color: var(--ink-700);
  font-size: var(--fs-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  text-align: left; white-space: nowrap;
}
.table tbody td {
  padding: 11px var(--sp-4);
  border-bottom: 1px solid var(--ink-100);
  color: var(--ink-700);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--brand-50); }

.table .num, .table .t-right { text-align: right; font-variant-numeric: tabular-nums; }
.table .t-center { text-align: center; }
.table th.num { text-align: right; }

/* Ozet tablo — ana sayfadaki ADET / TUTAR listeleri */
.table--summary tbody td:first-child {
  font-size: var(--fs-sm); font-weight: 600; color: var(--ink-700);
  text-transform: uppercase; letter-spacing: .04em;
}
.table--summary tbody tr:nth-child(odd) td { background: var(--surface-muted); }
.table--summary tbody tr:hover td { background: var(--brand-50); }
.table--summary .cell-count { width: 110px; font-weight: 700; color: var(--ink-900); }
.table--summary .cell-amount { width: 170px; font-weight: 700; color: var(--ink-900); }
.table--summary .cell-plate { width: 260px; }
.table--summary .is-zero { color: var(--text-faint); font-weight: 500; }

.table--compact tbody td { padding: 8px var(--sp-3); }

.plate-list { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }

.plate {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--ink-300);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: var(--fs-xs); font-weight: 700;
  letter-spacing: .04em; color: var(--ink-800);
  white-space: nowrap;
}
.plate--warn { border-color: var(--warn-500); background: var(--warn-50); color: #92400e; }
.plate--ok { border-color: var(--ok-500); background: var(--ok-50); color: #15803d; }

/* --- Etiketler --------------------------------------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--ink-100); color: var(--ink-700);
  font-size: var(--fs-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  white-space: nowrap;
}
.badge--brand { background: var(--brand-100); color: var(--brand-800); }
.badge--ok    { background: var(--ok-50);   color: #15803d; }
.badge--warn  { background: var(--warn-50); color: #92400e; }
.badge--err   { background: var(--err-50);  color: #b91c1c; }
.badge--info  { background: var(--info-50); color: #0369a1; }
.badge--muted { background: var(--ink-100); color: var(--ink-500); }

.money { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

/* --- Formlar ----------------------------------------------------------- */

.form-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--wide { grid-column: 1 / -1; }
.field > label {
  font-size: var(--fs-sm); font-weight: 600; color: var(--ink-700);
}
.field .req { color: var(--err-500); }

.field input[type="text"], .field input[type="number"], .field input[type="email"],
.field input[type="password"], .field input[type="date"], .field input[type="time"],
.field input[type="datetime-local"], .field input[type="url"], .field input[type="tel"],
.field select, .field textarea,
.input, .select, .textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px var(--sp-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: inherit; font-size: var(--fs-base);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field textarea, .textarea { min-height: 96px; resize: vertical; line-height: 1.55; }

.field input:focus, .field select:focus, .field textarea:focus,
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px var(--brand-100);
}

.field__hint { font-size: var(--fs-xs); color: var(--text-muted); }
.field__error { font-size: var(--fs-xs); color: var(--err-500); font-weight: 600; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--err-500); }

.check { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-base); }
.check input { width: 17px; height: 17px; accent-color: var(--brand-500); }

.form-actions {
  display: flex; gap: var(--sp-2); flex-wrap: wrap;
  padding-top: var(--sp-4); margin-top: var(--sp-4);
  border-top: 1px solid var(--border);
}

/* Filtre cubugu */
.filters {
  display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: flex-end;
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--sp-4);
  box-shadow: var(--shadow-sm);
}
.filters .field { flex: 1 1 180px; }
.filters .form-actions { padding: 0; margin: 0; border: 0; }

/* --- Sekmeler ---------------------------------------------------------- */

.tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--sp-4);
  box-shadow: var(--shadow-sm);
}
.tab {
  padding: 7px var(--sp-4);
  border-radius: var(--radius);
  color: var(--ink-600);
  font-size: var(--fs-sm); font-weight: 600;
  white-space: nowrap;
}
.tab:hover { background: var(--brand-50); color: var(--brand-700); }
.tab.is-active { background: var(--brand-500); color: #fff; box-shadow: var(--shadow-brand); }

/* --- Not paneli -------------------------------------------------------- */

.note {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand-400);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.note__head {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--brand-50);
  border-bottom: 1px solid var(--brand-100);
}
.note__title { font-size: var(--fs-sm); font-weight: 700; color: var(--brand-800); }
.note__meta { margin-left: auto; font-size: var(--fs-xs); color: var(--text-muted); }
.note__body {
  padding: var(--sp-4);
  max-height: 260px; overflow-y: auto;
  font-size: var(--fs-sm); line-height: 1.65;
  color: var(--ink-700);
  white-space: pre-wrap; word-break: break-word;
}

/* --- Bos durum --------------------------------------------------------- */

.empty { padding: var(--sp-10) var(--sp-5); text-align: center; }
.empty__icon {
  width: 56px; height: 56px; margin: 0 auto var(--sp-3);
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--brand-50); color: var(--brand-400);
  border: 1px solid var(--brand-100);
}
.empty__title { font-size: var(--fs-md); color: var(--ink-800); margin-bottom: 4px; }
.empty__text { font-size: var(--fs-sm); color: var(--text-muted); }

/* --- Uyarilar ---------------------------------------------------------- */

.alerts { display: grid; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.alert {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: var(--surface);
  font-size: var(--fs-base);
  box-shadow: var(--shadow-sm);
}
.alert--success { border-left-color: var(--ok-500);   background: var(--ok-50); }
.alert--error   { border-left-color: var(--err-500);  background: var(--err-50); }
.alert--warning { border-left-color: var(--warn-500); background: var(--warn-50); }
.alert--info    { border-left-color: var(--info-500); background: var(--info-50); }
.alert__close {
  margin-left: auto; border: 0; background: transparent;
  color: var(--text-muted); cursor: pointer; padding: 0 2px;
}

/* --- Sayfalama --------------------------------------------------------- */

.pager {
  display: flex; align-items: center; gap: var(--sp-2);
  flex-wrap: wrap; justify-content: center;
  padding: var(--sp-4);
}
.pager__link {
  min-width: 34px; height: 34px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink-700);
  font-size: var(--fs-sm); font-weight: 600;
}
.pager__link:hover { background: var(--brand-50); border-color: var(--brand-300); color: var(--brand-700); }
.pager__link.is-active {
  background: var(--brand-500); border-color: var(--brand-500); color: #fff;
}
.pager__info { font-size: var(--fs-sm); color: var(--text-muted); margin-right: auto; }

/* --- Tanim listesi ---------------------------------------------------- */

.dl { display: grid; grid-template-columns: 190px 1fr; gap: 1px; }
.dl > dt {
  padding: 9px var(--sp-4);
  background: var(--surface-muted);
  font-size: var(--fs-sm); font-weight: 600; color: var(--ink-600);
}
.dl > dd {
  margin: 0; padding: 9px var(--sp-4);
  font-size: var(--fs-base); color: var(--ink-800);
}
@media (max-width: 620px) { .dl { grid-template-columns: 1fr; } }

/* --- Giris ekrani ----------------------------------------------------- */

.auth {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: var(--sp-6);
  background:
    radial-gradient(1100px 520px at 12% -10%, var(--brand-100), transparent 62%),
    radial-gradient(900px 480px at 100% 105%, var(--brand-50), transparent 60%),
    var(--page-bg);
}
.auth__card {
  width: 100%; max-width: 420px;
  padding: var(--sp-8);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}
.auth__brand { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-6); }
.auth__brand .brand-mark { width: 46px; height: 46px; font-size: var(--fs-lg); }
.auth__title { font-size: var(--fs-lg); color: var(--ink-900); }
.auth__sub { font-size: var(--fs-sm); color: var(--text-muted); margin-bottom: var(--sp-5); }
.auth__foot { margin-top: var(--sp-5); text-align: center; font-size: var(--fs-xs); color: var(--text-faint); }

/* --- Yardimci siniflar ----------------------------------------------- */

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: var(--sp-4); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.fw-700 { font-weight: 700; }
.nowrap { white-space: nowrap; }
.flex { display: flex; align-items: center; gap: var(--sp-2); }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.ml-auto { margin-left: auto; }
