* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: #1f2937;
    background: #f4f7fb;
    font-family: Arial, Helvetica, sans-serif;
}

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

.auth-page {
    display: grid;
    place-items: center;
    padding: 32px;
    background:
            linear-gradient(135deg, rgba(16, 185, 129, 0.16), transparent 34%),
            linear-gradient(315deg, rgba(37, 99, 235, 0.18), transparent 38%),
            #eef4f8;
}

.login-panel {
    width: min(460px, 100%);
    padding: 32px;
    border: 1px solid #d8e0ea;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 48px rgba(31, 41, 55, 0.12);
}

.brand-block {
    margin-bottom: 28px;
}

.eyebrow {
    margin: 0 0 8px;
    color: #0f766e;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    color: #111827;
    font-size: 32px;
    line-height: 1.2;
}

.client-request {
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    color: #1e3a8a;
    background: #eff6ff;
    font-size: 14px;
    line-height: 1.5;
}

.client-request strong {
    font-weight: 800;
}

p {
    color: #4b5563;
    line-height: 1.6;
}

.login-form {
    display: grid;
    gap: 12px;
}

.login-form label,
.admin-form label,
.stack-form label {
    font-size: 14px;
    font-weight: 700;
}

.login-form input,
.admin-form input,
.admin-form select,
.stack-form input,
.stack-form select {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 15px;
}

.login-form button,
.admin-form button,
.stack-form button,
.link-button {
    cursor: pointer;
}

.login-form button,
.admin-form button,
.stack-form button,
.primary-link {
    height: 44px;
    margin-top: 8px;
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    background: #2563eb;
    font-size: 15px;
    font-weight: 700;
}

.login-form .integrated-login-button {
    margin-top: 0;
    color: #1d4ed8;
    background: #dbeafe;
}

.primary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
}

.alert {
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
}

.alert.error {
    color: #991b1b;
    background: #fee2e2;
}

.alert.success {
    color: #166534;
    background: #dcfce7;
}

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

.auth-actions {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

.auth-action-link {
    width: 100%;
    height: 44px;
    margin-top: 0;
}

.account-list span {
    padding: 7px 10px;
    border: 1px solid #d8e0ea;
    border-radius: 999px;
    color: #475569;
    background: #f8fafc;
    font-size: 13px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding: 0 32px;
    border-bottom: 1px solid #d8e0ea;
    background: #ffffff;
}

.logo {
    font-size: 20px;
    font-weight: 800;
}

.topbar nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

.topbar a,
.link-button {
    border: 0;
    background: transparent;
    color: #475569;
    font: inherit;
    font-weight: 700;
}

.topbar .active {
    color: #2563eb;
}

.page-shell {
    width: min(1080px, calc(100% - 40px));
    margin: 42px auto;
}

.page-heading {
    padding: 36px;
    border-radius: 8px;
    color: #ffffff;
}

.page-heading h1,
.page-heading p,
.page-heading .eyebrow {
    color: #ffffff;
}

.admin-heading {
    background: linear-gradient(135deg, #0f172a, #2563eb);
}

.user-heading {
    background: linear-gradient(135deg, #0f766e, #1d4ed8);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 16px;
    margin-top: 18px;
}

.metric-card {
    min-height: 164px;
    padding: 22px;
    border: 1px solid #d8e0ea;
    border-radius: 8px;
    background: #ffffff;
}

.action-card {
    display: block;
    height: 100%;
}

.action-card:hover {
    border-color: #2563eb;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.12);
}

.metric-card span {
    color: #64748b;
    font-size: 14px;
    font-weight: 700;
}

.metric-card strong {
    display: block;
    margin: 14px 0 8px;
    color: #111827;
    font-size: 30px;
}

.admin-panel {
    margin-top: 18px;
    padding: 24px;
    border: 1px solid #d8e0ea;
    border-radius: 8px;
    background: #ffffff;
}

.narrow-shell {
    width: min(720px, calc(100% - 40px));
}

.panel-heading {
    margin-bottom: 18px;
}

.split-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

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

.panel-heading h2 {
    margin: 0;
    color: #111827;
    font-size: 24px;
}

.admin-form {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 160px 120px;
    gap: 12px;
    align-items: end;
}

.stack-form {
    display: grid;
    gap: 12px;
}

.stack-form .checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    margin-top: 4px;
}

.stack-form .checkbox-row input {
    width: 18px;
    height: 18px;
    padding: 0;
}

.form-actions {
    align-items: center;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.panel-actions .primary-link,
.panel-actions .secondary-link,
.form-actions button,
.form-actions .secondary-link {
    margin-top: 0;
}

.secondary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 16px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #475569;
    background: #ffffff;
    font-size: 15px;
    font-weight: 700;
}

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

.user-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.user-table th,
.user-table td {
    padding: 13px 12px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: middle;
}

.user-table th {
    color: #475569;
    background: #f8fafc;
    font-size: 13px;
    font-weight: 800;
}

.empty-cell {
    color: #64748b;
    text-align: center;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
}

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

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

.status-pill.pending {
    color: #854d0e;
    background: #fef3c7;
}

.table-action {
    color: #2563eb;
    font-weight: 800;
}

.admin-form label {
    grid-row: 1;
}

.admin-form input,
.admin-form select,
.admin-form button {
    grid-row: 2;
}

@media (max-width: 760px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
        padding: 16px 20px;
    }

    .topbar nav {
        flex-wrap: wrap;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .admin-form {
        grid-template-columns: 1fr;
    }

    .split-heading,
    .panel-actions,
    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-form label,
    .admin-form input,
    .admin-form select,
    .admin-form button {
        grid-row: auto;
    }

    .page-heading {
        padding: 28px;
    }
}
