/* XML Merkezi - pure black premium theme (dark only) */
:root {
  color-scheme: dark;

  /* surfaces */
  --bg: #000000;
  --card: #0b0b0c;          /* panels, cards */
  --raised: #121214;        /* inputs, code, inset blocks */
  --hover: #19191c;         /* hover on raised */
  --line: #222226;          /* hairline (also used by inline styles in templates) */
  --line-strong: #33333a;

  /* text */
  --ink: #ececef;
  --ink-strong: #ffffff;
  --muted: #8f8f96;         /* 6.5:1 on #000, 5.2:1 on #19191c */
  --faint: #85858d;         /* placeholders, >=4.5:1 on --raised */

  /* accent: champagne gold, used sparingly */
  --accent: #d6b66d;
  --accent-hi: #e8cf90;
  --accent-lo: #b9994f;
  --accent-ink: #0a0a0a;    /* text on accent fills */
  --accent-a08: rgba(214, 182, 109, .08);
  --accent-a12: rgba(214, 182, 109, .12);
  --accent-a28: rgba(214, 182, 109, .28);
  --accent-ring: rgba(214, 182, 109, .30);

  /* semantic (muted, no neon) */
  --ok: #6fdcaa;
  --warn: #f0c36a;
  --bad: #ff8a98;
  --info: #86b6ff;

  --radius: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --gut: 24px;
  --t: 150ms ease;

  --font: "Inter", "SF Pro Display", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Consolas, Menlo, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: #000; -webkit-text-size-adjust: 100%; scrollbar-color: #2e2e34 transparent; }

body {
  margin: 0;
  min-height: 100vh;
  background: #000000;
  color: var(--ink);
  font: 16px/1.55 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent-a28); color: var(--ink-strong); }

/* ---------- focus ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- typography ---------- */
h1 { font-size: 28px; line-height: 1.2; font-weight: 650; letter-spacing: -.022em; color: var(--ink-strong); margin: 4px 0 20px; }
h2 { font-size: 17px; line-height: 1.3; font-weight: 600; letter-spacing: -.01em; color: var(--ink-strong); margin: 0 0 12px; }
p { margin: 0 0 .9em; }
b, strong { font-weight: 600; color: var(--ink-strong); }
.muted { color: var(--muted); }
.muted b { color: #cfcfd6; }
small { display: block; margin-top: 4px; color: var(--muted); font-size: 12.5px; line-height: 1.4; }

a { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-a28); text-underline-offset: 3px; transition: color var(--t), text-decoration-color var(--t); }
a:hover { color: var(--accent-hi); text-decoration-color: currentColor; }

hr { border: 0; height: 1px; background: var(--line); margin: 28px 0; }

code, pre { font-family: var(--mono); }
code { font-size: .9em; background: var(--raised); border: 1px solid var(--line); padding: 2px 6px; border-radius: 6px; }
pre { margin: 0; overflow: auto; }

/* ---------- nav ---------- */
nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  padding: 10px var(--gut);
  background: rgba(0, 0, 0, .94);
  border-bottom: 1px solid var(--line);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  nav { background: rgba(0, 0, 0, .72); -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px); }
}
nav a {
  white-space: nowrap;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14.5px; font-weight: 550; letter-spacing: -.003em;
  text-decoration: none;
  transition: color var(--t), background-color var(--t), box-shadow var(--t);
}
nav a:hover { color: var(--ink-strong); background: var(--hover); text-decoration: none; }
nav a.active, nav a.active:hover { color: var(--accent); background: var(--accent-a12); box-shadow: inset 0 0 0 1px var(--accent-a28); }
nav .muted { font-size: 13px; white-space: nowrap; padding: 0 8px; }
nav form { display: flex; }

