/* SağlamDosya — tema ve bileşenler */
:root {
  --bg: #f5f7fb;
  --bg-2: #eef1f7;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e8f0;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #64748b;
  --brand: #4f46e5;
  --brand-2: #0ea5e9;
  --brand-ink: #ffffff;
  --brand-soft: #eef2ff;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --bad: #dc2626;
  --bad-soft: #fef2f2;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(15, 23, 42, .12);
  --shadow-lg: 0 12px 40px -12px rgba(79, 70, 229, .25);
  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] { --bg:#0b1020; --bg-2:#0f1629; --surface:#121a2f; --surface-2:#182238; --border:#243049; --text:#e6eaf2; --text-2:#b6bfd1; --muted:#8a94ab; --brand:#7c7ff5; --brand-2:#38bdf8; --brand-soft:#1d2246; --ok:#34d399; --ok-soft:#0f2a22; --warn:#fbbf24; --warn-soft:#2d2410; --bad:#f87171; --bad-soft:#2f1515; --shadow:0 1px 2px rgba(0,0,0,.4), 0 10px 30px -14px rgba(0,0,0,.6); --shadow-lg:0 12px 40px -12px rgba(124,127,245,.35); color-scheme: dark; }
}
:root[data-theme="dark"] { --bg:#0b1020; --bg-2:#0f1629; --surface:#121a2f; --surface-2:#182238; --border:#243049; --text:#e6eaf2; --text-2:#b6bfd1; --muted:#8a94ab; --brand:#7c7ff5; --brand-2:#38bdf8; --brand-soft:#1d2246; --ok:#34d399; --ok-soft:#0f2a22; --warn:#fbbf24; --warn-soft:#2d2410; --bad:#f87171; --bad-soft:#2f1515; --shadow:0 1px 2px rgba(0,0,0,.4), 0 10px 30px -14px rgba(0,0,0,.6); --shadow-lg:0 12px 40px -12px rgba(124,127,245,.35); color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.55; font-size: 15.5px; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
p { margin: 0 0 1rem; }
code, .mono { font-family: var(--mono); font-size: .92em; }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: .05em .4em; }
.muted { color: var(--muted); }
.small { font-size: .9em; }
.tiny { font-size: .8em; }
.strong { font-weight: 600; color: var(--text); }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.r { text-align: right; }
.mt { margin-top: 2.5rem; }
.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.section { padding: 2rem 0 3rem; }
.section-title { font-size: 1.25rem; font-weight: 700; margin: 1.75rem 0 1rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.h-sm { font-size: 1.05rem; font-weight: 700; margin: 1.25rem 0 .75rem; }
.h-xs { font-size: .95rem; font-weight: 700; margin: 0 0 .5rem; }

/* üst çubuk */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--border); }
.topbar-in { display: flex; align-items: center; gap: 1rem; height: 62px; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 800; font-size: 1.1rem; letter-spacing: -.02em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: var(--shadow-lg); }
.search { flex: 1; display: flex; align-items: center; gap: .5rem; max-width: 520px; margin-inline: auto; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 0 .9rem; height: 40px; color: var(--muted); transition: border-color .15s, box-shadow .15s; }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.search input { flex: 1; border: 0; background: transparent; color: var(--text); font: inherit; outline: none; min-width: 0; }
.topnav { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
.ico-moon { display: none; }
:root[data-theme="dark"] .ico-moon { display: block; }
:root[data-theme="dark"] .ico-sun { display: none; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .ico-moon { display: block; } :root[data-theme="auto"] .ico-sun { display: none; } }

/* düğmeler */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .6rem 1.1rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; transition: transform .12s, box-shadow .15s, background .15s; white-space: nowrap; }
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 70%, var(--brand-2))); color: var(--brand-ink); border-color: transparent; box-shadow: var(--shadow-lg); }
.btn-primary:hover { background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 88%, black), var(--brand)); filter: saturate(1.1); }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--bad); color: #fff; border-color: transparent; }
.btn-block { width: 100%; }
.btn-lg { padding: .85rem 1.2rem; font-size: 1.05rem; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--bad); }

