@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap");

:root {
    --bg: #1A3646;
    --surface: #ffffff;
    --text: #1A3646;
    --muted: #64748b;
    --border: #e2e8f0;
    --primary: #010027;
    --primary-accent: #516FFF;
    --primary-hover: #1A3646;
    --lime: #D2F50C;
    --black: #000000;
    --white: #ffffff;
    --danger: #010027;
    --success: #15803d;
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.10);
    --font-brand: "Outfit", sans-serif;

    /* Brand palette (No Shame) */
    --brand-navy: #010027;
    --brand-slate: #1A3646;
    --brand-blue: #516FFF;
    --brand-lime: #D2F50C;

    /* Admin table chrome — slate wash (swap to navy vars below for a stronger bar) */
    --table-toolbar-bg: color-mix(in srgb, var(--brand-slate) 10%, var(--white));
    --table-header-bg: color-mix(in srgb, var(--brand-slate) 18%, var(--white));
    --table-header-bg-sorted: color-mix(in srgb, var(--brand-blue) 14%, var(--white));
    --table-header-text: var(--brand-navy);
    --table-header-border: color-mix(in srgb, var(--brand-slate) 24%, var(--white));

    /* Text on slate page background (outside white cards) */
    --text-on-dark: #f8fafc;
    --text-on-dark-muted: #cbd5e1;

    /* Shared inputs (forms + admin filters) */
    --control-height: 2.375rem;
    --control-padding-x: 0.65rem;
    --control-radius: 6px;
    --control-font-size: 0.95rem;
    --control-bg: var(--white);
    --control-border: var(--border);
}

* { box-sizing: border-box; }

html, body, h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5 {
    font-family: var(--font-brand);
    font-size: 13px !important;
}

body.auth-page,
body.auth-page input,
body.auth-page select,
body.auth-page textarea,
body.auth-page button {
    font-size: 14px !important;
}

/* Ensure scaffolded Identity pages use the same base font. */
body, input, select, textarea, button {
    font-family: var(--font-brand);
}

html, body {
    margin: 0;  
    padding: 0;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

body:not(.auth-page) {
    color: var(--text-on-dark-muted);
}

body:not(.auth-page) .page-intro h1 {
    color: var(--text-on-dark);
}

a { color: var(--primary-accent); text-decoration: none; }
a:hover { color: var(--primary); text-decoration: underline; }

.topbar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: #f8fafc;
    box-shadow: var(--shadow);
}

