@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700&family=Poppins:wght@500;600;700&display=swap');

:root {
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-soft: #EFF4FF;
  --on-primary: #FFFFFF;
  --fg: #0F172A;
  --fg-2: #334155;
  --muted: #475569;
  --subtle: #64748B;
  --bg: #F6F8FB;
  --card: #FFFFFF;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --ok: #047857;
  --ok-soft: #ECFDF5;
  --warn: #92400E;
  --warn-soft: #FFFBEB;
  --danger: #B91C1C;
  --danger-soft: #FEF2F2;
  --ring: 0 0 0 3px rgba(37, 99, 235, .35);
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, .10);
  --font: 'Open Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--fg); background: var(--bg); }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; letter-spacing: -.01em; margin: 0; color: var(--fg); }
h1 { font-size: 20px; line-height: 1.3; }
h2 { font-size: 15px; line-height: 1.4; }
h3 { font-size: 14px; line-height: 1.4; }
p { margin: 0; }
a { color: var(--primary); }
.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* Üst bar */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--border); }
.topbar-in { max-width: 1440px; margin: 0 auto; height: 52px; padding: 0 24px; display: flex; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); font: 600 15px var(--font-head); }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; background: var(--primary); color: #fff; display: grid; place-items: center; }
.brand-mark .icon { width: 15px; height: 15px; }
.topbar .spacer { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); color: var(--fg-2); font-size: 12px; white-space: nowrap; }
.chip .icon { width: 14px; height: 14px; }
.chip.warn { background: var(--warn-soft); border-color: #FDE68A; color: var(--warn); }

/* Sayfa */
.page { max-width: 1440px; margin: 0 auto; padding: 20px 24px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin-top: 4px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 13px; margin-bottom: 6px; min-height: 28px; }
.back:hover { color: var(--fg); }

/* Butonlar */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--card); color: var(--fg); font: 600 13px var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease); }
.btn:hover { background: var(--bg); border-color: var(--subtle); }
.btn:focus-visible, .seg button:focus-visible, input:focus-visible, textarea:focus-visible, .list-item:focus-visible, a:focus-visible { outline: none; box-shadow: var(--ring); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--bg); color: var(--fg); }
.btn.danger-ghost { border-color: transparent; background: transparent; color: var(--danger); }
.btn.danger-ghost:hover { background: var(--danger-soft); }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 12px; }
.btn.sm .icon { width: 14px; height: 14px; }
.btn.icon-only { padding: 0; width: 34px; }
.btn.sm.icon-only { width: 30px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.done { background: var(--ok); border-color: var(--ok); color: #fff; }

/* Segment kontrol */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--border); }
.seg button { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font: 600 12px var(--font); cursor: pointer; transition: background .15s var(--ease), color .15s var(--ease); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--fg); box-shadow: var(--shadow); }
.seg .icon { width: 14px; height: 14px; }

/* Form */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 13px; color: var(--fg-2); }
.field .help { font-size: 12px; color: var(--muted); }
.field .err { font-size: 12px; color: var(--danger); }
input[type=text], input[type=password], input[type=url], input[type=search], textarea {
  width: 100%; min-height: 36px; padding: 7px 11px; border: 1px solid var(--border-strong); border-radius: 8px;
  font: 14px/1.5 var(--font); color: var(--fg); background: #fff; transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input:hover, textarea:hover { border-color: var(--subtle); }
input:focus, textarea:focus { border-color: var(--primary); }
textarea { resize: vertical; min-height: 96px; }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--subtle); pointer-events: none; }
.input-icon input { padding-left: 34px; }

/* Kart */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card-pad { padding: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }

/* Bildirimler */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 1.5; }
.notice .icon { margin-top: 2px; }
.notice.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid #FDE68A; }
.notice.danger { background: var(--danger-soft); color: var(--danger); border: 1px solid #FECACA; }
.notice.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid #A7F3D0; }
.notice.info { background: var(--primary-soft); color: #1E3A8A; border: 1px solid #C7D7FE; }
.notice ul { margin: 4px 0 0; padding-left: 18px; }

.toast-wrap { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); }
.toast { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: var(--radius); background: var(--fg); color: #fff; box-shadow: var(--shadow-lg); font-size: 13px; animation: toast-in .22s var(--ease); }
.toast.err { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* İlerleme */
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(37, 99, 235, .2); border-top-color: var(--primary); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; background: var(--primary-soft); border: 1px solid #C7D7FE; color: #1E3A8A; font-size: 13px; }
.progress strong { font-weight: 600; }

/* Önizleme */
.preview-box { position: relative; overflow: hidden; background: #F5F5F9; border-radius: var(--radius); border: 1px solid var(--border); }
.preview-box iframe { display: block; border: 0; background: #fff; transform-origin: 0 0; }
.preview-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--fg-2); }
.badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--bg); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge.new { background: var(--primary-soft); color: var(--primary-hover); border-color: #C7D7FE; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: #A7F3D0; }

/* Listeler */
.list { display: flex; flex-direction: column; }
.list-item { display: block; width: 100%; text-align: left; padding: 9px 14px; border: 0; border-bottom: 1px solid var(--border); background: transparent; font: inherit; color: inherit; cursor: pointer; transition: background .15s var(--ease); }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--bg); }
.list-item[aria-current="true"] { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.list-item .t { font-size: 13px; color: var(--fg); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.list-item .m { margin-top: 2px; font-size: 11px; color: var(--subtle); display: flex; gap: 8px; flex-wrap: wrap; }
.empty { padding: 20px 14px; text-align: center; color: var(--muted); font-size: 13px; }

.tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--border); }
.tabs button { position: relative; min-height: 38px; padding: 0 8px; border: 0; background: none; font: 600 13px var(--font); color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--fg); }
.tabs button[aria-selected="true"]::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--primary); border-radius: 2px; }
.tabs .count { margin-left: 4px; color: var(--subtle); font-weight: 500; }

details.diff { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
details.diff + details.diff { margin-top: 8px; }
details.diff summary { cursor: pointer; padding: 8px 10px; font-size: 13px; list-style: none; display: flex; gap: 8px; align-items: baseline; }
details.diff summary::-webkit-details-marker { display: none; }
details.diff summary .n { font: 600 12px var(--mono); color: var(--subtle); }
details.diff pre { margin: 0; padding: 8px 10px; font: 11.5px/1.5 var(--mono); white-space: pre-wrap; word-break: break-all; border-top: 1px solid var(--border); max-height: 220px; overflow: auto; }
details.diff pre.del { background: #FEF2F2; color: #7F1D1D; }
details.diff pre.add { background: #F0FDF4; color: #14532D; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .spinner { animation: spin 1.6s linear infinite !important; }
}
@media (max-width: 640px) {
  .topbar-in, .page { padding-left: 16px; padding-right: 16px; }
  .topbar .chip.hide-sm { display: none; }
  h1 { font-size: 18px; }
}