/* hero */
.hero { position: relative; overflow: hidden; background: radial-gradient(1200px 500px at 10% -10%, color-mix(in srgb, var(--brand) 28%, transparent), transparent 60%), radial-gradient(900px 400px at 95% 0%, color-mix(in srgb, var(--brand-2) 24%, transparent), transparent 60%), var(--bg-2); border-bottom: 1px solid var(--border); }
.hero-in { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: center; padding: 3.5rem 0 3rem; }
.hero h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; letter-spacing: -.03em; background: linear-gradient(90deg, var(--text), color-mix(in srgb, var(--text) 60%, var(--brand))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.15rem; color: var(--text-2); max-width: 46ch; }
.hero-search { display: flex; gap: .5rem; max-width: 560px; margin-top: 1.4rem; }
.hero-search input { flex: 1; height: 48px; padding: 0 1rem; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 1rem; outline: none; box-shadow: var(--shadow); }
.hero-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.stat { background: color-mix(in srgb, var(--surface) 75%, transparent); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; text-align: center; backdrop-filter: blur(6px); }
.stat-v { font-size: 1.3rem; white-space: nowrap; font-weight: 800; letter-spacing: -.02em; }
.stat-l { font-size: .8rem; color: var(--muted); }

/* çipler */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: .25rem 0 .5rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: .9rem; font-weight: 500; }
.chip:hover { text-decoration: none; border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip-n { font-size: .75em; opacity: .7; }

/* kartlar */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1rem; }
.grid-featured { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); margin-bottom: .5rem; }
.card { display: flex; flex-direction: column; gap: .5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.15rem; color: var(--text); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s; min-height: 150px; }
.card-sm { min-height: 0; }
.card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.card h3 { font-size: 1.02rem; font-weight: 700; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-top { display: flex; align-items: center; gap: .5rem; }
.card-date { margin-left: auto; font-size: .8rem; }
.card-desc { color: var(--text-2); font-size: .9rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta span { white-space: nowrap; }
.card-meta { display: flex; flex-wrap: wrap; gap: .3rem .45rem; align-items: center; color: var(--muted); font-size: .86rem; margin-top: auto; padding-top: .25rem; }
.card-featured { background: linear-gradient(160deg, var(--brand-soft), var(--surface) 65%); }
.file-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); flex: none; }
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: .74rem; font-weight: 600; letter-spacing: .01em; }
.badge-accent { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 2rem; }
.empty { text-align: center; padding: 3.5rem 1rem; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius); }
.empty p { margin: .75rem 0 1rem; }
.err-code { font-size: 3rem; font-weight: 800; color: var(--brand); }

/* dosya sayfası */
.crumbs { display: flex; gap: .5rem; font-size: .9rem; color: var(--muted); margin-bottom: 1rem; flex-wrap: wrap; }
.item-grid { display: grid; grid-template-columns: 1fr 340px; gap: 1.5rem; align-items: start; }
.item-title { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; letter-spacing: -.02em; }
.item-meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; color: var(--muted); font-size: .9rem; margin-bottom: 1rem; }
.item-desc { white-space: pre-line; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.15rem; margin-bottom: 1rem; }
.parts { display: flex; flex-direction: column; gap: .5rem; }
.part { display: flex; align-items: center; gap: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .75rem 1rem; }
.part-info { min-width: 0; flex: 1; }
.part-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.part-sub { font-size: .85rem; }
.btn-dl { flex: none; }
.item-side { position: sticky; top: 78px; display: flex; flex-direction: column; gap: 1rem; }
.side-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.side-row { display: flex; justify-content: space-between; padding: .4rem 0; border-bottom: 1px solid var(--border); font-size: .93rem; }
.side-row:last-of-type { border-bottom: 0; margin-bottom: .75rem; }
.side-card .tiny { margin: .75rem 0 0; }
.tips { margin: 0; padding-left: 1.1rem; color: var(--text-2); font-size: .88rem; }
.tips li { margin-bottom: .35rem; }

