/* ═══════════════════════════ bileşenler ═══════════════════════════ */

/* ── ikon ── */
.i { width: 18px; height: 18px; flex: 0 0 auto; stroke: currentColor; fill: none;
     stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 15px; height: 15px; }
.i-lg { width: 22px; height: 22px; }

/* ── buton (pill) ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 18px;
  border-radius: var(--r-pill);
  font-size: var(--fs-md); font-weight: 600; letter-spacing: -.005em;
  white-space: nowrap; user-select: none;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--line-2);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform .08s;
}
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--line-2); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible { box-shadow: var(--focus); border-radius: var(--r-pill); }

.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent);
                box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 60%, transparent); }
.btn--primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--soft { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.btn--soft:hover:not(:disabled) { background: var(--accent-soft-2); border-color: transparent; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn--ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn--hot { background: var(--hot); border-color: var(--hot); color: var(--on-hot);
            box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--hot) 70%, transparent); }
.btn--hot:hover:not(:disabled) { background: var(--hot-hover); border-color: var(--hot-hover); }
a.btn:hover { text-decoration: none; }
.btn--danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--danger-solid:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 88%, #000); }
.btn--danger { color: var(--danger); }
.btn--danger:hover:not(:disabled) { background: var(--danger-soft); border-color: transparent; }

.btn--sm { height: 32px; padding: 0 13px; font-size: var(--fs-sm); gap: 5px; }
.btn--xs { height: 26px; padding: 0 10px; font-size: var(--fs-xs); gap: 4px; }
.btn--block { width: 100%; }
.btn--icon { width: 40px; padding: 0; }
.btn--icon.btn--sm { width: 32px; }
.btn--icon.btn--xs { width: 26px; }

.btn .spinner { width: 15px; height: 15px; border-width: 2px; }

/* ── form alanları ── */
.label { display: block; font-size: var(--fs-xs); font-weight: 600; color: var(--text-2);
         margin: 0 0 6px 4px; letter-spacing: .01em; }

.input, .select {
  width: 100%; height: 42px; padding: 0 16px;
  border-radius: var(--r-pill);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line-2);
  font-size: var(--fs-md); outline: 0;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur);
}
.input::placeholder { color: var(--text-3); }
.input:hover, .select:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line-2)); }
.input:focus, .select:focus { border-color: var(--accent); box-shadow: var(--focus); }
.input:disabled, .select:disabled { opacity: .5; cursor: not-allowed; background: var(--surface-2); }
.input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.input--sm, .select--sm { height: 36px; font-size: var(--fs-sm); padding: 0 14px; }

.select {
  appearance: none; cursor: pointer; padding-right: 38px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b8a98' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 16px;
}

.field { position: relative; }
.field > .i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
              color: var(--text-3); pointer-events: none; }
.field > .input { padding-left: 42px; }
.field-error { font-size: var(--fs-xs); color: var(--danger); margin: 5px 0 0 6px; }

/* ── kart ── */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.card--flush { padding: 0; }
.card--inset { background: var(--surface-2); box-shadow: none; }
.card[data-stripe]::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: var(--stripe, var(--accent));
}
.card[data-stripe="navy"]   { --stripe: var(--navy); }
.card[data-stripe="hot"]    { --stripe: var(--hot); }
.card[data-stripe="orange"] { --stripe: var(--pastel-orange); }
.card[data-stripe="green"]  { --stripe: var(--pastel-green); }
.card[data-stripe="purple"] { --stripe: var(--pastel-purple); }
.card[data-stripe="rose"]   { --stripe: var(--pastel-rose); }
.card[data-stripe] { padding-top: calc(var(--space-4) + 4px); }

.card__head { display: flex; align-items: center; justify-content: space-between;
              gap: var(--space-2); margin-bottom: var(--space-3); }
.card__title { font-size: var(--fs-md); font-weight: 700; letter-spacing: -.01em; }
.card__sub { font-size: var(--fs-xs); color: var(--text-3); margin-top: 1px; }

/* ── bölüm girişi (sekme başı) ── */
.intro { padding: 2px 4px var(--space-2); }
.intro .h2 { margin-top: 6px; }
.intro p { margin-top: 6px; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.55; }

/* ── anahtar (switch) ── */
.switch { display: flex; align-items: center; gap: var(--space-3); cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track {
  position: relative; flex: 0 0 auto; width: 40px; height: 24px; border-radius: var(--r-pill);
  background: var(--surface-3); border: 1px solid var(--line-2);
  transition: background var(--dur) var(--ease), border-color var(--dur);
}
.switch__track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform var(--dur) var(--ease);
}
.switch input:checked + .switch__track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { box-shadow: var(--focus); }
.switch__text b { display: block; font-size: var(--fs-md); font-weight: 600; }
.switch__text small { display: block; color: var(--text-3); font-size: var(--fs-xs); margin-top: 1px; }

