:root {
    --bg: #081622;
    --bg-soft: #102437;
    --panel: rgba(9, 28, 42, 0.86);
    --panel-border: rgba(180, 226, 255, 0.16);
    --text: #f2f7fb;
    --muted: #a8bfcd;
    --accent: #3de0c5;
    --accent-strong: #16b89f;
    --warm: #ffc76a;
    --danger: #ff7a66;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(61, 224, 197, 0.18), transparent 32%),
        radial-gradient(circle at bottom right, rgba(255, 199, 106, 0.15), transparent 26%),
        linear-gradient(135deg, #04101a 0%, #0a1e2d 48%, #10293a 100%);
    color: var(--text);
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.portal-shell,
.admin-shell,
.bridge-shell,
.login-shell {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
}

.portal-body,
.admin-body,
.bridge-body,
.admin-login-body {
    padding: 2rem 0 4rem;
}

.portal-shell {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 1.5rem;
    align-items: stretch;
}

.brand-panel,
.portal-card,
.panel,
.bridge-card,
.login-card,
.stat-card {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 28px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.brand-panel,
.portal-card,
.bridge-card,
.login-card,
.panel {
    padding: 2rem;
}

.eyebrow {
    margin: 0 0 0.7rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.78rem;
    font-weight: 700;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    font-size: clamp(2.1rem, 4vw, 3.8rem);
    line-height: 0.98;
    margin-bottom: 1rem;
}

h2 {
    font-size: clamp(1.3rem, 2.4vw, 2rem);
    margin-bottom: 0.35rem;
}

.lead,
.muted,
.fact-card span {
    color: var(--muted);
}

.brand-facts,
.stats-grid,
.admin-grid,
.meta-grid {
    display: grid;
    gap: 1rem;
}

.brand-facts {
    margin: 2rem 0;
}

.fact-card,
.terms-box,
.alert,
.filter-tabs a,
.ghost-button,
.danger-button,
.primary-button,
input,
textarea,
select,
table {
    border-radius: 18px;
}

.fact-card,
.terms-box {
    padding: 1rem 1.1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.logo-frame {
    margin-top: 2rem;
    padding: 1.2rem;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 22px;
}

.logo-frame img {
    max-height: 96px;
    object-fit: contain;
}

.stack-form {
    display: grid;
    gap: 1rem;
}

label span {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--muted);
    font-size: 0.94rem;
}

input,
textarea,
select,
button {
    width: 100%;
    border: 1px solid rgba(168, 191, 205, 0.18);
    background: rgba(7, 18, 28, 0.78);
    color: var(--text);
    padding: 0.95rem 1rem;
    font: inherit;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    outline: 2px solid rgba(61, 224, 197, 0.35);
    border-color: rgba(61, 224, 197, 0.7);
}

.inline-checkbox {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
    padding: 0.9rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.inline-checkbox input {
    width: auto;
    margin-top: 0.15rem;
}

.primary-button,
.ghost-button,
.danger-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.primary-button {
    background: linear-gradient(135deg, var(--accent) 0%, var(--warm) 100%);
    border: none;
    color: #07202d;
}

.ghost-button {
    width: auto;
    background: transparent;
    border: 1px solid rgba(168, 191, 205, 0.22);
    color: var(--text);
}

.danger-button {
    width: auto;
    background: rgba(255, 122, 102, 0.12);
    border: 1px solid rgba(255, 122, 102, 0.38);
    color: #ffd8d2;
}

.primary-button:hover,
.ghost-button:hover,
.danger-button:hover {
    transform: translateY(-1px);
}

.alert {
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-error {
    background: rgba(255, 122, 102, 0.12);
    border-color: rgba(255, 122, 102, 0.32);
}

.alert-success {
    background: rgba(61, 224, 197, 0.12);
    border-color: rgba(61, 224, 197, 0.26);
}

.alert-info {
    background: rgba(255, 199, 106, 0.12);
    border-color: rgba(255, 199, 106, 0.28);
}

.bridge-shell,
.login-shell {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 6rem);
}

.bridge-card,
.login-card {
    width: min(560px, 100%);
}

.admin-topbar,
.panel-header,
.toolbar,
.actions-row,
.row-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.admin-topbar {
    margin-bottom: 1.5rem;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1.5rem;
}

.stat-card {
    padding: 1.3rem 1.4rem;
}

.stat-card span {
    display: block;
    color: var(--muted);
}

.stat-card strong {
    font-size: 2rem;
    margin-top: 0.3rem;
    display: block;
}

.admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 1.5rem;
}

.panel {
    margin-bottom: 1.5rem;
}

.meta-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.meta-grid div {
    padding: 0.9rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 18px;
}

.meta-grid strong,
.meta-grid span {
    display: block;
}

.meta-grid span {
    color: var(--muted);
    margin-top: 0.35rem;
}

.toolbar {
    margin: 1rem 0;
    flex-wrap: wrap;
}

.filter-tabs {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.filter-tabs a {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.filter-tabs a.active {
    background: rgba(61, 224, 197, 0.16);
    border-color: rgba(61, 224, 197, 0.34);
}

.search-form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.search-form input {
    min-width: 220px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
}

thead {
    background: rgba(255, 255, 255, 0.04);
}

th,
td {
    padding: 0.95rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.row-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.row-actions form {
    margin: 0;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.75rem;
    font-size: 0.84rem;
    border-radius: 999px;
    border: 1px solid transparent;
}

.status-active {
    background: rgba(61, 224, 197, 0.12);
    border-color: rgba(61, 224, 197, 0.3);
}

.status-not_active {
    background: rgba(255, 199, 106, 0.14);
    border-color: rgba(255, 199, 106, 0.28);
}

.status-expired {
    background: rgba(255, 122, 102, 0.12);
    border-color: rgba(255, 122, 102, 0.32);
}

.empty-state {
    text-align: center;
    color: var(--muted);
}

@media (max-width: 960px) {
    .portal-shell,
    .admin-grid,
    .stats-grid,
    .meta-grid {
        grid-template-columns: 1fr;
    }

    .admin-topbar,
    .toolbar,
    .search-form,
    .panel-header,
    .actions-row {
        align-items: stretch;
        flex-direction: column;
    }

    .ghost-button,
    .danger-button,
    .search-form button {
        width: 100%;
    }
}
