:root {
    --bg: #0f1216;
    --panel: #1a1f27;
    --panel-2: #222834;
    --text: #e6e9ef;
    --muted: #9aa4b2;
    --accent: #4c8dff;
    --accent-2: #3a6fd8;
    --ok: #2ecc71;
    --warn: #f1c40f;
    --err: #e74c3c;
    --border: #2b3240;
}
* { box-sizing: border-box; }
body {
    margin: 0; background: var(--bg); color: var(--text);
    font: 15px/1.5 -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar {
    background: var(--panel); border-bottom: 1px solid var(--border);
    padding: 12px 20px; display: flex; align-items: center; gap: 20px;
}
.brand { font-weight: 700; font-size: 18px; color: var(--text); }
.topbar nav a { margin-right: 16px; color: var(--muted); }
.topbar nav a.active { color: var(--text); }
.container { max-width: 1200px; margin: 28px auto; padding: 0 20px; }
.footer { text-align: center; color: var(--muted); padding: 30px 0; }
h1 { font-size: 24px; margin: 0 0 18px; }
h2 { font-size: 18px; margin: 24px 0 12px; }
.card {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 10px; padding: 20px; margin-bottom: 18px;
}
.price { font-size: 28px; font-weight: 700; }
label { display: block; margin: 12px 0 4px; color: var(--muted); font-size: 14px; }
input[type=text], input[type=email], input[type=number], input[type=password], select, textarea {
    width: 100%; padding: 10px 12px; background: var(--panel-2);
    border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 15px;
}
textarea { min-height: 80px; resize: vertical; }
.btn {
    display: inline-block; background: var(--accent); color: #fff; border: 0;
    padding: 10px 18px; border-radius: 8px; font-size: 15px; cursor: pointer; font-weight: 600;
}
.btn:hover { background: var(--accent-2); text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-danger { background: var(--err); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--panel-2); }
/* Puhább, áttetsző piros a kevésbé drasztikus műveletekhez (pl. Visszavon) */
.btn-warn { background: rgba(231,76,60,.16); color: #ea9a92; border: 1px solid rgba(231,76,60,.35); }
.btn-warn:hover { background: rgba(231,76,60,.30); color: #fff; }
/* Kompakt „X" ikon-gomb (törlés) */
.btn-x { padding: 3px 7px; font-weight: 700; line-height: 1; }
/* Admin felső menü – gombszerű linkek */
.navbtn {
    display: inline-block; padding: 6px 12px; margin: 0 6px 0 0;
    background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px;
    color: var(--muted); font-size: 13px; font-weight: 600;
}
.navbtn:hover { background: var(--border); color: var(--text); text-decoration: none; }
.navbtn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--muted); font-weight: 600; }
.badge { padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-active { background: rgba(46,204,113,.15); color: var(--ok); }
.badge-available { background: rgba(76,141,255,.15); color: var(--accent); }
.badge-revoked, .badge-pending { background: rgba(241,196,15,.15); color: var(--warn); }
.badge-issued { background: rgba(46,204,113,.15); color: var(--ok); }
.badge-deactivated { background: rgba(154,164,178,.16); color: var(--muted); }
.muted { color: var(--muted); }
.serial { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .4px; font-size: 13px; }
.copy-btn { margin-left: 8px; vertical-align: middle; }

/* Szériaszám-lista: minden szöveg 12px, gombok 10px */
.serials-list, .serials-list th, .serials-list td, .serials-list .serial { font-size: 12px; }
.serials-list .btn, .serials-list .btn-sm { font-size: 10px; padding: 3px 7px; }

/* Email-cella a szériaszám-listában: érték + ceruza gomb, alatta az inline szerkesztő.
   A [hidden] szabályok kellenek, mert a .btn/.email-form saját `display` értéke
   egyébként felülírná a böngésző alapértelmezett [hidden]{display:none} szabályát. */
.email-cell .email-edit-btn { margin-left: 6px; vertical-align: middle; font-size: 12px; }
.email-form { display: flex; gap: 4px; align-items: center; margin-top: 3px; }
.email-form[hidden], .btn[hidden] { display: none; }
.email-form input[type="email"] { width: 190px; font-size: 11px; padding: 2px 5px; }

/* Vásárlás-lista: minden szöveg 11px a sorokban */
.purchases-list th, .purchases-list td,
.purchases-list .badge, .purchases-list .btn, .purchases-list small { font-size: 11px; }
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 14px; border: 1px solid var(--border); }
.flash-info { background: rgba(76,141,255,.1); }
.flash-success { background: rgba(46,204,113,.12); color: #b8f0cf; }
.flash-error { background: rgba(231,76,60,.12); color: #f5c3bd; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.stat .n { font-size: 26px; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 13px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 16px; }
.filters > div { flex: 1; min-width: 140px; }
.inline { display: inline; }
/* Toggle kapcsoló (checkbox switch) */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: var(--panel-2); border: 1px solid var(--border);
    border-radius: 22px; cursor: pointer; transition: .2s; }
.switch .slider::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 2px;
    background: var(--muted); border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(18px); background: #fff; }
/* Művelet-oszlop: a tartalomhoz zsugorodik (nincs nagy térköz a tábla széléig) */
.row-actions { white-space: nowrap; width: 1%; }
.row-actions form + form { margin-left: 6px; }
