/* ==========================================================================
   Bileşenler

   Ekranlar arasında tutarlılık için ortak parçalar. Buradaki her şey birden
   fazla sayfada kullanılır; tek bir sayfaya özel stil yazmaktan kaçınıyoruz ki
   yeni bir ekran eklendiğinde görünüm kendiliğinden yerine otursun.

   Temel değişkenler ve öğeler app.css içinde; bu dosya onların üzerine kurulur.
   ========================================================================== */

/* --- Bölüm başlığı: başlık solda, eylem sağda ----------------------------- */

.section {
  display: flex; align-items: flex-end; gap: 14px;
  margin: 30px 0 12px; flex-wrap: wrap;
}
.section > div:first-child { flex: 1; min-width: 200px; }
.section h2 { margin: 0; }
.section .note { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; }

/* --- Yapışkan eylem çubuğu ------------------------------------------------ */

.toolbar {
  position: sticky; bottom: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: rgba(255, 255, 255, .93);
  backdrop-filter: blur(7px);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 11px 15px; margin-top: 22px;
  box-shadow: 0 -2px 12px rgba(16, 26, 38, .07);
}
.toolbar .spacer { flex: 1; }
.toolbar .hint { font-size: 12.5px; color: var(--muted); }

/* --- Satır listesi -------------------------------------------------------- */

