:root {
  --bg: #0a0916;
  --panel: #14122b;
  --panel2: #1c1a3a;
  --line: #2c2a55;
  --text: #f1f0fa;
  --muted: #a6a3c7;
  --accent: #a24bff;
  --ok: #31c48d;
  --err: #ff6b6b;
  --grad: linear-gradient(120deg, #3b6bff, #a24bff 55%, #ff8a3d);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 "Segoe UI", system-ui, -apple-system, "Noto Sans Armenian", Arial, sans-serif;
}
a { color: #c9a6ff; }
h1 { font-size: 26px; line-height: 1.25; margin: 0 0 12px; }
h2 { font-size: 19px; margin: 0 0 12px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.top {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: .5px; }
.brand img { width: 38px; height: 38px; display: block; }
.top nav { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.top nav a, .linkbtn {
  color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 10px;
  background: none; border: 0; font: inherit; cursor: pointer;
}
.top nav a:hover, .linkbtn:hover, .top nav a.on { background: var(--panel2); }
.top form { margin: 0; }

.wrap { max-width: 960px; margin: 0 auto; padding: 20px 16px 60px; }
.narrow { max-width: 440px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 16px; }

.flash { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; border: 1px solid; }
.flash.ok { background: rgba(49,196,141,.12); border-color: rgba(49,196,141,.5); }
.flash.err { background: rgba(255,107,107,.12); border-color: rgba(255,107,107,.5); }

label { display: block; font-size: 14px; color: var(--muted); margin: 0 0 4px; }
.field { margin-bottom: 14px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: #0e0d20; color: var(--text); font: inherit; min-height: 44px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=file] { width: 100%; color: var(--muted); font: inherit; }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 0; cursor: pointer;
  background: var(--grad); color: #fff; font: inherit; font-weight: 700; text-decoration: none;
}
.btn:hover { filter: brightness(1.1); }
.btn.ghost { background: var(--panel2); border: 1px solid var(--line); font-weight: 600; }
.btn.danger { background: #7a1f2b; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1 1 200px; min-width: 0; }

.hero { text-align: center; padding: 28px 0 8px; }
.hero img { width: 120px; height: 120px; }
.code-input { text-transform: uppercase; letter-spacing: 3px; text-align: center; font-weight: 700; font-size: 20px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cardbox { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.cardbox .band { height: 64px; background: var(--c, #7c5cdb); background-size: cover; background-position: center; }
.cardbox .body { padding: 0 16px 16px; }
.cardbox .ava {
  width: 64px; height: 64px; border-radius: 50%; margin-top: -32px; border: 3px solid var(--panel);
  background: var(--panel2); object-fit: cover; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 22px;
}
.cardbox h3 { margin: 8px 0 0; font-size: 18px; overflow-wrap: anywhere; }
.stats { display: flex; gap: 18px; margin: 12px 0; }
.stats b { display: block; font-size: 22px; line-height: 1.1; }
.stats span { font-size: 13px; color: var(--muted); }
.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); }
.badge.ok { color: var(--ok); border-color: rgba(49,196,141,.5); }
.badge.off { color: var(--err); border-color: rgba(255,107,107,.5); }

.copyline { display: flex; gap: 8px; align-items: center; background: #0e0d20; border: 1px solid var(--line); border-radius: 10px; padding: 6px 6px 6px 12px; }
.copyline code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--text); }

.item-row { display: grid; grid-template-columns: 150px 1fr 1fr 44px 44px; gap: 8px; margin-bottom: 8px; }
.item-row button { min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); cursor: pointer; font-size: 16px; }
@media (max-width: 640px) {
  .item-row { grid-template-columns: 1fr 44px 44px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
  .item-row select { grid-column: 1; }
  .item-row input { grid-column: 1 / -1; }
  .item-row input:first-of-type { grid-row: 2; }
  .item-row input:last-of-type { grid-row: 3; }
}

.tpls { display: flex; gap: 10px; flex-wrap: wrap; }
.tpls label { margin: 0; cursor: pointer; }
.tpls input { position: absolute; opacity: 0; }
.tpls span { display: block; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); background: #0e0d20; color: var(--text); font-size: 15px; }
.tpls input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.tpls input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.swatches button { width: 36px; height: 36px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); cursor: pointer; padding: 0; }
.swatches input[type=color] { width: 48px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: none; cursor: pointer; }
.thumb { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 15px; margin: 6px 0 0; }
.check input { width: 18px; height: 18px; }

.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; border-radius: 10px; text-decoration: none; color: var(--text); background: var(--panel); border: 1px solid var(--line); }
.tabs a.on { background: var(--grad); border-color: transparent; font-weight: 700; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--panel); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td form { margin: 0; }
td input[type=number] { width: 80px; min-height: 36px; padding: 6px 8px; }
td code { font-size: 14px; }
.addchips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip { min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font: inherit; font-size: 15px; cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.g-wrap { display: flex; justify-content: center; min-height: 44px; color-scheme: light; }
details summary { cursor: pointer; color: var(--muted); }