/* ── segmented ── */
.seg {
  display: flex; gap: 3px; padding: 4px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-pill);
}
.seg button {
  flex: 1; height: 32px; padding: 0 12px; border-radius: var(--r-pill);
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background var(--dur) var(--ease), color var(--dur), box-shadow var(--dur);
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] {
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm);
}
.seg button:focus-visible { box-shadow: var(--focus); }
.seg--accent button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

/* ── onay kutusu ── */
.check { position: relative; flex: 0 0 auto; width: 20px; height: 20px; }
.check input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.check span {
  display: grid; place-items: center; width: 20px; height: 20px; border-radius: 7px;
  border: 1.6px solid var(--line-2); background: var(--surface);
  transition: background var(--dur) var(--ease), border-color var(--dur);
}
.check span::after {
  content: ""; width: 9px; height: 5px; border: 2px solid var(--on-accent);
  border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px) scale(0);
  transition: transform var(--dur) var(--ease);
}
.check input:checked + span { background: var(--accent); border-color: var(--accent); }
.check input:checked + span::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.check input:focus-visible + span { box-shadow: var(--focus); }
.check input:disabled + span { opacity: .4; }

/* ── çip / rozet ── */
.chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  height: 30px; padding: 0 12px; border-radius: var(--r-pill);
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--line);
  transition: background var(--dur), color var(--dur), border-color var(--dur);
}
button.chip:hover { border-color: var(--line-2); color: var(--text); }
.chip.is-on { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 8px; border-radius: var(--r-pill);
  font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
  background: var(--surface-3); color: var(--text-2);
}
.badge--accent  { background: var(--accent-soft); color: var(--accent-text); }
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--danger  { background: var(--danger-soft);  color: var(--danger); }
.badge--hot     { background: var(--hot-soft); color: var(--hot-text); }

/* ── katman listesi ── */
.list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.item {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: 48px; padding: 7px 8px 7px 10px; border-radius: var(--r-md);
  cursor: pointer; border: 1px solid transparent;
  transition: background var(--dur) var(--ease), border-color var(--dur);
}
.item:hover { background: var(--surface-2); }
.item.is-on { background: var(--accent-soft); }
.item.is-disabled { opacity: .45; cursor: not-allowed; }
.item.is-locked .item__title { color: var(--text-2); }
.lock-dot { width: 20px; height: 20px; flex: 0 0 auto; display: grid; place-items: center; color: var(--hot-text); }
.chip--locked { color: var(--text-3); border-style: dashed; }
.chip--locked .i { color: var(--hot-text); }
.item__dot { width: 10px; height: 10px; border-radius: 4px; flex: 0 0 auto;
             box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.item__body { flex: 1; min-width: 0; }
.item__title { display: block; font-size: var(--fs-sm); font-weight: 600; line-height: 1.3; color: var(--text); }
.item__meta { display: block; font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; line-height: 1.35; }
.item__act { opacity: 0; transition: opacity var(--dur); }
.item:hover .item__act, .item:focus-within .item__act { opacity: 1; }

/* ── kaydırıcı ── */
.slider { display: flex; align-items: center; gap: var(--space-3); }
.slider label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); white-space: nowrap; }
.slider output { font-size: var(--fs-sm); font-weight: 700; color: var(--accent-text);
                 min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
input[type=range] {
  flex: 1; appearance: none; height: 6px; border-radius: 6px; outline: 0; cursor: pointer;
  background: linear-gradient(to right, var(--accent) 0 var(--p, 50%), var(--surface-3) var(--p, 50%) 100%);
}
input[type=range]::-webkit-slider-thumb {
  appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent);
  box-shadow: 0 2px 6px rgba(15,31,46,.2); transition: transform var(--dur);
}
input[type=range]:hover::-webkit-slider-thumb { transform: scale(1.1); }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: var(--focus); }
input[type=range]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: var(--surface);
  border: 2px solid var(--accent);
}

/* ── anahtar–değer ── */
.kv { display: grid; grid-template-columns: minmax(96px, 38%) 1fr; gap: 9px 14px; font-size: var(--fs-sm); }
.kv dt { color: var(--text-3); font-weight: 500; }
.kv dd { color: var(--text); font-weight: 600; word-break: break-word; }
.kv dd .faint { font-weight: 500; }

/* ── lejant ── */
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.legend__i { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--text-2); }
.legend__i i { width: 12px; height: 12px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.14); }

/* ── satır içi bildirim ── */
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 14px; border-radius: var(--r-md);
  font-size: var(--fs-sm); line-height: 1.5;
  background: var(--info-soft); color: var(--text);
}
.notice .i { margin-top: 1px; color: var(--info); }
.notice--success { background: var(--success-soft); } .notice--success .i { color: var(--success); }
.notice--warning { background: var(--warning-soft); } .notice--warning .i { color: var(--warning); }
.notice--error   { background: var(--danger-soft); }  .notice--error .i   { color: var(--danger); }
.notice b { font-weight: 700; }
.notice .btn { margin-top: 8px; }

