/* ==========================================================================
   if only admin design system
   A quiet, editorial admin console aligned to the public If Only brand:
   cloud blues, clean white surfaces and gentle support accents.
   ========================================================================== */

:root {
    /* Type */
    --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-display: var(--font-sans);
    --font-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', 'Cascadia Code', Menlo, Consolas, monospace;

    /* Surfaces */
    --paper: #eef6fc;
    --paper-2: #dbeefa;
    --surface: #ffffff;
    --surface-muted: #f5fbff;
    --ink: #0a4770;
    --ink-2: #063758;
    --ink-line: rgba(221, 244, 255, 0.16);

    /* Text */
    --text: #17324a;
    --text-muted: #587185;
    --text-faint: #8aa7ba;
    --cream: #f3fbff;
    --cream-muted: #b9e7ff;

    /* Lines */
    --line: #d5e8f4;
    --line-strong: #b9d8eb;

    /* Accents */
    --accent: #4a87c6;
    --accent-deep: #0d61a8;
    --accent-soft: #dff0fb;
    --accent-ring: rgba(74, 135, 198, 0.28);
    --gold: #18a77d;
    --gold-soft: #dff5ed;
    --gold-line: #bde5d8;
    --danger: #b23b32;
    --danger-deep: #97302a;
    --danger-soft: #f6ded9;
    --ok: #18a77d;

    /* Shape */
    --radius: 14px;
    --radius-sm: 9px;
    --radius-pill: 999px;

    /* Elevation */
    --shadow-sm: 0 1px 2px rgba(10, 71, 112, 0.06), 0 1px 3px rgba(10, 71, 112, 0.05);
    --shadow-md: 0 4px 12px -2px rgba(10, 71, 112, 0.12), 0 2px 6px -2px rgba(10, 71, 112, 0.08);
    --shadow-lg: 0 24px 55px -14px rgba(10, 71, 112, 0.28);

    --sidebar-w: 264px;
}

/* --- Base ------------------------------------------------------------------ */

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background-color: var(--paper);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0;
    color: var(--text);
    margin: 0;
}

a {
    color: var(--accent-deep);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

:focus-visible {
    outline: 3px solid var(--accent-ring);
    outline-offset: 2px;
    border-radius: 4px;
}

/* --- App shell ------------------------------------------------------------- */

.app {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    min-height: 100vh;
}

/* --- Sidebar --------------------------------------------------------------- */

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--ink);
    background-image:
        radial-gradient(120% 80% at 0% 0%, rgba(74, 135, 198, 0.28), transparent 55%),
        linear-gradient(180deg, var(--ink-2), var(--ink));
    border-right: 1px solid rgba(0, 0, 0, 0.35);
    color: var(--cream);
    z-index: 40;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 22px 20px;
}

.sidebar__mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(150deg, var(--accent), var(--accent-deep));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), var(--shadow-sm);
    color: #fff;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    flex: none;
}

.sidebar__wordmark {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.sidebar__wordmark b {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 0;
    color: #fff;
}

.sidebar__wordmark span {
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cream-muted);
}

.sidebar__section {
    padding: 6px 16px;
    margin-top: 8px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--cream-muted);
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 4px 14px;
    flex: 1;
    overflow-y: auto;
}

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--cream-muted);
    font-weight: 500;
    transition: background-color 0.16s ease, color 0.16s ease;
}

.nav-link:hover {
    background-color: rgba(221, 244, 255, 0.08);
    color: var(--cream);
    text-decoration: none;
}

.nav-link svg {
    width: 19px;
    height: 19px;
    flex: none;
    opacity: 0.85;
}

.nav-link.is-active {
    background-color: rgba(74, 135, 198, 0.24);
    color: #fff;
}

.nav-link.is-active::before {
    content: '';
    position: absolute;
    left: -14px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 22px;
    border-radius: 0 4px 4px 0;
    background: var(--accent);
}

.nav-link.is-active svg {
    opacity: 1;
    color: var(--accent);
}

.nav-sublist {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0 0 8px 31px;
}

.nav-link--sub {
    padding: 7px 10px;
    font-size: 13px;
    border-radius: 8px;
}