.topbar a { color: #f8fafc; }
.topbar .brand a {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
}
.topbar .brand a:hover {
    color: #ffffff;
    text-decoration: none;
}
.brand-lockup {
    display: inline-block;
    line-height: 1;
}
.topbar .brand-lockup:not(.brand-lockup--card) {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}
.brand-lockup__mark {
    height: 1.75rem;
    width: 1.75rem;
    flex-shrink: 0;
    object-fit: cover;
    object-position: left center;
}
.brand-lockup__name {
    font-family: var(--font-brand);
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    white-space: nowrap;
}
.brand-lockup__company {
    font-weight: 500;
}
.brand-lockup__product {
    font-weight: 600;
}
.brand-lockup--card {
    display: block;
    margin: 0 auto 0.35rem;
    text-align: center;
}
.brand-lockup--card .brand-lockup__name {
    font-size: 1.35rem;
    color: var(--primary);
}
.brand-lockup--card .brand-lockup__product {
    color: var(--primary-accent);
}
.topbar .nav { display: flex; gap: 1rem; flex: 1; }
.topbar .nav a { color: #cbd5e1; }
.topbar .nav a:hover { color: #ffffff; text-decoration: none; }

.user { display: flex; gap: 0.75rem; align-items: center; color: #cbd5e1; }
.user form.inline { display: inline; margin: 0; }

.logo {
    background: url("/images/alula-logo.svg") no-repeat center center;
    background-size: cover;
    width: 220px;
    height: 60px;
}

.nav-icon { color: var(--lime) !important; }
.tablink { color: #1A3646; }
.w3-text-icon { color: var(--lime) !important; }

button.link {
    background: none;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    font: inherit;
    padding: 0;
}
button.link:hover { color: #ffffff; }

.container {
    max-width: 1100px;
    margin: 1.5rem auto;
    padding: 0 1.5rem;
}

/* Branded look for Identity account pages (login/register/forgot password). */
body.auth-page {
    min-height: 100vh;
    background-color: var(--primary);
    background-image:
        radial-gradient(circle at 88% 58%, rgba(210, 245, 12, 0.36) 0 21%, rgba(210, 245, 12, 0.10) 21% 30%, transparent 31%),
        radial-gradient(circle at 88% 58%, transparent 0 15%, rgba(1, 0, 39, 0.92) 16% 100%);
}

.auth-shell {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1.5rem 2.5rem;
}

body.auth-page .auth-container {
    width: 100%;
    max-width: 28rem;
    margin: 0;
    background: var(--white);
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 18px 40px rgba(1, 0, 39, 0.45);
    overflow: hidden;
}

.auth-container__header {
    padding: 1.75rem 2rem 0.25rem;
    text-align: center;
}

.auth-container__body {
    padding: 0.5rem 2rem 0.25rem;
}

.auth-card-foot {
    margin: 0;
    padding: 1rem 2rem 1.35rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--muted);
    font-size: 0.82rem !important;
    line-height: 1.45;
}

.auth-card-foot small {
    display: block;
}

/* Enterprise sign-in card */
.auth-signin__header {
    margin-bottom: 1.5rem;
}

.auth-signin__header h1 {
    margin: 0 0 0.4rem;
    font-size: 1.75rem !important;
    font-weight: 600;
    color: var(--text);
}

.auth-signin__intro {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.auth-signin__validation {
    margin-bottom: 1rem;
}

.auth-signin__validation.validation-summary-errors ul {
    margin: 0;
    padding: 0.65rem 0.85rem;
    list-style: none;
    background: #fee2e2;
    color: #7f1d1d;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    font-size: 0.92rem;
}

.auth-signin__external {
    margin-bottom: 1.25rem;
}

/* Microsoft Entra sign-in button spacing: 21px logo, 12px logo-to-label gap
   https://learn.microsoft.com/en-us/entra/identity-platform/howto-add-branding-in-apps */
.btn-microsoft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.65rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    color: var(--text);
    font-size: 0.95rem !important;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.2;
}

.btn-microsoft:hover,
.btn-microsoft:focus {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--text);
    text-decoration: none;
}

.btn-microsoft__content {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.btn-microsoft__icon {
    width: 21px;
    height: 21px;
    flex-shrink: 0;
}

.btn-microsoft__label {
    white-space: nowrap;
}

.auth-signin__divider {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin: 0 0 1.25rem;
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.auth-signin__divider::before,
.auth-signin__divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-signin__section-title {
    margin: 0 0 1rem;
    font-size: 0.82rem !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.auth-signin__form {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.auth-field {
    margin-bottom: 1.15rem;
}

.auth-field label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.92rem !important;
    font-weight: 600;
    color: var(--text);
}

.auth-field .form-control {
    width: 100%;
    padding: 0.62rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    color: var(--text);
    font-size: 0.95rem !important;
}

.auth-field .form-control::placeholder {
    color: #94a3b8;
}

.auth-field__error,
.auth-field .text-danger {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.85rem !important;
    color: #b91c1c;
}

.auth-signin__options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0.15rem 0 1.1rem;
    flex-wrap: wrap;
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    font-size: 0.92rem !important;
    color: var(--text);
    cursor: pointer;
}

.auth-check input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--primary-accent);
}

.auth-signin__forgot {
    font-size: 0.92rem !important;
    font-weight: 500;
}

.auth-signin__submit {
    width: 100%;
    padding: 0.62rem 1rem !important;
    font-size: 0.95rem !important;
}

.auth-signin__note {
    margin: 0 0 1.5rem;
    padding: 0.85rem 1rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.auth-signin__actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.auth-signin__actions .auth-signin__submit {
    text-align: center;
    text-decoration: none;
}

/* Full-page auth transition states (external login callback, etc.) */
.auth-transition {
    min-height: 12rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0;
}

.auth-transition__card {
    width: 100%;
    max-width: 22rem;
    margin: 0 auto;
    padding: 1.5rem 0 0.5rem;
    text-align: center;
}

.auth-transition__spinner {
    width: 2.5rem;
    height: 2.5rem;
    margin: 0 auto 1.1rem;
    border: 3px solid var(--border);
    border-top-color: var(--primary-accent);
    border-radius: 50%;
    animation: auth-transition-spin 0.85s linear infinite;
}

@keyframes auth-transition-spin {
    to { transform: rotate(360deg); }
}

.auth-transition__title {
    margin: 0 0 0.4rem;
    font-size: 1.35rem !important;
    font-weight: 600;
    color: var(--text);
}

.auth-transition__message {
    margin: 0;
    font-size: 0.95rem !important;
    line-height: 1.5;
    color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
    .auth-transition__spinner {
        animation: none;
        border-top-color: var(--primary-accent);
    }
}

/* Centered confirmation panels on auth pages (logout, etc.) */
.auth-feedback {
    text-align: center;
    max-width: 26rem;
    margin: 0.5rem auto 0;
    padding: 0.5rem 0 0.25rem;
}

.auth-feedback__icon {
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto 1.15rem;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(81, 111, 255, 0.14), rgba(210, 245, 12, 0.28));
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-feedback__icon svg {
    width: 1.85rem;
    height: 1.85rem;
    display: block;
}

.auth-feedback__title {
    margin: 0 0 0.45rem;
    font-size: 1.45rem !important;
    font-weight: 600;
    color: var(--text);
}

.auth-feedback__message {
    margin: 0 0 1.35rem;
    color: var(--muted);
    font-size: 0.98rem;
    line-height: 1.55;
}

.auth-feedback__progress {
    height: 0.28rem;
    background: var(--border);
    border-radius: 999px;
    margin: 0 auto 1rem;
    max-width: 14rem;
    overflow: hidden;
}

.auth-feedback__progress-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-accent), var(--lime));
    border-radius: inherit;
    transform-origin: left center;
    animation: auth-feedback-progress var(--logout-delay, 3s) linear forwards;
}

@keyframes auth-feedback-progress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .auth-feedback__progress-bar {
        animation: none;
        transform: scaleX(0);
    }
}

.auth-feedback__countdown {
    margin: 0 0 1.35rem;
    font-size: 0.92rem;
    color: var(--muted);
}

.auth-feedback__countdown #logout-countdown {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--primary-accent);
}

