:root {
    --TEXT_PRIMARY: #F5F5F5;
    --TEXT_SECONDARY: #A0A0A0;
    --TEXT_HIGHLIGHT: #20B8CD;
    --LINK_TEXT: #20B8CD;
    --SURFACE_MAIN: #1A1A1A;
    --SURFACE_VARIANT: #242424;
    --OUTLINE_SOFT: #3A3A3A;
    --TOGGLE_ON_START: #20B8CD;
    --TOGGLE_ON_END: #1AA3B5;
    --TOGGLE_OFF_START: #3A3A3A;
    --TOGGLE_OFF_END: #2A2A2A;
    --PRIMARY: #20B8CD;
    --NUMBER_TEXT_COLOR: #20B8CD;
    --bg-dark: var(--SURFACE_MAIN);
    --bg-deep: var(--SURFACE_MAIN);
    --bg-card: rgba(36, 36, 36, 0.88);
    --bg-card-strong: rgba(26, 26, 26, 0.96);
    --accent: var(--PRIMARY);
    --accent-soft: rgba(32, 184, 205, 0.18);
    --accent-strong: var(--TEXT_HIGHLIGHT);
    --text-primary: var(--TEXT_PRIMARY);
    --text-muted: var(--TEXT_SECONDARY);
    --border: var(--OUTLINE_SOFT);
    --danger: var(--TEXT_HIGHLIGHT);
    --success: var(--TEXT_HIGHLIGHT);
    --warning: var(--TEXT_HIGHLIGHT);
    --surface-main-rgb: 26, 26, 26;
    --surface-variant-rgb: 36, 36, 36;
    --outline-soft-rgb: 58, 58, 58;
    --primary-rgb: 32, 184, 205;
    --teal-soft: rgba(var(--primary-rgb), 0.12);
    --teal-medium: rgba(var(--primary-rgb), 0.16);
    --teal-strong: rgba(var(--primary-rgb), 0.28);
    --teal-border: rgba(var(--primary-rgb), 0.3);
    --teal-focus: rgba(var(--primary-rgb), 0.82);
    --surface-main-soft: rgba(var(--surface-main-rgb), 0.92);
    --surface-variant-soft: rgba(var(--surface-variant-rgb), 0.92);
    --surface-outline-soft: rgba(var(--outline-soft-rgb), 0.82);
    --shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
}

body {
    background:
        radial-gradient(circle at top left, rgba(var(--primary-rgb), 0.14), transparent 34%),
        radial-gradient(circle at top right, rgba(var(--primary-rgb), 0.1), transparent 30%),
        linear-gradient(180deg, var(--SURFACE_MAIN) 0%, var(--TOGGLE_OFF_END) 100%);
    color: var(--text-primary);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

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

a:hover {
    color: var(--TEXT_HIGHLIGHT);
}

code {
    font-family: "Consolas", "Courier New", monospace;
    color: var(--NUMBER_TEXT_COLOR);
}

.app-shell {
    min-height: 100vh;
    padding: 24px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-main-soft);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
    position: sticky;
    top: 20px;
    z-index: 10;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, var(--TEXT_PRIMARY), var(--accent));
    box-shadow: 0 0 0 8px rgba(var(--primary-rgb), 0.14);
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-text strong {
    font-family: "Georgia", serif;
    font-size: 1.05rem;
    letter-spacing: 0.04em;
}

.brand-text small {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 0.68rem;
}

.topnav {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
}

.topnav a {
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--text-muted);
    transition: 160ms ease;
}

.topnav a:hover {
    color: var(--TEXT_HIGHLIGHT);
    background: var(--teal-soft);
}

.page {
    width: min(1180px, 100%);
    margin: 32px auto 0;
}

.hero,
.panel,
.card,
.table-card,
.form-card,
.stat-card,
.one-time-key {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, var(--bg-card-strong), var(--bg-card));
    box-shadow: var(--shadow);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
    gap: 24px;
    padding: 32px;
}

.hero-copy h1,
.page-heading h1,
.section-heading h2,
.card h3,
.one-time-key h2 {
    margin: 0 0 12px;
    font-family: "Georgia", serif;
    letter-spacing: 0.02em;
}

.hero-copy p,
.muted,
.card p,
.one-time-key p {
    color: var(--text-muted);
}

.hero-copy .eyebrow,
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-strong);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.76rem;
    margin-bottom: 18px;
}

.hero-copy .eyebrow::before,
.eyebrow::before {
    content: "";
    width: 38px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent));
}

.hero-copy p {
    max-width: 56ch;
    line-height: 1.65;
    margin-bottom: 24px;
}

.hero-actions,
.inline-actions,
.card-actions,
.table-actions,
.form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-side {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 22px;
}

.section-heading {
    margin: 30px 0 16px;
}

.grid {
    display: grid;
    gap: 20px;
}

.grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card,
.panel,
.form-card,
.table-card,
.stat-card,
.one-time-key {
    padding: 24px;
}