.nav-link--sub.is-active::before {
    left: -45px;
    height: 18px;
}

.sidebar__foot {
    padding: 14px;
    border-top: 1px solid var(--ink-line);
}

.sidebar__foot .nav-link {
    color: var(--cream-muted);
}

/* --- Main column ----------------------------------------------------------- */

.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 34px;
    background: color-mix(in srgb, var(--paper) 82%, transparent);
    backdrop-filter: saturate(1.4) blur(8px);
    border-bottom: 1px solid var(--line);
}

.topbar__title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0;
}

.topbar__spacer {
    flex: 1;
}

.icon-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

/* User menu (native details/summary) */
.usermenu {
    position: relative;
}

.usermenu > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--surface);
    cursor: pointer;
    list-style: none;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s ease;
}

.usermenu > summary::-webkit-details-marker {
    display: none;
}

.usermenu > summary:hover {
    border-color: var(--line-strong);
}

.avatar {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(150deg, var(--accent), var(--accent-deep));
    color: #fff;
    font-size: 12.5px;
    font-weight: 700;
    flex: none;
}

.usermenu__id {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    max-width: 190px;
}

.usermenu__id b {
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.usermenu__id span {
    font-size: 11.5px;
    color: var(--text-faint);
}

.usermenu__chevron {
    width: 16px;
    height: 16px;
    color: var(--text-faint);
}

.usermenu__panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 220px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
}

.usermenu__panel .muted {
    padding: 6px 10px 10px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 6px;
    font-size: 12.5px;
    color: var(--text-muted);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.menu-item:hover {
    background: var(--surface-muted);
    text-decoration: none;
}

.menu-item svg {
    width: 17px;
    height: 17px;
    color: var(--text-faint);
}

.menu-item--danger {
    color: var(--danger-deep);
}

.menu-item--danger svg {
    color: var(--danger);
}

/* --- Content --------------------------------------------------------------- */

.content {
    padding: 32px 34px 56px;
    max-width: 1140px;
    width: 100%;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
}

.page-head__eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-deep);
    margin-bottom: 6px;
}

.page-head h1 {
    font-size: 30px;
    line-height: 1.1;
}

.page-head__sub {
    color: var(--text-muted);
    margin-top: 8px;
    max-width: 56ch;
}

/* --- Cards ----------------------------------------------------------------- */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.card__body {
    padding: 24px 26px;
}

/* --- Stat cards ------------------------------------------------------------ */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 30px;
}

.stat {
    position: relative;
    overflow: hidden;
    padding: 22px 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.stat::after {
    content: '';
    position: absolute;
    inset: 0 0 auto auto;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle at 80% 10%, var(--accent-soft), transparent 70%);
    opacity: 0.7;
    pointer-events: none;
}

.stat--gold::after {
    background: radial-gradient(circle at 80% 10%, var(--gold-soft), transparent 70%);
}

.stat--attention::after {
    background: radial-gradient(circle at 80% 10%, var(--danger-soft), transparent 70%);
}

.stat__label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.stat__label svg {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.stat--gold .stat__label svg {
    color: var(--gold);
}

.stat--attention .stat__label svg {
    color: var(--danger);
}

.stat__value {
    font-family: var(--font-display);
    font-size: 44px;
    font-weight: 700;
    line-height: 1;
    margin-top: 14px;
    letter-spacing: 0;
}

.stat__hint {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-faint);
}

/* --- Buttons --------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    font: inherit;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
    white-space: nowrap;
}

.btn:hover {
    text-decoration: none;
    background-color: var(--accent-soft);
    color: var(--text);
    border-color: var(--line-strong);
}

.btn:active {
    transform: translateY(1px);
}

.btn svg {
    width: 17px;
    height: 17px;
}

.btn--primary {
    background: linear-gradient(180deg, var(--accent), var(--accent-deep));
    color: #fff;
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn--primary:hover {
    background: #dff0fb;
    color: #17324a;
    border-color: #b9d8eb;
}

.btn--ghost {
    background: var(--surface);
    border-color: var(--line-strong);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.btn--ghost:hover {
    background: var(--surface-muted);
    border-color: var(--text-faint);
}

.btn--subtle {
    background: transparent;
    color: var(--text-muted);
    padding: 7px 12px;
}

.btn--subtle:hover {
    background: var(--surface-muted);
    color: var(--text);
}

.btn--danger {
    background: transparent;
    color: var(--danger-deep);
    border-color: var(--danger-soft);
    padding: 7px 12px;
}

.btn--danger:hover {
    background: var(--danger-soft);
    border-color: var(--danger);
}

.btn--sm {
    padding: 6px 11px;
    font-size: 13px;
}

/* --- Table ----------------------------------------------------------------- */

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14.5px;
}

