/* ============================================================================
   ICOPAD — Admin panel
   PRD: §15.3 (admin dashboard), §18.1 (audit visibility), §19 (accessibility),
        §22 (RBAC), §16 (i18n).
   Mobile-first, WCAG 2.2 AA conscious.

   Desktop sidebar is pinned via position: sticky.
   Mobile  sidebar is an off-canvas drawer opened by [data-menu-toggle].
   ============================================================================ */

/* ═══════════════════════════════════════════════════════════════════════
   1. ADMIN PAGE SHELL
   ═══════════════════════════════════════════════════════════════════════ */

.admin-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 1400px;
}

.admin-page__header {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-subtle, #eaeaea);
    max-width: 780px;
}

.admin-page__eyebrow {
    font-size: .6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .16em;
    color: var(--brand, #0a4d8c);
    margin: 0;
    line-height: 1.2;
}

.admin-page__header h1 {
    font-size: clamp(1.5rem, 1.25rem + 1.2vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: 0;
    color: var(--text, #111);
    text-wrap: balance;
}

.admin-page__lead {
    font-size: .9375rem;
    line-height: 1.6;
    color: var(--text-muted, #555);
    margin: 0;
    text-wrap: pretty;
}
.admin-page__lead a {
    color: var(--brand, #0a4d8c);
    text-decoration: none;
    font-weight: 600;
}
.admin-page__lead a:hover { text-decoration: underline; }

/* ── Alerts ────────────────────────────────────────────────────────── */

.admin-page .alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: .9375rem;
    line-height: 1.55;
}
.admin-page .alert ul {
    margin: .25rem 0 0;
    padding-left: 1.25rem;
}
.admin-page .alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}
.admin-page .alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}
.admin-page .alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}
.admin-page .alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

/* ═══════════════════════════════════════════════════════════════════════
   2. CARD
   ═══════════════════════════════════════════════════════════════════════ */

.admin-card {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e5e5e5);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 1px 2px 0 rgb(22 20 19 / 0.03);
}
@media (min-width: 640px) {
    .admin-card { padding: 1.5rem; }
}
.admin-card + .admin-card { margin-top: 1rem; }
.admin-card > h2 {
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -.015em;
    margin: 0 0 1rem;
    color: var(--text, #111);
}
.admin-card > h3 {
    font-size: .9375rem;
    font-weight: 600;
    margin: 1.5rem 0 .75rem;
    color: var(--text, #111);
}
.admin-card__desc {
    font-size: .8125rem;
    color: var(--text-muted, #555);
    margin: 0 0 1rem;
    line-height: 1.55;
}
.admin-card--attention {
    border-color: color-mix(in srgb, #f59e0b 45%, var(--border, #e5e5e5));
    background: color-mix(in srgb, #f59e0b 3%, var(--surface, #fff));
}

/* ═══════════════════════════════════════════════════════════════════════
   3. STAT GRID
   ═══════════════════════════════════════════════════════════════════════ */

.admin-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .75rem;
}
@media (min-width: 768px) {
    .admin-stats { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
}
@media (min-width: 1024px) {
    .admin-stats { grid-template-columns: repeat(6, 1fr); }
}
.admin-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 1rem 1.25rem;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e5e5e5);
    border-radius: 14px;
}
.admin-stat--attention {
    border-color: color-mix(in srgb, #f59e0b 45%, var(--border, #e5e5e5));
    background: color-mix(in srgb, #f59e0b 4%, var(--surface, #fff));
}
.admin-stat__value {
    font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--text, #111);
    font-variant-numeric: tabular-nums;
}
.admin-stat--attention .admin-stat__value { color: #b45309; }
.admin-stat__label {
    font-size: .6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-subtle, #888);
    line-height: 1.3;
}
a.admin-stat {
    text-decoration: none;
    color: inherit;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
a.admin-stat:hover,
a.admin-stat:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgb(22 20 19 / .06);
    border-color: color-mix(in srgb, var(--brand, #0a4d8c) 35%, var(--border, #e5e5e5));
    outline: none;
}
a.admin-stat:focus-visible {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand, #0a4d8c) 25%, transparent);
}
a.admin-stat .admin-stat__value { color: var(--text, #111); }

/* ═══════════════════════════════════════════════════════════════════════
   4. TWO-COLUMN LAYOUT
   ═══════════════════════════════════════════════════════════════════════ */

.two-col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}
@media (min-width: 1024px) {
    .two-col { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
}

/* ═══════════════════════════════════════════════════════════════════════
   5. TABLE
   ═══════════════════════════════════════════════════════════════════════ */

.admin-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border, #e5e5e5);
    border-radius: 14px;
    background: var(--surface, #fff);
    box-shadow: 0 1px 2px rgb(22 20 19 / 0.03);
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
    font-variant-numeric: tabular-nums;
}
.admin-table th,
.admin-table td {
    padding: 12px 16px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border-subtle, #eaeaea);
}
.admin-table th {
    font-size: .6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-subtle, #888);
    background: var(--bg-subtle, #fafafa);
    white-space: nowrap;
}
.admin-table tbody tr { transition: background-color .15s ease; }
.admin-table tbody tr:hover { background: var(--surface-hover, #f9f9f9); }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table a {
    color: var(--brand, #0a4d8c);
    text-decoration: none;
    font-weight: 500;
}
.admin-table a:hover { text-decoration: underline; }

@media (max-width: 767px) {
    .admin-table.responsive thead { display: none; }
    .admin-table.responsive,
    .admin-table.responsive tbody,
    .admin-table.responsive tr,
    .admin-table.responsive td { display: block; width: 100%; }
    .admin-table.responsive tr {
        border-bottom: 1px solid var(--border, #e5e5e5);
        padding: 12px 16px;
    }
    .admin-table.responsive tr:last-child { border-bottom: 0; }
    .admin-table.responsive td {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        padding: 6px 0;
        border: 0;
    }
    .admin-table.responsive td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-subtle, #888);
        font-size: .6875rem;
        text-transform: uppercase;
        letter-spacing: .08em;
        flex-shrink: 0;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   6. LIST
   ═══════════════════════════════════════════════════════════════════════ */

.admin-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.admin-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--bg-subtle, #fafafa);
    font-size: .875rem;
    color: var(--text, #111);
}
.admin-list small {
    color: var(--text-subtle, #888);
    font-size: .75rem;
}
.admin-list__code {
    font-size: .75rem;
    color: var(--brand, #0a4d8c);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ═══════════════════════════════════════════════════════════════════════
   7. BADGES
   ═══════════════════════════════════════════════════════════════════════ */

.admin-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    border-radius: 999px;
    background: var(--bg-muted, #f1f1f1);
    color: var(--text-muted, #555);
    white-space: nowrap;
    line-height: 1.3;
}
.admin-badge--ok       { background: #d1fae5; color: #065f46; }
.admin-badge--warn     { background: #fef3c7; color: #92400e; }
.admin-badge--bad      { background: #fee2e2; color: #991b1b; }
.admin-badge--info     { background: #dbeafe; color: #1e40af; }
.admin-badge--neutral  { background: var(--bg-muted, #f1f1f1); color: var(--text-muted, #555); }
.admin-badge--brand    { background: color-mix(in srgb, var(--brand, #0a4d8c) 12%, transparent); color: var(--brand, #0a4d8c); }

/* ═══════════════════════════════════════════════════════════════════════
   8. ACTION BUTTONS IN TABLES
   ═══════════════════════════════════════════════════════════════════════ */

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.admin-actions form {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    margin: 0;
}
.admin-actions input[type="text"] {
    padding: 6px 10px;
    font: inherit;
    font-size: .8125rem;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #d4d4d4);
    border-radius: 8px;
    min-width: 140px;
    max-width: 220px;
    color: var(--text, #111);
}
.admin-actions input[type="text"]:focus {
    outline: none;
    border-color: var(--brand, #0a4d8c);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand, #0a4d8c) 20%, transparent);
}
.admin-actions select {
    padding: 6px 10px;
    font: inherit;
    font-size: .8125rem;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #d4d4d4);
    border-radius: 8px;
    color: var(--text, #111);
}

/* ═══════════════════════════════════════════════════════════════════════
   9. BUTTONS (scoped to admin)
   ═══════════════════════════════════════════════════════════════════════ */

.admin-page .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 16px;
    min-height: 38px;
    font: inherit;
    font-size: .8125rem;
    font-weight: 600;
    letter-spacing: -0.005em;
    border: 1px solid transparent;
    border-radius: 9px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.admin-page .btn-primary {
    background: var(--brand, #0a4d8c);
    color: #fff;
}
.admin-page .btn-primary:hover { background: color-mix(in srgb, var(--brand, #0a4d8c) 88%, #000); }
.admin-page .btn-secondary {
    background: var(--surface, #fff);
    color: var(--text, #111);
    border-color: var(--border-strong, #d4d4d4);
}
.admin-page .btn-secondary:hover {
    background: var(--surface-hover, #f3f3f3);
    border-color: var(--text-subtle, #888);
}
.admin-page .btn-danger { background: #dc2626; color: #fff; }
.admin-page .btn-danger:hover { background: #b91c1c; }
.admin-page .btn-warn { background: #d97706; color: #fff; }
.admin-page .btn-warn:hover { background: #b45309; }
.admin-page .btn-success { background: #059669; color: #fff; }
.admin-page .btn-success:hover { background: #047857; }
.admin-page .btn-sm {
    min-height: 32px;
    padding: 0 12px;
    font-size: .75rem;
    border-radius: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════
   10. INLINE CHECKBOX GROUP
   ═══════════════════════════════════════════════════════════════════════ */

.admin-check-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    align-items: center;
}
.admin-check-group label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .8125rem;
    font-weight: 500;
    color: var(--text, #111);
    cursor: pointer;
}
.admin-check-group input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--brand, #0a4d8c);
}

/* ═══════════════════════════════════════════════════════════════════════
   11. DETAILS / SUMMARY
   ═══════════════════════════════════════════════════════════════════════ */

.admin-details {
    border: 1px solid var(--border, #e5e5e5);
    border-radius: 12px;
    margin-bottom: 1rem;
    background: var(--surface, #fff);
}
.admin-details[open] { box-shadow: 0 1px 2px rgb(22 20 19 / 0.04); }
.admin-details > summary {
    padding: 12px 16px;
    font-size: .9375rem;
    font-weight: 600;
    color: var(--text, #111);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    list-style: none;
    border-radius: 12px;
}
.admin-details > summary::-webkit-details-marker { display: none; }
.admin-details > summary::before {
    content: "▸";
    color: var(--text-subtle, #888);
    font-size: .875rem;
    transition: transform .15s ease;
}
.admin-details[open] > summary::before { transform: rotate(90deg); }
.admin-details > summary:hover { background: var(--bg-subtle, #fafafa); }
.admin-details__form {
    padding: 0 16px 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.admin-details__actions { display: flex; gap: 8px; }

/* ═══════════════════════════════════════════════════════════════════════
   12. FORMS
   ═══════════════════════════════════════════════════════════════════════ */

.admin-page .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 1rem;
}
.admin-page .form-group label {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--text, #111);
}
.admin-page .form-group input,
.admin-page .form-group select,
.admin-page .form-group textarea {
    padding: 10px 12px;
    font: inherit;
    font-size: .875rem;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #d4d4d4);
    border-radius: 9px;
    color: var(--text, #111);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.admin-page .form-group input:focus,
.admin-page .form-group select:focus,
.admin-page .form-group textarea:focus {
    outline: none;
    border-color: var(--brand, #0a4d8c);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand, #0a4d8c) 20%, transparent);
}
.admin-page .form-group textarea { min-height: 100px; resize: vertical; }
.admin-page .form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 640px) {
    .admin-page .form-row { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .admin-page .form-row { grid-template-columns: repeat(3, 1fr); }
}

/* ═══════════════════════════════════════════════════════════════════════
   13. EMPTY STATE
   ═══════════════════════════════════════════════════════════════════════ */

.admin-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 2rem 1rem;
    background: var(--bg-subtle, #fafafa);
    border: 1px dashed var(--border-strong, #ccc);
    border-radius: 14px;
}
.admin-empty__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--brand, #0a4d8c) 10%, transparent);
    color: var(--brand, #0a4d8c);
    margin-bottom: .5rem;
}
.admin-empty__title {
    font-size: 1.0625rem;
    font-weight: 600;
    margin: 0;
    color: var(--text, #111);
}
.admin-empty__body {
    font-size: .875rem;
    color: var(--text-muted, #555);
    margin: 0;
    max-width: 480px;
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════════════
   14. FILTERS
   ═══════════════════════════════════════════════════════════════════════ */

.admin-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1rem;
}
.admin-filter {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--text-muted, #555);
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e5e5e5);
    border-radius: 999px;
    text-decoration: none;
    transition: all .15s ease;
}
.admin-filter:hover {
    color: var(--text, #111);
    border-color: var(--border-strong, #ccc);
    text-decoration: none;
}
.admin-filter.is-active {
    background: var(--brand, #0a4d8c);
    color: #fff;
    border-color: var(--brand, #0a4d8c);
}
.admin-filter__count {
    margin-left: 6px;
    padding: 1px 6px;
    font-size: .6875rem;
    background: rgb(255 255 255 / .2);
    border-radius: 999px;
}

/* ═══════════════════════════════════════════════════════════════════════
   15. APP SHELL
   ═══════════════════════════════════════════════════════════════════════ */

.app-shell {
    display: block;
    background: var(--bg-subtle, #fafafa);
    min-height: calc(100dvh - var(--header-height-mobile, 56px));
    margin: 0;
    padding: 0;
}
@media (min-width: 1024px) {
    .app-shell {
        display: grid;
        grid-template-columns: 280px 1fr;
        align-items: start;
        min-height: calc(100dvh - var(--header-height, 64px));
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   16. APP SIDEBAR
   ═══════════════════════════════════════════════════════════════════════ */

.app-sidebar {
    background: var(--surface, #fff);
    border-right: 1px solid var(--border-subtle, #eaeaea);
    padding: 1rem 1rem .5rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "cv11" 1, "ss01" 1;
}
@media (min-width: 1024px) {
    .app-sidebar {
        position: sticky;
        top: var(--header-height, 64px);
        align-self: start;
        height: calc(100dvh - var(--header-height, 64px));
        max-height: calc(100dvh - var(--header-height, 64px));
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 1.25rem 1rem .75rem;
        scrollbar-width: thin;
        scrollbar-color: color-mix(in srgb, var(--border-strong, #ccc) 60%, transparent) transparent;
    }
    .app-sidebar::-webkit-scrollbar { width: 8px; }
    .app-sidebar::-webkit-scrollbar-thumb {
        background: color-mix(in srgb, var(--border-strong, #ccc) 60%, transparent);
        border-radius: 999px;
    }
    .app-sidebar::-webkit-scrollbar-thumb:hover { background: var(--border-strong, #ccc); }

    .app-main {
        align-self: stretch;
        min-height: calc(100dvh - var(--header-height, 64px));
    }
}
@media (min-width: 1024px) {
    .app-sidebar { transition: box-shadow .15s ease; }
    body.is-scrolled .app-sidebar {
        box-shadow: 1px 0 0 0 color-mix(in srgb, var(--border, #e5e5e5) 80%, transparent);
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   17. ADMIN SIDEBAR — MOBILE DRAWER
   ═══════════════════════════════════════════════════════════════════════ */

.app-sidebar__toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: .75rem 1rem .25rem;
    width: calc(100% - 2rem);
    padding: 10px 14px;
    min-height: 44px;
    font: inherit;
    font-size: .875rem;
    font-weight: 600;
    color: var(--text, #111);
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e5e5e5);
    border-radius: 10px;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}
.app-sidebar__toggle:hover {
    background: var(--surface-hover, #f3f3f3);
    border-color: var(--border-strong, #d4d4d4);
}
.app-sidebar__toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand, #0a4d8c) 25%, transparent);
}
.app-sidebar__toggle-text { line-height: 1; }

.app-sidebar__backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgb(0 0 0 / .45);
    opacity: 0;
    transition: opacity .25s ease;
    -webkit-tap-highlight-color: transparent;
}
.app-sidebar__backdrop.is-visible { opacity: 1; }
.app-sidebar__backdrop[hidden]    { display: none; }

.app-sidebar__drawer-head {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle, #eaeaea);
    flex-shrink: 0;
}
.app-sidebar__drawer-title {
    font-size: .6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .16em;
    color: var(--brand, #0a4d8c);
}
.app-sidebar__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: var(--text, #111);
    background: transparent;
    border: 1px solid var(--border, #e5e5e5);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}
.app-sidebar__close:hover {
    background: var(--surface-hover, #f3f3f3);
    border-color: var(--border-strong, #d4d4d4);
}
.app-sidebar__close:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand, #0a4d8c) 25%, transparent);
}

@media (max-width: 1023px) {
    .app-sidebar__toggle { display: inline-flex; }

    .app-sidebar.app-sidebar--admin {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 9000;
        width: min(86vw, 340px);
        max-width: 100%;
        height: 100dvh;
        margin: 0;
        padding: 0;
        background: var(--surface, #fff);
        border-right: 1px solid var(--border, #e5e5e5);
        box-shadow: 0 10px 40px rgb(0 0 0 / .28);
        overflow-y: auto;
        overscroll-behavior: contain;
        transform: translateX(-100%);
        transition: transform .25s ease;
        will-change: transform;
        isolation: isolate;
    }
    .app-sidebar.app-sidebar--admin.is-open { transform: translateX(0); }

    .app-sidebar__backdrop { top: 0; z-index: 8900; }
    .app-sidebar__drawer-head { display: flex; }

    .app-sidebar--admin .app-sidebar__nav {
        display: flex;
        padding: 12px 16px 20px;
    }
    .app-sidebar--admin .app-sidebar__user { margin: 12px 16px 0; }

    html.nav-locked,
    body.is-drawer-open { overflow: hidden; }
}

@media (min-width: 1024px) {
    .app-sidebar__toggle,
    .app-sidebar__drawer-head,
    .app-sidebar__backdrop { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════════
   18. RECENT ACTIVITY
   ═══════════════════════════════════════════════════════════════════════ */

.activity-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 14px;
}
.activity-head h2 { margin: 0 0 4px; }

.activity-head__tools { flex-shrink: 0; min-width: 220px; }

.activity-search {
    width: 100%;
    padding: 8px 12px;
    font: inherit;
    font-size: .8125rem;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #d4d4d4);
    border-radius: 8px;
    color: var(--text, #111);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.activity-search:focus {
    outline: none;
    border-color: var(--brand, #0a4d8c);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand, #0a4d8c) 20%, transparent);
}

.activity-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle, #eaeaea);
    overflow-x: auto;
    scrollbar-width: thin;
}
.activity-tabs::-webkit-scrollbar { height: 6px; }
.activity-tabs::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--border-strong, #ccc) 60%, transparent);
    border-radius: 999px;
}

.activity-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--text-muted, #555);
    font: inherit;
    font-size: .8125rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.activity-tab:hover {
    background: var(--surface-hover, #f3f3f3);
    color: var(--text, #111);
}
.activity-tab:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand, #0a4d8c) 25%, transparent);
}
.activity-tab.is-active {
    background: color-mix(in srgb, var(--brand, #0a4d8c) 10%, transparent);
    color: var(--brand, #0a4d8c);
    border-color: color-mix(in srgb, var(--brand, #0a4d8c) 25%, transparent);
}
.activity-tab__label { line-height: 1; }
.activity-tab__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: .6875rem;
    font-weight: 700;
    border-radius: 999px;
    background: var(--bg-muted, #f1f1f1);
    color: var(--text-muted, #555);
    font-variant-numeric: tabular-nums;
}
.activity-tab.is-active .activity-tab__count {
    background: var(--brand, #0a4d8c);
    color: #fff;
}

.activity-panels { position: relative; }
.activity-panel { display: block; }
.activity-panel[hidden] { display: none; }

.admin-list--activity li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.admin-activity__row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}
.admin-activity__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
}
.admin-activity__meta strong { font-weight: 600; }
.admin-activity__sep { color: var(--text-subtle, #bbb); }
.admin-activity__time {
    color: var(--text-subtle, #888);
    font-size: .75rem;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    white-space: nowrap;
}
.admin-activity__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--brand, #0a4d8c) 12%, transparent);
    color: var(--brand, #0a4d8c);
    font-size: .6875rem;
    font-weight: 800;
    letter-spacing: .02em;
    flex-shrink: 0;
    text-transform: uppercase;
    line-height: 1;
}

.activity-empty {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 14px;
    background: var(--bg-subtle, #fafafa);
    border: 1px dashed var(--border-strong, #ccc);
    border-radius: 10px;
    color: var(--text-muted, #555);
    font-size: .875rem;
}
.activity-empty__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-muted, #f1f1f1);
    color: var(--text-subtle, #888);
    flex-shrink: 0;
}
.activity-empty__text { margin: 0; }

.activity-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-subtle, #eaeaea);
}
.activity-pager__status {
    font-size: .75rem;
    color: var(--text-muted, #666);
    font-variant-numeric: tabular-nums;
    text-align: center;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.activity-pager .btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .activity-head { flex-direction: column; align-items: stretch; }
    .activity-head__tools { min-width: 0; }
    .activity-pager .btn span { display: none; }
    .activity-pager .btn { padding: 0 10px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   19. REVIEW MODAL BODY (organisation applications)
   ═══════════════════════════════════════════════════════════════════════ */

.review { display: flex; flex-direction: column; gap: 20px; }

.review__head { display: flex; flex-direction: column; gap: 4px; }
.review__org {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text, #111);
    line-height: 1.2;
}
.review__meta {
    margin: 0;
    font-size: .8125rem;
    color: var(--text-muted, #666);
    line-height: 1.5;
}
.review__meta a { color: var(--brand, #0a4d8c); text-decoration: none; }
.review__meta a:hover { text-decoration: underline; }

.review__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}
@media (min-width: 640px) {
    .review__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.review__section {
    padding: 16px 18px;
    background: var(--bg-subtle, #fafafa);
    border: 1px solid var(--border-subtle, #eaeaea);
    border-radius: 12px;
}
.review__section-title {
    margin: 0 0 10px;
    font-size: .6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--brand, #0a4d8c);
}
.review__section--info {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.review__dl {
    display: grid;
    grid-template-columns: minmax(120px, max-content) 1fr;
    gap: 6px 16px;
    margin: 0;
    font-size: .875rem;
}
.review__dl dt {
    color: var(--text-subtle, #888);
    font-weight: 600;
    text-transform: capitalize;
}
.review__dl dd {
    margin: 0;
    color: var(--text, #111);
    word-break: break-word;
    white-space: pre-wrap;
}

.review__chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: .8125rem;
    color: var(--text-muted, #555);
    margin: 0 0 6px;
}
.review__chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    font-size: .6875rem;
    font-weight: 600;
    border-radius: 999px;
    background: var(--bg-muted, #f1f1f1);
    color: var(--text-muted, #555);
    line-height: 1.4;
}

.review__prose {
    margin: 0;
    font-size: .9375rem;
    line-height: 1.65;
    color: var(--text, #111);
    overflow-wrap: anywhere;
}
.review__prose img { max-width: 100%; height: auto; }
.review__prose a { color: var(--brand, #0a4d8c); }

.review__tinymce-mount {
    border: 1px solid var(--border, #e5e5e5);
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface, #fff);
}
.review__tinymce-mount .tox-tinymce { border: 0 !important; }

.review__raw {
    border: 1px dashed var(--border-strong, #ccc);
    border-radius: 10px;
    padding: 12px 14px;
    background: var(--bg-subtle, #fafafa);
}
.review__raw > summary {
    cursor: pointer;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--text-muted, #555);
    list-style: none;
}
.review__raw > summary::-webkit-details-marker { display: none; }
.review__raw > summary::before { content: "▸ "; color: var(--text-subtle, #888); }
.review__raw[open] > summary::before { content: "▾ "; }
.review__pre {
    margin: 10px 0 0;
    padding: 12px;
    background: var(--surface, #fff);
    border-radius: 8px;
    font-size: .75rem;
    line-height: 1.5;
    overflow-x: auto;
    max-height: 320px;
    color: var(--text, #111);
}

@media (max-width: 640px) {
    #moderation-review-body .review__grid { grid-template-columns: 1fr; }
    #moderation-review-body .review__tinymce-mount { max-height: 55dvh; overflow: auto; }
}

/* ═══════════════════════════════════════════════════════════════════════
   20. MODERATION HUB
   ═══════════════════════════════════════════════════════════════════════ */

.mod-hub {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
@media (min-width: 640px) {
    .mod-hub { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .mod-hub { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.mod-hub__card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 18px 20px;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e5e5e5);
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.mod-hub__card:hover,
.mod-hub__card:focus-visible {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--brand, #0a4d8c) 35%, var(--border, #e5e5e5));
    box-shadow: 0 4px 12px rgb(22 20 19 / .06);
    outline: none;
}
.mod-hub__card:focus-visible {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand, #0a4d8c) 25%, transparent);
}
.mod-hub__card--attention {
    border-color: color-mix(in srgb, #f59e0b 45%, var(--border, #e5e5e5));
    background: color-mix(in srgb, #f59e0b 3%, var(--surface, #fff));
}

.mod-hub__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--brand, #0a4d8c) 10%, transparent);
    color: var(--brand, #0a4d8c);
    flex-shrink: 0;
}
.mod-hub__card--attention .mod-hub__icon {
    background: color-mix(in srgb, #f59e0b 15%, transparent);
    color: #b45309;
}

.mod-hub__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mod-hub__title { font-weight: 700; font-size: .9375rem; letter-spacing: -.01em; }
.mod-hub__desc  { font-size: .8125rem; color: var(--text-muted, #555); line-height: 1.5; }

.mod-hub__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    font-size: .875rem;
    font-weight: 700;
    border-radius: 999px;
    background: var(--bg-muted, #f1f1f1);
    color: var(--text-muted, #555);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.mod-hub__count.is-attention {
    background: #b45309;
    color: #fff;
}

/* ═══════════════════════════════════════════════════════════════════════
   21. DOUBLE-SUBMIT GUARD
   ═══════════════════════════════════════════════════════════════════════ */

form.is-submitting button[type="submit"] {
    opacity: .7;
    cursor: progress;
}

/* ═══════════════════════════════════════════════════════════════════════
   22. REDUCED MOTION
   ═══════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    .admin-page .btn,
    .admin-table tbody tr,
    .admin-filter,
    .admin-details > summary::before,
    .app-sidebar.app-sidebar--admin,
    .app-sidebar__backdrop,
    a.admin-stat,
    .mod-hub__card,
    .dash-tile,
    .dash-quick__link {
        transition-duration: .01ms !important;
    }
    a.admin-stat:hover,
    a.admin-stat:focus-visible,
    .mod-hub__card:hover,
    .mod-hub__card:focus-visible,
    .dash-tile:hover,
    .dash-tile:focus-visible {
        transform: none;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   23. DASHBOARD ENHANCEMENTS (attention tiles + two-column strip)
   ═══════════════════════════════════════════════════════════════════════ */

.dash-two-col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 900px) {
    .dash-two-col { grid-template-columns: 1fr 1fr; }
}

.dash-attention__head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 1rem;
}
.dash-attention__head h2 { margin: 0 0 4px; }

.dash-attention__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
@media (min-width: 640px) {
    .dash-attention__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .dash-attention__grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}

.dash-tile {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e5e5e5);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
    min-width: 0;
}
.dash-tile:hover,
.dash-tile:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgb(22 20 19 / .06);
    border-color: color-mix(in srgb, var(--brand, #0a4d8c) 35%, var(--border, #e5e5e5));
    outline: none;
}
.dash-tile:focus-visible {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand, #0a4d8c) 25%, transparent);
}
.dash-tile--attention {
    border-color: color-mix(in srgb, #f59e0b 45%, var(--border, #e5e5e5));
    background: color-mix(in srgb, #f59e0b 4%, var(--surface, #fff));
}
.dash-tile__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--brand, #0a4d8c) 10%, transparent);
    color: var(--brand, #0a4d8c);
    flex-shrink: 0;
}
.dash-tile--attention .dash-tile__icon {
    background: color-mix(in srgb, #f59e0b 15%, transparent);
    color: #b45309;
}
.dash-tile__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dash-tile__value {
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.02em;
    color: var(--text, #111);
    font-variant-numeric: tabular-nums;
}
.dash-tile--attention .dash-tile__value { color: #b45309; }
.dash-tile__label {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-subtle, #888);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.dash-quick__link {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--text, #111);
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e5e5e5);
    border-radius: 999px;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.dash-quick__link:hover,
.dash-quick__link:focus-visible {
    background: color-mix(in srgb, var(--brand, #0a4d8c) 8%, transparent);
    border-color: color-mix(in srgb, var(--brand, #0a4d8c) 35%, var(--border, #e5e5e5));
    color: var(--brand, #0a4d8c);
    text-decoration: none;
    outline: none;
}
.dash-quick__link:focus-visible {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand, #0a4d8c) 25%, transparent);
}

.admin-activity__count {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    font-size: .6875rem;
    font-weight: 700;
    border-radius: 999px;
    background: var(--bg-muted, #f1f1f1);
    color: var(--text-muted, #555);
    font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════════════════════════
   24. USERS & ROLES TOOLBAR
   ═══════════════════════════════════════════════════════════════════════ */

.admin-users__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.admin-users__search {
    flex: 1 1 280px;
    max-width: 480px;
    display: flex;
}
.admin-users__search input {
    width: 100%;
    padding: 10px 14px;
    font: inherit;
    font-size: .875rem;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #d4d4d4);
    border-radius: 10px;
    color: var(--text, #111);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.admin-users__search input:focus {
    outline: none;
    border-color: var(--brand, #0a4d8c);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand, #0a4d8c) 20%, transparent);
}

/* ═══════════════════════════════════════════════════════════════════════
   25. ABOUT EDITOR MODALS (and shared modal-form polish)
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Current-image preview inside any modal ────────────────────────── */

.current-image,
.modal__current-image {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}
.current-image img,
.modal__current-image img {
    display: block;
    max-width: 200px;
    max-height: 140px;
    width: auto;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--border, #e5e5e5);
    background: var(--bg-subtle, #fafafa);
    object-fit: contain;
}
.current-image label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .8125rem;
    color: var(--text-muted, #555);
    cursor: pointer;
}

/* ── File inputs ──────────────────────────────────────────────────── */

.admin-page .form-group input[type="file"] {
    padding: 8px 10px;
    font-size: .8125rem;
    background: var(--surface, #fff);
    border: 1px dashed var(--border-strong, #ccc);
    border-radius: 9px;
    color: var(--text-muted, #555);
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
    width: 100%;
}
.admin-page .form-group input[type="file"]:hover {
    border-color: var(--brand, #0a4d8c);
    background: color-mix(in srgb, var(--brand, #0a4d8c) 3%, var(--surface, #fff));
}
.admin-page .form-group input[type="file"]:focus-visible {
    outline: none;
    border-color: var(--brand, #0a4d8c);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand, #0a4d8c) 20%, transparent);
}
.admin-page .form-group input[type="file"]::file-selector-button {
    margin-right: 10px;
    padding: 6px 12px;
    font: inherit;
    font-size: .75rem;
    font-weight: 600;
    color: var(--text, #111);
    background: var(--bg-muted, #f1f1f1);
    border: 1px solid var(--border, #d4d4d4);
    border-radius: 7px;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}
.admin-page .form-group input[type="file"]::file-selector-button:hover {
    background: var(--surface-hover, #f3f3f3);
    border-color: var(--border-strong, #ccc);
}

/* ── Number and date inputs, tidied ───────────────────────────────── */

.admin-page .form-group input[type="number"],
.admin-page .form-group input[type="date"] {
    font-variant-numeric: tabular-nums;
}
.admin-page .form-group input[type="number"]::-webkit-outer-spin-button,
.admin-page .form-group input[type="number"]::-webkit-inner-spin-button {
    opacity: 1;
}

/* ── Checkbox row inside a modal/forms (label wraps the input) ─────── */

.admin-page .form-group > label.admin-check-group {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-subtle, #fafafa);
    border: 1px solid var(--border-subtle, #eaeaea);
    border-radius: 9px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}
.admin-page .form-group > label.admin-check-group:hover {
    border-color: var(--border-strong, #ccc);
    background: var(--surface-hover, #f9f9f9);
}
.admin-page .form-group > label.admin-check-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    accent-color: var(--brand, #0a4d8c);
    flex-shrink: 0;
}
.admin-page .form-group > label.admin-check-group span {
    font-size: .875rem;
    line-height: 1.4;
    color: var(--text, #111);
}

/* ── In-modal form-group tweaks ───────────────────────────────────── */

.modal .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 1rem;
}
.modal .form-group:last-child { margin-bottom: 0; }
.modal .form-group label {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--text, #111);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.modal .form-group label .req {
    color: #dc2626;
    font-weight: 700;
}
.modal .form-group input[type="text"],
.modal .form-group input[type="email"],
.modal .form-group input[type="tel"],
.modal .form-group input[type="url"],
.modal .form-group input[type="number"],
.modal .form-group input[type="date"],
.modal .form-group select,
.modal .form-group textarea {
    padding: 10px 12px;
    font: inherit;
    font-size: .875rem;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #d4d4d4);
    border-radius: 9px;
    color: var(--text, #111);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.modal .form-group input:focus,
.modal .form-group select:focus,
.modal .form-group textarea:focus {
    outline: none;
    border-color: var(--brand, #0a4d8c);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand, #0a4d8c) 20%, transparent);
}
.modal .form-group input[aria-invalid="true"],
.modal .form-group select[aria-invalid="true"],
.modal .form-group textarea[aria-invalid="true"] {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgb(220 38 38 / 0.18);
}
.modal .form-group textarea {
    min-height: 90px;
    resize: vertical;
}
.modal .form-group small {
    color: var(--text-subtle, #888);
    font-size: .75rem;
    line-height: 1.4;
}

/* Two-column row inside a modal */
.modal .form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 560px) {
    .modal .form-row { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
    .modal .form-row { grid-template-columns: 1fr 1fr; }
}

/* ── Sticky footer inside modals ──────────────────────────────────── */

.modal__dialog > form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}
.modal__dialog > form > .modal__footer {
    position: sticky;
    bottom: 0;
    background: var(--bg-subtle, #fafafa);
    z-index: 1;
}

/* ── Mobile: About editor modals full-height forms ────────────────── */

@media (max-width: 640px) {
    #about-leader-modal .modal__dialog,
    #about-milestone-modal .modal__dialog,
    #about-report-modal .modal__dialog {
        max-height: calc(100dvh - 24px);
    }
    #about-leader-form,
    #about-milestone-form,
    #about-report-form {
        display: flex;
        flex-direction: column;
        max-height: 100%;
        min-height: 0;
    }
    #about-leader-form > .modal__body,
    #about-milestone-form > .modal__body,
    #about-report-form > .modal__body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
    }
}

/* Editorial review forms */
.editor-form {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-bottom: 1rem;
}
.editor-form label {
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-muted);
}
.editor-form textarea {
    width: 100%;
    padding: .6rem .75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font: inherit;
    min-height: 80px;
    resize: vertical;
}
.editor-form .checkbox {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .9rem;
    font-weight: 400;
}
.editor-form button {
    align-self: flex-start;
}
.meta-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: .4rem 1.2rem;
    margin: 0 0 1rem;
}
.meta-grid dt {
    font-weight: 600;
    color: var(--text-muted);
    font-size: .85rem;
}
.meta-grid dd {
    margin: 0;
}
.callout {
    padding: .75rem 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    font-size: .9rem;
}
.callout--info { background: #0d2438; color: #58a6ff; }
.callout--warn { background: #3a2b0b; color: #d29922; }
.pagination {
    display: flex;
    gap: .3rem;
    margin: 1rem 0;
}
.pagination__item {
    padding: .35rem .7rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    text-decoration: none;
}
.pagination__item.is-active {
    background: var(--color-primary);
    color: #fff;
}
.status-badge {
    display: inline-block;
    padding: .1rem .55rem;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}
.status-badge--ok    { background: #0f2d16; color: #3fb950; }
.status-badge--warn  { background: #3a2b0b; color: #d29922; }
.status-badge--bad   { background: #2d0f0f; color: #f85149; }
.status-badge--info  { background: #0d2438; color: #58a6ff; }
.status-badge--muted { background: #21262d; color: #8b949e; }