.stat-card .stat-label {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.74rem;
}

.stat-card .stat-value {
    display: block;
    margin-top: 10px;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-strong);
}

.card .meta,
.stat-card .meta {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.detail-list {
    display: grid;
    gap: 10px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(var(--outline-soft-rgb), 0.75);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row span:first-child {
    color: var(--text-muted);
}

.login-card {
    padding: 26px;
}

.form-grid {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 8px;
    font-size: 0.95rem;
    color: var(--text-muted);
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-variant-soft);
    outline: none;
    transition: border-color 160ms ease, background 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--teal-focus);
    background: rgba(var(--outline-soft-rgb), 0.95);
}

input::placeholder,
textarea::placeholder {
    color: var(--TEXT_SECONDARY);
    opacity: 1;
}

select option {
    color: var(--TEXT_PRIMARY);
    background: var(--SURFACE_VARIANT);
}

input:disabled,
select:disabled,
textarea:disabled,
button:disabled {
    color: var(--TEXT_SECONDARY);
}

input[type="checkbox"],
input[type="range"] {
    accent-color: var(--PRIMARY);
}

input[type="number"] {
    color: var(--NUMBER_TEXT_COLOR);
}

.btn,
button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.55;
    cursor: wait;
    transform: none;
}

.btn-primary {
    color: var(--SURFACE_MAIN);
    background: linear-gradient(135deg, var(--TOGGLE_ON_START), var(--TOGGLE_ON_END));
    box-shadow: 0 14px 30px var(--teal-strong);
}

.btn-secondary {
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--TOGGLE_OFF_START), var(--TOGGLE_OFF_END));
    border: 1px solid var(--border);
}

.btn-danger {
    color: var(--TEXT_HIGHLIGHT);
    background: linear-gradient(135deg, var(--TOGGLE_OFF_START), var(--TOGGLE_OFF_END));
    border: 1px solid var(--teal-border);
}

.alert {
    margin-bottom: 18px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
}

.alert-error {
    color: var(--TEXT_PRIMARY);
    background: linear-gradient(135deg, rgba(var(--surface-variant-rgb), 0.96), rgba(var(--surface-main-rgb), 0.96));
    border-color: var(--teal-border);
}

.alert-success {
    color: var(--TEXT_PRIMARY);
    background: var(--teal-soft);
    border-color: var(--teal-border);
}

.alert-info {
    color: var(--TEXT_PRIMARY);
    background: linear-gradient(135deg, rgba(var(--surface-variant-rgb), 0.96), rgba(var(--surface-main-rgb), 0.96));
    border-color: var(--teal-border);
}

.one-time-key {
    margin-bottom: 24px;
    background:
        radial-gradient(circle at top right, rgba(var(--primary-rgb), 0.18), transparent 42%),
        linear-gradient(180deg, rgba(var(--surface-main-rgb), 0.98), rgba(var(--surface-variant-rgb), 0.96));
}

.one-time-key code {
    display: inline-block;
    padding: 16px 18px;
    margin: 8px 0 10px;
    border-radius: 14px;
    background: rgba(var(--surface-main-rgb), 0.88);
    font-size: 1.15rem;
    letter-spacing: 0.14em;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    background: rgba(42, 42, 42, 0.9);
    color: var(--text-muted);
}

.pill.success {
    background: var(--teal-medium);
    color: var(--TEXT_PRIMARY);
}

.pill.warning {
    background: var(--teal-soft);
    color: var(--TEXT_PRIMARY);
}

.pill.danger {
    background: linear-gradient(135deg, rgba(var(--surface-variant-rgb), 0.96), rgba(var(--surface-main-rgb), 0.96));
    color: var(--TEXT_HIGHLIGHT);
    border: 1px solid var(--teal-border);
}

.pill.muted {
    background: rgba(42, 42, 42, 0.78);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--surface-outline-soft);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
}

tbody tr:hover {
    background: rgba(var(--primary-rgb), 0.06);
}

.split {
    display: grid;
    gap: 20px;
    grid-template-columns: 1.15fr 0.85fr;
}

.form-inline > * {
    flex: 1 1 160px;
}

.support-note {
    margin-top: 16px;
    color: var(--text-muted);
    font-size: 0.94rem;
}

.dashboard-shell {
    display: grid;
    gap: 24px;
}

.empty-state {
    padding: 26px;
    text-align: center;
    border-radius: var(--radius-lg);
    border: 1px dashed rgba(var(--outline-soft-rgb), 0.92);
    color: var(--text-muted);
}

.footer-note {
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

@media (max-width: 980px) {
    .hero,
    .split,
    .grid.two,
    .grid.three,
    .grid.four {
        grid-template-columns: 1fr;
    }

    .topbar,
    .page-heading {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 720px) {
    .app-shell {
        padding: 16px;
    }

    .hero,
    .card,
    .panel,
    .form-card,
    .table-card,
    .stat-card,
    .one-time-key {
        padding: 20px;
    }

    .topbar {
        border-radius: 24px;
    }
}