.data-table thead th {
    padding: 13px 20px;
    text-align: left;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--surface-muted);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

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

.data-table tbody tr {
    transition: background-color 0.12s ease;
}

.data-table tbody tr:hover {
    background: var(--surface-muted);
}

.cell-name {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cell-name b {
    font-weight: 600;
}

.cell-email {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 13px;
}

.cell-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.you-tag {
    margin-left: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-faint);
}

/* --- Badges ---------------------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 11px 3px 9px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge--admin {
    background: var(--accent-soft);
    color: var(--accent-deep);
    border-color: color-mix(in srgb, var(--accent) 24%, transparent);
}

.badge--super {
    background: var(--gold-soft);
    color: var(--gold);
    border-color: var(--gold-line);
}

.badge--attention {
    background: var(--danger-soft);
    color: var(--danger-deep);
    border-color: #efc5c0;
}

.badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.badge-list .badge {
    background: #eef3f6;
    border-color: var(--line);
    color: var(--text-muted);
}

/* --- Forms ----------------------------------------------------------------- */

.form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.checkbox-list {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.checkbox-row {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    gap: 10px;
    min-height: 42px;
    padding: 9px 12px;
}

.checkbox-row input {
    accent-color: var(--accent);
    height: 16px;
    width: 16px;
}

.field .checkbox-row input[type='checkbox'] {
    appearance: auto;
    border-radius: 3px;
    box-shadow: none;
    flex: 0 0 auto;
    height: 16px;
    padding: 0;
    width: 16px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field > label {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 11px 13px;
    font: inherit;
    font-size: 15px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    appearance: none;
}

.field textarea {
    min-height: 150px;
    resize: vertical;
}

.field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23587185' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}

.field__help {
    font-size: 12.5px;
    color: var(--text-faint);
}

.field__error {
    display: block;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--danger-deep);
}

.field--invalid input,
.field--invalid select,
.field--invalid textarea {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px var(--danger-soft);
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 4px;
}

.form-actions .spacer {
    flex: 1;
}

.affirmation-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.media-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.affirmation-quote {
    font-family: var(--font-display);
    font-size: 18px;
    line-height: 1.45;
}

.emergency-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.emergency-link-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.emergency-link-row {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr) 38px;
    gap: 14px;
    align-items: end;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
}

