:root {
  --bg: #f4f6fb; --panel: #fff; --ink: #0f172a; --muted: #64748b; --line: #e2e8f0; --brand: #1d4ed8; --brand2: #2563eb;
  --soft: #eef2ff; --green: #15803d; --amber: #b45309; --red: #b91c1c; --chip: #f1f5f9;
  --r: 10px; --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 14px rgba(15, 23, 42, .05);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b1220; --panel: #111a2e; --ink: #e5e9f2; --muted: #94a3b8; --line: #23304a; --brand: #60a5fa; --brand2: #3b82f6;
    --soft: #16213a; --green: #4ade80; --amber: #fbbf24; --red: #f87171; --chip: #1b2742; --shadow: none; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: var(--ink); }
body.noscroll { overflow: hidden; }
a { color: var(--brand); }
h2 { font-size: 1.35rem; margin: .2rem 0 .8rem; }
h3 { font-size: 1.02rem; margin: 1rem 0 .4rem; }
.hide { display: none !important; }
.muted { color: var(--muted); }
.sm { font-size: .85rem; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.b { font-weight: 600; }
.r { text-align: right; }
.nowrap { white-space: nowrap; }

/* üst bar */
.top { position: sticky; top: 0; z-index: 20; background: var(--panel); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
.brand { display: flex; gap: .6rem; align-items: center; padding: .55rem 1rem 0; max-width: 1280px; margin: auto; }
.brand b { font-size: 1.05rem; display: block; line-height: 1.1; }
.brand small { color: var(--muted); font-size: .78rem; }
.tabs { display: flex; gap: .2rem; overflow-x: auto; padding: .35rem .8rem 0; max-width: 1280px; margin: auto; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: .55rem .8rem .6rem; font: inherit; color: var(--muted); cursor: pointer; white-space: nowrap; border-bottom: 3px solid transparent; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.pill { background: var(--brand); color: #fff; border-radius: 99px; padding: 0 .45rem; font-size: .75rem; }

main { max-width: 1280px; margin: auto; padding: 1rem; min-height: 70vh; }
.pane { display: none; }
.pane.on { display: block; }
.lead { color: var(--muted); margin: .2rem 0 .9rem; max-width: 900px; }
footer { text-align: center; color: var(--muted); font-size: .82rem; padding: 1.5rem 1rem 2rem; }

/* form */
input, select, button, .btn { font: inherit; }
input, select { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .6rem; min-height: 40px; max-width: 100%; }
input:focus, select:focus { outline: 2px solid var(--brand2); outline-offset: -1px; }
button, .btn { cursor: pointer; border-radius: 8px; padding: .5rem .9rem; border: 1px solid var(--line); background: var(--panel); color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; min-height: 40px; }
button:disabled { opacity: .45; cursor: default; }
.primary { background: var(--brand2); color: #fff; border-color: var(--brand2); font-weight: 600; }
.ghost:hover { background: var(--soft); }
.danger { color: var(--red); }
button.sm, .btn.sm { padding: .25rem .55rem; min-height: 30px; font-size: .85rem; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .6rem; }
.filters input[type=search] { flex: 1 1 260px; }
.filters input[type=number] { width: 150px; }
.chk { display: inline-flex; gap: .4rem; align-items: center; cursor: pointer; }
.chk input { min-height: auto; width: 18px; height: 18px; }
.chk.warn { background: var(--soft); padding: .6rem .7rem; border-radius: 8px; margin: .6rem 0; align-items: flex-start; }
.seg { display: inline-flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .7rem; }
.seg button { border-radius: 99px; }
.seg button.on { background: var(--brand2); color: #fff; border-color: var(--brand2); }

.status { min-height: 1.4rem; margin: .3rem 0 .6rem; color: var(--muted); font-size: .92rem; }
.status.busy::before { content: ""; display: inline-block; width: 12px; height: 12px; border: 2px solid var(--brand2); border-right-color: transparent; border-radius: 50%; margin-right: .45rem; vertical-align: -1px; animation: spin .8s linear infinite; }
.status.err { color: var(--red); }
@keyframes spin { to { transform: rotate(360deg); } }

/* kartlar */
.cards { display: grid; gap: .7rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: .85rem 1rem; box-shadow: var(--shadow); }
.card h3 { margin: .3rem 0 .35rem; font-size: 1.02rem; line-height: 1.35; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--brand); }
.ch { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.type { color: var(--muted); font-size: .8rem; margin-left: auto; }
.meta { display: flex; flex-wrap: wrap; gap: .25rem 1rem; color: var(--muted); font-size: .88rem; }
.reqs { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.req { background: var(--chip); border-radius: 6px; padding: .12rem .45rem; font-size: .82rem; }
.acts { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.badge { font-size: .75rem; padding: .08rem .5rem; border-radius: 99px; font-weight: 600; color: #fff; }
.badge.green { background: #16a34a; } .badge.amber { background: #d97706; } .badge.red { background: #dc2626; }
.badge.gray { background: #64748b; } .badge.blue { background: #2563eb; }
.code { font-family: ui-monospace, Consolas, monospace; background: var(--soft); border-radius: 4px; padding: 0 .3rem; cursor: help; font-size: .82rem; white-space: nowrap; }

/* tablolar */
.tablewrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.tablewrap:empty, .tablewrap:has(table:empty) { display: none; }
table.grid { width: 100%; border-collapse: collapse; font-size: .88rem; }
.grid th { position: sticky; top: 0; background: var(--soft); text-align: left; font-weight: 600; padding: .5rem .55rem; white-space: nowrap; }
.grid td { padding: .45rem .55rem; border-top: 1px solid var(--line); vertical-align: top; }
.grid tr:hover td { background: color-mix(in srgb, var(--soft) 55%, transparent); }
.grid tr.blocked td { opacity: .55; }
.star { border: 0; background: none; font-size: 1.2rem; color: var(--muted); padding: 0 .2rem; min-height: auto; }
.star.on { color: #eab308; }
.bar { display: inline-block; width: 52px; height: 7px; background: var(--chip); border-radius: 9px; overflow: hidden; vertical-align: middle; }
.bar i { display: block; height: 100%; width: 0; }
.bar.g i { background: #16a34a; } .bar.a i { background: #d97706; } .bar.r i { background: #dc2626; }
.warnTxt { color: var(--amber); font-size: .8rem; }
.errTxt { color: var(--red); font-size: .8rem; }

.pager { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin: .8rem 0; }
.pager button { min-height: 34px; padding: .2rem .65rem; }
.pager button.on { background: var(--brand2); color: #fff; border-color: var(--brand2); }

/* bilgilerim */
.me { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: .8rem 1rem; margin-bottom: .8rem; box-shadow: var(--shadow); }
.me .row { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: flex-end; margin-bottom: .5rem; }
.me label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; color: var(--muted); position: relative; }
.me label.chk { flex-direction: row; color: var(--ink); }
.me label.grow { flex: 1 1 100%; }
.codes { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.codes input[type=search] { flex: 1 1 240px; }
.chip { background: var(--soft); color: var(--ink); border-radius: 99px; padding: .2rem .25rem .2rem .65rem; display: inline-flex; align-items: center; gap: .2rem; font-size: .85rem; }
.chip button { border: 0; background: none; min-height: auto; padding: 0 .35rem; color: var(--muted); }
.suggest { position: absolute; top: 100%; left: 0; right: 0; z-index: 15; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; max-height: 300px; overflow: auto; box-shadow: 0 10px 30px rgba(0, 0, 0, .15); }
.suggest button { display: block; width: 100%; text-align: left; border: 0; border-radius: 0; border-bottom: 1px solid var(--line); min-height: auto; padding: .45rem .7rem; }
.suggest button:hover { background: var(--soft); }
.suggest div { padding: .5rem .7rem; }
.hint { color: var(--muted); font-size: .82rem; margin: .3rem 0 0; }

/* simülasyon sonucu */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: .9rem 1rem; margin-bottom: .8rem; box-shadow: var(--shadow); }
.panel.sum { display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: center; }
.big { text-align: center; min-width: 210px; padding: .6rem 1rem; border-radius: var(--r); background: var(--soft); }
.big small, .big span { display: block; color: var(--muted); font-size: .8rem; }
.big b { font-size: 2.6rem; line-height: 1.15; }
.big.g b { color: var(--green); } .big.a b { color: var(--amber); } .big.r b { color: var(--red); }
.facts { flex: 1 1 380px; }
.facts p { margin: .25rem 0; }
.sens { display: inline-block; background: var(--chip); border-radius: 6px; padding: .05rem .45rem; margin: .1rem .2rem .1rem 0; font-size: .85rem; }
.warns { margin: .2rem 0; padding-left: 1.1rem; }
.warns li { margin: .25rem 0; }

/* modal + balon */
.modal { position: fixed; inset: 0; background: rgba(2, 6, 23, .55); z-index: 50; display: flex; justify-content: center; align-items: flex-start; padding: 4vh 1rem; overflow: auto; }
.modal .box { background: var(--panel); border-radius: 12px; max-width: 860px; width: 100%; padding: 1.2rem 1.3rem; position: relative; }
.modal .x { position: absolute; top: .6rem; right: .6rem; border: 0; min-height: auto; }
ul.plain { padding-left: 1.1rem; }
pre.text, pre.disclaimer { white-space: pre-wrap; word-break: break-word; background: var(--soft); padding: .8rem; border-radius: 8px; font: .85rem/1.5 system-ui, sans-serif; max-height: 60vh; overflow: auto; }
.tip { position: absolute; z-index: 60; max-width: 380px; background: #0f172a; color: #f8fafc; font-size: .82rem; padding: .4rem .6rem; border-radius: 6px; pointer-events: none; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
.prose { max-width: 860px; }
.prose li { margin: .3rem 0; }

@media (max-width: 640px) {
  main { padding: .7rem; }
  .brand small { display: none; }
  .filters > * { flex: 1 1 calc(50% - .5rem); min-width: 0; width: 0; }
  .filters .chk { width: auto; }
  .filters input[type=search] { flex-basis: 100%; }
  .filters input[type=number] { width: auto; }
  .big b { font-size: 2.1rem; }
  .grid { font-size: .82rem; }
}
