:root {
    --bg: #0f1b2a;
    --bg-soft: #16263b;
    --card: #ffffff;
    --ink: #1c2733;
    --muted: #61707f;
    --line: #e2e8ef;
    --brand: #0e6f6f;
    --brand-strong: #0a5555;
    --accent: #e8a33d;
    --ok: #1e874b;
    --warn: #b4402f;
    --radius: 14px;
    --shadow: 0 24px 60px rgba(4, 16, 30, 0.35);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(1100px 500px at 100% -10%, #17405c 0%, transparent 60%),
        radial-gradient(900px 500px at -10% 110%, #12434a 0%, transparent 55%),
        var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 16px;
    line-height: 1.5;
}

.card {
    width: 100%;
    max-width: 460px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px 30px 26px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.brand__mark {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(160deg, var(--brand), var(--brand-strong));
    color: #fff;
    font-size: 20px;
}

.brand__name { margin: 0; font-weight: 700; letter-spacing: .2px; }
.brand__sub { margin: 0; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }

h1 { font-size: 1.3rem; margin: 0 0 8px; }

.muted { color: var(--muted); }
.small { font-size: .82rem; }

label {
    display: block;
    margin: 16px 0 6px;
    font-size: .86rem;
    font-weight: 600;
}

input[type="email"], input[type="password"], input[type="text"], input[type="number"] {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 1rem;
    background: #fbfcfe;
    color: var(--ink);
}

input:focus { outline: 2px solid rgba(14, 111, 111, .35); border-color: var(--brand); }

.pw { position: relative; display: flex; gap: 8px; align-items: center; }
.pw input { flex: 1; }

.pw__toggle {
    border: 1px solid var(--line);
    background: #f3f6fa;
    color: var(--muted);
    border-radius: 9px;
    padding: 9px 10px;
    font-size: .78rem;
    cursor: pointer;
    white-space: nowrap;
}
.pw__toggle:hover { background: #e9eef5; color: var(--ink); }

.strength { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.strength__bar {
    flex: 1;
    height: 7px;
    border-radius: 999px;
    background: #edf1f6;
    overflow: hidden;
}
.strength__bar i { display: block; height: 100%; width: 0; background: #c0392b; transition: width .25s ease, background .25s ease; }
.strength__label { font-size: .76rem; color: var(--muted); min-width: 76px; text-align: right; }

.actions { margin: 16px 0 4px; }

.btn {
    display: inline-block;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 11px 16px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-strong); }
.btn--ghost { background: #f3f6fa; border-color: var(--line); color: var(--brand-strong); }
.btn--ghost:hover { background: #e9eef5; }
.btn--block { width: 100%; margin-top: 18px; }
.btn--danger { background: #fff; border-color: #f0c8c0; color: var(--warn); }
.btn--danger:hover { background: #fdf2f0; }
.btn--small { padding: 7px 10px; font-size: .8rem; }

.alert {
    background: #fdecea;
    border: 1px solid #f5c6c0;
    color: #922d20;
    border-radius: 10px;
    padding: 11px 13px;
    font-size: .88rem;
    margin: 4px 0 6px;
}

.notice { text-align: left; }
.notice--ok { border-left: 4px solid var(--ok); padding-left: 14px; }
.notice--warn { border-left: 4px solid var(--accent); padding-left: 14px; }

/* ---------- Admin ---------- */
.admin { max-width: 940px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
td .mono, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; word-break: break-all; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.badge--active { background: #e5f5ec; color: var(--ok); }
.badge--used { background: #eef1f6; color: var(--muted); }
.badge--expired { background: #fdf1dc; color: #98621a; }
.badge--revoked { background: #fdecea; color: var(--warn); }

.rowactions { display: flex; gap: 6px; flex-wrap: wrap; }

.copyfield { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.copyfield input { font-family: ui-monospace, monospace; font-size: .8rem; }

.section { margin-top: 30px; }
.section h2 { font-size: 1.05rem; margin: 0 0 4px; }
.section .hint { color: var(--muted); font-size: .84rem; margin: 0 0 14px; }

.flash { background: #e5f5ec; border: 1px solid #bfe6cf; color: #15663a; border-radius: 10px; padding: 10px 13px; font-size: .88rem; margin-bottom: 14px; }
.flash--warn { background: #fdf1dc; border-color: #f2d9ab; color: #8a5a12; }

.inline-form { display: inline; }
.field-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.field-inline input[type="text"], .field-inline input[type="number"] { width: auto; }

@media (max-width: 560px) {
    .card { padding: 22px 18px; }
    .hide-sm { display: none; }
}