.auth-feedback__actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.auth-feedback__actions .btn {
    min-width: 9.5rem;
    text-align: center;
}

h1, h2, h3 { color: var(--text); }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.muted { color: var(--muted); }

.btn {
    display: inline-block;
    background: var(--white);
    color: var(--text);
    padding: 0.42rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--text);
    cursor: pointer;
    font: inherit;
    text-decoration: none;
    font-weight: 600;
    line-height: 1.2;
}

.btn:hover { text-decoration: none; background: #f8fafc; border-color: var(--primary-accent); color: var(--primary-accent); }

.btn.secondary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.btn.secondary:hover { background: var(--primary-accent); border-color: var(--primary-accent); }

.btn-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.btn-arrow__icon {
    font-size: 1.05em;
    line-height: 1;
    transition: transform 0.15s ease;
}

.btn-arrow:hover .btn-arrow__icon {
    transform: translateX(2px);
}

.btn.danger {
    background: var(--lime);
    color: var(--text);
    border-color: var(--lime);
}

.btn.danger:hover { background: #c2e40a; }

/* Bootstrap Identity UI overrides to match Alula brand. */
.btn-primary {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: var(--white) !important;
    border-radius: 999px;
    font-weight: 600;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-accent) !important;
    border-color: var(--primary-accent) !important;
}

.btn-outline-primary {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
    border-radius: 999px;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    color: var(--white) !important;
    background-color: var(--primary-accent) !important;
    border-color: var(--primary-accent) !important;
}

.form-control:focus {
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 0.2rem rgba(81, 111, 255, 0.25);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

table th, table td {
    text-align: left;
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}

table th {
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
}

table tr:last-child td { border-bottom: none; }

.foot {
    color: var(--text-on-dark-muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 1.5rem;
}

.foot a {
    color: var(--brand-blue);
}

.foot a:hover {
    color: var(--text-on-dark);
}

form .field { margin-bottom: 0.75rem; }
form label { display: block; font-weight: 600; margin-bottom: 0.25rem; }

.field-required {
    color: #b91c1c;
    font-weight: 700;
}

.field-error,
.field .text-danger {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.85rem !important;
    color: #b91c1c;
}

form input.input-validation-error,
form select.input-validation-error,
form textarea.input-validation-error {
    border-color: #b91c1c;
    box-shadow: 0 0 0 1px #b91c1c;
}

form input.input-validation-error:focus,
form select.input-validation-error:focus,
form textarea.input-validation-error:focus {
    border-color: #b91c1c;
    outline-color: #b91c1c;
    box-shadow: 0 0 0 0.2rem rgba(185, 28, 28, 0.2);
}

.form-hint {
    margin: 0 0 0.75rem;
    font-size: 0.88rem !important;
}

.field-readonly {
    padding: 0.5rem 0.65rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background: color-mix(in srgb, var(--brand-slate) 8%, var(--white));
    color: var(--muted);
    font-size: 0.95rem !important;
    line-height: 1.4;
}

.field-readonly-list {
    margin: 0;
    padding-left: 1.1rem;
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="search"],
form input[type="url"],
form input[type="number"],
form select,
form textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--control-border);
    border-radius: var(--control-radius);
    background-color: var(--control-bg);
    color: var(--text);
    font-size: var(--control-font-size) !important;
    line-height: 1.25;
    -webkit-appearance: none;
    appearance: none;
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="search"],
form input[type="url"],
form input[type="number"],
form select {
    height: var(--control-height);
    padding: 0 var(--control-padding-x);
}

form input[type="search"]::-webkit-search-decoration,
form input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

form select {
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' viewBox='0 0 12 8'%3E%3Cpath stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1.5 2 6 6.5 10.5 2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 0.7rem;
}

form textarea {
    min-height: 5rem;
    padding: 0.5rem var(--control-padding-x);
    resize: vertical;
}

form input[type="text"]:focus,
form input[type="email"]:focus,
form input[type="password"]:focus,
form input[type="search"]:focus,
form input[type="url"]:focus,
form input[type="number"]:focus,
form select:focus,
form textarea:focus,
.btn:focus,
a:focus {
    outline: 2px solid var(--primary-accent);
    outline-offset: 2px;
}

.alert { padding: 0.6rem 0.85rem; border-radius: 6px; margin-bottom: 1rem; }
.alert.success { background: #dcfce7; color: #14532d; border: 1px solid #86efac; }
.alert.error { background: #fee2e2; color: #7f1d1d; border: 1px solid #fca5a5; }

.client-secret-status {
    margin: 0 0 1rem;
}

.client-secret-form {
    margin-top: 0.25rem;
}

.client-secret-form .field {
    margin-bottom: 0.75rem;
}

.client-secrets-table-wrap {
    overflow-x: auto;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.client-secrets-table {
    width: 100%;
    border-collapse: collapse;
    border: none;
    border-radius: 0;
    background: transparent;
}

.client-secrets-table th,
.client-secrets-table td {
    padding: 0.6rem 0.85rem;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}

.client-secrets-table th {
    background: var(--table-header-bg);
    color: var(--table-header-text);
    font-size: 0.84rem !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--table-header-border);
}

.client-secrets-table-wrap .client-secrets-table th.admin-table__sort .admin-table__sort-link {
    color: var(--table-header-text);
    font-weight: 600;
}

.client-secrets-table-wrap .client-secrets-table th.admin-table__sort.is-sorted {
    background: var(--table-header-bg-sorted);
}

.client-secrets-table-wrap .client-secrets-table th.admin-table__sort .admin-table__sort-link:hover,
.client-secrets-table-wrap .client-secrets-table th.admin-table__sort.is-sorted .admin-table__sort-link {
    color: var(--brand-blue);
}

.client-secrets-table__actions-col {
    width: 5rem;
    white-space: nowrap;
}

.client-secrets-table td {
    background: var(--surface);
    color: var(--text);
}

.client-secrets-table tbody tr:last-child td {
    border-bottom: none;
}

.client-secrets-table__actions {
    text-align: right;
    white-space: nowrap;
}

.client-secrets-table__actions form {
    margin: 0;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

.card form > .actions {
    justify-content: flex-end;
    margin-top: 0.25rem;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: #e8edff;
    color: var(--primary);
    border-radius: 999px;
    font-size: 0.78rem;
    margin-right: 0.25rem;
}

.badge--status-active {
    background: #dcfce7;
    color: #14532d;
}

.badge--status-disabled {
    background: #fee2e2;
    color: #7f1d1d;
}

.badge--meta {
    background: color-mix(in srgb, var(--brand-slate) 12%, var(--white));
    color: var(--brand-slate);
    font-weight: 600;
}

.field-status {
    margin-bottom: 0.45rem;
}

.field-status__control {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    margin-bottom: 0 !important;
}

.field-input-with-action {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.field-input-with-action input {
    flex: 1;
    min-width: 0;
}

.field-input-with-action .btn {
    flex-shrink: 0;
    align-self: stretch;
}

.field-input-with-action .btn[hidden] {
    display: none;
}

.redirect-uri-list__label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.redirect-uri-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.redirect-uri-list__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: start;
}

.redirect-uri-list__error {
    grid-column: 1 / -1;
}

.redirect-uri-list__add {
    margin-top: 0.5rem;
}

.admin-one-time-value__message {
    margin: 0 0 0.75rem;
}

.admin-one-time-value .field {
    margin-bottom: 0;
}

.admin-one-time-value__input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.form-checkbox-list__label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.form-checkbox-list {
    margin-top: 0.35rem;
}

.form-checkbox-list__option {
    display: block;
    margin-bottom: 0.25rem;
}

.form-checkbox-list__option input[type="checkbox"] {
    margin-right: 0.35rem;
}


/* Admin dashboard landing (same palette as the rest of the app) */
.page-intro {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.35rem;
}

.page-intro:has(> h1) {
    flex-direction: column;
    align-items: stretch;
}

.page-intro__back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.45rem;
    color: var(--text-on-dark-muted);
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.3;
    text-decoration: none;
    transition: color 0.15s ease;
}

.page-intro__back-icon {
    font-size: 1rem;
    line-height: 1;
}

.page-intro__back:hover {
    color: var(--white);
    text-decoration: none;
}

.page-intro__content {
    flex: 1;
    min-width: 0;
}

.page-intro__action {
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 0.1rem;
    margin-left: auto;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .page-intro__action {
        width: 100%;
        margin-left: 0;
        text-align: center;
    }
}

.page-intro h1 {
    margin-bottom: 0.35rem;
    font-size: 1.75rem !important;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.page-intro .muted {
    line-height: 1.5;
    margin: 0;
    font-size: 1rem !important;
    color: var(--text-on-dark-muted);
}

.admin-metadata {
    margin-bottom: 1.5rem;
}

.admin-metadata__card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem 1.5rem 1.35rem;
    box-shadow: var(--shadow);
}

.admin-metadata__header {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}

.admin-metadata__header .admin-tile__icon {
    font-size: 0.62rem;
    letter-spacing: 0.01em;
}

.admin-metadata__title {
    margin: 0.15rem 0 0;
    font-size: 1.2rem !important;
    font-weight: 600;
    color: var(--text);
}

.admin-metadata__lead {
    margin: 0 0 1.25rem;
    line-height: 1.55;
    color: var(--muted);
    font-size: 0.95rem !important;
}

.admin-metadata__endpoints {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.15rem;
}

.admin-metadata__endpoint {
    padding: 1.15rem 1.2rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.admin-metadata__endpoint-title {
    margin: 0 0 0.5rem;
    font-size: 1.02rem !important;
    font-weight: 600;
    color: var(--text);
}

.admin-metadata__endpoint p {
    margin: 0 0 0.65rem;
    font-size: 0.92rem !important;
    line-height: 1.5;
    color: var(--muted);
}

.admin-metadata__when {
    font-size: 0.88rem !important;
}

.admin-metadata__when strong {
    color: var(--text);
    font-weight: 600;
}

.admin-metadata__link {
    display: inline-block;
    margin-top: 0.35rem;
    font-size: 0.88rem !important;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.15rem;
    align-items: stretch;
}

.admin-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem 1.35rem 1.15rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-height: 10rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-tile:hover {
    border-color: rgba(81, 111, 255, 0.45);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

.admin-tile__icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(81, 111, 255, 0.18), rgba(210, 245, 12, 0.22));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    color: var(--primary);
    flex-shrink: 0;
}

.admin-tile__meta {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary-accent);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-tile h3 {
    margin: 0;
    font-size: 1.08rem !important;
    font-weight: 600;
    color: var(--text);
}

.admin-tile p {
    margin: 0;
    flex: 1 1 auto;
    font-size: 0.92rem;
    color: var(--muted);
    line-height: 1.45;
}

.admin-tile__action {
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--border);
}

.admin-tile__action .btn {
    display: block;
    width: 100%;
    text-align: center;
}

/* Shared admin data tables — Azure Portal-style single panel */
.admin-table {
    display: flex;
    flex-direction: column;
}

.admin-table__panel {
    padding: 0;
    margin-bottom: 1rem;
    overflow: hidden;
}

.admin-table__toolbar {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--table-header-border);
    background: var(--table-toolbar-bg);
}

.admin-table__filters {
    display: grid;
    grid-template-columns: minmax(14rem, 1.6fr) repeat(3, minmax(9rem, 1fr)) auto;
    gap: 0.75rem 1rem;
    align-items: end;
}

.admin-table__filters--simple {
    grid-template-columns: minmax(14rem, 1fr) auto;
}

.admin-table__filters--clients {
    grid-template-columns: minmax(12rem, 1.4fr) repeat(3, minmax(8rem, 1fr)) auto;
}

.admin-table__filters--scopes,
.admin-table__filters--audit {
    grid-template-columns: minmax(12rem, 1.4fr) minmax(9rem, 1fr) auto;
}

.admin-table__filter {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

@media (max-width: 900px) {
    .admin-table__filters {
        grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    }

    .admin-table__filter-actions {
        grid-column: 1 / -1;
        padding-top: 0;
        justify-content: flex-start;
    }
}

.admin-table__filter--search {
    min-width: 12rem;
}

.admin-table__filter--compact {
    max-width: 7rem;
}

.admin-table__filter--roles,
.admin-table__filter--scopes {
    min-width: 10rem;
}

.admin-table__filter-label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.82rem !important;
    line-height: 1.25;
    font-weight: 600;
    color: var(--text);
}

.admin-table__multi-select {
    position: relative;
}

.admin-table__multi-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: var(--control-height);
    min-height: var(--control-height);
    padding: 0 var(--control-padding-x);
    border: 1px solid var(--control-border);
    border-radius: var(--control-radius);
    background: var(--control-bg);
    color: var(--text);
    font-size: var(--control-font-size) !important;
    line-height: 1.25;
    cursor: pointer;
    list-style: none;
    box-sizing: border-box;
}