.navbtn {
  font: inherit; font-size: 14px; font-weight: 600;
  min-height: 40px; padding: 8px 16px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: transparent; color: var(--ink); cursor: pointer;
  transition: background-color var(--t), border-color var(--t), color var(--t);
}
.navbtn:hover { background: var(--hover); border-color: #46464f; color: var(--ink-strong); }
.navbtn:active { background: #202024; }

/* ---------- layout ---------- */
main { max-width: 1200px; margin: 0 auto; padding: 32px var(--gut) 80px; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.panel > :last-child { margin-bottom: 0; }
details.panel > summary { font-size: 16px; }
details.panel[open] > summary { margin-bottom: 4px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card b { display: block; font-size: 32px; line-height: 1.15; font-weight: 600; letter-spacing: -.025em; color: var(--ink-strong); }
.card span { display: block; margin-top: 6px; color: var(--muted); font-size: 13.5px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 18px; }

/* ---------- buttons ---------- */
button { font-family: inherit; }
.big, a.big {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px;
  font: inherit; font-size: 17px; font-weight: 600; line-height: 1.2; letter-spacing: -.005em; text-align: center;
  padding: 13px 26px;
  border: 1px solid transparent; border-radius: var(--radius-md);
  background: #ece8df; color: #0a0a0a;          /* primary: warm white */
  cursor: pointer; text-decoration: none;
  transition: background-color var(--t), border-color var(--t), color var(--t), transform var(--t), box-shadow var(--t);
}
.big:hover, a.big:hover { background: #ffffff; color: #0a0a0a; text-decoration: none; }
.big:active, a.big:active { background: #d6d1c6; transform: translateY(1px); }

.big.ok, a.big.ok { background: var(--accent); color: var(--accent-ink); }          /* confirm: accent */
.big.ok:hover, a.big.ok:hover { background: var(--accent-hi); color: var(--accent-ink); }
.big.ok:active, a.big.ok:active { background: var(--accent-lo); }

.big.gray, a.big.gray { background: transparent; color: var(--ink); border-color: var(--line-strong); }  /* secondary: ghost */
.big.gray:hover, a.big.gray:hover { background: var(--hover); border-color: #4a4a54; color: var(--ink-strong); }
.big.gray:active, a.big.gray:active { background: #222226; }

button:disabled, .big:disabled, .navbtn:disabled, input:disabled, select:disabled, textarea:disabled, .big[aria-disabled=true] {
  opacity: .38; cursor: not-allowed; filter: saturate(.4);
}
.big:disabled, .big:disabled:hover, .big:disabled:active, .big.ok:disabled, .big.ok:disabled:hover, .big.gray:disabled, .big.gray:disabled:hover {
  background: #141416; color: #9a9aa2; border-color: var(--line-strong); opacity: .55; filter: none; transform: none;
}
.navbtn:disabled, .navbtn:disabled:hover { background: transparent; color: #9a9aa2; border-color: var(--line-strong); }

.btns { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.btns form { margin: 0; }
.pager { justify-content: center; margin-top: 24px; }

/* ---------- flash ---------- */
.flash {
  margin-bottom: 16px; padding: 14px 18px;
  border: 1px solid rgba(111, 220, 170, .28); border-radius: var(--radius-md);
  background: rgba(111, 220, 170, .08); color: #9be8c6;
  font-weight: 500;
}
.flash b { color: inherit; font-weight: 700; }
.flash.bad { background: rgba(255, 138, 152, .09); border-color: rgba(255, 138, 152, .3); color: #ffb0ba; }
.flash.warn { background: rgba(240, 195, 106, .09); border-color: rgba(240, 195, 106, .3); color: #f6d48f; }

/* ---------- forms ---------- */
label.f { display: block; margin-bottom: 8px; color: #c9c9d0; font-size: 13.5px; font-weight: 600; letter-spacing: .005em; }
label { cursor: default; }

input[type=text], input[type=number], input[type=password], input[type=search], input[type=email], input[type=url], select, textarea {
  display: block; width: 100%;
  min-height: 48px;
  font: inherit; font-size: 17px; line-height: 1.35;
  padding: 11px 14px;
  color: var(--ink);
  background: var(--raised);
  border: 1px solid var(--line-strong); border-radius: var(--radius-md);
  transition: border-color var(--t), box-shadow var(--t), background-color var(--t);
}
input[type=text]:hover, input[type=number]:hover, input[type=password]:hover, select:hover, textarea:hover { border-color: #46464f; }
input[type=text]:focus, input[type=number]:focus, input[type=password]:focus, input[type=search]:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); background: #0e0e10; box-shadow: 0 0 0 3px var(--accent-ring);
}
::placeholder { color: var(--faint); opacity: 1; }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input[type=number] { font-variant-numeric: tabular-nums; }

select {
  -webkit-appearance: none; appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238f8f96' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 12px 8px;
}
option { background: #121214; color: var(--ink); }

input[type=file] {
  display: block; width: 100%; padding: 10px;
  font: inherit; color: var(--muted);
  background: var(--raised); border: 1px dashed var(--line-strong); border-radius: var(--radius-md);
  cursor: pointer; transition: border-color var(--t);
}
input[type=file]:hover { border-color: var(--accent-lo); }
input[type=file]::file-selector-button {
  font: inherit; font-size: 15px; font-weight: 600;
  margin-right: 14px; padding: 9px 16px;
  color: var(--ink); background: transparent;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  cursor: pointer; transition: background-color var(--t), border-color var(--t);
}
input[type=file]::file-selector-button:hover { background: var(--hover); border-color: #4a4a54; }

input[type=checkbox] {
  width: 20px; height: 20px; margin: 0 8px 0 0;
  accent-color: var(--accent); cursor: pointer; vertical-align: middle; flex: none;
}
input[type=checkbox]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- tables ---------- */
table {
  width: 100%;
  border-collapse: separate; border-spacing: 0;
  background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius-md);
  overflow: hidden;
  font-size: 14.5px;
}
th, td { padding: 14px 16px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
th {
  padding-top: 12px; padding-bottom: 12px;
  background: #070708;
  border-bottom-color: var(--line-strong);
  color: var(--muted);
  font-size: 11.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; white-space: nowrap;
}
tr:last-child > td { border-bottom: 0; }
tbody tr { transition: background-color var(--t); }
tbody tr:hover > td { background: rgba(255, 255, 255, .028); }
tr:has(> th):hover > th { background: #070708; }
td a { font-weight: 500; }
td .big { vertical-align: middle; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* tables nested in panels / details: no second frame */
.panel table, details table { background: transparent; border: 0; border-radius: 0; }
.panel table th { background: transparent; padding-left: 0; }
.panel table td:first-child { padding-left: 0; }
.panel table th:last-child, .panel table td:last-child { padding-right: 0; }

/* ---------- tags & status ---------- */
.tag {
  display: inline-block; vertical-align: middle;
  padding: 3px 11px;
  border: 1px solid var(--line-strong); border-radius: 99px;
  background: #1a1a1d; color: #b8b8c0;
  font-size: 12px; font-weight: 600; line-height: 1.4; letter-spacing: .02em; white-space: nowrap;
}
.tag.yeni       { background: rgba(214, 182, 109, .12); border-color: rgba(214, 182, 109, .32); color: #e6c981; }
.tag.alindi     { background: rgba(134, 182, 255, .11); border-color: rgba(134, 182, 255, .30); color: #9cc3ff; }
.tag.kargolandi { background: rgba(185, 162, 255, .11); border-color: rgba(185, 162, 255, .30); color: #c8b6ff; }
.tag.teslim, .tag.drop { background: rgba(111, 220, 170, .10); border-color: rgba(111, 220, 170, .28); color: #86e4b9; }
.tag.iptal      { background: rgba(255, 138, 152, .10); border-color: rgba(255, 138, 152, .28); color: #ff9eaa; }
.tag.inceleme   { background: rgba(255, 165, 110, .11); border-color: rgba(255, 165, 110, .30); color: #ffb286; }

.risk { color: var(--bad); font-weight: 600; }
div.risk { margin-top: 4px; font-size: 11.5px; letter-spacing: .08em; }

/* ---------- category tree ---------- */
ul.tree, ul.tree ul { list-style: none; margin: 0; padding: 0; }
ul.tree ul { margin: 2px 0 4px 9px; padding-left: 18px; border-left: 1px solid var(--line); }
ul.tree label { display: inline-flex; align-items: center; padding: 7px 0; cursor: pointer; }
ul.tree label:hover { color: var(--ink-strong); }
ul.tree input { width: 20px; height: 20px; margin: 0 10px 0 0; }
ul.tree summary { display: flex; align-items: center; gap: 6px; list-style: none; cursor: pointer; padding: 1px 0; border-radius: 8px; }
ul.tree summary::-webkit-details-marker { display: none; }
ul.tree summary::before {
  content: ""; flex: none; box-sizing: border-box;
  border: solid var(--muted); border-width: 0 1.5px 1.5px 0;
  width: 7px; height: 7px; margin: 0 4.5px 0 2.5px;
  transform: rotate(-45deg); transition: transform var(--t);
}
ul.tree details[open] > summary::before { transform: rotate(45deg); }
ul.tree summary:hover::before { border-color: var(--accent); }
ul.tree li.node > label { margin-left: 20px; }
summary { cursor: pointer; }
summary:hover { color: var(--ink-strong); }
.count {
  display: inline-block; margin-left: 10px; padding: 0 8px;
  background: var(--raised); border: 1px solid var(--line); border-radius: 99px;
  color: var(--muted); font-size: 12px; line-height: 1.6; font-variant-numeric: tabular-nums;
}

/* ---------- progress / sticky ---------- */
.bar { height: 8px; margin: 14px 0 10px; background: #1a1a1d; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .4s ease; }

.sticky {
  position: sticky; bottom: 0; z-index: 4;
  margin: 16px calc(var(--gut) * -1) 0; padding: 14px var(--gut);
  background: rgba(0, 0, 0, .9);
  border-top: 1px solid var(--line);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sticky { background: rgba(0, 0, 0, .72); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
}

code.link {
  display: inline-block; max-width: 100%;
  padding: 6px 12px;
  color: var(--ink);
  background: var(--raised); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-size: 14px; line-height: 1.45; word-break: break-all; user-select: all;
}

/* ---------- catalog ---------- */
.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 18px; }
.pcard {
  display: flex; flex-direction: column;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: border-color var(--t), background-color var(--t);
}
.pcard:hover { border-color: #3a3a42; background: #0f0f11; }
.pimg {
  display: flex; align-items: center; justify-content: center;
  height: 200px; padding: 12px;
  background: #f3f2ef; border-radius: var(--radius-sm);
  text-decoration: none;
}
.pimg img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pbody { display: flex; flex-direction: column; flex: 1; gap: 4px; padding: 14px 8px 8px; }
.ptitle {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  min-height: 2.7em;
  color: var(--ink); text-decoration: none;
  font-size: 15px; font-weight: 550; line-height: 1.35;
}
.ptitle:hover { color: var(--accent-hi); text-decoration: none; }
.pcat { color: var(--muted); font-size: 12.5px; }
.prices { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; }
.prices b { font-size: 20px; font-weight: 650; letter-spacing: -.015em; color: var(--ink-strong); }
.prices span { font-size: 13px; }
.pmeta { color: var(--muted); font-size: 12.5px; word-break: break-all; }

/* ---------- product detail ---------- */
.detail { display: grid; grid-template-columns: minmax(260px, 420px) minmax(0, 1fr); gap: 20px; align-items: start; }
.detail > * { min-width: 0; }
.detail > .panel, .detail > div > .panel:last-child { margin-bottom: 20px; }
.mainimg {
  display: block; width: 100%; max-height: 420px; padding: 14px;
  object-fit: contain; background: #f3f2ef; border-radius: var(--radius-md);
}
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.thumbs img {
  width: 64px; height: 64px; padding: 4px; object-fit: contain;
  background: #f3f2ef; border: 2px solid transparent; border-radius: var(--radius-sm);
  cursor: pointer; transition: border-color var(--t), transform var(--t);
}
.thumbs img:hover { border-color: var(--accent); }
.xmlbox {
  margin-top: 12px; padding: 16px;
  background: #050506; color: #c9c9d0;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; overflow: auto;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  /* wide tables scroll inside their own box instead of the page */
  table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table > tbody, table > thead { display: table; width: 100%; }
  table:has(th) > tbody, table:has(th) > thead { width: max-content; min-width: 100%; }  /* data tables scroll; key/value tables wrap */
  .panel table th:last-child, .panel table td:last-child { padding-right: 16px; }
}
@media (max-width: 800px) {
  .detail { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  nav { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; padding: 8px var(--gut); gap: 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  nav::-webkit-scrollbar { display: none; }
  nav > * { flex: none; }
  nav a { padding: 12px 13px; }
}
@media (max-width: 640px) {
  :root { --gut: 16px; }
  main { padding-top: 22px; padding-bottom: 64px; }
  h1 { font-size: 24px; margin-bottom: 16px; }
  .panel { padding: 18px 16px; border-radius: 14px; margin-bottom: 16px; }
  .card { padding: 16px; }
  .card b { font-size: 28px; }
  .btns .big, .btns > form { flex: 1 1 calc(50% - 6px); }
  .btns > form > .big { width: 100%; }
  .pimg { height: 190px; }
  th, td { padding: 12px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .big:active, a.big:active { transform: none; }
}
