h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
/* Administration workspace */
:root { --admin-ink: #153a2d; --admin-gold: #9b7a39; --admin-line: #d9e1da; --admin-muted: #5d6b62; }
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", Tahoma, Arial, sans-serif; background: #f5f6f2; color: #203b30; line-height: 1.65; }
a { color: #17543d; text-underline-offset: 4px; }
button, input, textarea, select { font: inherit; }
button, .button { cursor: pointer; }
button:disabled, fieldset:disabled { cursor: default; }
button:disabled { opacity: .5; }
.admin-shell { min-height: 100svh; display: flex; flex-direction: column; }
.admin-header { background: #fff; border-bottom: 1px solid var(--admin-line); display: flex; align-items: center; gap: 2rem; padding: 1rem max(5vw, 1rem); flex-wrap: wrap; }
.admin-brand { display: flex; flex-direction: column; text-decoration: none; }
.admin-brand strong { font-size: 1.65rem; letter-spacing: .04em; }
.admin-brand span { font-size: .8rem; color: var(--admin-muted); }
.account-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.account-actions a { overflow-wrap: anywhere; }
.admin-main { width: min(1240px, 92%); margin: 2.5rem auto; flex: 1; }
.admin-footer { padding: 1rem 4%; text-align: center; font-size: .85rem; color: var(--admin-muted); border-top: 1px solid var(--admin-line); }
h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin: 0 0 .4rem; line-height: 1.3; }
h2 { font-size: 1.3rem; margin-top: 0; }
p { margin: .5rem 0 1rem; }
.eyebrow { color: #806126; font-size: .85rem; font-weight: 700; margin-bottom: .5rem; }
.muted, small { color: var(--admin-muted); }
small { display: block; font-size: .8rem; margin-top: .35rem; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 1.5rem 0; }
.button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border: 1px solid var(--admin-line); border-radius: 7px; padding: .6rem 1rem; text-decoration: none; font-weight: 600; background: white; color: var(--admin-ink); }
.primary, .btn-primary { background: var(--admin-ink); color: white; border-color: var(--admin-ink); }
.secondary { background: white; }
.danger { color: #a22a28; border-color: #d9aaaa; }
.button:hover { filter: brightness(.94); }
:focus-visible { outline: 3px solid #b58b37; outline-offset: 3px; }
.panel, .translation-panel, .service-item, .empty-state, .account-panel, .welcome-panel { background: white; border: 1px solid var(--admin-line); border-radius: 12px; padding: 1.5rem; min-width: 0; }
.panel { margin-bottom: 1.5rem; }
fieldset { margin: 0; }
legend { padding: 0 .5rem; font-weight: 700; font-size: 1.15rem; }
.fields-grid, .translations-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
label { display: block; font-weight: 600; font-size: .9rem; margin: 1rem 0 .4rem; }
input:not([type=checkbox]):not([type=hidden]), textarea, select { width: 100%; background: #fff; color: #203b30; border: 1px solid #adbcb1; padding: .65rem .75rem; border-radius: 6px; min-width: 0; }
input:disabled, textarea:disabled, select:disabled { background: #f2f4f0 !important; color: #56645b !important; }
textarea { resize: vertical; }
.seo-fields { border-top: 1px solid var(--admin-line); margin-top: 1.4rem; padding-top: .8rem; }
summary { cursor: pointer; color: #356346; }
.action-bar { display: flex; align-items: center; gap: 1rem; margin: 1.5rem 0; flex-wrap: wrap; }
.actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.notice { padding: 1rem 1.2rem; border: 1px solid #d7bd7e; background: #fff9e9; border-radius: 8px; margin: 1rem 0; }
.notice.error { color: #852a25; background: #fff1ef; border-color: #ddb4ae; }
.notice.success { color: #1b5934; background: #edf8ed; border-color: #b6d4bc; }
.badge { border-radius: 20px; padding: .2rem .7rem; font-size: .8rem; display: inline-block; }
.published { background: #e0f0e4; color: #235a35; }
.draft { background: #f2ead6; color: #785820; }
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.item-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.service-item h2 { overflow-wrap: anywhere; }
.slug { font-size: .85rem; color: var(--admin-muted); overflow-wrap: anywhere; text-align: end; }
.empty-state { text-align: center; padding: 3.5rem 1rem; }
.back-link { display: inline-block; margin-bottom: .3rem; }
.publishing-panel { margin-top: 1.5rem; }
.confirmation { margin-top: 1rem; padding: 1rem; border: 2px solid #bc9a56; border-radius: 8px; background: #fffaf0; }
.order-control { display: flex; align-items: end; gap: .7rem; flex-wrap: wrap; margin-top: 1rem; }
.order-control input { max-width: 100px; }
.order-control label { margin-bottom: .6rem; }
.account-panel { max-width: 550px; margin: 0 auto; }
.account-panel form > button { margin-top: 1.5rem; }
.welcome-panel { padding: 3rem; }
.validation-message, .text-danger { color: #a12c26; }
@media (max-width: 900px) { .service-grid { grid-template-columns: 1fr 1fr; } .translations-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .fields-grid, .service-grid { grid-template-columns: 1fr; } .admin-main { margin-top: 1.2rem; } .admin-header { gap: .7rem; } .account-actions { width: 100%; margin: 0; } .panel, .translation-panel { padding: 1rem; } .welcome-panel { padding: 1.5rem; } }

/* Login page */
.account-panel.login-panel {
    width: 100%;
    max-width: 500px;
    margin: 1rem auto 2rem;
    padding: clamp(1.25rem, 4vw, 2.5rem);
    background: #fff;
    border: 1px solid var(--admin-line);
    border-top: 3px solid var(--admin-gold);
    border-radius: 16px;
    box-shadow: 0 12px 36px rgb(21 58 45 / 6%);
    text-align: start;
}

.login-panel .login-heading {
    margin-bottom: 1.75rem;
    text-align: center;
}

.login-panel .login-brand {
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    line-height: 1.7;
    letter-spacing: normal;
    text-wrap: balance;
}

.admin-brand strong {
    font-size: 1.2rem;
    line-height: 1.6;
    letter-spacing: normal;
    white-space: normal;
}


.login-panel h1 {
    margin-bottom: .75rem;
    font-size: clamp(1.6rem, 5vw, 2rem);
}

.login-panel .login-heading .muted {
    margin-bottom: 0;
    font-size: .95rem;
}

.login-panel .login-setup {
    margin-bottom: 1.5rem;
    font-size: .875rem;
}

.login-panel .login-field {
    margin-bottom: 1.25rem;
}

    .login-panel .login-field > label {
        margin: 0 0 .5rem;
        font-size: .95rem;
        font-weight: 600;
    }

.login-panel input.login-input {
    width: 100%;
    min-height: 48px;
    padding: .75rem .9rem;
    border: 1px solid #adbcb1;
    border-radius: 8px;
    background: #fff;
    color: var(--admin-ink);
    text-align: start;
}

    .login-panel input.login-input:focus {
        border-color: var(--admin-ink);
    }

.login-panel .validation-message {
    margin-top: .4rem;
    font-size: .85rem;
}

.login-panel .login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem 1rem;
    margin: .25rem 0 1.25rem;
    font-size: .875rem;
}

.login-panel .login-remember {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    font-size: .875rem;
    font-weight: 400;
    cursor: pointer;
}

    .login-panel .login-remember input {
        width: 18px;
        height: 18px;
        margin: 0;
        accent-color: var(--admin-ink);
    }

.login-panel .login-submit,
.login-panel .login-passkey {
    width: 100%;
    min-height: 48px;
    margin: 0;
    border-radius: 8px;
    white-space: normal;
}

.login-panel .login-divider {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin: 1.25rem 0;
    color: var(--admin-muted);
    font-size: .85rem;
}

    .login-panel .login-divider::before,
    .login-panel .login-divider::after {
        content: "";
        flex: 1;
        height: 1px;
        background: var(--admin-line);
    }

.login-panel .login-links {
    margin-top: 1.25rem;
    text-align: center;
    font-size: .875rem;
}

.login-panel .login-external {
    margin-top: 1.5rem;
    font-size: .85rem;
    overflow-wrap: anywhere;
}

    .login-panel .login-external:empty {
        display: none;
    }

@media (max-width: 600px) {
    .admin-header {
        gap: .75rem;
        padding: 1rem;
    }

        .admin-header .admin-brand {
            flex: 0 0 100%;
            min-width: 0;
        }

            .admin-header .admin-brand strong {
                font-size: 1.1rem;
                line-height: 1.7;
            }

        .admin-header > nav {
            margin-inline-end: auto;
        }

            .admin-header > nav a {
                display: inline-flex;
                align-items: center;
                min-height: 44px;
            }

        .admin-header > .button {
            min-height: 44px;
        }

    .admin-footer {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: .4rem;
    }

        .admin-footer a {
            font-weight: 600;
        }
}
/* Services administration */
.services-page {
    min-width: 0;
}

    .services-page .services-heading {
        align-items: center;
        margin: 0 0 1.75rem;
        padding-bottom: 1.5rem;
        border-bottom: 1px solid var(--admin-line);
    }

        .services-page .services-heading h1 {
            margin-bottom: .65rem;
        }

        .services-page .services-heading .muted {
            margin-bottom: 0;
            max-width: 42rem;
        }

    .services-page .button {
        min-height: 44px;
        white-space: normal;
    }

    .services-page .services-empty {
        padding: clamp(2rem, 6vw, 4rem) 1.25rem;
        border-top: 3px solid var(--admin-gold);
    }

        .services-page .services-empty h2 {
            margin: .5rem 0 .75rem;
            font-size: 1.4rem;
        }

        .services-page .services-empty .muted {
            max-width: 32rem;
            margin: 0 auto 1.5rem;
        }

    .services-page .services-loading p {
        margin: 0;
        color: var(--admin-muted);
    }

    .services-page .services-count {
        margin-bottom: 1rem;
        color: var(--admin-muted);
        font-size: .9rem;
    }

    .services-page .service-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: stretch;
    }

    .services-page .service-item {
        display: flex;
        flex-direction: column;
        padding: 1.5rem;
    }

    .services-page .item-top {
        gap: .75rem;
        margin-bottom: 1.25rem;
        font-size: .85rem;
    }

    .services-page .service-item h2 {
        margin: 0 0 .75rem;
        font-size: 1.2rem;
        line-height: 1.7;
    }

        .services-page .service-item h2 a {
            text-decoration: none;
        }

            .services-page .service-item h2 a:hover {
                text-decoration: underline;
            }

    .services-page .slug {
        margin: 0 0 1.5rem;
        text-align: start;
    }

    .services-page .service-card-actions {
        margin-top: auto;
        padding-top: 1rem;
        border-top: 1px solid var(--admin-line);
    }

        .services-page .service-card-actions .button {
            width: 100%;
        }

    .services-page .services-error {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 1rem;
    }

@media (max-width: 900px) {
    .services-page .service-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .services-page .services-heading {
        align-items: stretch;
        flex-direction: column;
        gap: 1rem;
    }

        .services-page .services-heading > .button {
            width: 100%;
        }

    .services-page .service-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .services-page .service-item {
        padding: 1.25rem;
    }
}

/* =========================================================
   Service editor
   ========================================================= */

.service-editor {
    width: min(1180px, 100%);
    margin-inline: auto;
}

    .service-editor > .back-link {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        margin-bottom: 1rem;
        color: var(--admin-ink);
        font-weight: 600;
        text-decoration: none;
    }

        .service-editor > .back-link:hover {
            text-decoration: underline;
        }

    .service-editor .editor-heading {
        align-items: flex-start;
        margin-top: 0;
        padding-bottom: 1rem;
        border-bottom: 1px solid var(--admin-line);
    }

        .service-editor .editor-heading h1 {
            margin-bottom: 0;
        }

    .service-editor .panel,
    .service-editor .translation-panel {
        background: #ffffff;
        border: 1px solid var(--admin-line);
        box-shadow: 0 8px 24px rgba(21, 58, 45, 0.05);
    }

    .service-editor .fields-grid {
        align-items: start;
    }

    .service-editor .translation-panel {
        margin: 0;
    }

        .service-editor .translation-panel legend {
            color: var(--admin-ink);
        }

        .service-editor .translation-panel textarea {
            line-height: 1.75;
        }

    .service-editor .seo-fields {
        margin-top: 1.5rem;
    }

        .service-editor .seo-fields summary {
            padding-block: 0.5rem;
            font-weight: 600;
        }

    .service-editor .editor-save-bar {
        position: sticky;
        bottom: 0;
        z-index: 20;
        justify-content: space-between;
        padding: 1rem;
        background: rgba(255, 255, 255, 0.96);
        border: 1px solid var(--admin-line);
        border-radius: 10px;
        box-shadow: 0 -8px 24px rgba(21, 58, 45, 0.08);
        backdrop-filter: blur(8px);
    }

    .service-editor .publishing-panel {
        margin-top: 2rem;
    }

        .service-editor .publishing-panel > h2 {
            margin-bottom: 0.25rem;
        }

    .service-editor .confirmation {
        margin-top: 1.25rem;
    }

    .service-editor .order-control {
        padding-top: 1rem;
        border-top: 1px solid var(--admin-line);
    }

@media (max-width: 900px) {
    .service-editor .editor-heading {
        align-items: flex-start;
    }
}

@media (max-width: 600px) {
    .service-editor .editor-heading {
        display: block;
    }

        .service-editor .editor-heading .badge {
            margin-top: 0.75rem;
        }

    .service-editor .editor-save-bar {
        align-items: stretch;
    }

        .service-editor .editor-save-bar .button {
            width: 100%;
        }

    .service-editor .publishing-panel .actions {
        display: grid;
        grid-template-columns: 1fr;
    }

        .service-editor .publishing-panel .actions .button {
            width: 100%;
        }

    .service-editor .order-control {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
    }

        .service-editor .order-control input {
            max-width: none;
        }
}

/* ===== المقالات: الشارات والتخطيط ===== */

.badge.legal {
    background: #ede3f3;
    color: #5a2f74;
}

.checkbox-field {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    justify-content: center;
}

    .checkbox-field label {
        display: flex;
        align-items: center;
        gap: .5rem;
        margin: 0;
        font-weight: 600;
        cursor: pointer;
    }

    .checkbox-field input[type="checkbox"] {
        width: auto;
        margin: 0;
        flex: 0 0 auto;
    }

.publishing-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: .75rem 1.25rem;
    margin: 0 0 1rem;
}

    .publishing-facts > div {
        display: flex;
        flex-direction: column;
        gap: .15rem;
    }

    .publishing-facts dt {
        font-size: .8rem;
        color: var(--admin-muted);
    }

    .publishing-facts dd {
        margin: 0;
        font-weight: 600;
        overflow-wrap: anywhere;
    }

/* حقل الجدولة يحتاج عرضًا كاملًا؛ القاعدة العامة لـ .order-control
   تحدّ الإدخال بـ 100px لأنها وُضعت لحقل رقم الترتيب. */
.publishing-panel .order-control input[type="datetime-local"] {
    max-width: none;
    width: 15rem;
}

.publishing-panel h3 {
    margin: 0;
}

@media (max-width: 600px) {
    .publishing-panel .order-control input[type="datetime-local"] {
        width: 100%;
    }
}

/* Consultation requests administration */
.request-card h2,
.request-card .request-note  {
    overflow-wrap: anywhere;
}

.request-card .request-note {
    white-space: pre-wrap;
    margin-top: .75rem;
}

.request-card details {
    margin-block: .75rem;
}

.request-card summary {
    padding-block: .35rem;
}

.request-card .action-bar {
    margin-bottom: 0;
}

/* Image upload control: a fixed thumbnail slot beside the actions. The native
   file input stays focusable but hidden; its label is the visible button. */
.image-upload {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
    margin-top: .8rem;
    padding: .9rem;
    border: 1px dashed #b9c7bc;
    border-radius: 10px;
    background: #fafbf8;
}

.image-upload__thumb {
    width: 112px;
    height: 112px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: .3rem;
    overflow: hidden;
    border: 1px solid var(--admin-line);
    border-radius: 8px;
    background: #fff;
    color: var(--admin-muted);
    font-size: .75rem;
    text-align: center;
}

    .image-upload__thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .image-upload__thumb svg {
        width: 30px;
        height: 30px;
        opacity: .7;
    }

.image-upload__body {
    min-width: 0;
}

    .image-upload__body small {
        margin-top: .5rem;
    }

.image-upload__actions {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

    /* The global label rule is for field captions; reset it for the button. */
    .image-upload__actions label.button {
        display: inline-flex;
        margin: 0;
        font-size: inherit;
    }

    .image-upload__actions input[type="file"] {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

        .image-upload__actions input[type="file"]:focus-visible + label {
            outline: 3px solid #b58b37;
            outline-offset: 3px;
        }

        .image-upload__actions input[type="file"]:disabled + label {
            opacity: .5;
            cursor: default;
            filter: none;
        }

.image-upload .notice {
    margin: .6rem 0 0;
}

@media (max-width: 600px) {
    .image-upload {
        grid-template-columns: 1fr;
        justify-items: start;
    }
}

/* Account settings */
.account-manage {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.account-manage-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .25rem;
}

    .account-manage-links a {
        display: block;
        padding: .55rem .8rem;
        border: 1px solid transparent;
        border-radius: 7px;
        color: var(--admin-ink);
        text-decoration: none;
    }

        .account-manage-links a.active {
            background: white;
            border-color: var(--admin-line);
            font-weight: 700;
        }

@media (max-width: 760px) {
    .account-manage {
        grid-template-columns: 1fr;
    }

    .account-manage-links {
        display: flex;
        flex-wrap: wrap;
    }
}

/* ===== Workspace frame ===== */
.admin-shell.is-signed-in {
    flex-direction: row;
    align-items: stretch;
}

.admin-frame {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100svh;
}

    .admin-frame .admin-main {
        width: 100%;
        max-width: 1200px;
        margin: 0 auto;
        padding: 2rem clamp(1rem, 3vw, 2.5rem) 3rem;
        flex: 1;
    }

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .7rem clamp(1rem, 3vw, 2.5rem);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--admin-line);
}

.topbar-title {
    font-weight: 700;
    color: var(--admin-ink);
}

.topbar-brand {
    font-weight: 700;
    color: var(--admin-ink);
    text-decoration: none;
}

.admin-topbar .account-actions {
    margin-inline-start: auto;
    gap: .75rem;
}

.account-chip {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    color: var(--admin-ink);
    text-decoration: none;
    font-size: .9rem;
}

    .account-chip:hover bdi {
        text-decoration: underline;
    }

.account-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #e7eee8;
    color: var(--admin-ink);
    font-weight: 700;
}

.admin-sidebar {
    flex: 0 0 248px;
    position: sticky;
    top: 0;
    height: 100svh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 1.25rem .85rem;
    background: var(--admin-ink);
    color: #dfe8e2;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .25rem .5rem 1.25rem;
    margin-bottom: .5rem;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    color: #fff;
    text-decoration: none;
}

/* The logo's emblem only: the full image is enlarged and cropped to its top part. */
.sidebar-logo {
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

    .sidebar-logo img {
        width: 72px;
        max-width: none;
        height: auto;
        margin-top: 2px;
    }

.login-logo {
    display: block;
    width: 120px;
    height: auto;
    margin: 0 auto .75rem;
}

.sidebar-brand strong {
    display: block;
    font-size: 1rem;
}

.sidebar-brand small {
    display: block;
    margin: 0;
    color: #b9c9be;
    font-size: .78rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.sidebar-group {
    margin: 1.1rem .75rem .35rem;
    font-size: .72rem;
    font-weight: 700;
    color: #8fa89a;
}

.sidebar-nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .6rem .75rem;
    border-radius: 8px;
    color: #dfe8e2;
    text-decoration: none;
    font-size: .95rem;
}

    .sidebar-nav a:hover {
        background: rgba(255, 255, 255, .07);
        color: #fff;
    }

    .sidebar-nav a.active {
        background: rgba(255, 255, 255, .12);
        color: #fff;
        font-weight: 700;
    }

        .sidebar-nav a.active::before {
            content: "";
            position: absolute;
            inset-inline-start: -.85rem;
            top: .45rem;
            bottom: .45rem;
            width: 4px;
            border-start-end-radius: 4px;
            border-end-end-radius: 4px;
            background: var(--admin-gold);
        }

.nav-icon {
    flex: none;
    width: 20px;
    height: 20px;
}

.nav-label {
    flex: 1;
}

.nav-count {
    min-width: 1.6rem;
    padding: 0 .45rem;
    border-radius: 999px;
    background: #c0392b;
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    line-height: 1.6rem;
    text-align: center;
}

.button .nav-icon {
    width: 18px;
    height: 18px;
}

/* ===== Home dashboard ===== */
.dashboard-hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
}

    .dashboard-hero h1 {
        margin: 0;
    }

.dashboard-date {
    margin: .25rem 0 0;
    color: var(--admin-muted);
    font-size: .9rem;
}

.quick-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.stat-card {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "label icon" "value icon" "detail detail";
    gap: .15rem .75rem;
    padding: 1.2rem 1.25rem;
    background: #fff;
    border: 1px solid var(--admin-line);
    border-radius: 14px;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(21, 58, 45, .04);
    transition: border-color .15s, box-shadow .15s, transform .15s;
}

    .stat-card:hover {
        border-color: #c9b27a;
        box-shadow: 0 6px 18px rgba(21, 58, 45, .08);
        transform: translateY(-1px);
    }

.stat-label {
    grid-area: label;
    font-size: .85rem;
    font-weight: 600;
    color: var(--admin-muted);
}

.stat-value {
    grid-area: value;
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--admin-ink);
    font-variant-numeric: tabular-nums;
}

.stat-icon {
    grid-area: icon;
    align-self: start;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #eef3ef;
    color: var(--admin-ink);
}

    .stat-icon .nav-icon {
        width: 22px;
        height: 22px;
    }

.stat-detail {
    grid-area: detail;
    margin-top: .5rem;
    padding-top: .6rem;
    border-top: 1px solid #eef1ec;
    font-size: .85rem;
    color: var(--admin-muted);
}

.stat-card.attention {
    border-color: #e2c98f;
    background: linear-gradient(180deg, #fffaf0, #fff);
}

    .stat-card.attention .stat-icon {
        background: #f7ecd2;
        color: #8a6420;
    }

.section-title {
    margin: 2.25rem 0 .85rem;
    font-size: 1.05rem;
    color: var(--admin-ink);
}

.recent-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--admin-line);
    border-radius: 14px;
}

    .recent-list li + li {
        border-top: 1px solid #eef1ec;
    }

    .recent-list a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: .85rem 1.25rem;
        color: inherit;
        text-decoration: none;
    }

        .recent-list a:hover {
            background: #f8faf7;
        }

.recent-name {
    display: block;
    font-weight: 700;
    color: var(--admin-ink);
}

.recent-meta {
    display: block;
    font-size: .85rem;
    color: var(--admin-muted);
}

.recent-time {
    font-size: .8rem;
    color: var(--admin-muted);
    white-space: nowrap;
}

.dashboard-note {
    margin-top: 1.75rem;
    font-size: .85rem;
}

@media (max-width: 900px) {
    .admin-shell.is-signed-in {
        flex-direction: column;
    }

    .admin-sidebar {
        position: static;
        height: auto;
        flex: none;
        padding: .6rem .75rem;
    }

    .sidebar-brand, .sidebar-group {
        display: none;
    }

    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        gap: .25rem;
    }

        .sidebar-nav a {
            white-space: nowrap;
            padding: .5rem .7rem;
        }

            .sidebar-nav a.active::before {
                display: none;
            }

    .admin-topbar {
        position: static;
    }
}

@media (max-width: 600px) {
    .account-chip bdi {
        display: none;
    }

    .stat-value {
        font-size: 1.8rem;
    }

    .recent-list a {
        flex-direction: column;
        align-items: flex-start;
        gap: .25rem;
    }
}

/* ===== Users ===== */
.role-options {
    border: 0;
    padding: 0;
    margin: 1rem 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .75rem;
}

    .role-options legend {
        padding: 0;
        margin-bottom: .5rem;
        font-size: .9rem;
    }

.role-option {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    margin: 0;
    padding: .8rem;
    border: 1px solid var(--admin-line);
    border-radius: 10px;
    font-weight: 400;
    cursor: pointer;
}

    .role-option:has(input:checked) {
        border-color: var(--admin-ink);
        background: #f1f6f2;
    }

    .role-option input {
        margin-top: .3rem;
    }

    .role-option strong {
        display: block;
        font-size: .95rem;
    }

    .role-option small {
        margin-top: .15rem;
    }

.issued-password {
    border-color: #e2c98f;
    background: #fffaf0;
}

.temp-password code {
    display: inline-block;
    padding: .6rem 1rem;
    border: 1px dashed #c9a860;
    border-radius: 8px;
    background: #fff;
    font-size: 1.2rem;
    letter-spacing: .06em;
    user-select: all;
}

.user-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.user-row {
    padding: 1rem 0;
    border-top: 1px solid #eef1ec;
}

    .user-row:first-child {
        padding-top: 0;
        border-top: 0;
    }

.user-main {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.user-email {
    font-weight: 700;
    color: var(--admin-ink);
    overflow-wrap: anywhere;
}

.user-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .3rem;
}

    .user-badges .badge {
        background: #eef3ef;
        color: var(--admin-ink);
    }

        .user-badges .badge.published {
            background: #e0f0e4;
            color: #235a35;
        }

        .user-badges .badge.draft {
            background: #f2ead6;
            color: #785820;
        }

        .user-badges .badge.locked {
            background: #fbe4e1;
            color: #8e2a22;
        }

.user-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .85rem;
    padding-inline-start: calc(34px + .75rem);
}

    .user-actions .button {
        padding: .4rem .75rem;
        font-size: .85rem;
    }

.button.role-on {
    background: #e0f0e4;
    border-color: #9cc4a8;
}

@media (max-width: 600px) {
    .user-actions {
        padding-inline-start: 0;
    }
}