/* ───────── Kodlazim UI · temel tasarım sistemi ───────── */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --fill: rgba(120, 120, 128, .08);
  --fill-2: rgba(120, 120, 128, .14);
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --line: rgba(0, 0, 0, .08);
  --line-2: rgba(0, 0, 0, .12);
  --accent: #0071e3;
  --accent-2: #0077ed;
  --accent-soft: rgba(0, 113, 227, .1);
  --green: #1f9d55; --green-soft: rgba(52, 199, 89, .14);
  --red: #e5352b; --red-soft: rgba(255, 59, 48, .12);
  --orange: #e57a00; --orange-soft: rgba(255, 149, 0, .14);
  --amber: #b7791f; --amber-soft: rgba(255, 204, 0, .2);
  --purple: #9b45d0; --purple-soft: rgba(175, 82, 222, .13);
  --indigo: #5856d6; --indigo-soft: rgba(88, 86, 214, .12);
  --teal: #12839c; --teal-soft: rgba(48, 176, 199, .14);
  --gray: #6e6e73; --gray-soft: rgba(120, 120, 128, .14);
  --r-sm: 10px; --r: 14px; --r-lg: 20px; --r-xl: 28px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04), 0 1px 1px rgba(0,0,0,.03);
  --shadow: 0 2px 6px rgba(0,0,0,.04), 0 12px 32px rgba(0,0,0,.06);
  --shadow-lg: 0 30px 80px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.06);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.25, .1, .25, 1);
  --spring: cubic-bezier(.2, .9, .3, 1.2);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text);
  background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility; letter-spacing: -.011em;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
::selection { background: rgba(0, 113, 227, .2); }
:focus-visible { outline: 3px solid rgba(0, 113, 227, .45); outline-offset: 2px; border-radius: 6px; }

