/* XREPORT — TTPANEL ile aynı estetik: saf siyah zemin, beyaz metin, kırmızı vurgu.
   Mobil-öncelikli, tam responsive. */

:root {
  --accent: #ff3b3b;
  --accent-dim: #d32424;
  --accent-soft: rgba(255, 59, 59, .12);
  --accent-border: rgba(255, 59, 59, .34);
  --ok: #20e37a;
  --warn: #ffb020;
  --err: #ff5a5a;
  --bg: #000;
  --surface-0: #050505;
  --surface-1: #0a0a0a;
  --surface-2: #101010;
  --hover: #161616;
  --border: rgba(255, 255, 255, .10);
  --border-strong: rgba(255, 255, 255, .20);
  --txt: #fff;
  --txt2: #cfcfcf;
  --txt3: #8a8a8a;
  --r: 10px;
  --r-sm: 8px;
  --r-pill: 999px;
  --sidebar-w: 232px;
  --topbar-h: 56px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--txt);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3, h4 { font-weight: 650; letter-spacing: -.01em; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

.app { display: flex; min-height: 100vh; min-height: 100dvh; }

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface-0);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 12px calc(12px + var(--safe-b));
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 60;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 16px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #7a0d0d);
  display: grid; place-items: center; font-weight: 800; font-size: 13px; letter-spacing: .02em;
}
.brand strong { display: block; font-size: 15px; }
.brand small { display: block; font-size: 10.5px; color: var(--txt3); }

.nav { display: flex; flex-direction: column; gap: 3px; flex: 0 0 auto; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 11px; border-radius: var(--r-sm);
  color: var(--txt2); font-size: 13.5px; font-weight: 500;
  text-align: left; transition: background .15s, color .15s;
}
.nav-item svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; flex-shrink: 0; }
.nav-item:hover { background: var(--hover); color: var(--txt); }
.nav-item.active { background: var(--accent-soft); color: #fff; box-shadow: inset 2.5px 0 0 var(--accent); }
.nav-item.active svg { stroke: var(--accent); }

.sidebar-quick { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--border); }
.sidebar-foot {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: var(--txt3); padding: 10px 6px 0;
  border-top: 1px solid var(--border);
}
.sidebar-foot .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.sidebar-foot .dot.err { background: var(--err); box-shadow: 0 0 8px var(--err); }

.overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.6); z-index: 55; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
body.sidebar-open .overlay { display: block; }

/* ---- Content ---- */
.content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(5,5,5,.92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 40;
}
.topbar h1 { font-size: 16px; flex: 1; }
.topbar-right { display: flex; gap: 8px; }
.hamburger {
  display: none; flex-direction: column; justify-content: center; gap: 4px;
  width: 40px; height: 40px; margin-left: -8px;
}
.hamburger span { display: block; width: 20px; height: 2px; background: var(--txt); border-radius: 2px; transition: .25s; }
body.sidebar-open .hamburger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.sidebar-open .hamburger span:nth-child(2) { opacity: 0; }
body.sidebar-open .hamburger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.main { flex: 1; padding: 20px; overflow-x: hidden; }

/* ---- Pieces ---- */
.pill {
  padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 11px; font-weight: 600; color: var(--txt2); white-space: nowrap;
}
.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px;
  margin-bottom: 16px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { font-size: 15px; }
.card-head h3 { font-size: 13.5px; }
.card-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--txt3); }
.text-sm { font-size: 12.5px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mt-12 { margin-top: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 14px; min-height: 38px;
  background: #0c0c0c; color: var(--txt);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500; transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--hover); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn.full { width: 100%; }
.btn.sm { min-height: 32px; padding: 6px 11px; font-size: 12px; }
.btn.xs { min-height: 26px; padding: 3px 8px; font-size: 11px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--accent-dim); }
.btn.ghost { background: transparent; color: var(--txt2); }
.btn.ghost:hover { color: var(--txt); background: var(--hover); }
.btn.danger { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-border); }
.btn.danger:hover { background: var(--accent); color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--txt2); margin-bottom: 6px; }
.input, .field input, .field textarea, .field select {
  width: 100%; padding: 10px 12px;
  background: #030303; color: var(--txt);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  font-size: 14px; outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent-border); box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder { color: var(--txt3); }
textarea.input { resize: vertical; min-height: 120px; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12.5px; line-height: 1.5; }
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-tile { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; }
.stat-tile .label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--txt3); margin-bottom: 6px; }
.stat-tile .value { font-size: 26px; font-weight: 700; line-height: 1; }
.stat-tile .sub { font-size: 11px; color: var(--txt3); margin-top: 5px; }

