:root {
    color-scheme: light;
    --ink: #152437;
    --muted: #64748b;
    --line: #e3eaf0;
    --surface: #ffffff;
    --canvas: #f4f7fa;
    --brand: #087f8c;
    --brand-dark: #066671;
    --success: #16794b;
    --warning: #956313;
    --danger: #b33a46;
    font-family: Inter, system-ui, sans-serif;
    background: var(--canvas);
    color: var(--ink);
}

html {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: wait;
    opacity: .62;
}

[hidden] {
    display: none !important;
}

.admin-shell {
    width: min(1120px, calc(100% - 40px));
    min-height: 100dvh;
    margin: 0 auto;
    padding: 26px 0 72px;
    overflow-x: clip;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 32px;
    color: var(--muted);
    font-size: .88rem;
    font-weight: 600;
}

.admin-brand img {
    display: block;
    width: 156px;
    height: 38px;
    object-fit: contain;
    object-position: left center;
}

.admin-card,
.queue-toolbar,
.application-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 12px 34px rgb(21 36 55 / 5%);
}

.admin-auth-card,
.admin-denied-card {
    width: min(100%, 520px);
    margin: 8vh auto 0;
    padding: clamp(24px, 5vw, 42px);
}

.eyebrow {
    margin-bottom: 10px;
    color: var(--brand);
    font-size: .73rem;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    font-family: Poppins, Inter, sans-serif;
    letter-spacing: -.025em;
}

.admin-auth-card h1,
.admin-denied-card h1,
.workspace-header h1 {
    margin-bottom: 10px;
    font-size: clamp(1.6rem, 3vw, 2rem);
}

.admin-auth-card > p,
.admin-denied-card > p,
.workspace-header p {
    color: var(--muted);
    line-height: 1.65;
}

.admin-login-form {
    display: grid;
    gap: 10px;
    margin-top: 26px;
}

.admin-login-form label,
.queue-toolbar label {
    color: #334155;
    font-size: .84rem;
    font-weight: 600;
}

.admin-login-form input,
.queue-toolbar select,
.review-note {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #fff;
    color: var(--ink);
}

.admin-login-form input:focus,
.queue-toolbar select:focus,
.review-note:focus {
    border-color: var(--brand);
    outline: 3px solid rgb(8 127 140 / 14%);
}

.admin-primary-button,
.admin-secondary-button,
.admin-text-button,
.review-action {
    min-height: 42px;
    border-radius: 9px;
    font-weight: 650;
    transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.admin-primary-button {
    margin-top: 8px;
    border: 1px solid var(--brand);
    background: var(--brand);
    color: #fff;
}

.admin-primary-button:hover {
    background: var(--brand-dark);
}

.admin-secondary-button {
    padding: 0 14px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
}

.admin-secondary-button:hover {
    border-color: #b9c7d5;
    background: #f7fafc;
}

.admin-text-button {
    padding: 0 8px;
    border: 0;
    background: transparent;
    color: var(--muted);
}

.admin-text-button:hover {
    color: var(--ink);
}

.admin-security-note {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 22px 0 0;
    color: var(--muted);
    font-size: .78rem;
}

.admin-inline-message,
.admin-global-message,
.review-action-message {
    color: var(--danger);
    font-size: .88rem;
    line-height: 1.5;
}

.workspace-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 25px;
}

.workspace-header p {
    margin-bottom: 0;
}

.workspace-actions {
    display: flex;
    align-items: center;
    gap: 13px;
    padding-top: 7px;
}

.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.admin-tab {
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-weight: 650;
}

.admin-tab:hover,
.admin-tab:focus-visible {
    background: #f3f7f8;
    color: var(--ink);
}

.admin-tab.is-active {
    border-color: rgb(8 127 140 / 20%);
    background: rgb(8 127 140 / 8%);
    color: var(--brand-dark);
}

.deletion-review-note {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    margin-bottom: 16px;
    border: 1px solid #ead9b0;
    border-radius: 11px;
    background: #fff9e9;
    color: #684a13;
    font-size: .84rem;
    line-height: 1.55;
}

.deletion-review-note strong {
    font-size: .88rem;
}

.queue-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    margin-bottom: 16px;
}

.queue-toolbar > div {
    display: grid;
    gap: 7px;
    width: min(100%, 280px);
}

.queue-toolbar p {
    margin: 0 0 11px;
    color: var(--muted);
    font-size: .88rem;
}

.verification-list {
    display: grid;
    gap: 16px;
}

.system-error-entry {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgb(21 36 55 / 4%);
}

.system-error-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    color: var(--ink);
}