.admin-table__multi-select-trigger::-webkit-details-marker {
    display: none;
}

.admin-table__multi-select-trigger::after {
    content: "▾";
    margin-left: 0.5rem;
    color: var(--muted);
    font-size: 0.85rem;
    flex-shrink: 0;
    line-height: 1;
}

.admin-table__multi-select[open] .admin-table__multi-select-trigger {
    border-color: var(--primary-accent);
}

.admin-table__multi-select-panel {
    position: absolute;
    z-index: 20;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    min-width: 14rem;
    max-height: 14rem;
    overflow: auto;
    padding: 0.45rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.admin-table__multi-select-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.15rem 0.4rem 0.45rem;
    margin-bottom: 0.15rem;
    border-bottom: 1px solid var(--border);
}

.admin-table__multi-select-action {
    padding: 0;
    border: 0;
    background: none;
    color: var(--primary-accent);
    font-size: 0.82rem !important;
    font-weight: 600;
    cursor: pointer;
}

.admin-table__multi-select-action:hover {
    text-decoration: underline;
}

.admin-table__multi-select-action-sep {
    color: var(--muted);
    font-size: 0.82rem !important;
}

.admin-table__multi-select-options {
    display: flex;
    flex-direction: column;
}

.admin-table__multi-select-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    margin-bottom: 0 !important;
    cursor: pointer;
}