.emergency-link-row__title {
    align-self: center;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.message-thread {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}

.message-item {
    display: flex;
    flex-direction: column;
    max-width: min(760px, 92%);
}

.message-item--admin {
    align-self: flex-end;
    align-items: flex-end;
}

.message-item--user {
    align-self: flex-start;
    align-items: flex-start;
}

.message-bubble {
    max-width: 100%;
    padding: 16px 18px;
    border: 0;
    border-radius: 18px;
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.message-bubble--admin {
    align-self: flex-end;
    background: #007aff;
}

.message-bubble--user {
    align-self: flex-start;
    background: #3a3a3c;
}

.message-bubble__meta {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.message-bubble__meta span {
    color: rgba(255, 255, 255, 0.64);
    white-space: nowrap;
}

.message-bubble__body {
    color: #fff;
    white-space: normal;
}

.message-bubble__actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
    padding-right: 4px;
}

.message-bubble__actions .btn--xs {
    padding: 4px 9px;
    border-radius: 8px;
    font-size: 12px;
}

.faq-filter {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.faq-filter__form {
    max-width: 320px;
}

.empty--compact {
    padding: 28px 20px;
}

.faq-preview,
.content-preview {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.faq-preview__section,
.content-preview__section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-preview__text,
.content-preview__text {
    max-width: 78ch;
    font-size: 17px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

/* --- Flash alerts ---------------------------------------------------------- */

.flashes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 22px;
}

.flash {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.flash svg {
    width: 19px;
    height: 19px;
    flex: none;
}

.flash--success {
    background: #e7f7f1;
    border-color: #bde5d8;
    color: #0f6b51;
}

.flash--success svg {
    color: var(--ok);
}

.flash--error {
    background: var(--danger-soft);
    border-color: #efc5c0;
    color: var(--danger-deep);
}

.flash--error svg {
    color: var(--danger);
}

/* --- Empty state ----------------------------------------------------------- */

.empty {
    padding: 54px 24px;
    text-align: center;
    color: var(--text-muted);
}

.empty svg {
    width: 40px;
    height: 40px;
    color: var(--text-faint);
    margin-bottom: 12px;
}

.empty h3 {
    font-size: 19px;
    margin-bottom: 6px;
}

/* --- Login ----------------------------------------------------------------- */

.auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(60% 55% at 50% 0%, rgba(74, 135, 198, 0.16), transparent 70%),
        radial-gradient(48% 40% at 92% 100%, rgba(24, 167, 125, 0.12), transparent 70%),
        linear-gradient(180deg, var(--paper), var(--paper-2));
}

.auth-card {
    width: 100%;
    max-width: 408px;
    padding: 38px 36px 34px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
}

.auth-card__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
}

.auth-card__brand .sidebar__mark {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), var(--shadow-md);
}

.auth-card__brand b {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
}

.auth-card__brand span {
    display: block;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.auth-card h1 {
    text-align: center;
    font-size: 26px;
    margin-bottom: 4px;
}

.auth-card__lead {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 26px;
}

.auth-card .field {
    margin-bottom: 18px;
}

.auth-card .btn--primary {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 15px;
}

.auth-foot {
    margin-top: 22px;
    text-align: center;
    font-size: 12.5px;
    color: var(--text-faint);
}

/* --- Sidebar backdrop (mobile) --------------------------------------------- */

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(10, 71, 112, 0.42);
    backdrop-filter: blur(2px);
}

/* --- Motion: staggered page-load reveal ------------------------------------ */

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(10px);
        animation: reveal 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    }

    .reveal:nth-child(2) { animation-delay: 0.05s; }
    .reveal:nth-child(3) { animation-delay: 0.10s; }
    .reveal:nth-child(4) { animation-delay: 0.15s; }
    .reveal:nth-child(5) { animation-delay: 0.20s; }
}

@keyframes reveal {
    to {
        opacity: 1;
        transform: none;
    }
}

/* --- Responsive ------------------------------------------------------------ */

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

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(84vw, var(--sidebar-w));
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
        box-shadow: var(--shadow-lg);
    }

    .app.is-sidebar-open .sidebar {
        transform: translateX(0);
    }

    .app.is-sidebar-open .sidebar-backdrop {
        display: block;
    }

    .icon-btn {
        display: inline-flex;
    }

    .topbar {
        padding: 14px 18px;
    }

    .content {
        padding: 24px 18px 48px;
    }

    .usermenu__id {
        display: none;
    }

    .emergency-link-row {
        grid-template-columns: 1fr;
    }
}

/* Preserve the transparent logo's proportions in both admin brand areas. */
.brand-logo {
    display: block;
    width: 80px;
    height: auto;
    flex: 0 0 auto;
    object-fit: contain;
}

.auth-card__brand .brand-logo {
    width: 112px;
    max-width: 40%;
}

.btn--icon {
    width: 38px;
    min-height: 38px;
    padding: 8px;
    justify-content: center;
    flex: none;
}
.emergency-link-row > .btn--icon {
    justify-self: end;
}
.emergency-link-row .field { min-width: 0; }

.reading-filter__form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    max-width: none;
}
.reading-filter__form .field { min-width: 0; }
@media (max-width: 560px) {
    .reading-filter__form { grid-template-columns: 1fr; }
}