.list { display: flex; flex-direction: column; }
.item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 6px; border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit;
  border-radius: var(--radius-sm);
}
.item:last-child { border-bottom: 0; }
.item:hover { background: #fafcfe; }
.item .icon {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center;
}
.item .icon svg { width: 17px; height: 17px; }
.item .icon.ok { background: var(--ok-soft); color: var(--ok); }
.item .icon.warn { background: var(--warn-soft); color: var(--warn); }
.item .icon.err { background: var(--err-soft); color: var(--err); }
.item .icon.mut { background: #eef1f5; color: var(--muted); }
.item .grow { flex: 1; min-width: 0; }
.item .title {
  font-weight: 600; font-size: 14px;
  display: flex; align-items: center; gap: 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.item .meta {
  font-size: 12.5px; color: var(--muted); margin-top: 3px;
  display: flex; gap: 9px; flex-wrap: wrap; align-items: center;
}
.item .meta .sep { opacity: .35; }
.item .side { text-align: right; flex: none; }
.item .side .big {
  font-size: 17px; font-weight: 700; line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.item .side .cap { font-size: 11.5px; color: var(--muted); }
.item .go { color: var(--muted); flex: none; }
.item:hover .go { color: var(--brand); }

/* --- Anahtar / değer satırları -------------------------------------------- */

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

/* --- Yatay çubuk grafik --------------------------------------------------- */

.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 1fr 68px; gap: 14px; align-items: center; }
.bar-row .label { font-size: 13px; display: flex; align-items: center; gap: 8px; }
.bar-row .label .swatch { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.bar-row .track { height: 8px; background: #e8edf3; border-radius: 99px; margin-top: 6px; }
.bar-row .track > div { height: 100%; border-radius: 99px; transition: width .35s; }
.bar-row .count {
  text-align: right; font-variant-numeric: tabular-nums;
  font-size: 14px; font-weight: 600;
}
.bar-row .count small { color: var(--muted); font-weight: 400; display: block; font-size: 11px; }

/* --- Halka gösterge ------------------------------------------------------- */

.ring {
  --pct: 0;
  --ring-color: var(--brand-2);
  width: 76px; height: 76px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--ring-color) calc(var(--pct) * 1%), #e6ebf2 0);
  display: grid; place-items: center; position: relative;
}
.ring::before {
  content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--panel);
}
.ring span {
  position: relative; font-size: 15px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ring.ok { --ring-color: var(--ok); }
.ring.warn { --ring-color: var(--warn); }

/* --- Segmentli seçici ----------------------------------------------------- */

.segmented {
  display: inline-flex; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 8px; padding: 3px; gap: 2px;
}
.segmented button {
  background: transparent; color: var(--muted); border: 0;
  padding: 5px 13px; font-size: 13px; border-radius: 6px; font-weight: 500;
}
.segmented button:hover { background: rgba(0, 0, 0, .04); color: var(--ink); }
.segmented button.active {
  background: var(--panel); color: var(--brand);
  box-shadow: var(--shadow); font-weight: 600;
}

/* --- Filtre etiketleri ---------------------------------------------------- */

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  background: var(--panel); border: 1px solid var(--line-strong); color: var(--ink-2);
  border-radius: 99px; padding: 4px 12px; font-size: 12.5px; font-weight: 500;
}
.chip:hover { border-color: var(--brand-2); color: var(--brand); background: var(--panel); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip .n { opacity: .6; margin-left: 6px; font-variant-numeric: tabular-nums; }

/* --- Adım göstergesi ------------------------------------------------------ */

.steps { display: flex; gap: 0; margin-bottom: 18px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 9px; padding-right: 24px; }
.step .n {
  width: 23px; height: 23px; border-radius: 50%; flex: none;
  background: var(--panel-2); border: 1px solid var(--line-strong); color: var(--muted);
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.step .t { font-size: 13px; color: var(--muted); }
.step.done .n { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.done .t { color: var(--ink-2); }
.step.active .n { background: var(--brand); border-color: var(--brand); color: #fff; }
.step.active .t { color: var(--ink); font-weight: 600; }

/* --- Kip penceresi -------------------------------------------------------- */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(12, 22, 36, .48);
  display: none; place-items: center; padding: 24px;
}
.modal-backdrop.open { display: grid; }
.modal-box {
  background: var(--panel); border-radius: 13px;
  box-shadow: 0 22px 60px rgba(6, 16, 30, .3);
  width: 100%; max-width: 760px; max-height: 86vh;
  display: flex; flex-direction: column;
}
.modal-box header {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 20px; border-bottom: 1px solid var(--line);
}
.modal-box header h3 { margin: 0; flex: 1; }
.modal-box .body { padding: 18px 20px; overflow-y: auto; }
.modal-box footer {
  padding: 13px 20px; border-top: 1px solid var(--line);
  display: flex; gap: 9px; justify-content: flex-end; align-items: center;
}
.modal-close {
  background: none; border: 0; color: var(--muted); font-size: 21px;
  line-height: 1; padding: 2px 9px; border-radius: 6px;
}
.modal-close:hover { background: var(--panel-2); color: var(--err); }

/* --- Yükleme iskeleti ----------------------------------------------------- */

.skeleton {
  background: linear-gradient(90deg, #eef1f5 25%, #f7f9fb 50%, #eef1f5 75%);
  background-size: 200% 100%; animation: kayar 1.3s ease-in-out infinite;
  border-radius: 6px; height: 13px; margin: 10px 0;
}
.skeleton.lg { height: 36px; }
.skeleton.w60 { width: 60%; }
.skeleton.w40 { width: 40%; }
@keyframes kayar { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* --- Anlık bildirim ------------------------------------------------------- */

.toasts {
  position: fixed; right: 18px; bottom: 18px; z-index: 120;
  display: flex; flex-direction: column; gap: 9px; max-width: 380px;
}
.toast {
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--brand-2);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 12px 15px; font-size: 13.5px; animation: girer .2s ease-out;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--err); }
.toast.warn { border-left-color: var(--warn); }
.toast strong { display: block; margin-bottom: 2px; }
.toast.kapanir { animation: cikar .25s ease-in forwards; }
@keyframes girer { from { opacity: 0; transform: translateY(10px); } }
@keyframes cikar { to { opacity: 0; transform: translateX(24px); } }

/* --- Yan gezinme (uzun formlar için) -------------------------------------- */

.with-aside { display: grid; grid-template-columns: 200px 1fr; gap: 26px; align-items: start; }
.aside-nav { position: sticky; top: 72px; display: flex; flex-direction: column; gap: 2px; }
.aside-nav a {
  padding: 8px 12px; border-radius: var(--radius-sm); font-size: 13.5px;
  color: var(--muted); text-decoration: none; border-left: 2px solid transparent;
}
.aside-nav a:hover { background: var(--panel); color: var(--brand); }
.aside-nav a.active {
  background: var(--panel); color: var(--brand); font-weight: 600;
  border-left-color: var(--brand);
}

/* --- Küçük yardımcılar ---------------------------------------------------- */

.hint-box {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 11px 13px;
  font-size: 12.5px; color: var(--ink-2); line-height: 1.55;
}
.hint-box strong { color: var(--ink); }
.hint-box + .hint-box { margin-top: 8px; }

.field-hint { font-size: 12px; color: var(--muted); margin: 5px 0 0; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill-num {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px;
  padding: 0 6px; border-radius: 99px; background: var(--brand-soft);
  color: var(--brand); font-size: 11.5px; font-weight: 700;
}

@media (max-width: 900px) {
  .with-aside { grid-template-columns: 1fr; gap: 12px; }
  .aside-nav { position: static; flex-direction: row; overflow-x: auto; }
  .aside-nav a { border-left: 0; border-bottom: 2px solid transparent; white-space: nowrap; }
  .aside-nav a.active { border-left: 0; border-bottom-color: var(--brand); }
}