.i { width: 18px; height: 18px; flex: none; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: 0; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; word-break: break-word; }
.right { text-align: right; }
.center { text-align: center; }
.hide { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack > * + * { margin-top: 12px; }
.stack-lg > * + * { margin-top: 20px; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 16px; } .mt-lg { margin-top: 28px; } .mb { margin-bottom: 16px; }
.green { color: var(--green); } .red { color: var(--red); } .orange { color: var(--orange); } .blue { color: var(--accent); }

/* ───────── Butonlar ───────── */
.btn {
  --h: 40px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h);
  padding: 0 18px; border-radius: 980px; border: 0; cursor: pointer; font-weight: 500; font-size: 15px;
  white-space: nowrap; transition: background .2s var(--ease), transform .15s var(--ease), box-shadow .2s, color .2s;
  text-decoration: none !important; user-select: none;
}
.btn:active { transform: scale(.97); }
.btn .i { width: 17px; height: 17px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); }
.btn-dark { background: var(--text); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-light { background: var(--fill); color: var(--text); }
.btn-light:hover { background: var(--fill-2); }
.btn-white { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }
.btn-outline { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1px currentColor; }
.btn-outline:hover { background: var(--accent-soft); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: rgba(255,59,48,.2); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { filter: brightness(1.06); }
.btn-link { background: none; color: var(--accent); padding: 0 6px; }
.btn-link:hover { text-decoration: underline !important; }
.btn-sm { --h: 32px; padding: 0 14px; font-size: 13px; }
.btn-lg { --h: 50px; padding: 0 26px; font-size: 17px; }
.btn-block { width: 100%; }
.btn-icon { width: var(--h); padding: 0; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ───────── Formlar ───────── */
.field { display: block; }
.field + .field { margin-top: 16px; }
.label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 7px; }
.label em { font-style: normal; font-weight: 400; color: var(--text-3); }
.hint { font-size: 12.5px; color: var(--text-3); margin-top: 6px; }
.input, .select, .textarea {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--line-2); outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
  font-size: 15px;
}
.textarea { height: auto; min-height: 120px; padding: 12px 14px; resize: vertical; line-height: 1.55; }
.select { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2386868b' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.input:hover, .select:hover, .textarea:hover { border-color: rgba(0,0,0,.2); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(0,113,227,.14); }
.input-group { position: relative; }
.input-group .input { padding-left: 40px; }
.input-group > .i, .input-group > .adorn { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-group .suffix { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 14px; pointer-events: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 .field + .field, .grid-3 .field + .field { margin-top: 0; }

.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 2px 0 0; flex: none; }

/* chip seçimleri */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-check { position: relative; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 980px;
  background: var(--surface); border: 1px solid var(--line-2); font-size: 14px; cursor: pointer;
  transition: all .18s var(--ease); user-select: none;
}
.chip-check span:hover { border-color: rgba(0,0,0,.25); }
.chip-check input:checked + span { background: var(--text); border-color: var(--text); color: #fff; }
.chip-check input:focus-visible + span { box-shadow: 0 0 0 4px rgba(0,113,227,.25); }

/* toggle */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; cursor: pointer; }
.switch + .switch { border-top: 1px solid var(--line); }
.switch input { appearance: none; width: 51px; height: 31px; border-radius: 31px; background: var(--fill-2); position: relative; cursor: pointer; transition: background .25s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.16); transition: transform .3s var(--spring); }
.switch input:checked { background: #34c759; }
.switch input:checked::after { transform: translateX(20px); }
.switch b { display: block; font-weight: 500; font-size: 15px; }
.switch small { display: block; color: var(--text-3); font-size: 13px; }

/* ───────── Kartlar ───────── */
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.card-pad { padding: 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 17px; font-weight: 600; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; }
.card-head h3 .i { color: var(--text-3); }
.card-body { padding: 24px; }
.card-foot { padding: 16px 24px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }

/* ───────── Rozetler ───────── */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 980px; font-size: 12px; font-weight: 600; white-space: nowrap; letter-spacing: 0; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge-blue { background: var(--accent-soft); color: var(--accent); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-orange { background: var(--orange-soft); color: var(--orange); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-purple { background: var(--purple-soft); color: var(--purple); }
.badge-indigo { background: var(--indigo-soft); color: var(--indigo); }
.badge-teal { background: var(--teal-soft); color: var(--teal); }
.badge-gray { background: var(--gray-soft); color: var(--gray); }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 8px; background: var(--fill); color: var(--text-2); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.tag .i { width: 14px; height: 14px; }
.verified { color: var(--accent); display: inline-flex; }
.verified .i { width: 16px; height: 16px; }

/* ───────── Avatar ───────── */
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 14px; color: #fff; flex: none; background: linear-gradient(135deg, #5e5ce6, #0a84ff); letter-spacing: 0; }
.avatar.anon { background: linear-gradient(135deg, #3a3a3c, #636366); }
.avatar.staff { background: linear-gradient(135deg, #1d1d1f, #48484a); }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person b { display: flex; align-items: center; gap: 5px; font-weight: 600; font-size: 15px; }
.person small { display: block; color: var(--text-3); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.stars { display: inline-flex; gap: 1px; color: #ff9f0a; vertical-align: -2px; }
.stars .i { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.stars .off { color: rgba(0,0,0,.14); }

/* ───────── Uyarı / flash ───────── */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); font-size: 14px; line-height: 1.5; }
.alert .i { margin-top: 1px; }
.alert b { font-weight: 600; }
.alert-info { background: var(--accent-soft); color: #00478f; }
.alert-success { background: var(--green-soft); color: #13663a; }
.alert-error { background: var(--red-soft); color: #a1170e; }
.alert-warn { background: var(--orange-soft); color: #8a4a00; }
.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; width: min(520px, calc(100% - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: center; padding: 14px 16px 14px 18px; border-radius: 16px; background: rgba(29,29,31,.92); color: #fff; backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); box-shadow: var(--shadow-lg); font-size: 14px; animation: toastIn .5s var(--spring); }
.toast .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.toast .dot .i { width: 14px; height: 14px; stroke-width: 2.6; }
.toast.success .dot { background: #34c759; }
.toast.error .dot { background: #ff3b30; }
.toast button { margin-left: auto; background: none; border: 0; color: rgba(255,255,255,.6); cursor: pointer; padding: 4px; }
.toast.out { animation: toastOut .35s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-12px) scale(.97); } }

/* ───────── Tablo ───────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .t-title { font-weight: 600; color: var(--text); display: block; }
.table a.t-title:hover { color: var(--accent); }
.table .t-sub { color: var(--text-3); font-size: 12.5px; }

/* ───────── Dialog (sheet) ───────── */
dialog.sheet { border: 0; padding: 0; border-radius: 22px; width: min(520px, calc(100% - 32px)); background: var(--surface); box-shadow: var(--shadow-lg); color: var(--text); }
dialog.sheet[open] { animation: sheetIn .4s var(--spring); }
dialog.sheet::backdrop { background: rgba(0,0,0,.32); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.sheet-head { padding: 22px 24px 0; }
.sheet-head h3 { font-size: 20px; }
.sheet-head p { color: var(--text-2); font-size: 14px; margin-top: 6px; }
.sheet-body { padding: 20px 24px; }
.sheet-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 0 24px 22px; }
@keyframes sheetIn { from { opacity: 0; transform: translateY(20px) scale(.97); } }

/* ───────── Boş durum ───────── */
.empty { text-align: center; padding: 48px 24px; }
.empty .em-ico { width: 56px; height: 56px; border-radius: 16px; background: var(--fill); display: grid; place-items: center; margin: 0 auto 14px; color: var(--text-3); }
.empty .em-ico .i { width: 26px; height: 26px; }
.empty h4 { font-size: 17px; font-weight: 600; }
.empty p { color: var(--text-2); font-size: 14px; margin-top: 4px; max-width: 380px; margin-inline: auto; }
.empty .btn { margin-top: 18px; }

/* ───────── Reveal animasyonu ───────── */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; } .reveal.d3 { transition-delay: .24s; } .reveal.d4 { transition-delay: .32s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

@media (max-width: 720px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-2 .field + .field, .grid-3 .field + .field { margin-top: 16px; }
  .card-pad, .card-body { padding: 18px; }
  .card-head { padding: 16px 18px; }
}