.admin-table__multi-select-option:hover {
    background: color-mix(in srgb, var(--primary-accent) 8%, transparent);
}

.admin-table__multi-select-option input[type="checkbox"] {
    width: auto;
    min-width: 1rem;
    margin: 0;
    flex-shrink: 0;
}

.admin-table__multi-select-option span {
    line-height: 1.3;
}

.admin-table__filter > label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.82rem !important;
    line-height: 1.25;
    font-weight: 600;
    color: var(--text);
}

.admin-table__filter input:not([type="checkbox"]),
.admin-table__filter select {
    width: 100%;
    margin: 0;
}

.admin-table__filter:has(> select) {
    position: relative;
}

.admin-table__filter:has(> select)::after {
    content: "▾";
    position: absolute;
    right: 0.65rem;
    top: calc(0.82rem * 1.25 + 0.3rem + var(--control-height) / 2);
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1;
    pointer-events: none;
}

.admin-table__filters select {
    height: var(--control-height);
    padding: 0 2rem 0 var(--control-padding-x);
    border: 1px solid var(--control-border);
    border-radius: var(--control-radius);
    background-color: var(--control-bg);
    background-image: none;
    color: var(--text);
    font-size: var(--control-font-size) !important;
    line-height: 1.25;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.admin-table__filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
    justify-content: flex-end;
    align-self: end;
    padding-top: calc(0.82rem * 1.25 + 0.3rem);
}