.system-error-header time,
.system-error-meta {
    color: var(--muted);
    font-size: .8rem;
}

.system-error-meta {
    margin: 8px 0 12px;
    overflow-wrap: anywhere;
}

.system-error-entry details {
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.system-error-entry summary {
    color: var(--brand-dark);
    cursor: pointer;
    font-size: .82rem;
    font-weight: 650;
}

.system-error-entry pre {
    max-height: 18rem;
    overflow: auto;
    margin: 10px 0 0;
    padding: 12px;
    border-radius: 8px;
    background: #f4f7fa;
    color: #334155;
    font: .78rem/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.application-card {
    padding: clamp(18px, 3vw, 26px);
}

.application-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.application-header h2 {
    margin-bottom: 5px;
    font-size: 1.22rem;
}

.application-handle,
.application-submitted {
    margin: 0;
    color: var(--muted);
    font-size: .84rem;
}

.status-pill {
    flex: 0 0 auto;
    padding: 6px 10px;
    border-radius: 999px;
    background: #fff5da;
    color: var(--warning);
    font-size: .74rem;
    font-weight: 700;
}

.status-pill.approved {
    background: #e5f5ec;
    color: var(--success);
}

.status-pill.rejected {
    background: #fde9eb;
    color: var(--danger);
}

.application-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 24px;
    padding: 18px 0;
}

.detail-label {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: .75rem;
}

.detail-value {
    overflow-wrap: anywhere;
    font-size: .9rem;
    font-weight: 600;
}

.document-list,
.review-history {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 6px 0 16px;
}

.document-button {
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: var(--brand-dark);
    font-size: .8rem;
    font-weight: 650;
}

.document-button:hover {
    background: #effafb;
    border-color: #89c4ca;
}

.review-history {
    display: grid;
    gap: 8px;
    margin: 14px 0 0;
}

.history-entry {
    padding: 11px 13px;
    border-left: 3px solid #b7c7d4;
    border-radius: 0 8px 8px 0;
    background: #f6f8fa;
    color: var(--muted);
    font-size: .8rem;
    line-height: 1.5;
}

.review-actions {
    display: grid;
    gap: 10px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.review-actions label {
    font-size: .84rem;
    font-weight: 600;
}

.review-note {
    min-height: 84px;
    resize: vertical;
}

.review-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.review-action {
    padding: 0 12px;
    border: 1px solid var(--line);
    background: white;
    color: var(--ink);
    font-size: .82rem;
}

.review-action.approve {
    border-color: var(--success);
    background: var(--success);
    color: white;
}

.review-action.request {
    border-color: #e3bd70;
    background: #fff9e9;
    color: #80540d;
}

.review-action.reject {
    border-color: #e9b8bd;
    background: #fff4f5;
    color: var(--danger);
}

.review-action-message {
    margin: 0;
}

.queue-empty {
    padding: 42px 24px;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    color: var(--muted);
    text-align: center;
}

.queue-empty h2 {
    margin-bottom: 7px;
    color: var(--ink);
    font-size: 1.15rem;
}

@media (max-width: 700px) {
    .admin-shell {
        width: min(100% - 28px, 1120px);
        padding-top: 18px;
    }

    .admin-brand {
        margin-bottom: 22px;
    }

    .workspace-header,
    .queue-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .workspace-actions {
        justify-content: flex-start;
    }

    .queue-toolbar > div {
        width: 100%;
    }

    .queue-toolbar p {
        margin-bottom: 0;
    }

    .application-details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 460px) {
    .admin-brand {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .application-header {
        flex-direction: column;
    }

    .application-details {
        grid-template-columns: minmax(0, 1fr);
    }

    .review-action-buttons {
        display: grid;
    }
}

.listing-review-content {
    display: grid;
    grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
    align-items: start;
    gap: 18px;
    margin-top: 14px;
}

.listing-review-image {
    display: block;
    width: 100%;
    max-height: 210px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f6f7f9;
    object-fit: contain;
}

.listing-review-description {
    min-width: 0;
}

.listing-review-description > p {
    margin: 0 0 14px;
    color: var(--muted);
    line-height: 1.55;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.listing-review-description .application-details {
    margin-top: 0;
}

.listing-review-reason {
    margin: 14px 0 0;
    padding: 11px 13px;
    border-left: 3px solid var(--danger);
    border-radius: 0 8px 8px 0;
    background: #fff4f5;
    color: #7c2631;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.review-actions label span {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 450;
}

@media (max-width: 700px) {
    .listing-review-content {
        grid-template-columns: minmax(0, 1fr);
    }

    .listing-review-image {
        max-width: 280px;
        max-height: 190px;
    }
}