/* HonestKits — Admin Panel */
:root {
    --bg:      #0d0d14;
    --surface: #141420;
    --surf2:   #1a1a2a;
    --line:    #252535;
    --purple:  #7c3aed;
    --purple2: #6d28d9;
    --text:    #f0f0f8;
    --muted:   #8b8ba8;
    --good:    #4ade80;
    --bad:     #f87171;
    --gold:    #fdad34;
    --display: "Oswald", sans-serif;
    --body:    "Inter", system-ui, sans-serif;
    --mono:    "JetBrains Mono", ui-monospace, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 15px; line-height: 1.6; }
a { color: var(--purple); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin: 0 0 .5rem; }
h1 { font-size: 1.8rem; }
h2 { font-size: 1.1rem; }
code { font-family: var(--mono); background: #000; padding: .1rem .4rem; border-radius: 4px; font-size: .88em; }
small { font-size: .82em; }

/* ── Header ──────────────────────────────────────────────────────────────── */
.hk-header {
    display: flex; align-items: center; gap: 1.5rem;
    background: #09090f; border-bottom: 1px solid var(--line);
    padding: .75rem 1.5rem; flex-wrap: wrap; position: sticky; top: 0; z-index: 100;
}
.hk-brand {
    font-family: var(--display); font-weight: 700; font-size: 1.2rem;
    color: var(--text); display: flex; align-items: center; gap: .6rem;
}
.hk-brand:hover { text-decoration: none; }
.hk-mark {
    display: inline-grid; place-items: center; width: 30px; height: 30px;
    background: var(--purple); color: #fff; border-radius: 7px;
    font-family: var(--display); font-weight: 700; font-size: 1rem;
}
.hk-nav { display: flex; gap: 1.25rem; margin-left: auto; align-items: center; flex-wrap: wrap; }
.hk-nav a { color: var(--muted); font-family: var(--display); text-transform: uppercase; letter-spacing: 1px; font-size: .82rem; }
.hk-nav a:hover, .hk-nav a.active { color: var(--text); text-decoration: none; }
.hk-nav a.active { color: var(--purple); }
.hk-logout { color: var(--bad) !important; }

/* ── Main ────────────────────────────────────────────────────────────────── */
.hk-main { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }

/* ── Page head ───────────────────────────────────────────────────────────── */
.hk-page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.hk-page-head h1 { margin: 0; }

/* ── Stats ───────────────────────────────────────────────────────────────── */
.hk-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin: 1.25rem 0 2rem; }
.hk-stat { background: var(--surf2); border: 1px solid var(--line); border-radius: 10px; padding: 1.25rem; text-align: center; }
.hk-stat-num { display: block; font-family: var(--display); font-weight: 700; font-size: 2.2rem; color: var(--purple); line-height: 1; margin-bottom: .35rem; }
.hk-stat-label { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: 1px; }

/* ── Card ────────────────────────────────────────────────────────────────── */
.hk-card { background: var(--surf2); border: 1px solid var(--line); border-radius: 10px; padding: 1.25rem; }
.hk-card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.hk-card-head h2 { margin: 0; }
.hk-card-success { border-color: rgba(74,222,128,.4); background: rgba(74,222,128,.05); }

