﻿:root {
    color-scheme: light;
    --sage-teal: #2f7373;
    --sage-teal-dark: #276565;
    --sage-steel: #558ca6;
    --sage-steel-dark: #3f7088;
    --sage-tile-a: #94b4c2;
    --sage-tile-b: #7d9eaf;
    --sage-panel-a: #80aabb;
    --sage-panel-b: #40718a;
    --sage-bg: #eef1f4;
    --sage-card: #ffffff;
    --sage-ink: #2b3540;
    --sage-muted: #6b7a86;
    --sage-line: #e1e6ea;
    --sage-shadow: 4px 3px 6px rgba(20, 40, 60, 0.06);
    --sage-radius: 8px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--sage-bg);
    color: var(--sage-ink);
    font-family: "Segoe UI", "Open Sans", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

button,
input,
select,
textarea {
    font: inherit;
}

a {
    color: var(--sage-teal);
}

#app {
    min-height: 100vh;
}

.status-bar-safe-area {
    display: none;
}

/* ----- Shell ----- */
.admin-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--sage-bg);
}

/* ----- Top gradient toolbar ----- */
.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    height: 60px;
    padding: 0 1.1rem 0 1.4rem;
    background: linear-gradient(90deg, #ffffff 0%, #eff6f2 6%, #558ca6 92%, #3f7088 100%);
    box-shadow: 0 1px 5px rgba(30, 50, 70, 0.16);
}

.admin-topbar__brand {
    display: inline-flex;
    align-items: baseline;
    gap: 0.55rem;
    text-decoration: none;
}

.admin-topbar__logo {
    font-size: 1.3125rem;
    font-weight: 700;
    letter-spacing: 0.34em;
    color: #263039;
}

.admin-topbar__sub {
    font-size: 0.7425rem;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: #5a6a75;
}

.admin-topbar__spacer {
    flex: 1;
}

.admin-topbar__actions {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.admin-icon-btn {
    position: relative;
    width: 2.25rem;
    height: 2.25rem;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
}

.admin-icon-btn:hover {
    background: rgba(255, 255, 255, 0.18);
}

.admin-icon-btn svg {
    width: 1.15rem;
    height: 1.15rem;
}

.admin-icon-btn__badge {
    position: absolute;
    top: 0.1rem;
    right: 0.05rem;
    min-width: 0.95rem;
    height: 0.95rem;
    padding: 0 0.18rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #d9534f;
    color: #fff;
    font-size: 0.6425rem;
    font-weight: 700;
    line-height: 1;
}

/* ----- Body: rail + main ----- */
.admin-body {
    display: flex;
    flex: 1;
    min-height: 0;
}

.admin-rail {
    position: relative;
    flex: 0 0 76px;
    width: 76px;
    padding: 0.4rem 0;
    background: #ffffff;
    border-right: 1px solid var(--sage-line);
}

.admin-rail__nav {
    display: flex;
    flex-direction: column;
}

.admin-rail__link {
    display: grid;
    justify-items: center;
    gap: 0.28rem;
    padding: 0.75rem 0.25rem;
    text-decoration: none;
    color: #5b6b76;
    border-left: 3px solid transparent;
}

button.admin-rail__link {
    width: 100%;
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
    background: none;
    font: inherit;
    cursor: pointer;
}

.admin-rail__link--open {
    background: #f2f6f7;
    color: var(--sage-teal);
}

.admin-flyout {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 100%;
    z-index: 20;
    width: 220px;
    padding: 1rem 0.5rem;
    background: #ffffff;
    border-right: 1px solid var(--sage-line);
    box-shadow: 6px 0 18px rgba(43, 53, 64, 0.08);
}

.admin-flyout__title {
    margin: 0 0 0.6rem;
    padding: 0 0.75rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sage-muted);
}

.admin-flyout__link {
    display: block;
    padding: 0.55rem 0.75rem;
    border-radius: 6px;
    color: var(--sage-ink);
    font-size: 0.9rem;
    text-decoration: none;
}

.admin-flyout__link:hover {
    background: #f2f6f7;
    color: var(--sage-teal);
}

.admin-flyout__link.active {
    background: #eaf3f2;
    color: var(--sage-teal);
    font-weight: 600;
}

/* Clicking anywhere outside the panel closes it. */
.admin-flyout-backdrop {
    position: fixed;
    inset: 0;
    z-index: 15;
}

.admin-rail__link:hover {
    background: #f2f6f7;
    color: var(--sage-teal);
}

