/* Skyra Zone QR — admin */

:root {
    --bg: #0d1014;
    --panel: #141920;
    --panel-2: #1b222b;
    --line: #262f3a;
    --fg: #e8ecf1;
    --muted: #8895a5;
    --accent: #f4c542;
    --accent-ink: #12151b;
    --danger: #e5484d;
    --ok: #46c48a;
    --r: 12px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: "IBM Plex Sans", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, legend, .logo {
    font-family: "Space Grotesk", sans-serif;
    letter-spacing: -.01em;
}

a { color: var(--accent); }

/* --- Brand mark: four QR modules --- */
.brand-mark {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    width: 30px; height: 30px;
}
.brand-mark span { background: var(--accent); border-radius: 3px; }
.brand-mark span:nth-child(3) { background: var(--line); }
.brand-mark.sm { width: 20px; height: 20px; gap: 2px; }

/* --- Top bar --- */
.topbar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 26px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
    position: sticky; top: 0; z-index: 10;
}
.logo {
    display: flex; align-items: center; gap: 10px;
    color: var(--fg); text-decoration: none;
    font-weight: 700; font-size: 16px;
}
.logo b { color: var(--accent); font-weight: 700; }
.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a {
    color: var(--muted); text-decoration: none;
    padding: 7px 13px; border-radius: 8px; font-size: 14px; font-weight: 500;
}
.nav a:hover { color: var(--fg); background: var(--panel-2); }
.nav a.on { color: var(--accent-ink); background: var(--accent); }
.out { margin-left: auto; color: var(--muted); text-decoration: none; font-size: 14px; }
.out:hover { color: var(--fg); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 30px 26px 70px; }

/* --- Page head --- */
.page-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 20px; flex-wrap: wrap; margin-bottom: 24px;
}
.page-head h1 { margin: 0; font-size: 27px; }
.sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.sub a { color: var(--muted); }
.head-actions { display: flex; gap: 8px; }

/* --- Buttons --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-2);
    color: var(--fg);
    font: inherit; font-size: 14px; font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: filter .15s ease, border-color .15s ease;
}
.btn:hover { filter: brightness(1.15); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--fg); border-color: var(--muted); }
.btn-danger { background: transparent; border-color: transparent; color: var(--muted); }
.btn-danger:hover { color: var(--danger); border-color: var(--danger); }

/* --- Forms --- */
label { display: block; margin-bottom: 16px; font-size: 13px; font-weight: 600; color: var(--muted); }
label.tight { margin-bottom: 10px; }
input[type=text], input[type=password], input[type=email], input[type=search], select, input[type=file] {
    display: block; width: 100%;
    margin-top: 7px;
    padding: 11px 13px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--fg);
    font: inherit; font-size: 15px; font-weight: 400;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }
input[type=color] {
    margin-top: 7px; width: 100%; height: 44px;
    background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
    padding: 4px; cursor: pointer;
}
small { display: block; margin-top: 6px; color: var(--muted); font-weight: 400; font-size: 12.5px; }
label.check { display: flex; align-items: center; gap: 9px; font-weight: 500; color: var(--fg); }
label.check input { width: auto; margin: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

fieldset {
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--panel);
    padding: 20px 22px 6px;
    margin: 0 0 18px;
}
legend { padding: 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }

.prefix-input { display: flex; align-items: center; margin-top: 7px; }
.prefix-input .prefix {
    padding: 11px 10px 11px 13px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-right: 0;
    border-radius: 10px 0 0 10px;
    color: var(--muted);
    font-size: 13px; font-weight: 400;
    white-space: nowrap;
}
.prefix-input input { margin-top: 0; border-radius: 0 10px 10px 0; }

.logo-field { display: flex; gap: 18px; align-items: flex-start; }
.logo-prev {
    width: 84px; height: 84px; flex: none;
    border: 2px dashed var(--line); border-radius: 14px;
    display: grid; place-items: center;
    color: var(--muted); font-size: 11px;
    overflow: hidden;
}
.logo-prev img { width: 100%; height: 100%; object-fit: cover; }
.logo-field > div:last-child { flex: 1; }

.actions { display: flex; gap: 10px; }

/* --- Stats --- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.stat {
    background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--r); padding: 16px 18px;
}
.stat b {
    display: block;
    font-family: "Space Grotesk", sans-serif;
    font-size: 28px; font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.stat span { color: var(--muted); font-size: 12.5px; }

/* --- Search --- */
.search { display: flex; gap: 8px; margin-bottom: 18px; }
.search input { margin-top: 0; }