/* Tablo */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-sm); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead th {
  text-align: left; padding: 10px 12px; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--txt3); border-bottom: 1px solid var(--border);
  background: var(--surface-2); position: sticky; top: 0; white-space: nowrap;
}
.table tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.sel { background: var(--accent-soft); }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: var(--r-pill);
  font-size: 10.5px; font-weight: 600; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--txt2);
}
.badge.ok { color: var(--ok); border-color: rgba(32,227,122,.4); background: rgba(32,227,122,.1); }
.badge.err { color: var(--err); border-color: rgba(255,90,90,.4); background: rgba(255,90,90,.1); }
.badge.warn { color: var(--warn); border-color: rgba(255,176,32,.4); background: rgba(255,176,32,.1); }
.badge.idle { color: var(--txt3); }

input[type="checkbox"] {
  width: 18px; height: 18px; -webkit-appearance: none; appearance: none;
  background: #030303; border: 1.5px solid var(--border-strong); border-radius: 5px;
  cursor: pointer; position: relative; flex-shrink: 0; vertical-align: middle;
}
input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"]:checked::after {
  content: ""; position: absolute; inset: 2px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/contain no-repeat;
}
input[type="radio"] {
  width: 18px; height: 18px; -webkit-appearance: none; appearance: none;
  background: #030303; border: 1.5px solid var(--border-strong); border-radius: 50%;
  cursor: pointer; position: relative; flex-shrink: 0; vertical-align: middle;
}
input[type="radio"]:checked { border-color: var(--accent); }
input[type="radio"]:checked::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); }

.progress { height: 10px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); transition: width .3s var(--ease); border-radius: 6px; }

.reason-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.reason-chip {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: #060606; border: 1px solid var(--border); border-radius: var(--r-sm);
  cursor: pointer; font-size: 13px; transition: border-color .15s, background .15s;
}
.reason-chip:hover { border-color: var(--accent-border); }
.reason-chip.on { border-color: var(--accent); background: var(--accent-soft); }

/* Kılavuz */
.guide h3 { margin: 18px 0 8px; font-size: 15px; }
.guide h3:first-child { margin-top: 0; }
.guide p, .guide li { color: var(--txt2); font-size: 13.5px; margin-bottom: 6px; }
.guide ul, .guide ol { padding-left: 20px; margin-bottom: 10px; }
.guide code { background: var(--surface-2); padding: 2px 6px; border-radius: 5px; font-size: 12px; color: var(--accent); }
.guide .step { display: flex; gap: 12px; margin-bottom: 12px; }
.guide .step .n { width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }

