:root {
    color-scheme: light;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #202124;
    background: #f6f7f9;
    line-height: 1.5;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: #195ab4; }
.container { width: min(100% - 2rem, 72rem); margin-inline: auto; }
main { padding-block: 2rem; }

.site-header { background: #fff; border-bottom: 1px solid #d8dce3; }
.header-content { display: flex; align-items: center; gap: 2rem; min-height: 4rem; }
.brand { color: inherit; font-weight: 750; text-decoration: none; }
nav { display: flex; gap: 1rem; }
.admin-email { margin-left: auto; color: #5d6470; overflow-wrap: anywhere; }

form { max-width: 42rem; }
label { display: block; margin-bottom: .4rem; font-weight: 650; }
.form-row { display: flex; gap: .6rem; }
input, select, textarea, button, .button { border: 1px solid #aeb5c0; border-radius: .35rem; font: inherit; padding: .65rem .8rem; }
input, select, textarea { width: 100%; background: #fff; color: inherit; }
button, .button { background: #195ab4; border-color: #195ab4; color: #fff; cursor: pointer; font-weight: 650; }
.button-secondary { background: #fff; color: #202124; border-color: #777f8c; }

:focus-visible { outline: 3px solid #ffbf47; outline-offset: 3px; }

.alert, .error-context { border-left: .35rem solid; border-radius: .25rem; margin-block: 1rem; padding: .8rem 1rem; background: #e8f5ec; border-color: #287a43; }
.alert-error, .error-context { background: #fdebec; border-color: #b4232c; }
.alert-warning { background: #fff5d6; border-color: #a66100; }
.error-context { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.badge { border-radius: 999px; display: inline-block; font-size: .85rem; font-weight: 700; padding: .15rem .55rem; }
.badge-active { color: #176533; background: #dff3e6; }
.badge-revoked { color: #5c626c; background: #e7e9ed; }
.badge-error { color: #9d1c24; background: #fde1e3; }

.table-scroll { max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
caption { padding: .75rem; text-align: left; font-weight: 700; }
th, td { border-bottom: 1px solid #d8dce3; padding: .75rem; text-align: left; white-space: nowrap; }
th { background: #eef0f3; }

.details-list { display: grid; grid-template-columns: minmax(8rem, 1fr) 2fr; background: #fff; }
.details-list dt, .details-list dd { border-bottom: 1px solid #e1e4e8; margin: 0; padding: .7rem; }
.details-list dt { font-weight: 700; }
.danger-zone { border: 1px solid #d0922e; border-radius: .4rem; background: #fff5d6; margin-block: 1.5rem; padding: 1rem; }
.button-danger { background: #b4232c; border-color: #b4232c; }
.empty-state { border: 1px dashed #aeb5c0; border-radius: .4rem; margin-top: 1.5rem; padding: 2rem; text-align: center; }
.empty-state h2 { margin-top: 0; }
.pagination { align-items: center; justify-content: center; margin-block: 1.5rem; }
code { overflow-wrap: anywhere; }

@media (max-width: 40rem) {
    .header-content { align-items: flex-start; flex-direction: column; gap: .6rem; padding-block: .8rem; }
    .admin-email { margin-left: 0; }
    .form-row { align-items: stretch; flex-direction: column; }
    .details-list { grid-template-columns: 1fr; }
    .details-list dt { padding-bottom: 0; border-bottom: 0; }
    .error-context { align-items: stretch; flex-direction: column; }
}