/* uyarılar */
.flashes { margin-top: 1rem; }
.flash { padding: .7rem 1rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); margin-bottom: .5rem; font-size: .93rem; }
.flash-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.flash-err { background: var(--bad-soft); color: var(--bad); border-color: transparent; }

.footer { border-top: 1px solid var(--border); padding: 1.5rem 0; color: var(--muted); font-size: .86rem; margin-top: 2rem; }
.footer-in { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* formlar */
.form label { display: flex; flex-direction: column; gap: .3rem; font-size: .88rem; font-weight: 600; color: var(--text-2); margin-bottom: .9rem; }
.form input:not([type=checkbox]), .form select, .form textarea, .inline-form input, .inline-form select { font: inherit; font-size: .95rem; padding: .55rem .75rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); outline: none; width: 100%; }
.form input:focus, .form select:focus, .form textarea:focus, .inline-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.form textarea { resize: vertical; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-end; }
.form-row > label { flex: 1 1 200px; }
.form-row > label.grow { flex: 3 1 300px; }
.form label.check { flex-direction: row; align-items: center; gap: .5rem; font-weight: 500; }
.inline-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.inline-form input { width: auto; }
.inline-form .grow { flex: 1; min-width: 200px; }
.inline { display: inline; }
.w-xs { width: 70px !important; }
.w-sm { width: 110px !important; }
.login-card { max-width: 400px; margin: 3rem auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow-lg); }
.login-card h1 { font-size: 1.4rem; margin-bottom: 1.25rem; }

/* yönetim */
.admin-wrap { display: grid; grid-template-columns: 210px 1fr; gap: 2rem; padding: 1.5rem 0 3rem; align-items: start; }
.admin-nav { position: sticky; top: 78px; display: flex; flex-direction: column; gap: .15rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem; }
.admin-nav a, .admin-nav .link-btn { display: block; padding: .55rem .8rem; border-radius: 9px; color: var(--text-2); font-weight: 500; text-align: left; width: 100%; }
.admin-nav a:hover { background: var(--surface-2); text-decoration: none; }
.admin-nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.admin-nav form { border-top: 1px solid var(--border); margin-top: .3rem; padding-top: .3rem; }
.admin-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 1rem; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.admin-head .admin-title { margin-bottom: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow); }
.tile-l { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.tile-v { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; margin: .15rem 0; }
.tile-s { font-size: .82rem; color: var(--muted); }
.meter { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-top: .5rem; border: 1px solid var(--border); }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.meter.sm { display: inline-block; width: 120px; vertical-align: middle; margin: 0 .4rem 0 0; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem 1.25rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.panel .h-sm { margin-top: .25rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .5rem .6rem; border-bottom: 1px solid var(--border); }
.table td.nw, .table td.r { white-space: nowrap; }
.table td { padding: .55rem .6rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table input:not([type=checkbox]) { width: 100%; }
.table.kv td:first-child { color: var(--muted); width: 140px; }
.row-dim { opacity: .55; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 90px; padding-top: .5rem; }
.bar { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.bar span { display: block; width: 100%; min-height: 2px; background: linear-gradient(180deg, var(--brand-2), var(--brand)); border-radius: 3px 3px 0 0; }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); }
.steps { padding-left: 1.2rem; color: var(--text-2); }
.steps li { margin-bottom: .5rem; }
pre.code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: .9rem 1rem; overflow: auto; font-family: var(--mono); font-size: .85rem; line-height: 1.5; }
.copy.done { color: var(--ok); }

@media (max-width: 900px) {
  .hero-in { grid-template-columns: 1fr; padding: 2.5rem 0 2rem; }
  .item-grid { grid-template-columns: 1fr; }
  .item-side { position: static; }
  .admin-wrap { grid-template-columns: 1fr; }
  .admin-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .admin-nav form { border: 0; margin: 0; padding: 0; }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .search { display: none; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); gap: .5rem; }
  .stat-v { font-size: 1.1rem; }
  .part { flex-direction: column; align-items: stretch; }
  .btn-dl { width: 100%; }
}
