:root {
  --ink: #14161b; --ink-2: #4a4f5a; --muted: #8a909c; --line: #e7e3da;
  --paper: #fff; --canvas: #f7f5f0; --gold: #b8913f; --gold-2: #d9b968; --gold-soft: #f6eedb;
  --ok: #15803d; --ok-soft: #e8f5ec; --warn: #b45309; --warn-soft: #fff7e6; --err: #b91c1c; --err-soft: #fdecec;
  --ty: #f27a1a; --wc: #7f54b3;
  --r: 14px;
  font-family: "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  color: var(--ink); background: var(--canvas); font-size: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0; }
h3 { margin: 0 0 6px; }
.muted { color: var(--muted); margin: 0; }
.r { text-align: right; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; }
.link { color: var(--gold); text-decoration: none; font-weight: 600; font-size: 13px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 10px;
  border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s; }
.btn--gold { background: var(--ink); color: #fff; }
.btn--gold:hover { background: #000; }
.btn--ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--gold); }
.btn--sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: wait; }
.btn:focus-visible, input:focus-visible, .seg button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Brand */
.brand { display: flex; align-items: center; gap: 10px; font-size: 16px; letter-spacing: -.01em; }
.brand b { color: var(--gold-2); }
.brand__dot { width: 12px; height: 12px; border-radius: 4px; background: linear-gradient(135deg, var(--gold-2), var(--gold)); }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center;
  background: radial-gradient(700px 300px at 70% 0%, rgba(217,185,104,.25), transparent 60%), linear-gradient(135deg, #15171c, #23262e); }
.login__card { width: 360px; background: #fff; border-radius: 18px; padding: 28px; display: grid; gap: 10px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.login__card .brand b { color: var(--gold); }
.login__card label { font-weight: 600; margin-top: 8px; }
.err { color: var(--err); margin: 0; min-height: 18px; font-size: 13px; }
input[type=password], input[type=text], input[type=number], input[type=search] {
  height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font: inherit; background: #fff; color: var(--ink); }
input:focus { border-color: var(--gold); outline: 0; box-shadow: 0 0 0 3px rgba(184,145,63,.15); }

/* Layout */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #fff; padding: 22px 16px; display: flex; flex-direction: column; gap: 26px; position: sticky; top: 0; height: 100vh; }
.nav { display: grid; gap: 2px; }
.nav a { color: #c9ccd3; text-decoration: none; padding: 10px 12px; border-radius: 10px; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.is-on { background: rgba(217,185,104,.14); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.side__foot { margin-top: auto; display: grid; gap: 10px; }
.side__foot .btn--ghost { background: transparent; color: #c9ccd3; border-color: rgba(255,255,255,.15); }
.pulse { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #9aa0ab; }
.pulse span { width: 8px; height: 8px; border-radius: 50%; background: #6b7180; }
.pulse.is-ok span { background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.15); }
.pulse.is-err span { background: #ef4444; box-shadow: 0 0 0 4px rgba(239,68,68,.15); }
.pulse.is-run span { background: var(--gold-2); animation: blink 1s infinite; }
.pulse em { font-style: normal; }
@keyframes blink { 50% { opacity: .3; } }
.main { padding: 28px 32px 60px; min-width: 0; }
@media (max-width: 860px) { .app { grid-template-columns: 1fr; } .side { position: static; height: auto; } .main { padding: 18px; } }

.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.head__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Cards & KPIs */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.card--flush { padding: 0; overflow: auto; }
.card__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.kpi small { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.kpi strong { display: block; font-size: 28px; margin-top: 6px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 12.5px; color: var(--ink-2); }
.kpi--warn strong { color: var(--warn); }
.kpi--err strong { color: var(--err); }
.cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; }
@media (max-width: 1100px) { .cols { grid-template-columns: 1fr; } }

.setup { background: var(--warn-soft); border: 1px solid #fde3b0; color: #7c4a03; border-radius: var(--r); padding: 14px 18px; margin-bottom: 18px; line-height: 1.6; }
.setup b { color: #5c3602; }

/* Lists */
.row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row__main { flex: 1; min-width: 0; }
.row__main div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__main small { color: var(--muted); }
.delta { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.delta.neg { color: var(--err); } .delta.pos { color: var(--ok); }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }

/* Toolbar */
.toolbar { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.toolbar input[type=search] { flex: 1; min-width: 220px; max-width: 420px; }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; padding: 7px 12px; border-radius: 7px; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg button.is-on { background: var(--ink); color: #fff; }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #fcfbf8; position: sticky; top: 0; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid #f0ede6; vertical-align: middle; }
.tbl tr:hover td { background: #fcfbf8; }
.tbl td.r, .tbl th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .name { max-width: 360px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.num-big { font-weight: 700; font-size: 15px; }
.diff { color: var(--warn); font-weight: 700; }
.na { color: #c7c3ba; }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.pill--ok { background: var(--ok-soft); color: var(--ok); }
.pill--warn { background: var(--warn-soft); color: var(--warn); }
.pill--err { background: var(--err-soft); color: var(--err); }
.pill--muted { background: #f1f0ec; color: var(--ink-2); }
.pill--gold { background: var(--gold-soft); color: #8a6a24; }
.ch { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12.5px; }
.ch::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.ch--ty { color: var(--ty); } .ch--wc { color: var(--wc); }

/* Logs */
.logs { font-size: 13px; }
.log { display: grid; grid-template-columns: 150px 60px 1fr; gap: 12px; padding: 9px 16px; border-bottom: 1px solid #f0ede6; }
.log time { color: var(--muted); font-variant-numeric: tabular-nums; }
.log--error { background: #fffafa; } .log--warn { background: #fffdf7; }

/* Dialog */
.dlg { border: 0; border-radius: 18px; padding: 24px; width: min(440px, 92vw); box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.dlg--wide { width: min(760px, 94vw); }
.dlg::backdrop { background: rgba(20,22,27,.5); backdrop-filter: blur(2px); }
.dlg form { display: grid; gap: 8px; }
.dlg label { font-weight: 600; margin-top: 6px; }
.dlg__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.dlg__moves { max-height: 180px; overflow: auto; margin-top: 8px; font-size: 12.5px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 20px; margin: 12px 0 16px; }
.kv small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-weight: 500; z-index: 10; }
.toast.is-err { background: var(--err); }

/* ---- Lisans paneline özel ---- */
.key { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-weight: 700; letter-spacing: .04em; font-size: 13px; }
.copy { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 2px 4px; border-radius: 6px; }
.copy:hover { color: var(--gold); background: var(--gold-soft); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: grid; gap: 6px; font-weight: 600; font-size: 13px; }
.form-grid input, .form-grid select, .form-grid textarea {
  height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font: inherit; background: #fff; color: var(--ink); font-weight: 400; }
.form-grid textarea { height: 70px; padding: 10px 12px; resize: vertical; }
.form-grid select:focus, .form-grid textarea:focus { border-color: var(--gold); outline: 0; box-shadow: 0 0 0 3px rgba(184,145,63,.15); }
.hint { color: var(--muted); font-size: 12px; font-weight: 400; }
.tabs2 { display: inline-flex; gap: 6px; }
.issued { margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--gold-soft); border: 1px solid var(--gold-2); display: grid; gap: 6px; }
.issued .key { font-size: 16px; }
.products { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 14px; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 14px; }
.actions-row input { width: 90px; height: 30px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font: inherit; }
.sec-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: 16px 0 8px; }
.tbl--compact td, .tbl--compact th { padding: 8px 10px; }