.admin-table__filter-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--control-height);
    padding: 0 1rem;
    white-space: nowrap;
}

.admin-table__clear {
    font-size: 0.9rem !important;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
}

.admin-table__filter-actions .admin-table__clear {
    display: inline-flex;
    align-items: center;
    min-height: var(--control-height);
}

.admin-table__clear:hover {
    color: var(--primary-accent);
    text-decoration: underline;
}

.admin-table__panel .admin-table__scroll {
    padding: 0;
}

.admin-table__panel .admin-table__toolbar {
    position: relative;
    z-index: 2;
}

.admin-table__panel .admin-table__pager {
    margin-top: 0;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--border);
}

.admin-table__pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    width: 100%;
}

.admin-table__pager-summary {
    color: var(--muted);
    font-size: 0.9rem !important;
}

.admin-table__pager-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem 1rem;
}

.admin-table__page-size {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    position: relative;
}

.admin-table__page-size label {
    margin: 0;
    font-size: 0.88rem !important;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
}

.admin-table__page-size::after {
    content: "▾";
    position: absolute;
    right: 0.45rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1;
    pointer-events: none;
}

.admin-table__page-size select {
    width: auto;
    min-width: 4.25rem;
    height: var(--control-height);
    padding: 0 2rem 0 0.55rem;
    border: 1px solid var(--control-border);
    border-radius: var(--control-radius);
    background-color: var(--control-bg);
    background-image: none;
    font-size: var(--control-font-size) !important;
    line-height: 1.25;
    -webkit-appearance: none;
    appearance: none;
}