.admin-rail__link.active {
    color: var(--sage-teal);
    background: #eaf3f2;
    border-left-color: var(--sage-teal);
}

.admin-rail__icon {
    width: 1.35rem;
    height: 1.35rem;
    display: grid;
    place-items: center;
}

.admin-rail__icon svg {
    width: 100%;
    height: 100%;
}

/* The rail is 76px, so a two-word label wraps. justify-items centres the box, not the
   text inside it, which left-aligned the second line against the first. */
.admin-rail__label {
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.25;
}

.admin-main {
    flex: 1;
    min-width: 0;
    padding: 1.4rem 1.75rem 2.5rem;
}

/* ----- Page header ----- */
/* No width cap: these pages are tables of 29,000 products and sync runs with eight columns, and
   they earn every pixel. Prose keeps its own measure below. */
.admin-page {
    display: grid;
    gap: 1.2rem;
}

.admin-page__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.admin-page__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    color: var(--sage-muted);
    font-size: 0.7625rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.page-title {
    margin: 0.35rem 0 0.45rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1.7125rem;
    font-weight: 600;
    color: var(--sage-ink);
}

.page-title:focus,
.page-title:focus-visible {
    outline: none;
}

.page-title__icon {
    display: inline-grid;
    place-items: center;
    width: 1.7rem;
    height: 1.7rem;
    color: var(--sage-teal);
}

.page-title__icon svg {
    width: 100%;
    height: 100%;
}

.admin-page__intro {
    margin: 0;
    max-width: 66ch;
    color: var(--sage-muted);
    line-height: 1.6;
}

/* ----- Dashboard tile panel ----- */
.admin-tilepanel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.85rem;
    padding: 1rem;
    border-radius: var(--sage-radius);
    background: linear-gradient(180deg, var(--sage-panel-a), var(--sage-panel-b));
    box-shadow: var(--sage-shadow);
}

.admin-tile {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-height: 132px;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: linear-gradient(180deg, var(--sage-tile-a), var(--sage-tile-b));
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(30, 50, 70, 0.16);
}

.admin-tile:hover {
    filter: brightness(1.05);
}

.admin-tile__label {
    font-size: 0.8825rem;
    font-weight: 700;
    line-height: 1.25;
}

.admin-tile__value {
    margin-top: auto;
    font-size: 2.1625rem;
    font-weight: 300;
    line-height: 1;
}

.admin-tile__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.7825rem;
    opacity: 0.92;
}

.admin-tile__foot svg {
    width: 0.8rem;
    height: 0.8rem;
}

/* ----- Cards / panels ----- */
.admin-panel,
.admin-stat-card {
    padding: 1.2rem 1.35rem;
    border: 1px solid var(--sage-line);
    border-radius: var(--sage-radius);
    background: var(--sage-card);
    box-shadow: var(--sage-shadow);
}

.admin-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--sage-line);
}

.admin-panel__header h2 {
    margin: 0;
    font-size: 1.1425rem;
    font-weight: 600;
    color: var(--sage-ink);
}

.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.admin-stat-card {
    display: grid;
    gap: 0.3rem;
}

.admin-stat-card span {
    color: var(--sage-muted);
    font-size: 0.7625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.admin-stat-card strong {
    font-size: 1.6125rem;
    font-weight: 600;
    color: var(--sage-teal);
}

/* ----- Two-column editor grid ----- */
.admin-grid {
    display: grid;
    grid-template-columns: minmax(260px, 340px) 1fr;
    gap: 1rem;
    align-items: start;
}

.admin-list {
    display: grid;
    gap: 0.5rem;
}

.admin-list-item {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 0.75rem;
    align-items: center;
    width: 100%;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--sage-line);
    border-radius: 6px;
    background: #ffffff;
    text-align: left;
    cursor: pointer;
}

.admin-list-item:hover {
    border-color: #c3d4d3;
    background: #f6f9f9;
}

.admin-list-item img,
.admin-preview {
    width: 100%;
    height: auto;
    border-radius: 5px;
    object-fit: cover;
}

.admin-list-item strong {
    display: block;
    color: var(--sage-ink);
    font-weight: 600;
}

.admin-list-item span {
    color: var(--sage-muted);
    font-size: 0.8825rem;
}

.admin-list-item--active {
    border-color: var(--sage-teal);
    background: #eaf3f2;
}

/* Text-only list rows (no thumbnail), e.g. quiz questions/results. */
.admin-list-item--text {
    grid-template-columns: 1fr;
}

