/* AX Catalog Hub admin: dark navy, accent #6d5efc. No external fonts, scripts or images. */
:root {
  --bg: #080a14;
  --bg2: #0d1124;
  --panel: #121730;
  --panel2: #0e1328;
  --line: #232a4d;
  --tx: #e6e9f8;
  --mut: #9aa3c7;
  --accent: #6d5efc;
  --accent2: #9b8cff;
  --ok: #3ddc97;
  --err: #ff7b86;
  --warn: #ffc857;
  --radius: 12px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--tx);
  background: radial-gradient(1200px 600px at 12% -8%, #1c1f4a 0, rgba(28, 31, 74, 0) 60%), radial-gradient(900px 500px at 100% 0, #2a1a52 0, rgba(42, 26, 82, 0) 55%), var(--bg);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a { color: var(--accent2); }
a:hover { color: #c3baff; }
h1 { font-size: 26px; margin: 8px 0 6px; letter-spacing: .2px; }
h2 { font-size: 17px; margin: 0 0 10px; }
code { background: #0a0e20; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; }
.muted { color: var(--mut); }
.small { font-size: 12.5px; }
.r { text-align: right; }
.nowrap { white-space: nowrap; }
.errtext { color: var(--err); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---- top bar ---- */
.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px;
  padding: 12px max(16px, calc((100vw - 1100px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(10, 13, 30, .8);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 5;
}
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--tx); text-decoration: none; font-weight: 700; letter-spacing: .3px; }
.mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), #9b5efc); color: #fff; font-size: 13px; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.nav a, .linkbtn { color: var(--mut); text-decoration: none; padding: 7px 11px; border-radius: 9px; background: none; border: 0; font: inherit; cursor: pointer; }
.nav a:hover, .linkbtn:hover { color: var(--tx); background: rgba(109, 94, 252, .15); }
.nav a.on { color: #fff; background: rgba(109, 94, 252, .28); }
form.inline { display: inline; margin: 0; }

.badge { display: inline-block; min-width: 20px; padding: 0 7px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; text-align: center; }

/* ---- layout ---- */
.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 22px 16px 60px; flex: 1; }
.foot { text-align: center; color: var(--mut); font-size: 12px; padding: 18px; border-top: 1px solid var(--line); }
.crumbs { color: var(--mut); font-size: 13px; margin: 0; }
.row-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.row-head h2 { margin: 0; }

.card {
  background: linear-gradient(180deg, rgba(24, 29, 62, .9), rgba(18, 23, 48, .92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin: 16px 0;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .28);
}
.card.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.danger-zone { border-color: #5b2330; }
.danger-zone h2 { color: var(--err); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 14px 0; }
.tile { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; }
.tile .n { font-size: 26px; font-weight: 700; }
.tile .l { color: var(--mut); font-size: 13px; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel2); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { color: var(--mut); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
tbody th { font-weight: 600; }
tbody th .muted, tbody th .small { font-weight: 400; }
tbody tr:hover { background: rgba(109, 94, 252, .06); }
th.r, td.r { text-align: right; }
.clip { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acts { white-space: nowrap; }
.acts .btn { margin: 2px 2px 2px 0; }

/* ---- forms & buttons ---- */
label { display: block; margin: 14px 0 5px; font-size: 13px; color: var(--mut); }
input[type=text], input[type=password], input[type=number], select {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--tx); font: inherit;
}
input::placeholder { color: #6a7399; }
fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 16px 0 0; padding: 4px 12px 12px; }
legend { color: var(--mut); font-size: 13px; padding: 0 6px; }
label.check { display: flex; align-items: center; gap: 9px; color: var(--tx); font-size: 14.5px; margin: 10px 0 0; }
label.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.filter { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 10px 0 16px; }
.filter label { margin: 0 0 5px; }
.filter select { width: auto; min-width: 220px; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.btn {
  display: inline-block; font: inherit; cursor: pointer; text-decoration: none; color: var(--tx);
  padding: 9px 15px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2);
}
.btn:hover:not(:disabled) { border-color: var(--accent); color: #fff; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.primary { background: linear-gradient(90deg, var(--accent), #8a5cf5); border-color: transparent; color: #fff; font-weight: 600; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.1); }
.btn.danger { border-color: #6b2b37; color: var(--err); }
.btn.danger:hover:not(:disabled) { background: #3a1620; border-color: var(--err); color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, pre:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }

/* ---- status ---- */
.pill { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; border: 1px solid var(--line); color: var(--mut); }
.pill.ok { color: var(--ok); border-color: #1f6a4d; background: rgba(61, 220, 151, .08); }
.pill.err { color: var(--err); border-color: #7a2c37; background: rgba(255, 123, 134, .08); }

.flash { border-radius: 10px; padding: 11px 14px; margin: 0 0 14px; border: 1px solid var(--line); }
.flash.ok { border-color: #1f6a4d; background: rgba(61, 220, 151, .1); color: #bff5dc; }
.flash.err { border-color: #7a2c37; background: rgba(255, 123, 134, .1); color: #ffd3d7; }

progress { width: 100%; height: 12px; margin: 14px 0 6px; border: 0; border-radius: 99px; overflow: hidden; background: var(--line); appearance: none; }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--accent), #9b5efc); transition: width .25s; }
progress::-moz-progress-bar { background: linear-gradient(90deg, var(--accent), #9b5efc); }
.log {
  max-height: 280px; overflow: auto; margin: 8px 0 0; padding: 12px; border-radius: 10px; background: #060813; border: 1px solid var(--line);
  font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; color: #aeb8de; white-space: pre-wrap; overflow-wrap: anywhere;
}

/* ---- messages ---- */
.msg.unread { border-color: var(--accent); }
.msg header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 10px 0 0; }

@media (max-width: 640px) {
  h1 { font-size: 22px; }
  .card { padding: 14px; }
  .top { position: static; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.replace-box{border:1px solid var(--line);border-radius:12px;margin:0 0 16px;padding:12px 16px}
.replace-box legend{padding:0 8px;font-weight:600}
.replace-box .check{display:inline-flex;margin-right:18px}

.inline-form{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.inline-form select{background:var(--panel2);color:var(--tx);border:1px solid var(--line);border-radius:10px;padding:10px 12px;min-width:240px;max-width:420px;flex:1 1 280px}
