:root {
    --ink: #22314e;
    --ink-soft: #415579;
    --coral: #f26d5d;
    --coral-deep: #db5d4f;
    --sand: #f7f2ea;
    --sand-deep: #efe5d6;
    --gold: #f6bf4f;
    --line: rgba(34, 49, 78, 0.12);
    --surface: rgba(255, 255, 255, 0.88);
    --surface-strong: #ffffff;
    --shadow: 0 20px 60px rgba(34, 49, 78, 0.10);
    --radius-lg: 26px;
    --radius-md: 18px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top right, rgba(242, 109, 93, 0.14), transparent 28%),
        radial-gradient(circle at left 20%, rgba(246, 191, 79, 0.18), transparent 22%),
        linear-gradient(180deg, #fbf7f1 0%, #f6efe4 100%);
}

a {
    color: var(--ink);
}

.page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 32px 22px 56px;
}

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

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: inherit;
}

.brand-logo {
    width: 168px;
    max-width: 100%;
    height: auto;
}

.brand-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.brand-kicker {
    margin: 0;
    color: var(--coral);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.brand-title {
    margin: 0;
    font-size: 0.98rem;
    color: var(--ink-soft);
}

.header-chip,
.host-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(34, 49, 78, 0.1);
    background: rgba(255, 255, 255, 0.72);
    color: var(--ink-soft);
    font-size: 0.92rem;
}

.page-hero,
.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.8fr);
    gap: 24px;
    align-items: stretch;
    margin-bottom: 24px;
}

.auth-shell {
    min-height: calc(100vh - 88px);
    align-items: center;
}

.hero-card,
.card {
    background: var(--surface);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.hero-card {
    padding: 34px;
    position: relative;
    overflow: hidden;
}

.hero-card::after {
    content: "";
    position: absolute;
    right: -80px;
    bottom: -90px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(246, 191, 79, 0.26), transparent 70%);
    pointer-events: none;
}

.card {
    padding: 24px;
}

h1, h2, h3 {
    margin-top: 0;
    letter-spacing: -0.03em;
}

h1 {
    font-size: clamp(2rem, 3vw, 3.2rem);
    line-height: 1.04;
    margin-bottom: 14px;
}

.page-lead {
    margin: 0;
    max-width: 760px;
    color: var(--ink-soft);
    font-size: 1.02rem;
    line-height: 1.65;
}

.section-label {
    margin: 0 0 12px;
    color: var(--coral);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero-actions {
    margin-top: 24px;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
}

.stack {
    display: grid;
    gap: 18px;
}

.button,
button,
input[type="submit"] {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 11px 16px;
    border: 0;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    font: inherit;
    font-weight: 700;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
    box-shadow: 0 10px 24px rgba(34, 49, 78, 0.18);
}

.button:hover,
button:hover,
input[type="submit"]:hover {
    transform: translateY(-1px);
    background: #1c2940;
}

.button-secondary {
    background: rgba(34, 49, 78, 0.08);
    color: var(--ink);
    box-shadow: none;
}

.button-secondary:hover {
    background: rgba(34, 49, 78, 0.14);
}

.button-accent {
    background: linear-gradient(135deg, var(--coral) 0%, var(--coral-deep) 100%);
}

.button-accent:hover {
    background: linear-gradient(135deg, #e86a5b 0%, #cf5648 100%);
}

.flash-success,
.flash-error,
.flash-warning {
    padding: 14px 16px;
    border-radius: 16px;
    margin: 0;
    border: 1px solid transparent;
}

.flash-success {
    background: #dcfce7;
    border-color: #bbf7d0;
    color: #166534;
}

.flash-error {
    background: #fee2e2;
    border-color: #fecaca;
    color: #991b1b;
}

.flash-warning {
    background: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
}

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

.field-card,
.metric-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(249, 244, 236, 0.92) 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 16px 18px;
}

.metric-value {
    margin-top: 6px;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--ink);
}

.muted {
    color: #687791;
}

.eyebrow {
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--coral);
}

.status-active,
.status-revoked,
.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.86rem;
}

.status-active {
    background: #dcfce7;
    color: #166534;
}

.status-revoked {
    background: #fee2e2;
    color: #991b1b;
}

label {
    display: block;
    margin-top: 14px;
    font-weight: 700;
    color: var(--ink);
}

input,
textarea,
select {
    width: 100%;
    margin-top: 7px;
    padding: 12px 14px;
    border: 1px solid rgba(34, 49, 78, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--ink);
    font: inherit;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

code {
    padding: 3px 7px;
    border-radius: 8px;
    background: rgba(34, 49, 78, 0.08);
    color: #FFFFFF;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: transparent;
}

thead th {
    color: var(--ink-soft);
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

th,
td {
    border-bottom: 1px solid rgba(34, 49, 78, 0.08);
    padding: 14px 10px;
    text-align: left;
    vertical-align: top;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.62);
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.inline-form {
    display: inline-flex;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
    gap: 18px;
}

.aside-note {
    padding: 20px;
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, rgba(34, 49, 78, 0.96) 0%, rgba(28, 41, 64, 0.96) 100%);
    color: #fff;
}

.aside-note h3,
.aside-note p,
.aside-note li {
    color: #fff;
}

.aside-note ul {
    margin: 0;
    padding-left: 18px;
}

.list-clean {
    margin: 0;
    padding-left: 18px;
}

.list-clean li + li {
    margin-top: 10px;
}

.pagination {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(34, 49, 78, 0.12);
    text-decoration: none;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.84);
}

.pagination .current {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0 0;
}

.qr-box {
    margin-top: 10px;
    display: inline-flex;
    padding: 12px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--line);
}

.qr-box img {
    display: block;
    width: 220px;
    height: 220px;
    object-fit: contain;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-actions {
    margin-top: 22px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

@media (max-width: 860px) {
    .page-hero,
    .auth-shell,
    .split,
    .form-row {
        grid-template-columns: 1fr;
    }

    .app-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page {
        padding: 24px 16px 40px;
    }

    .hero-card,
    .card {
        padding: 22px;
    }

    h1 {
        font-size: 2rem;
    }
}