.admin-table__pager-nav {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.admin-table__pager-page {
    color: var(--muted);
    font-size: 0.88rem !important;
    padding: 0 0.25rem;
}

.admin-table__pager-btn.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.admin-table__scroll {
    overflow-x: auto;
}

.admin-table__grid {
    width: 100%;
    min-width: 52rem;
    border: none;
    border-radius: 0;
    overflow: visible;
    background: transparent;
}

.admin-table__panel .admin-table__grid th {
    background: var(--table-header-bg);
    color: var(--table-header-text);
    font-size: 0.84rem !important;
    font-weight: 600;
    border-bottom: 1px solid var(--table-header-border);
}

.admin-table__panel .admin-table__grid th .admin-table__sort-link {
    color: var(--table-header-text);
    font-weight: 600;
}

.admin-table__panel .admin-table__grid th.is-sorted {
    background: var(--table-header-bg-sorted);
}

.admin-table__panel .admin-table__grid th .admin-table__sort-link:hover {
    color: var(--brand-blue);
}

.admin-table__panel .admin-table__grid th.is-sorted .admin-table__sort-link {
    color: var(--brand-blue);
}

.admin-table__sort {
    white-space: nowrap;
}

.admin-table__sort-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: inherit;
    font-weight: 600;
    text-decoration: none;
}