/* ----- Forms ----- */
.admin-form {
    display: grid;
    gap: 1.1rem;
}

.admin-form--single {
    max-width: 520px;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.admin-field {
    display: grid;
    gap: 0.4rem;
}

.admin-field--wide {
    grid-column: 1 / -1;
}

.admin-field--checkbox {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding-top: 1.7rem;
}

/* Display-order rows: the order input keeps the standard field width in the page's
   left column, with its visibility toggle sitting right beside it. */
.admin-order-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: end;
}

.admin-order-row__toggle {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    /* Matches the order input's box (line-height + 0.6rem padding + 1px borders)
       so the toggle sits on the same line as the input. */
    min-height: calc(1.5rem + 1.2rem + 2px);
    cursor: pointer;
    white-space: nowrap;
}

.admin-order-row__toggle input[type="checkbox"] {
    margin: 0;
}

.admin-order-row__toggle span {
    color: var(--sage-muted);
    font-size: 0.7825rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.admin-field__toggle input[type="checkbox"] {
    margin: 0;
}

.admin-field span,
.admin-select span {
    color: var(--sage-muted);
    font-size: 0.7825rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.admin-field input,
.admin-field select,
.admin-field textarea,
.admin-select select,
.admin-view-url {
    padding: 0.6rem 0.7rem;
    border: 1px solid #cdd6dc;
    border-radius: 6px;
    background: #ffffff;
    color: var(--sage-ink);
}

.admin-field input:focus,
.admin-field select:focus,
.admin-field textarea:focus,
.admin-select select:focus,
.admin-view-url:focus {
    outline: none;
    border-color: var(--sage-teal);
    box-shadow: 0 0 0 3px rgba(47, 115, 115, 0.14);
}

.admin-field textarea {
    min-height: 120px;
    resize: vertical;
}

.admin-select {
    display: grid;
    gap: 0.4rem;
}

/* ----- Image previews & per-view uploads ----- */
.admin-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.admin-preview {
    min-height: 150px;
    height: 200px;
    background: #dce4e8;
    border: 1px solid var(--sage-line);
}

.admin-preview--single {
    max-width: 260px;
}

.admin-preview--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--sage-muted);
    font-size: 0.8625rem;
}

.admin-subheading {
    margin: 1.4rem 0 0.25rem;
    font-size: 1.0125rem;
    font-weight: 700;
    color: var(--sage-ink);
}

.admin-hint {
    margin: 0 0 0.5rem;
    font-size: 0.8625rem;
    color: var(--sage-muted);
}

.admin-tagged-products {
    display: grid;
    gap: 0.5rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.admin-tagged-products li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.admin-tagged-products li > span {
    display: grid;
    flex: 1;
    min-width: 0;
}

.admin-tagged-products small {
    color: var(--sage-muted);
}

.admin-tagged-products img {
    width: 2.5rem;
    height: 2.5rem;
    object-fit: cover;
    border-radius: 4px;
}

.admin-upload-results {
    margin: 0 0 1rem;
    padding-left: 1.1rem;
    font-size: 0.85rem;
    color: var(--sage-ink);
}

.admin-upload-results__failed {
    color: #a3342a;
}

.admin-details {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.45rem 1rem;
    margin: 0 0 1.25rem;
    font-size: 0.9rem;
}

.admin-details dt {
    color: var(--sage-muted);
}

.admin-details dd {
    margin: 0;
    color: var(--sage-ink);
    overflow-wrap: anywhere;
}

.admin-view-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 0.25rem;
}

