:root {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #17221d;
    background: #f3f6f4;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #f3f6f4;
}

button,
input {
    font: inherit;
}

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    background: #ffffff;
    border-bottom: 1px solid #dce4df;
}

.header-content {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    color: #17221d;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
}

main.container {
    padding-top: 48px;
    padding-bottom: 64px;
}

.auth-panel {
    width: min(100%, 440px);
    margin: 40px auto;
}

.card {
    padding: 32px;
    background: #ffffff;
    border: 1px solid #dce4df;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(20, 38, 29, 0.06);
}

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

h1 {
    margin-bottom: 8px;
    font-size: 28px;
}

h2 {
    font-size: 20px;
}

.muted {
    color: #617068;
    line-height: 1.6;
}

.field {
    margin-top: 24px;
}

.field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 650;
}

.field input {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    color: #17221d;
    background: #ffffff;
    border: 1px solid #aebbb4;
    border-radius: 8px;
}

.field input:focus {
    border-color: #126b46;
    outline: 3px solid rgba(18, 107, 70, 0.15);
}

.field-error {
    margin-top: 8px;
    color: #a12727;
    font-size: 14px;
}

.button {
    min-height: 42px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
}

.button-primary {
    color: #ffffff;
    background: #126b46;
}

.button-primary:hover {
    background: #0d5839;
}

.button-secondary {
    color: #26352d;
    background: #ffffff;
    border-color: #b8c4bd;
}

.button-full {
    width: 100%;
    margin-top: 28px;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
}

.alert {
    margin-bottom: 24px;
    padding: 14px 16px;
    border-radius: 8px;
}

.alert-success {
    color: #155c3d;
    background: #e4f4eb;
    border: 1px solid #acd4bd;
}

@media (max-width: 600px) {
    main.container {
        padding-top: 24px;
    }

    .card {
        padding: 24px;
    }
}

.form-card {
    max-width: 900px;
}

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

.section-heading {
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid #e1e7e3;
}

.field-help {
    margin-top: 8px;
    color: #68776f;
    font-size: 14px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 32px;
}

.table-wrapper {
    overflow-x: auto;
    background: #ffffff;
    border: 1px solid #dce4df;
    border-radius: 12px;
}

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

th,
td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #e5ebe7;
}

th {
    color: #5d6c64;
    font-size: 14px;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.table-action {
    text-align: right;
}

.table-action a {
    color: #126b46;
    font-weight: 700;
}

.status {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    background: #e8ecea;
    font-size: 13px;
    font-weight: 700;
}

.status-connected {
    color: #155c3d;
    background: #e4f4eb;
}

.status-revoked,
.status-disconnected,
.status-scope_missing {
    color: #8a2929;
    background: #f8e5e5;
}

@media (max-width: 700px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .page-heading {
        flex-direction: column;
        gap: 16px;
    }
}

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

.detail-grid > .card:first-child {
    grid-row: span 2;
}

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

.details {
    margin: 28px 0 0;
}

.details > div {
    padding: 14px 0;
    border-bottom: 1px solid #e5ebe7;
}

.details > div:last-child {
    border-bottom: 0;
}

.details dt {
    margin-bottom: 5px;
    color: #68776f;
    font-size: 14px;
}

.details dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 650;
}

.details.compact {
    margin-top: 20px;
}

.standalone-label {
    display: block;
    margin: 20px 0 8px;
    font-weight: 650;
}

.readonly-value {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    color: #26352d;
    background: #f5f7f6;
    border: 1px solid #b8c4bd;
    border-radius: 8px;
}

.logs-card {
    margin-top: 24px;
}

@media (max-width: 800px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-grid > .card:first-child {
        grid-row: auto;
    }
}

.public-page {
    width: min(100% - 32px, 520px);
    min-height: 100vh;
    margin: 0 auto;
    display: grid;
    place-items: center;
    padding: 32px 0;
}

.public-card {
    width: 100%;
}

.alert-error {
    color: #8a2929;
    background: #f8e5e5;
    border: 1px solid #e6b6b6;
}

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

.action-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.danger-zone {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #e5caca;
}

.danger-zone h3 {
    margin: 0 0 8px;
    color: #8a2929;
}

.confirmation {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0;
}

.button-danger {
    color: #ffffff;
    background: #a83232;
}

.button-danger:hover {
    background: #8f2929;
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}