.admin-table__sort-link:hover {
    color: var(--primary-accent);
    text-decoration: none;
}

.admin-table__sort.is-sorted .admin-table__sort-link {
    color: var(--primary-accent);
}

.admin-table__sort-indicator {
    font-size: 0.7rem;
    line-height: 1;
}

.admin-table__actions-col {
    width: 5rem;
    white-space: nowrap;
}

.admin-table__inline-form {
    display: inline;
    margin: 0;
}

.admin-table__action {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--primary-accent);
    cursor: pointer;
    text-decoration: underline;
}

.admin-table__action:hover {
    color: var(--brand-blue);
}

.admin-table__action--danger {
    color: var(--danger);
}

.admin-table__action--danger:hover {
    color: #b91c1c;
}

.admin-table__empty {
    text-align: center;
    color: var(--muted);
    padding: 1.5rem !important;
}

/* In-app confirm dialog (admin delete, unsaved changes) */
.confirm-dialog {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.confirm-dialog[hidden] {
    display: none !important;
}

.confirm-dialog__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(1, 0, 39, 0.55);
}

.confirm-dialog__panel {
    position: relative;
    width: min(24rem, 100%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem 1.35rem 1.1rem;
    box-shadow: 0 12px 40px rgba(1, 0, 39, 0.22);
    color: var(--text);
}

.confirm-dialog__title {
    margin: 0 0 0.55rem;
    font-size: 1.15rem !important;
    color: var(--text);
}

.confirm-dialog__message {
    margin: 0 0 1.15rem;
    color: var(--muted);
    line-height: 1.55;
}

.confirm-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
    flex-wrap: wrap;
}

body.confirm-dialog-open {
    overflow: hidden;
}

.admin-usage-list {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
    color: var(--text);
}

.admin-usage-list a {
    color: var(--primary-accent);
    font-weight: 600;
}

.admin-usage-force-delete {
    margin-top: 1rem;
}