.admin-view-preview {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-view-preview figcaption {
    color: var(--sage-muted);
    font-size: 0.7825rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.admin-view-url {
    width: 100%;
    font-size: 0.8425rem;
}

.admin-upload-button {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1rem;
    border: 1px solid var(--sage-line);
    border-radius: 6px;
    background: #e7edf0;
    color: var(--sage-ink);
    font-size: 0.8225rem;
    font-weight: 600;
    cursor: pointer;
}

.admin-upload-button:hover {
    background: #dbe3e8;
}

.admin-upload-button input[type="file"] {
    display: none;
}

/* ----- Quiz answer option rows ----- */
.admin-option-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.admin-option-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
    gap: 0.75rem;
    align-items: end;
    padding: 0.85rem;
    border: 1px solid var(--sage-line);
    border-radius: 6px;
    background: #f9fbfb;
}

.admin-option-row__image {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.admin-option-row__preview {
    width: 64px;
    height: 64px;
    min-height: 0;
    flex-shrink: 0;
}

.admin-option-row__remove {
    align-self: end;
}

/* ----- Buttons ----- */
.admin-actions {
    display: flex;
    gap: 0.6rem;
}

.admin-button {
    padding: 0.6rem 1.15rem;
    border: 0;
    border-radius: 6px;
    background: var(--sage-teal);
    color: #ffffff;
    font-size: 0.8825rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
}

.admin-button:hover {
    background: var(--sage-teal-dark);
}

.admin-button--secondary {
    background: #e7edf0;
    color: var(--sage-ink);
    border: 1px solid var(--sage-line);
}

.admin-button--secondary:hover {
    background: #dbe3e8;
}

.admin-button--danger {
    background: #fbeae9;
    color: #a3352f;
    border: 1px solid rgba(217, 83, 79, 0.35);
}

.admin-button--danger:hover {
    background: #f6d9d7;
}

.admin-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(28, 38, 46, 0.45);
}

.admin-modal {
    width: min(26rem, 100%);
    padding: 1.4rem 1.5rem 1.2rem;
    border-radius: 10px;
    background: var(--sage-card);
    box-shadow: 0 18px 40px rgba(20, 30, 38, 0.28);
}

.admin-modal__title {
    margin: 0;
    font-size: 1.1125rem;
    line-height: 1.35;
    color: var(--sage-ink);
}

.admin-modal__detail {
    margin: 0.6rem 0 0;
    font-size: 0.9125rem;
    line-height: 1.5;
    color: var(--sage-muted);
}

.admin-modal--wide {
    width: min(46rem, 100%);
}

.admin-modal__list {
    max-height: 22rem;
    margin: 0.9rem 0 0;
    padding-left: 1.1rem;
    overflow-y: auto;
    font-size: 0.9125rem;
    line-height: 1.55;
    color: var(--sage-ink);
}

.admin-modal__list li + li {
    margin-top: 0.45rem;
}

.admin-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 1.25rem;
}

/* ----- Messages ----- */
.admin-message,
.admin-error {
    margin: 0;
    padding: 0.8rem 1rem;
    border-radius: 6px;
    font-weight: 600;
}

.admin-message {
    background: rgba(47, 115, 115, 0.1);
    color: #235c5c;
    border: 1px solid rgba(47, 115, 115, 0.24);
}

.admin-error {
    background: rgba(217, 83, 79, 0.1);
    color: #a3352f;
    border: 1px solid rgba(217, 83, 79, 0.26);
}

#blazor-error-ui {
    color-scheme: light only;
    display: none;
    position: fixed;
    inset: auto 1rem 1rem auto;
    padding: 0.9rem 1.1rem;
    border-radius: 8px;
    background: #a3352f;
    color: #fff;
    box-shadow: 0 8px 24px rgba(60, 20, 16, 0.3);
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    margin-left: 0.75rem;
}

@media (max-width: 1100px) {
    .admin-grid,
    .admin-stat-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .admin-rail {
        flex-basis: 60px;
        width: 60px;
    }

    .admin-main {
        padding: 1rem;
    }

    .admin-page__header,
    .admin-panel__header,
    .admin-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-form-grid,
    .admin-preview-grid,
    .admin-view-preview-grid {
        grid-template-columns: 1fr;
    }

    .admin-option-row {
        grid-template-columns: 1fr;
    }
}

/* ----- Overrides: Sage's value beside the authored one ----- */
.admin-field__source {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--sage-muted);
}

.admin-field__source strong {
    color: var(--sage-ink);
    font-weight: 600;
}

.admin-link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--sage-teal);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

.admin-badge {
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(47, 115, 115, 0.12);
    color: var(--sage-teal-dark);
    font-size: 0.7625rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.admin-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0 0;
}

.admin-facts div {
    display: grid;
    gap: 0.2rem;
}