/* Toast */
.toast-stack { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 1200; }
.toast {
  padding: 12px 15px; background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); font-size: 13px; min-width: 240px; max-width: 360px;
  box-shadow: 0 12px 40px rgba(0,0,0,.6); animation: toastIn .25s var(--ease);
  transition: opacity .25s;
}
.toast.ok { border-left: 3px solid var(--ok); }
.toast.err { border-left: 3px solid var(--err); }
.toast.warn { border-left: 3px solid var(--warn); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* Modal */
.modal-back {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  display: grid; place-items: center; z-index: 1000; padding: 20px;
  animation: fadeIn .18s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(680px, 100%); max-height: 88vh; overflow-y: auto;
  background: var(--surface-1); border: 1px solid var(--border-strong);
  border-top: 2px solid var(--accent); border-radius: var(--r); padding: 22px;
  animation: modalIn .25s var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h2 { font-size: 17px; }
.modal-head .x { width: 34px; height: 34px; display: grid; place-items: center; font-size: 22px; color: var(--txt3); border-radius: var(--r-sm); }
.modal-head .x:hover { color: var(--err); background: var(--hover); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* Adım listesi (dashboard + kılavuz ortak) */
.step { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.step:last-child { margin-bottom: 0; }
.step .n {
  width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%;
  background: var(--accent); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 13px; margin-top: 1px;
}
.step > div:last-child { flex: 1; min-width: 0; font-size: 13.5px; color: var(--txt2); line-height: 1.5; }

/* Sol konsol / log paneli */
.console {
  flex: 1 1 auto; min-height: 110px;
  display: flex; flex-direction: column;
  border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; margin-bottom: 8px;
  overflow: hidden;
}
.console-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--txt3);
  padding: 0 4px 6px;
}
.console-head .live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); display: inline-block; margin-right: 5px; box-shadow: 0 0 6px var(--ok); animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .35; } }
.console-clear { font-size: 10px; color: var(--txt3); text-transform: none; letter-spacing: 0; }
.console-clear:hover { color: var(--accent); }
.console-body {
  flex: 1; overflow-y: auto; padding: 4px;
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10.5px; line-height: 1.5;
  background: #020202; border-radius: 6px; border: 1px solid var(--border);
}
.console-line { white-space: pre-wrap; word-break: break-word; padding: 1px 4px; border-bottom: 1px solid rgba(255,255,255,.03); }
.console-line .t { color: var(--txt3); margin-right: 5px; }
.console-line.ok { color: #7dffb0; }
.console-line.err { color: #ff8a8a; }
.console-line.warn { color: #ffd27a; }
.console-line.info { color: #cfcfcf; }
.console-empty { color: var(--txt3); padding: 8px; text-align: center; }

/* Dashboard hero + job list */
.hero {
  display: flex; align-items: center; gap: 16px;
  padding: 20px; margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(255,59,59,.16), rgba(255,59,59,.04)), var(--surface-1);
  border: 1px solid var(--accent-border); border-radius: var(--r);
}
.hero-icon { font-size: 34px; line-height: 1; flex-shrink: 0; }
.hero-body { flex: 1; min-width: 0; }
.hero-title { font-size: 18px; font-weight: 700; }
.hero-sub { font-size: 13px; color: var(--txt2); margin-top: 3px; }
.joblist { display: flex; flex-direction: column; }
.jobrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.jobrow:last-child { border-bottom: none; }

.empty { text-align: center; padding: 40px 20px; color: var(--txt3); }
.empty svg { width: 48px; height: 48px; opacity: .3; margin-bottom: 12px; }

.checkbox-row { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; margin-bottom: 8px; }

/* ---- Mobil ---- */
@media (max-width: 860px) {
  .sidebar { transform: translateX(-102%); transition: transform .28s var(--ease); box-shadow: 12px 0 40px rgba(0,0,0,.7); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .content { margin-left: 0; }
  .hamburger { display: flex; }
  .main { padding: 16px 12px calc(16px + var(--safe-b)); }
  .row, .row-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .topbar { padding: 0 14px; }
  .topbar-right .pill { display: none; }
  .card { padding: 14px; }
  .modal { padding: 16px 14px; max-height: 90vh; max-height: 90dvh; }
  .table-wrap > .table { min-width: 560px; }
  .reason-grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ---- Lisans kapısı ---- */
.license-gate {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: var(--bg, #0d0d0f);
  z-index: 9999;
}
.license-card {
  background: var(--card, #16161a);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 16px;
  padding: 40px;
  max-width: 440px;
  width: 100%;
  text-align: center;
}
.license-icon {
  font-size: 56px;
  margin-bottom: 12px;
}
.license-card h2 {
  margin: 0 0 8px;
  font-size: 22px;
}
.license-sub {
  color: var(--muted, rgba(255,255,255,0.55));
  margin: 0 0 24px;
  font-size: 14px;
}
#licenseKey {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg, #0d0d0f);
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: 10px;
  color: var(--fg, #fff);
  font-size: 16px;
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
  text-align: center;
  margin-bottom: 12px;
  outline: none;
  transition: border-color 0.15s;
}
#licenseKey:focus {
  border-color: var(--accent, #ff3b3b);
}
.license-err {
  color: var(--err, #ff5b5b);
  font-size: 13px;
  margin-top: 12px;
  min-height: 18px;
}
.license-foot {
  margin-top: 24px;
  font-size: 12px;
  color: var(--missing, rgba(255,255,255,0.45));
  line-height: 1.5;
}
.license-foot code {
  background: rgba(255,255,255,0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}