/* --- Client rows --- */
.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.row {
    display: flex; align-items: center; gap: 18px;
    background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--r); padding: 14px 16px;
}
.row:hover { border-color: #3a4655; }
.row-qr { width: 72px; height: 72px; flex: none; border-radius: 8px; background: #fff; }
.row-main { min-width: 0; flex: 1; }
.row-title { display: flex; align-items: center; gap: 8px; }
.row-title strong { font-size: 16px; }
.pill {
    font-size: 11px; padding: 2px 8px; border-radius: 999px;
    background: var(--panel-2); color: var(--muted); font-weight: 600;
}
.pill.off { color: var(--danger); border: 1px solid var(--danger); }
.row-url {
    display: block; margin-top: 3px;
    color: var(--muted); font-size: 13px; text-decoration: none;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row-url:hover { color: var(--accent); }
.row-meta { display: flex; align-items: center; gap: 16px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.row-meta b { color: var(--fg); font-variant-numeric: tabular-nums; }
.swatch { width: 14px; height: 14px; border-radius: 4px; background: var(--s); }
.row-actions { display: flex; gap: 6px; align-items: center; }
.row-actions form { margin: 0; }

.empty {
    text-align: center; padding: 60px 20px;
    border: 1px dashed var(--line); border-radius: var(--r); color: var(--muted);
}
.empty p { margin: 0 0 16px; }

/* --- Editor --- */
.editor-cols { display: grid; grid-template-columns: 1fr 280px; gap: 22px; align-items: start; }
.editor-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 12px; }
.side-card {
    background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--r); padding: 18px;
}
.side-card h3 { margin: 0 0 14px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.side-card canvas { width: 100%; height: auto; background: #fff; border-radius: 8px; }
.side-url { margin: 10px 0 0; font-size: 12px; color: var(--muted); word-break: break-all; }

.color-prev {
    border-radius: 10px; padding: 18px;
    display: flex; flex-direction: column; align-items: center; gap: 9px;
    background: #101319;
}
.cp-dot { width: 40px; height: 40px; border-radius: 10px; border: 3px solid var(--a, #f4c542); }
.cp-bar { width: 100%; height: 12px; border-radius: 6px; background: var(--a, #f4c542); }
.cp-bar.short { width: 60%; opacity: .35; }

/* --- QR page --- */
.qr-layout { display: grid; grid-template-columns: 1fr 300px; gap: 22px; align-items: start; }
.qr-side { display: flex; flex-direction: column; gap: 12px; }
.qr-card {
    background: #fff; color: #12151b;
    border-radius: 18px; padding: 36px 28px 30px;
    text-align: center;
    display: flex; flex-direction: column; align-items: center;
}
.qr-eyebrow {
    margin: 0; font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
    color: #6b7280; font-weight: 600;
}
.qr-logo { width: 62px; height: 62px; border-radius: 12px; object-fit: cover; margin-top: 16px; }
.qr-name { font-size: 26px; margin: 12px 0 20px; }
.qr-card canvas { width: 260px; height: 260px; }
.qr-cta { margin: 20px 0 0; font-size: 14px; color: #4b5563; max-width: 30ch; }
.qr-url { margin: 6px 0 0; font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 14px; }
.copy-row { display: flex; gap: 6px; }
.copy-row input { margin-top: 0; font-size: 13px; }

/* --- Chart --- */
.chart-card { margin-bottom: 24px; }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 150px; }
.bar {
    flex: 1; height: var(--h);
    background: var(--accent);
    border-radius: 3px 3px 0 0;
    opacity: .85;
    min-height: 2px;
}
.bar:hover { opacity: 1; }
.chart-axis {
    display: flex; justify-content: space-between;
    margin-top: 10px; font-size: 12px; color: var(--muted);
}
.chart-axis b { color: var(--fg); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.two-col h2 { font-size: 16px; margin: 0 0 14px; }

.board { list-style: none; margin: 0; padding: 0; }
.board li {
    display: grid; grid-template-columns: 1fr 90px 44px 54px;
    align-items: center; gap: 10px;
    padding: 10px 0; border-bottom: 1px solid var(--line);
    font-size: 14px;
}
.board a { color: var(--fg); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board a:hover { color: var(--accent); }
.board-bar { height: 6px; border-radius: 3px; background: var(--accent); width: var(--w); min-width: 2px; }
.board b { text-align: right; font-variant-numeric: tabular-nums; }
.board small { margin: 0; text-align: right; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 9px 0; border-bottom: 1px solid var(--line);
    font-size: 13.5px;
}
.feed time { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.muted { color: var(--muted); }

/* --- Messages --- */
.flash, .err, .ok {
    padding: 12px 16px; border-radius: 10px;
    margin: 0 0 20px; font-size: 14px; font-weight: 500;
}
.flash, .ok { background: rgba(70,196,138,.12); border: 1px solid rgba(70,196,138,.4); color: var(--ok); }
.err { background: rgba(229,72,77,.12); border: 1px solid rgba(229,72,77,.4); color: #ff8b8f; }

/* --- Auth screens --- */
.auth-body { display: grid; place-items: center; min-height: 100svh; padding: 24px; }
.auth-card {
    width: 100%; max-width: 380px;
    background: var(--panel); border: 1px solid var(--line);
    border-radius: 18px; padding: 32px;
}
.auth-card h1 { margin: 18px 0 4px; font-size: 22px; }
.auth-card .hint { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.auth-card .btn { width: 100%; margin-top: 4px; }

/* --- Print: only the QR card --- */
@media print {
    body { background: #fff; }
    .topbar, .no-print, .qr-side { display: none !important; }
    .wrap { padding: 0; max-width: none; }
    .qr-layout { display: block; }
    .qr-card { border: 1px solid #ddd; }
}

@media (max-width: 900px) {
    .editor-cols, .qr-layout, .two-col { grid-template-columns: 1fr; }
    .editor-side { position: static; }
    .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .topbar { flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
    .wrap { padding: 22px 16px 60px; }
    .row { flex-wrap: wrap; }
    .row-actions { width: 100%; }
    .two { grid-template-columns: 1fr; }
}

/* --- Repeatable link rows (Links section) --- */
.field-note { margin: -4px 0 18px; color: var(--muted); font-size: 13px; font-weight: 400; }
.linkgroup { margin-bottom: 18px; }
.linkgroup-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.linkgroup-head .ic {
    width: 26px; height: 26px; border-radius: 7px; flex: none;
    background: var(--accent);
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center; mask-position: center;
    -webkit-mask-size: 66%; mask-size: 66%;
}
.ic-google    { -webkit-mask-image: url("icons/star.svg");      mask-image: url("icons/star.svg"); }
.ic-instagram { -webkit-mask-image: url("icons/camera.svg");    mask-image: url("icons/camera.svg"); }
.ic-facebook  { -webkit-mask-image: url("icons/f.svg");         mask-image: url("icons/f.svg"); }
.ic-linkedin  { -webkit-mask-image: url("icons/linkedin.svg");  mask-image: url("icons/linkedin.svg"); }
.ic-pinterest { -webkit-mask-image: url("icons/pinterest.svg"); mask-image: url("icons/pinterest.svg"); }
.ic-youtube   { -webkit-mask-image: url("icons/play.svg");      mask-image: url("icons/play.svg"); }
.ic-maps      { -webkit-mask-image: url("icons/pin.svg");       mask-image: url("icons/pin.svg"); }
.ic-website   { -webkit-mask-image: url("icons/globe.svg");     mask-image: url("icons/globe.svg"); }
.linkgroup-head strong { font-size: 14px; }
.link-add {
    margin-left: auto; background: transparent; border: 1px solid var(--line);
    color: var(--accent); font: inherit; font-size: 13px; font-weight: 600;
    padding: 5px 12px; border-radius: 8px; cursor: pointer;
    transition: border-color .15s ease;
}
.link-add:hover { border-color: var(--accent); }
.link-rows { display: flex; flex-direction: column; gap: 8px; }
.link-row { display: flex; gap: 8px; align-items: center; }
.link-row input { margin-top: 0; }
.link-row input[type=url] { flex: 2; }
.link-row .link-label { flex: 1; }
.link-del {
    flex: none; width: 38px; height: 42px;
    background: transparent; border: 1px solid var(--line); border-radius: 10px;
    color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer;
    transition: color .15s ease, border-color .15s ease;
}
.link-del:hover { color: var(--danger); border-color: var(--danger); }
@media (max-width: 640px) {
    .link-row { flex-wrap: wrap; }
    .link-row input[type=url], .link-row .link-label { flex: 1 1 100%; }
    .link-del { width: 100%; height: 34px; }
}
