* {
    box-sizing: border-box;
}

:root {
    --bg: #080b12;
    --bg-soft: #0c1220;
    --panel: #111827;
    --panel-2: #151f33;
    --line: #26344f;
    --line-soft: rgba(148, 163, 184, 0.18);
    --text: #edf5ff;
    --muted: #9aa9bd;
    --accent: #22d3ee;
    --accent-2: #7c3aed;
    --accent-3: #38bdf8;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #22c55e;
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(34, 211, 238, 0.14), transparent 34rem),
        radial-gradient(circle at top right, rgba(124, 58, 237, 0.16), transparent 32rem),
        var(--bg);
    color: var(--text);
    font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: #a5f3fc;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    align-items: center;
    background: rgba(8, 11, 18, 0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line-soft);
    display: flex;
    gap: 22px;
    justify-content: space-between;
    min-height: 76px;
    padding: 12px 28px;
}

.brand {
    align-items: center;
    color: var(--text);
    display: inline-flex;
    flex: 0 0 auto;
    gap: 12px;
    font-weight: 800;
    min-width: max-content;
}

.brand img {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(124, 58, 237, 0.2));
    border: 1px solid rgba(34, 211, 238, 0.28);
    border-radius: 8px;
    height: 42px;
    object-fit: contain;
    padding: 4px;
    width: 42px;
}

.brand span {
    display: grid;
    gap: 1px;
}

.brand strong {
    color: #ffffff;
    font-size: 16px;
    letter-spacing: 0;
    line-height: 1.1;
}

.brand small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.topbar nav {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.topbar nav a {
    border: 1px solid transparent;
    border-radius: 7px;
    color: #c7d2e4;
    font-weight: 700;
    padding: 8px 10px;
}

.topbar nav a:hover {
    background: rgba(34, 211, 238, 0.09);
    border-color: rgba(34, 211, 238, 0.2);
    color: #ffffff;
}

.container {
    margin: 0 auto;
    max-width: 1240px;
    padding: 30px 28px 48px;
}

.login-page {
    display: grid;
    grid-template-rows: auto 1fr;
}

.login-page .topbar {
    justify-content: center;
}

.login-page .container {
    align-content: center;
    display: grid;
    max-width: 520px;
    min-height: calc(100vh - 76px);
    padding: 32px 18px;
    width: 100%;
}

.page-heading {
    align-items: end;
    border-bottom: 1px solid var(--line-soft);
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    justify-content: space-between;
    margin-bottom: 22px;
    padding-bottom: 16px;
}

.page-heading p {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    margin: 0;
    text-transform: uppercase;
}

h1 {
    color: #ffffff;
    font-size: 28px;
    line-height: 1.15;
    margin: 0;
}

.login-page h1 {
    margin: 0 0 18px;
    text-align: center;
}

h2 {
    color: #ffffff;
    font-size: 18px;
    margin: 0 0 14px;
}

.panel {
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(12, 18, 32, 0.98));
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin: 18px 0;
    overflow-x: auto;
    padding: 18px;
}

.login-page .panel {
    border-color: rgba(34, 211, 238, 0.25);
    margin: 0;
}

.login-brand {
    align-items: center;
    display: grid;
    justify-items: center;
    margin-bottom: 18px;
    text-align: center;
}

.login-brand img {
    height: 72px;
    margin-bottom: 10px;
    object-fit: contain;
    width: 72px;
}

.login-brand strong {
    color: #ffffff;
    font-size: 22px;
    line-height: 1.1;
}

.login-brand span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    margin-top: 3px;
    text-transform: uppercase;
}

.narrow {
    max-width: 560px;
}

.stats {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
}

.stats div {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.1), rgba(124, 58, 237, 0.1)), var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    min-height: 102px;
    padding: 16px;
}

.stats strong {
    color: #ffffff;
    display: block;
    font-size: 30px;
    line-height: 1.1;
}

.stats span {
    color: var(--muted);
    display: block;
    font-weight: 700;
    margin-top: 8px;
}

.section-title,
.toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 14px;
}

table {
    border-collapse: collapse;
    min-width: 760px;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid var(--line-soft);
    padding: 12px 10px;
    text-align: left;
    vertical-align: top;
}

th {
    color: #9fb2ca;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

tr:hover td {
    background: rgba(34, 211, 238, 0.035);
}

code,
.mono-wrap {
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.16);
    border-radius: 6px;
    color: #b8f7ff;
    display: inline-block;
    font-family: Consolas, Monaco, monospace;
    overflow-wrap: anywhere;
    padding: 2px 6px;
}

.form {
    display: grid;
    gap: 14px;
}

.inline-form {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.inline-form input,
.inline-form select {
    max-width: 220px;
}

label {
    color: #d7e1ef;
    display: grid;
    gap: 6px;
    font-weight: 800;
}

.check {
    align-items: center;
    display: flex;
    gap: 8px;
}

.check input {
    width: auto;
}

input,
select,
textarea {
    background: #0b1220;
    border: 1px solid #2c3b58;
    border-radius: 7px;
    color: var(--text);
    font: inherit;
    min-height: 42px;
    padding: 10px 12px;
    width: 100%;
}

textarea {
    min-height: 110px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.14);
    outline: 0;
}

button,
.button {
    background: linear-gradient(135deg, #0891b2, #4f46e5);
    border: 0;
    border-radius: 7px;
    color: #ffffff;
    cursor: pointer;
    display: inline-block;
    font: inherit;
    font-weight: 900;
    line-height: 1.2;
    padding: 10px 14px;
}

button:hover,
.button:hover {
    color: #ffffff;
    filter: brightness(1.08);
}

.secondary {
    background: #162235;
    border: 1px solid #30415e;
    color: #c7d2e4;
}

.danger {
    background: linear-gradient(135deg, #dc2626, #7f1d1d);
}

.actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.actions form {
    display: inline-flex;
    gap: 8px;
    margin: 0;
}

.badge {
    border: 1px solid transparent;
    border-radius: 999px;
    display: inline-block;
    font-size: 11px;
    font-weight: 900;
    padding: 4px 8px;
    text-transform: uppercase;
}

.badge.active {
    background: rgba(34, 197, 94, 0.14);
    border-color: rgba(34, 197, 94, 0.32);
    color: #86efac;
}

.badge.suspended,
.badge.expired {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.32);
    color: #facc15;
}

.badge.revoked {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.32);
    color: #fca5a5;
}

.badge.inactive {
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.24);
    color: #cbd5e1;
}

.notice,
.error {
    border-radius: 7px;
    font-weight: 800;
    margin: 12px 0;
    padding: 12px;
}

.notice {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.28);
    color: #bbf7d0;
}

.error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.28);
    color: #fecaca;
}

@media (max-width: 860px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px 18px;
    }

    .topbar nav {
        justify-content: flex-start;
        width: 100%;
    }

    .topbar nav a {
        background: rgba(255, 255, 255, 0.035);
    }

    .container {
        padding: 22px 16px 36px;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    h1 {
        font-size: 24px;
    }

    table {
        min-width: 680px;
    }
}