/* ── boş durum ── */
.empty { text-align: center; padding: 36px 20px; }
.empty__art {
  width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 22px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.empty__art .i { width: 28px; height: 28px; }
.empty .script { display: block; margin-bottom: 6px; }
.empty p { color: var(--text-2); font-size: var(--fs-sm); max-width: 260px; margin: 0 auto; }

/* ── iskelet ── */
.skeleton {
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--skeleton-a) 0%, var(--skeleton-b) 50%, var(--skeleton-a) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
.skel-row { display: flex; align-items: center; gap: 12px; padding: 10px; }
.skel-row .skeleton:first-child { width: 20px; height: 20px; border-radius: 7px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── dönen gösterge ── */
.spinner {
  display: inline-block; width: 16px; height: 16px; flex: 0 0 auto;
  border: 2px solid color-mix(in srgb, currentColor 22%, transparent);
  border-top-color: currentColor; border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── renk örneği satırı ── */
.swatches { display: flex; flex-direction: column; gap: 7px; }
.sw { display: grid; grid-template-columns: 22px 1fr auto 42px; align-items: center; gap: 10px; font-size: var(--fs-xs); }
.sw i { width: 22px; height: 22px; border-radius: 7px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.14); }
.sw .bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.sw .bar b { display: block; height: 100%; border-radius: 6px; }
.sw .hex { font-family: var(--mono); color: var(--text-3); }
.sw .pct { text-align: right; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }

.divider { height: 1px; background: var(--line); margin: var(--space-4) 0; border: 0; }

/* ═══════════ bildirim yığını (toast) ═══════════ */
.toasts {
  position: fixed; z-index: 60; right: var(--gap); bottom: calc(var(--gap) + 44px);
  display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
  pointer-events: none; max-width: min(400px, calc(100vw - 2 * var(--gap)));
}
.toast {
  pointer-events: auto; width: 100%;
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start;
  padding: 13px 14px 13px 14px; border-radius: var(--r-lg);
  background: var(--glass-strong); backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  animation: toast-in .28s var(--ease);
  position: relative; overflow: hidden;
}
.toast.is-leaving { animation: toast-out .2s var(--ease) forwards; }
.toast__icon {
  width: 32px; height: 32px; border-radius: 11px; display: grid; place-items: center;
  background: var(--info-soft); color: var(--info);
}
.toast--success .toast__icon { background: var(--success-soft); color: var(--success); }
.toast--warning .toast__icon { background: var(--warning-soft); color: var(--warning); }
.toast--error   .toast__icon { background: var(--danger-soft);  color: var(--danger); }
.toast__title { font-weight: 700; font-size: var(--fs-sm); line-height: 1.35; }
.toast__msg { font-size: var(--fs-sm); color: var(--text-2); margin-top: 2px; line-height: 1.45; word-break: break-word; }
.toast__detail { font-size: var(--fs-xs); color: var(--text-3); margin-top: 4px; font-family: var(--mono); }
.toast__actions { display: flex; gap: 6px; margin-top: 9px; }
.toast__close { color: var(--text-3); margin: -2px -2px 0 0; }
.toast__close:hover { color: var(--text); }
.toast__bar { position: absolute; left: 0; bottom: 0; height: 3px; background: currentColor; opacity: .25;
              animation: toast-bar linear forwards; }
@keyframes toast-in  { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes toast-out { to   { opacity: 0; transform: translateX(16px); } }
@keyframes toast-bar { from { width: 100%; } to { width: 0; } }

/* ═══════════ üst şerit (bağlantı/servis durumu) ═══════════ */
.banner {
  /* harita alanının ortasında, arama çubuğunun altında — paneli örtmez */
  position: fixed; z-index: 55; top: calc(var(--gap) + 60px);
  left: calc(var(--panel-w) + 2 * var(--gap) + (100vw - var(--panel-w) - 3 * var(--gap)) / 2);
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  width: max-content; max-width: calc(100vw - var(--panel-w) - 4 * var(--gap));
  padding: 8px 8px 8px 16px; border-radius: var(--r-pill);
  background: var(--glass-strong); backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  font-size: var(--fs-sm); font-weight: 600;
  animation: toast-in .28s var(--ease);
}
.banner .i { color: var(--warning); flex: 0 0 auto; }
body.panel-collapsed .banner { left: 50%; max-width: calc(100vw - 2 * var(--gap)); }
@media (max-width: 1180px) { .banner { top: calc(var(--gap) + 116px); } }
@media (max-width: 820px) { .banner { left: 50%; max-width: calc(100vw - 2 * var(--gap)); } }
.banner--error .i { color: var(--danger); }