/* ── Table ───────────────────────────────────────────────────────────────── */
.hk-table { width: 100%; border-collapse: collapse; }
.hk-table th, .hk-table td { padding: .55rem .5rem; border-bottom: 1px solid var(--line); text-align: left; }
.hk-table th { color: var(--muted); font-family: var(--display); text-transform: uppercase; font-size: .72rem; letter-spacing: 1px; }
.hk-table tbody tr:last-child td { border-bottom: none; }
.hk-table tbody tr:hover td { background: rgba(255,255,255,.02); }
.hk-muted { color: var(--muted); font-size: .88em; }
.hk-empty { color: var(--muted); padding: 1rem 0; }
.hk-link { color: var(--purple); font-size: .88rem; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.hk-badge { display: inline-block; padding: .15rem .55rem; border-radius: 99px; font-size: .72rem; text-transform: uppercase; letter-spacing: 1px; background: var(--line); color: var(--muted); }
.hk-badge-ok  { background: rgba(74,222,128,.15);  color: var(--good); }
.hk-badge-off { background: rgba(248,113,113,.12); color: var(--bad); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.hk-btn {
    display: inline-block; background: var(--purple); color: #fff; border: 0;
    border-radius: 7px; padding: .55rem 1.2rem; font-family: var(--display);
    font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
    cursor: pointer; font-size: .88rem; white-space: nowrap; transition: background .15s;
}
.hk-btn:hover { background: var(--purple2); text-decoration: none; color: #fff; }
.hk-btn-primary { background: var(--purple); }
.hk-btn-outline { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.hk-btn-outline:hover { border-color: var(--purple); color: var(--text); background: transparent; }
.hk-btn-danger  { background: transparent; border: 1px solid rgba(248,113,113,.4); color: var(--bad); }
.hk-btn-danger:hover { background: rgba(248,113,113,.1); }
.hk-btn-sm { padding: .3rem .7rem; font-size: .78rem; }
.hk-btn-full { width: 100%; text-align: center; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.hk-form { display: flex; flex-direction: column; gap: .9rem; }
.hk-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.hk-form label, .hk-form > label {
    display: flex; flex-direction: column; gap: .3rem;
    font-family: var(--display); font-size: .78rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted);
}
.hk-form input[type=text],
.hk-form input[type=number],
.hk-form input[type=datetime-local],
.hk-form input[type=password],
.hk-form select,
.hk-form textarea {
    background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
    color: var(--text); font-family: var(--body); font-size: .95rem; padding: .55rem .75rem;
    text-transform: none; letter-spacing: 0; width: 100%;
}
.hk-form input:focus, .hk-form select:focus, .hk-form textarea:focus {
    outline: 2px solid var(--purple); border-color: var(--purple);
}
.hk-hint { color: var(--muted); font-size: .78rem; margin: .15rem 0 0; }
.hk-checks { display: flex; flex-direction: column; gap: .5rem; margin-top: .25rem; }
.hk-check { display: flex; align-items: center; gap: .5rem; font-family: var(--body); font-size: .9rem; text-transform: none; letter-spacing: 0; color: var(--text); cursor: pointer; }
.hk-check input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--purple); cursor: pointer; }
.hk-cooldown-row { display: flex; align-items: center; gap: .75rem; }

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.hk-tabs { display: flex; gap: .5rem; flex-wrap: wrap; }
.hk-tab { background: var(--surf2); border: 1px solid var(--line); border-radius: 7px; padding: .4rem .9rem; color: var(--muted); font-size: .85rem; }
.hk-tab:hover { color: var(--text); text-decoration: none; }
.hk-tab.active { background: var(--purple); border-color: var(--purple); color: #fff; }

/* ── Kit list table extras ───────────────────────────────────────────────── */
.hk-row-actions { display: flex; gap: .5rem; align-items: center; }
.hk-drag-handle { cursor: grab; color: var(--muted); font-size: 1.1rem; padding: 0 .25rem; user-select: none; }
.hk-drag-handle:active { cursor: grabbing; }

/* ── Kit editor grid ─────────────────────────────────────────────────────── */
.hk-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }

/* ── Item builder ────────────────────────────────────────────────────────── */
#items-list { display: flex; flex-direction: column; gap: .5rem; margin-top: .75rem; }
.hk-item-row {
    display: flex; align-items: center; gap: .5rem;
    background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: .4rem .6rem;
}
.hk-item-row.dragging { opacity: .4; }
.hk-item-drag { cursor: grab; color: var(--muted); font-size: 1rem; flex-shrink: 0; }
.hk-item-fields { display: flex; align-items: center; gap: .4rem; flex: 1; flex-wrap: wrap; }
.hk-item-sn        { flex: 1; min-width: 140px; }
.hk-item-qty       { width: 58px; }
.hk-item-skin      { width: 90px; }
.hk-item-container { width: 72px; }
.hk-item-fields input, .hk-item-fields select {
    background: var(--surf2); border: 1px solid var(--line); border-radius: 5px;
    color: var(--text); font-family: var(--body); font-size: .85rem; padding: .3rem .5rem;
}
.hk-item-fields input:focus, .hk-item-fields select:focus { outline: 1px solid var(--purple); }
.hk-item-bp-label { display: flex; align-items: center; gap: .3rem; color: var(--muted); font-size: .82rem; cursor: pointer; flex-shrink: 0; }
.hk-item-del { background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: .9rem; padding: .2rem .4rem; border-radius: 4px; flex-shrink: 0; }
.hk-item-del:hover { color: var(--bad); background: rgba(248,113,113,.1); }

/* ── Key box ─────────────────────────────────────────────────────────────── */
.hk-key-box {
    display: block; word-break: break-all; background: #000; border: 1px solid var(--line);
    border-radius: 6px; padding: .75rem 1rem; font-family: var(--mono); font-size: .88rem;
    color: var(--good); margin: .75rem 0;
}

/* ── Messages ────────────────────────────────────────────────────────────── */
.hk-error { color: var(--bad); background: rgba(248,113,113,.08); border: 1px solid rgba(248,113,113,.3); padding: .6rem .9rem; border-radius: 6px; margin-bottom: 1rem; }

/* ── Login ───────────────────────────────────────────────────────────────── */
.hk-login-body { display: grid; place-items: center; min-height: 100vh; padding: 1rem; }
.hk-login-box { background: var(--surf2); border: 1px solid var(--line); border-radius: 12px; padding: 2.5rem 2rem; width: min(100%, 380px); }
.hk-login-brand { font-family: var(--display); font-weight: 700; font-size: 1.4rem; display: flex; align-items: center; gap: .6rem; margin-bottom: 1.25rem; color: var(--text); }
.hk-login-box h1 { font-size: 1.3rem; margin-bottom: 1.5rem; }
.hk-login-box label { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1rem; font-family: var(--display); font-size: .78rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.hk-login-box input { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; color: var(--text); font-size: 1rem; padding: .6rem .8rem; width: 100%; }
.hk-login-box input:focus { outline: 2px solid var(--purple); border-color: var(--purple); }

/* ── Analytics grid ──────────────────────────────────────────────────────── */
.hk-analytics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }

/* ── Categories grid ─────────────────────────────────────────────────────── */
.hk-cat-grid { display: grid; grid-template-columns: 340px 1fr; gap: 1.5rem; align-items: start; }

@media (max-width: 820px) {
    .hk-edit-grid      { grid-template-columns: 1fr; }
    .hk-form-row       { grid-template-columns: 1fr; }
    .hk-analytics-grid { grid-template-columns: 1fr; }
    .hk-cat-grid       { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .hk-item-fields { flex-direction: column; align-items: stretch; }
    .hk-item-qty, .hk-item-skin, .hk-item-container { width: 100%; }
}