.admin-facts dt {
    color: var(--sage-muted);
    font-size: 0.7825rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.admin-facts dd {
    margin: 0;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8825rem;
}

.admin-table th,
.admin-table td {
    padding: 0.55rem 0.6rem;
    border-bottom: 1px solid var(--sage-line);
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    color: var(--sage-muted);
    font-size: 0.7625rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.admin-table__changes {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.8125rem;
    word-break: break-all;
}

.admin-table__number {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.admin-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.7825rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.admin-badge--good {
    background: #e8f4ec;
    border-color: rgba(45, 122, 74, 0.28);
    color: #2d7a4a;
}

.admin-badge--warn {
    background: #fdf3e2;
    border-color: rgba(166, 110, 15, 0.3);
    color: #a66e0f;
}

.admin-badge--bad {
    background: #fbeae9;
    border-color: rgba(217, 83, 79, 0.35);
    color: #a3352f;
}

.admin-badge--busy {
    background: #e9f0f5;
    border-color: rgba(63, 112, 136, 0.3);
    color: var(--sage-steel-dark);
}

.admin-badge--neutral {
    background: #eef1f4;
    border-color: var(--sage-line);
    color: var(--sage-muted);
}

.admin-topbar__user {
    font-size: 0.8825rem;
    font-weight: 600;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.admin-topbar__user:hover,
.admin-topbar__user:focus-visible {
    border-bottom-color: currentColor;
}

.admin-topbar__signout {
    display: inline-flex;
    margin: 0;
}

/* ----- Account pages (static, outside the shell) ----- */
.account-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.account-card {
    width: 100%;
    max-width: 420px;
    padding: 2rem;
    border-radius: var(--sage-radius);
    background: var(--sage-card);
    box-shadow: var(--sage-shadow);
}

.account-card .admin-form-grid {
    grid-template-columns: 1fr;
}

.account-card h1 {
    margin: 0 0 0.25rem;
    font-size: 1.3125rem;
}

.account-card .admin-field--checkbox {
    padding-top: 0;
}

.account-card .admin-field--checkbox span {
    color: var(--sage-ink);
    font-size: 0.9125rem;
    font-weight: 400;
    letter-spacing: normal;
    text-transform: none;
}

.account-card__brand {
    display: block;
    margin-bottom: 1.25rem;
    color: var(--sage-teal);
    font-size: 0.8625rem;
    font-weight: 700;
    letter-spacing: 0.18em;
}

.account-qr {
    display: grid;
    gap: 0.75rem;
    justify-items: center;
    margin: 1rem 0;
}

.account-qr svg {
    width: 180px;
    height: 180px;
}

.account-key {
    font-family: Consolas, "Courier New", monospace;
    letter-spacing: 0.08em;
    word-break: break-all;
}

.account-codes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem 1rem;
    margin: 1rem 0;
    padding: 0;
    list-style: none;
    font-family: Consolas, "Courier New", monospace;
}

.validation-message {
    color: #a3352f;
    font-size: 0.8425rem;
}

.admin-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    padding: 0 1.1rem 0.9rem;
}

.admin-resultbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.6rem 1.1rem;
    border-top: 1px solid var(--sage-line);
    border-bottom: 1px solid var(--sage-line);
    background: #f7f9fa;
}

.admin-resultbar__count {
    font-size: 0.8625rem;
    font-weight: 700;
    color: var(--sage-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.admin-resultbar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.admin-resultbar__actions .admin-button {
    padding: 0.35rem 0.7rem;
    font-size: 0.8125rem;
}

.admin-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.25rem;
}

.admin-tag {
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: #e4ebef;
    color: var(--sage-muted);
    font-size: 0.7425rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.admin-tag--warning {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    background: #fcefd4;
    color: #8a4b00;
}

.admin-tag--warning::before {
    content: "";
    flex: none;
    width: 1.05em;
    height: 1.05em;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}

.admin-list-item__noimage {
    display: grid;
    place-items: center;
    border: 1px dashed #cdd6dc;
    border-radius: 5px;
    background: #f1f4f6;
    color: var(--sage-muted);
    font-size: 0.7425rem;
    text-align: center;
}

.admin-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
    padding: 1rem 1.1rem;
}

.admin-media-tile {
    display: grid;
    gap: 0.3rem;
    padding: 0.5rem;
    border: 1px solid var(--sage-line);
    border-radius: 6px;
    background: #ffffff;
    text-align: left;
    cursor: pointer;
}

.admin-media-tile:hover {
    border-color: var(--sage-teal);
}

.admin-media-tile--active {
    border-color: var(--sage-teal);
    box-shadow: 0 0 0 2px rgba(47, 115, 115, 0.16);
}

.admin-media-tile img {
    width: 100%;
    height: 110px;
    border-radius: 4px;
    object-fit: cover;
    background: #f1f4f6;
}

.admin-media-tile__name {
    font-size: 0.8425rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.admin-media-tile__meta {
    color: var(--sage-muted);
    font-size: 0.7625rem;
}
