@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@700&family=Nunito+Sans:wght@500&display=swap");

/* Admin Page Styles */

:root {
    --admin-page-bg: #f5f7fb;
    --admin-panel-bg: rgba(255, 255, 255, 0.96);
    --admin-panel-border: #d8dee6;
    --admin-panel-shadow: 0 10px 28px rgba(10, 30, 60, 0.08);
    --admin-panel-subtle: #fbfcfe;
    --admin-text: #1b2430;
    --admin-muted: #5f6b7a;
    --admin-accent: #0f62fe;
    --admin-accent-strong: #0b4ecc;
    --admin-danger: #b42318;
    --admin-warm: #9a4521;
    --brand-mane: #6741b8;
    --brand-bid: #b83280;
    --brand-tagline: #536176;
}

:root[data-theme="dark"] {
    --admin-page-bg: #0e1624;
    --admin-panel-bg: rgba(17, 25, 39, 0.94);
    --admin-panel-border: #2a3950;
    --admin-panel-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
    --admin-panel-subtle: #172235;
    --admin-text: #e6edf7;
    --admin-muted: #9eb0c8;
    --admin-accent: #5f9fff;
    --admin-accent-strong: #4a8ef8;
    --admin-danger: #ff8c86;
    --admin-warm: #f5bc8a;
    --brand-mane: #c8b8ff;
    --brand-bid: #ff9ccb;
    --brand-tagline: #b8c5d8;
}

.brand-lockup {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.app-wordmark {
    color: var(--brand-mane);
    font-family: "Fredoka", "Trebuchet MS", sans-serif;
    font-weight: 700;
    letter-spacing: 0;
}

.app-wordmark__mane {
    color: var(--brand-mane);
}

.app-wordmark__bid {
    color: var(--brand-bid);
}

.app-wordmark--inline {
    font-size: 1em;
}

.app-tagline {
    color: var(--brand-tagline);
    font-family: "Nunito Sans", "Segoe UI", sans-serif;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.about-branding {
    margin: 6px 0 0;
}

.about-branding .app-tagline,
.about-context {
    display: block;
}

.about-branding .app-tagline {
    font-size: 0.72rem;
}

.about-context {
    margin-top: 5px;
}

@media (forced-colors: active) {
    .app-wordmark__mane,
    .app-wordmark__bid {
        color: currentColor;
    }
}

body {
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(15, 98, 254, 0.08), transparent 26%),
        radial-gradient(circle at top right, rgba(16, 185, 129, 0.07), transparent 20%),
        linear-gradient(180deg, #f7f9fc 0%, var(--admin-page-bg) 100%);
    color: var(--admin-text);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

main {
    padding: 12px;
}

h2 {
    color: var(--admin-text);
}

#login-section {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: calc(100vh - 24px);
}

#admin-section {
    display: grid;
    gap: 12px;
}

/* Sticky Top Command Bar */
.sticky-controls {
    position: sticky;
    top: 0;
    backdrop-filter: blur(18px);
    background: rgba(251, 252, 254, 0.92);
    border: 1px solid rgba(216, 222, 230, 0.95);
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(10, 30, 60, 0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    z-index: 10;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
}

.menu-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.top-bar-wordmark {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 1.45rem;
    line-height: 1;
    margin: 0 6px;
    min-height: 40px;
    white-space: nowrap;
}

.menu-group--right {
    margin-left: auto;
}

.menu-group {
    position: relative;
    margin: 0;
}

.menu-group summary {
    list-style: none;
}

.menu-group summary::-webkit-details-marker {
    display: none;
}

.menu-trigger {
    align-items: center;
    background: #fff;
    border: 1px solid #d7deea;
    border-radius: 11px;
    color: #24436b;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
    user-select: none;
}

.menu-trigger::after {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    content: "";
    opacity: 0.75;
    transform: translateY(1px);
    transition: transform 0.15s ease;
}

.menu-group[open] .menu-trigger {
    background: #eef4ff;
    border-color: #b8cde9;
    box-shadow: 0 6px 16px rgba(15, 98, 254, 0.12);
}

.menu-group[open] .menu-trigger::after {
    transform: rotate(180deg) translateY(-1px);
}

.menu-panel {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid #d8dee6;
    border-radius: 14px;
    box-shadow: 0 16px 36px rgba(10, 30, 60, 0.14);
    display: none;
    gap: 10px;
    margin-top: 8px;
    min-width: 240px;
    padding: 12px;
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    z-index: 20;
}

.menu-panel--view {
    min-width: 220px;
}

.menu-group[open] .menu-panel {
    display: grid;
}

.menu-item-button,
.menu-item-link {
    align-items: center;
    appearance: none;
    background: #f8fbff;
    border: 1px solid #dbe6f5;
    border-radius: 10px;
    box-sizing: border-box;
    color: var(--admin-text);
    cursor: pointer;
    display: flex;
    font: inherit;
    font-weight: 600;
    justify-content: flex-start;
    line-height: 1.25;
    min-height: 40px;
    padding: 9px 12px;
    text-align: left;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    width: 100%;
}

.menu-item-button:hover,
.menu-item-link:hover {
    background: #eef4ff;
    border-color: #c6d7ef;
    box-shadow: 0 6px 14px rgba(15, 98, 254, 0.08);
}

.menu-item-button.is-current-page,
.menu-item-link.is-current-page {
    background: #e6f0ff;
    border-color: #8fb4ef;
    box-shadow: inset 0 0 0 1px rgba(15, 98, 254, 0.12);
    color: #0b4ecc;
    cursor: default;
}

.menu-item-button.is-current-page:hover,
.menu-item-link.is-current-page:hover {
    background: #e6f0ff;
    border-color: #8fb4ef;
    box-shadow: inset 0 0 0 1px rgba(15, 98, 254, 0.12);
}

.menu-item-button:disabled,
.menu-field select:disabled {
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.6;
}

.menu-native-select {
    display: none;
}

.menu-choice-list {
    display: grid;
    gap: 6px;
}

.menu-choice-button {
    align-items: center;
    appearance: none;
    background: #f8fbff;
    border: 1px solid #dbe6f5;
    border-radius: 10px;
    color: var(--admin-text);
    cursor: pointer;
    display: grid;
    font: inherit;
    font-weight: 600;
    gap: 10px;
    grid-template-columns: 18px minmax(0, 1fr);
    min-height: 38px;
    padding: 8px 12px;
    text-align: left;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    width: 100%;
}

.menu-choice-button:hover {
    background: #eef4ff;
    border-color: #c6d7ef;
    box-shadow: 0 6px 14px rgba(15, 98, 254, 0.08);
}

.menu-choice-button.is-selected {
    background: #eef4ff;
    border-color: #b8cde9;
    color: #24436b;
}

.menu-choice-button:disabled {
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.6;
}

.menu-choice-check {
    color: var(--admin-accent);
    display: inline-flex;
    font-weight: 900;
    justify-content: center;
}

.menu-field {
    display: grid;
    gap: 6px;
}

.menu-checkbox-field {
    align-items: center;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}

.menu-checkbox-field input[type="checkbox"] {
    height: 16px;
    margin: 0;
    width: 16px;
}

.menu-checkbox-row {
    align-items: center;
    background: #f8fbff;
    border: 1px solid #dbe6f5;
    border-radius: 10px;
    box-sizing: border-box;
    color: var(--admin-text);
    cursor: pointer;
    display: flex;
    font-weight: 600;
    gap: 10px;
    min-height: 40px;
    padding: 8px 12px;
}

.menu-checkbox-row input[type="checkbox"] {
    flex: 0 0 auto;
    height: 16px;
    margin: 0;
    width: 16px;
}

.menu-label {
    color: var(--admin-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.menu-field select {
    background: #fff;
    border: 1px solid #cbd5df;
    border-radius: 10px;
    color: var(--admin-text);
    font: inherit;
    min-height: 40px;
    padding: 8px 10px;
    width: 100%;
}

.menu-select-control {
    appearance: auto;
}

.menu-divider {
    border-top: 1px solid #e7ebf0;
    margin: 2px 0;
}

.auction-total-pill {
    align-items: center;
    background: linear-gradient(135deg, #eef4ff 0%, #f8fbff 100%);
    border: 1px solid #d7deea;
    border-radius: 999px;
    color: #24436b;
    display: inline-flex;
    font-size: 0.92rem;
    font-weight: 700;
    min-height: 40px;
    padding: 0 14px;
    white-space: nowrap;
}

.top-bar-status {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.header-status-pill {
    align-items: center;
    background: #fff;
    border: 1px solid #d7deea;
    border-radius: 999px;
    color: #24436b;
    display: inline-flex;
    font-size: 0.9rem;
    font-weight: 700;
    min-height: 40px;
    padding: 0 14px;
    white-space: nowrap;
}

.connection-status-pill {
    gap: 6px;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.connection-status-pill.is-connected {
    background: #eef8f1;
    border-color: #b9dfc7;
    color: #1f6b3c;
}

.connection-status-pill.is-disconnected {
    background: #fff1f1;
    border-color: #efb3b3;
    box-shadow: 0 0 0 2px rgba(209, 67, 67, 0.12);
    color: #a12828;
}

.connection-status-pill.is-checking {
    background: #fffaf0;
    border-color: #ead8b0;
    color: #8b5a00;
}

.user-menu-button {
    min-width: 132px;
}

.user-menu-content {
    min-width: 260px;
}

.user-menu-username-row {
    align-items: baseline;
    color: var(--admin-text);
    display: flex;
    font-size: 0.92rem;
    justify-content: space-between;
    gap: 12px;
}

.user-menu-username-row strong {
    color: #24436b;
}

.dropdown-content button {
    background: none;
    border: none;
    text-align: left;
    padding: 10px 15px;
    width: 100%;
    color: #333;
    font-weight: normal;
    cursor: pointer;
}

.dropdown-content button:hover {
    background-color: #f0f0f0;
}

.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content {
    display: flex;
}

/* Table Styling */
.table-container {
    background: var(--admin-panel-bg);
    border: 1px solid var(--admin-panel-border);
    border-radius: 14px;
    box-shadow: var(--admin-panel-shadow);
    margin-top: 0;
    max-width: 100%;
    min-width: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px;
}

#itemsTable,
#feed {
    width: 100%;
    border-collapse: collapse;
    background-color: transparent;
    box-shadow: none;
}

#itemsTable th,
#itemsTable td,
#feed th,
#feed td {
    border-top: 1px solid #e7ebf0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    padding: 7px 8px;
    text-align: left;
    vertical-align: middle;
}

#itemsTable th,
#feed th {
    background-color: var(--admin-panel-subtle);
    color: var(--admin-muted);
    font-size: 0.77rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

#itemsTable tbody tr:hover {
    background: #f8fbff;
}

#itemsTable tbody tr.item-row--message-target {
    animation: item-message-target 2.4s ease-out;
}

@keyframes item-message-target {
    0%, 100% {
        background: transparent;
        box-shadow: none;
    }
    18%, 72% {
        background: #fff4bf;
        box-shadow: inset 4px 0 0 #d14343;
    }
}

#itemsTable td:first-child,
#itemsTable th:first-child {
    width: 78px;
    white-space: nowrap;
}

#itemsTable td:nth-child(5),
#itemsTable th:nth-child(5) {
    width: 86px;
}

#itemsTable td:last-child,
#itemsTable th:last-child {
    width: 252px;
}

.item-thumb {
    border: 1px solid #d8dee6;
    border-radius: 8px;
    cursor: pointer;
    display: block;
    height: auto;
    max-height: var(--item-thumb-size, 56px);
    max-width: var(--item-thumb-size, 56px);
    object-fit: contain;
    width: auto;
}

.item-thumb--small {
    --item-thumb-size: 56px;
}

.item-thumb--medium {
    --item-thumb-size: 96px;
}

.item-thumb--large {
    --item-thumb-size: 144px;
}

.item-photo-placeholder {
    color: var(--admin-muted);
    font-size: 0.85rem;
}

.print-slip-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 0;
}

.actions-cell {
    white-space: normal;
}

.item-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.item-action-button,
.btn-finalize,
.btn-undo {
    align-items: center;
    background: #fff;
    border: 1px solid #cbd5df;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(10, 30, 60, 0.06);
    color: #24436b;
    cursor: pointer;
    display: inline-flex;
    height: 32px;
    justify-content: center;
    padding: 0;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    width: 32px;
}

.item-action-button:hover,
.btn-finalize:hover,
.btn-undo:hover {
    background: #f4f8ff;
    border-color: #b8cde9;
    box-shadow: 0 4px 10px rgba(15, 98, 254, 0.12);
}

.item-action-button:disabled,
.btn-finalize:disabled,
.btn-undo:disabled {
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.5;
}

.item-action-button.print-slip-button {
    color: #24436b;
}

.item-action-button.print-slip-button--printed,
.item-action-button.print-slip-button--printed:hover {
    background-color: #2e8b57;
    border-color: #2e8b57;
    color: #fff;
}

.item-action-button.print-slip-button--stale,
.item-action-button.print-slip-button--stale:hover {
    background-color: #f0ad4e;
    border-color: #f0ad4e;
    color: #111;
}

.btn-finalize {
    background: var(--admin-accent);
    border-color: var(--admin-accent);
    color: #fff;
}

.btn-finalize:hover {
    background: var(--admin-accent-strong);
    border-color: var(--admin-accent-strong);
}

.btn-undo {
    background: #fff4ef;
    border-color: #efc2af;
    color: var(--admin-warm);
}

.btn-undo:hover {
    background: #ffe9de;
    border-color: #e9b399;
    color: #7f3515;
}

.item-action-icon {
    align-items: center;
    display: inline-flex;
    justify-content: center;
}

.item-action-icon svg {
    fill: none;
    height: 16px;
    pointer-events: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    width: 16px;
}

.item-action-icon--print svg {
    fill: currentColor;
    stroke: none;
}

.item-row--deleted {
    color: #6b7280;
    background: #f3f4f6;
}

.item-row--deleted td {
    border-color: #d6d9de;
}

.item-row--deleted .item-thumb {
    filter: grayscale(1);
    opacity: 0.45;
}

.item-row--deleted .item-photo-placeholder,
.item-row--deleted .item-status-indicator {
    opacity: 0.65;
}

.status-column,
.status-cell {
    text-align: center;
}

.status-column {
    width: 72px;
}

.item-status-indicator {
    align-items: center;
    background: #f3f4f6;
    border: 1px solid #d7dde5;
    border-radius: 999px;
    color: #667085;
    display: inline-flex;
    height: 28px;
    justify-content: center;
    width: 28px;
}

.item-status-icon {
    align-items: center;
    display: inline-flex;
    justify-content: center;
}

.item-status-icon svg {
    fill: none;
    height: 20px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    width: 20px;
}

.item-status-icon .status-fill {
    fill: currentColor;
    opacity: 0.22;
    stroke: none;
}

.item-status-indicator--not_sold {
    background: #f3f4f6;
    border-color: #d7dde5;
    color: #667085;
}

.item-status-indicator--sold_unpaid {
    background: #f3f4f6;
    border-color: #d7dde5;
    color: #667085;
}

.item-status-indicator--part_paid {
    background: #fff5e8;
    border-color: #f1c88b;
    color: #9a5b00;
}

.item-status-indicator--paid_in_full {
    background: #ecfdf3;
    border-color: #9ad7ae;
    color: #12704a;
}

.item-status-indicator--collected {
    background: #edf5ff;
    border-color: #a8c8f0;
    color: #1f5ea8;
}

:root[data-theme="dark"] .item-status-indicator--not_sold {
    background: #1d2836;
    border-color: #324252;
    color: #b0becd;
}

:root[data-theme="dark"] .item-status-indicator--sold_unpaid {
    background: #1d2836;
    border-color: #324252;
    color: #b0becd;
}

:root[data-theme="dark"] .item-status-indicator--part_paid {
    background: rgba(154, 91, 0, 0.22);
    border-color: rgba(241, 200, 139, 0.32);
    color: #f5bc63;
}

:root[data-theme="dark"] .item-status-indicator--paid_in_full {
    background: rgba(18, 112, 74, 0.22);
    border-color: rgba(154, 215, 174, 0.3);
    color: #82d6ac;
}

:root[data-theme="dark"] .item-status-indicator--collected {
    background: rgba(31, 94, 168, 0.24);
    border-color: rgba(168, 200, 240, 0.3);
    color: #8ab9f2;
}

.move-toggle[aria-expanded="true"] {
    background: #eef4ff;
    border-color: #b8cde9;
}

.move-panel {
    background: var(--admin-panel-subtle);
    border: 1px solid #e7ebf0;
    border-radius: 10px;
    gap: 8px;
    margin-top: 8px;
    max-width: 248px;
    padding: 10px;
}

.move-panel select {
    background: #fff;
    border: 1px solid #cbd5df;
    border-radius: 8px;
    color: var(--admin-text);
    font: inherit;
    min-height: 34px;
    padding: 6px 9px;
    width: 100%;
}

.item-context-menu {
    background: #fff;
    border: 1px solid #cbd5df;
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(10, 30, 60, 0.2);
    color: var(--admin-text);
    min-width: 190px;
    overflow: hidden;
    padding: 6px;
    position: fixed;
    z-index: 12000;
}

.item-context-menu[hidden] {
    display: none;
}

.item-context-menu-header {
    border-bottom: 1px solid #e7ebf0;
    color: var(--admin-muted);
    font-size: 0.8rem;
    font-weight: 800;
    padding: 7px 9px 9px;
}

.item-context-menu-actions {
    display: grid;
    gap: 2px;
    padding-top: 5px;
}

.item-context-menu-action {
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--admin-text);
    cursor: pointer;
    font: inherit;
    min-height: 32px;
    padding: 7px 10px;
    text-align: left;
}

.item-context-menu-action:hover,
.item-context-menu-action:focus-visible {
    background: #eef4ff;
    outline: none;
}

.item-context-menu-action:disabled {
    color: var(--admin-muted);
    cursor: not-allowed;
    opacity: 0.48;
}

.item-context-menu-action:disabled:hover {
    background: transparent;
}

/* Forms */
form input[type="text"],
form input[type="file"],
form input[type="password"],
form input[type="number"] {
    width: 100%;
    background: #fff;
    border: 1px solid #cbd5df;
    border-radius: 8px;
    box-sizing: border-box;
    color: var(--admin-text);
    margin: 6px 0 12px;
    padding: 9px 11px;
}

form button {
    background-color: var(--admin-accent);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    margin-right: 10px;
    padding: 10px 15px;
}

form button:hover {
    background-color: var(--admin-accent-strong);
}

.export-panel-shell {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    margin-top: 0;
    padding: 0;
}

.export-panel-header {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.export-panel-header p {
    color: var(--admin-muted);
    margin: 6px 0 0;
}

.export-form {
    display: grid;
    gap: 18px;
}

.export-form [hidden] {
    display: none !important;
}

.export-form > .export-fieldset:nth-of-type(1) {
    grid-column: 1;
}

.export-form > .export-fieldset:nth-of-type(2) {
    grid-column: 2;
}

.export-form > .export-job-status,
.export-form > .export-actions {
    grid-column: 1 / -1;
}

.export-fieldset {
    border: 1px solid #d7deea;
    border-radius: 12px;
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 16px;
}

.export-fieldset legend {
    color: #24436b;
    font-weight: 700;
    padding: 0 6px;
}

.export-choice {
    align-items: flex-start;
    background: #f7faff;
    border: 1px solid #dbe6f5;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    gap: 12px;
    padding: 12px 14px;
}

.export-choice input {
    margin-top: 3px;
}

.export-choice span {
    display: grid;
    gap: 4px;
}

.export-choice--disabled {
    background: #f3f3f3;
    border-color: #d6d6d6;
    color: #8a8a8a;
    cursor: not-allowed;
}

.export-choice--disabled strong,
.export-choice--disabled small {
    color: #8a8a8a;
}

.export-choice--disabled input {
    cursor: not-allowed;
}

.export-choice small,
.export-help-text,
#export-job-detail {
    color: #5c6a79;
}

.export-range-controls {
    background: #f2f6fc;
    border-radius: 10px;
    padding: 12px;
}

.export-range-controls input[type="text"] {
    margin-bottom: 6px;
}

.export-help-text {
    margin: 0;
}

.export-job-status {
    background: #eef5ff;
    border: 1px solid #c8daf7;
    border-radius: 10px;
    padding: 16px;
}

.export-job-status h3 {
    margin-top: 0;
}

.export-job-status p {
    margin: 6px 0;
}

.export-job-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.export-actions {
    margin-top: 4px;
}

.app-modal[hidden] {
    display: none !important;
}

.app-modal {
    align-items: center;
    background: rgba(14, 23, 38, 0.52);
    display: flex;
    inset: 0;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
    position: fixed;
    z-index: 2000;
}

.app-modal-card {
    background: var(--admin-panel-bg);
    border: 1px solid var(--admin-panel-border);
    border-radius: 18px;
    box-shadow: 0 24px 48px rgba(10, 30, 60, 0.22);
    max-height: calc(100vh - 40px);
    max-width: 520px;
    overflow-y: auto;
    padding: 20px;
    width: min(100%, 520px);
}

.app-modal-header {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 16px;
}

.app-modal-header h3 {
    margin: 0;
}

.app-modal-header p {
    color: var(--admin-muted);
    margin: 6px 0 0;
}

.app-modal-close {
    align-self: flex-start;
    background: #eef4ff;
    border: 1px solid #d7deea;
    border-radius: 10px;
    color: #24436b;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    min-height: 38px;
    padding: 0 12px;
}

.app-modal-close:hover {
    background: #e5eefc;
    border-color: #c6d7ef;
}

.password-modal-overlay {
    align-items: center;
    background: rgba(14, 23, 38, 0.52);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 20px;
    position: fixed;
    z-index: 9999;
}

.password-modal-card {
    background: var(--admin-panel-bg);
    border: 1px solid var(--admin-panel-border);
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(10, 30, 60, 0.22);
    color: var(--admin-text);
    font: inherit;
    padding: 16px;
    width: min(420px, 92vw);
}

.password-modal-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 10px;
}

.password-modal-description {
    color: var(--admin-muted);
    line-height: 1.45;
    margin: 0 0 12px;
}

.password-modal-input {
    background: #fff;
    border: 1px solid #cbd5df;
    border-radius: 10px;
    box-sizing: border-box;
    color: var(--admin-text);
    display: block;
    font: inherit;
    margin-bottom: 8px;
    min-height: 40px;
    padding: 8px 10px;
    width: 100%;
}

.password-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 12px;
}

.password-modal-button {
    background: #eef4ff;
    border: 1px solid #d7deea;
    border-radius: 10px;
    color: #24436b;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    min-height: 38px;
    padding: 0 14px;
}

.password-modal-button--primary {
    background: var(--admin-accent);
    border-color: var(--admin-accent);
    color: #fff;
}

.password-modal-button:hover {
    background: #e5eefc;
    border-color: #c6d7ef;
}

.password-modal-button--primary:hover {
    filter: brightness(0.96);
}

.about-grid {
    display: grid;
    gap: 10px;
}

.about-row {
    align-items: center;
    background: #f8fbff;
    border: 1px solid #dbe6f5;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 12px;
}

.about-row span {
    color: var(--admin-muted);
}

.about-row strong {
    color: #24436b;
    text-align: right;
}

.third-party-notices {
    border: 1px solid #dbe6f5;
    border-radius: 12px;
    margin-top: 14px;
    overflow: hidden;
}

.third-party-notices summary {
    background: #f8fbff;
    color: #24436b;
    cursor: pointer;
    font-weight: 700;
    padding: 11px 12px;
}

.third-party-notices pre {
    background: #fff;
    color: var(--admin-text);
    font: 0.78rem/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    margin: 0;
    max-height: 240px;
    overflow: auto;
    padding: 12px;
    white-space: pre-wrap;
}

.app-modal-card--wide {
    max-width: 760px;
    width: min(100%, 760px);
}

.messaging-button {
    align-items: center;
    background: #fff;
    border: 1px solid #d7deea;
    border-radius: 999px;
    color: #24436b;
    cursor: pointer;
    display: inline-flex;
    height: 40px;
    justify-content: center;
    padding: 0 12px;
    position: relative;
    width: 46px;
}

.messaging-button svg {
    fill: none;
    height: 21px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 21px;
}

.messaging-button.has-unread {
    animation: messaging-pulse 1.5s ease-in-out infinite;
    background: #fff8e6;
    border-color: #f2c76f;
    color: #8a4b00;
}

.messaging-badge,
.messaging-user-unread {
    align-items: center;
    background: #d14343;
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 800;
    justify-content: center;
    min-height: 18px;
    min-width: 18px;
    padding: 0 5px;
}

.messaging-badge {
    position: absolute;
    right: -5px;
    top: -5px;
}

@keyframes messaging-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(209, 67, 67, 0.1);
    }
    50% {
        box-shadow: 0 0 0 5px rgba(209, 67, 67, 0.16);
    }
}

.app-modal-card--messaging {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    max-width: min(96vw, 980px);
    overflow: hidden;
    width: min(96vw, 980px);
}

.messaging-modal-header {
    margin-bottom: 12px;
}

.messaging-shell {
    border: 1px solid var(--admin-panel-border);
    border-radius: 8px;
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
    height: min(70vh, 620px);
    min-height: 420px;
    overflow: hidden;
}

.messaging-users {
    background: var(--admin-panel-subtle);
    border-right: 1px solid var(--admin-panel-border);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.messaging-users-head {
    border-bottom: 1px solid var(--admin-panel-border);
    color: var(--admin-muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 12px;
    text-transform: uppercase;
}

.messaging-user-list {
    min-height: 0;
    overflow-y: auto;
    padding: 8px;
}

.messaging-user-button {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--admin-text);
    cursor: pointer;
    display: flex;
    font: inherit;
    gap: 8px;
    justify-content: space-between;
    padding: 9px 10px;
    text-align: left;
    width: 100%;
}

.messaging-user-button:hover,
.messaging-user-button.is-active {
    background: #eef4ff;
    border-color: #d7deea;
}

.messaging-user-button--all {
    border-bottom-color: #d7deea;
    margin-bottom: 8px;
}

.messaging-user-main {
    align-items: center;
    display: inline-flex;
    gap: 8px;
    min-width: 0;
}

.messaging-user-details {
    display: grid;
    min-width: 0;
}

.messaging-broadcast-dot {
    align-items: center;
    background: #24436b;
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.66rem;
    font-weight: 800;
    height: 20px;
    justify-content: center;
    line-height: 1;
    min-width: 28px;
    padding: 0 6px;
}

.messaging-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.messaging-user-presence {
    color: var(--admin-muted);
    font-size: 0.74rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.messaging-presence-dot {
    background: #a8b3c2;
    border-radius: 999px;
    flex: 0 0 auto;
    height: 9px;
    width: 9px;
}

.messaging-presence-dot.is-online {
    background: #1f9d55;
}

.messaging-thread-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.messaging-thread-head {
    border-bottom: 1px solid var(--admin-panel-border);
    font-weight: 800;
    padding: 12px 14px;
}

.messaging-thread {
    background: #f8fbff;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    overflow-y: auto;
    padding: 14px;
}

.messaging-message {
    display: grid;
    gap: 4px;
    max-width: min(78%, 560px);
}

.messaging-message.is-outgoing {
    align-self: flex-end;
}

.messaging-message-body {
    background: #fff;
    border: 1px solid #dbe6f5;
    border-radius: 8px;
    padding: 9px 11px;
    white-space: pre-wrap;
    word-break: break-word;
}

.messaging-item-link {
    background: #eef4ff;
    border: 1px solid #b8cde9;
    border-radius: 7px;
    color: #24436b;
    cursor: pointer;
    display: inline;
    font: inherit;
    font-weight: 700;
    padding: 2px 6px;
    text-align: left;
}

.messaging-item-link:hover,
.messaging-item-link:focus-visible {
    border-color: var(--admin-accent);
    outline: none;
    text-decoration: underline;
}

.messaging-message.is-outgoing .messaging-message-body {
    background: #eaf3ff;
    border-color: #bfdbff;
}

.messaging-message.is-attention .messaging-message-body {
    background: #fff7ed;
    border-color: #d14343;
    box-shadow: 0 0 0 2px rgba(209, 67, 67, 0.14);
}

.messaging-message.is-attention.is-outgoing .messaging-message-body {
    background: #fff2d8;
    border-color: #d14343;
}

.messaging-message-meta {
    color: var(--admin-muted);
    font-size: 0.78rem;
}

.messaging-message.is-outgoing .messaging-message-meta {
    text-align: right;
}

.messaging-acknowledge {
    justify-self: start;
    padding: 5px 9px;
}

.messaging-compose,
.messaging-item-panel {
    border-top: 1px solid var(--admin-panel-border);
    display: grid;
    gap: 8px;
    padding: 12px;
}

.messaging-attention-toggle {
    align-items: center;
    color: var(--admin-text);
    display: inline-flex;
    font-size: 0.9rem;
    gap: 7px;
}

.messaging-attention-toggle input {
    margin: 0;
}

.messaging-compose textarea,
.messaging-item-search-row input {
    border: 1px solid #cbd6e2;
    border-radius: 8px;
    box-sizing: border-box;
    color: var(--admin-text);
    font: inherit;
    padding: 9px 10px;
    resize: vertical;
    width: 100%;
}

.messaging-compose textarea.is-over-limit {
    border-color: var(--admin-danger);
}

.messaging-compose-actions,
.messaging-item-search-row {
    align-items: center;
    display: flex;
    gap: 8px;
}

.messaging-compose-actions {
    justify-content: flex-end;
}

.messaging-count {
    color: var(--admin-muted);
    font-size: 0.82rem;
    margin-right: auto;
}

.messaging-status {
    border-radius: 8px;
    font-size: 0.9rem;
    padding: 8px 10px;
}

.messaging-status[data-type="error"] {
    background: #fff1f1;
    color: #9d1c1c;
}

.messaging-empty {
    color: var(--admin-muted);
    padding: 10px;
}

.messaging-item-results {
    display: grid;
    gap: 6px;
    max-height: 150px;
    overflow-y: auto;
}

.messaging-item-result {
    background: #fff;
    border: 1px solid #dbe6f5;
    border-radius: 8px;
    color: var(--admin-text);
    cursor: pointer;
    font: inherit;
    padding: 8px 10px;
    text-align: left;
}

.messaging-item-result:hover {
    border-color: var(--admin-accent);
}

.bidder-manager-table-wrap {
    max-height: min(58vh, 520px);
    overflow: auto;
}

.bidder-manager-table {
    border-collapse: collapse;
    width: 100%;
}

.bidder-manager-table th,
.bidder-manager-table td {
    border-bottom: 1px solid var(--admin-panel-border);
    padding: 10px;
    text-align: left;
}

.bidder-manager-table input,
.bidder-manager-add input {
    border: 1px solid #cbd6e2;
    border-radius: 8px;
    box-sizing: border-box;
    font: inherit;
    padding: 8px 10px;
    width: 100%;
}

.bidder-manager-add {
    align-items: end;
    display: grid;
    gap: 10px;
    grid-template-columns: 130px minmax(0, 1fr) auto;
    margin-top: 16px;
}

.bidder-manager-add label {
    color: var(--admin-muted);
    display: grid;
    gap: 4px;
    font-size: 0.92rem;
    font-weight: 700;
}

.bidder-manager-warning {
    background: #fff8e1;
    border: 1px solid #ecd37f;
    border-radius: 10px;
    margin-bottom: 12px;
    padding: 10px 12px;
}

.app-modal-card--image {
    max-width: min(92vw, 1080px);
    width: min(92vw, 1080px);
}

.image-preview-stage {
    align-items: center;
    background: var(--admin-panel-subtle);
    border: 1px solid var(--admin-panel-border);
    border-radius: 16px;
    display: flex;
    justify-content: center;
    min-height: min(72vh, 820px);
    overflow: hidden;
    padding: 16px;
}

.image-preview-stage img {
    display: block;
    max-height: min(68vh, 760px);
    max-width: 100%;
    object-fit: contain;
    width: auto;
}

.item-details-table-wrap {
    max-height: min(70vh, 640px);
    overflow: auto;
}

.item-details-table {
    border-collapse: collapse;
    width: 100%;
}

.item-details-table th,
.item-details-table td {
    border-bottom: 1px solid #dbe6f5;
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

.item-details-table th {
    color: var(--admin-muted);
    font-weight: 700;
    width: 34%;
}

.item-details-table td {
    color: var(--admin-text);
    font-family: "Consolas", "SFMono-Regular", monospace;
    word-break: break-word;
}

.import-items-card {
    max-width: 1180px;
    width: min(100%, 1180px);
}

.import-items-panel {
    display: grid;
    gap: 12px;
}

.import-file-field {
    display: grid;
    gap: 6px;
}

.import-file-field span {
    color: var(--admin-muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.import-file-field input {
    background: #fff;
    border: 1px solid #cbd5df;
    border-radius: 10px;
    box-sizing: border-box;
    color: var(--admin-text);
    font: inherit;
    min-height: 42px;
    padding: 8px 10px;
    width: 100%;
}

.import-items-summary,
.import-items-counts {
    color: var(--admin-muted);
    margin: 0;
}

.import-items-summary.is-error {
    color: var(--admin-danger);
    font-weight: 700;
}

.import-items-table-wrap {
    border: 1px solid var(--admin-panel-border);
    border-radius: 12px;
    max-height: min(58vh, 560px);
    overflow: auto;
}

.import-items-table {
    border-collapse: collapse;
    min-width: 1040px;
    width: 100%;
}

.import-items-table th,
.import-items-table td {
    border-bottom: 1px solid #dbe6f5;
    padding: 9px 10px;
    text-align: left;
    vertical-align: top;
}

.import-items-table th {
    background: #f8fbff;
    color: var(--admin-muted);
    font-size: 0.78rem;
    position: sticky;
    text-transform: uppercase;
    top: 0;
    z-index: 1;
}

.import-items-table td {
    color: var(--admin-text);
    font-size: 0.9rem;
    max-width: 220px;
    overflow-wrap: anywhere;
}

.import-items-table input[type="file"] {
    max-width: 180px;
}

.import-items-empty {
    color: var(--admin-muted);
    text-align: center !important;
}

.import-row-number,
.import-row-status {
    white-space: nowrap;
}

.import-row-status[data-state="failed"],
.import-items-table tr.is-invalid .import-row-status {
    color: var(--admin-danger);
    font-weight: 700;
}

.import-row-status[data-state="imported"] {
    color: #18794e;
    font-weight: 700;
}

.import-items-table tr.is-importing td {
    background: #eef4ff;
}

.import-items-table tr.is-imported td {
    background: #edf8f2;
}

.import-items-table tr.is-failed td,
.import-items-table tr.is-invalid td {
    background: #fff4f2;
}

.import-image-preview {
    background: #fff;
    border: 1px solid #dbe6f5;
    border-radius: 8px;
    display: block;
    height: 54px;
    object-fit: cover;
    width: 54px;
}

.import-image-placeholder {
    color: var(--admin-muted);
    display: inline-block;
    min-width: 64px;
}

.import-items-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.import-items-actions button {
    border: 1px solid #d7deea;
    border-radius: 10px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    min-height: 40px;
    padding: 0 14px;
}

.import-items-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.import-items-primary {
    background: #18794e;
    border-color: #18794e !important;
    color: #fff;
}

@media (min-width: 900px) {
    .export-form {
        align-items: start;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}

/* Message Banner Styles */
.message-banner {
    position: fixed;
    top: 10px;
    left: 50%;
    width: 200px;
    text-align: center;
    transform: translateX(-50%);
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: none;
    opacity: 0;
    transition: opacity 3s;
    z-index: 1000;
}

/* Success Message */
.message-banner.success {
    background-color: #28a745;
    color: white;
}

/* Error Message */
.message-banner.error {
    background-color: #dc3545;
    color: white;
}

/* Info Message */
.message-banner.info {
    background-color: #17a2b8;
    color: white;
}

/* Mobile Optimization */
@media (max-width: 600px) {
    .sticky-controls {
        position: static;
        flex-direction: column;
        align-items: stretch;
        padding: 8px;
        gap: 6px;
    }

    .menu-bar {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        gap: 6px;
        align-items: stretch;
    }

    .top-bar-wordmark {
        grid-column: 1 / -1;
        justify-content: flex-start;
        margin: 0;
        min-height: 30px;
        padding: 2px 6px;
    }

    .menu-group--right {
        margin-left: 0;
    }

    .export-panel-header,
    .export-job-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .export-form > .export-fieldset:nth-of-type(1),
    .export-form > .export-fieldset:nth-of-type(2),
    .export-form > .export-job-status,
    .export-form > .export-actions {
        grid-column: 1;
    }

    .menu-group,
    .menu-trigger,
    .top-bar-status,
    .header-status-pill,
    .auction-total-pill {
        width: 100%;
    }

    .menu-group {
        min-width: 0;
    }

    .menu-trigger,
    .header-status-pill,
    .auction-total-pill {
        border-radius: 10px;
        font-size: 0.9rem;
        min-height: 34px;
        padding: 0 12px;
    }

    .menu-trigger::after {
        border-left-width: 3px;
        border-right-width: 3px;
        border-top-width: 4px;
    }

    .menu-panel {
        grid-column: 1 / -1;
        min-width: 0;
        position: static;
        margin-top: 6px;
        padding: 10px;
    }

    .top-bar-status {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: stretch;
        gap: 6px;
    }

    .menu-item-button,
    .menu-item-link,
    .menu-choice-button,
    .menu-checkbox-row,
    .menu-field select {
        min-height: 36px;
        font-size: 0.92rem;
    }

    .menu-item-button,
    .menu-item-link,
    .menu-choice-button,
    .menu-checkbox-row {
        padding: 7px 10px;
    }

    .menu-label {
        font-size: 0.68rem;
    }

    .app-modal {
        padding: 12px;
    }

    main {
        padding: 12px;
    }

    #itemsTable th,
    #itemsTable td,
    #feed th,
    #feed td {
        padding: 8px;
    }

    #itemsTable td:last-child,
    #itemsTable th:last-child {
        width: 220px;
    }

    .item-actions {
        gap: 4px;
    }

    .item-action-button,
    .btn-finalize,
    .btn-undo {
        height: 30px;
        width: 30px;
    }

    #edit-form .form-actions button,
    #add-form .form-actions button {
        min-width: 100%;
    }

    .move-panel {
        max-width: none;
    }

    .about-row {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 420px) {
    .menu-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .top-bar-status {
        grid-template-columns: 1fr;
    }
}

footer {
    text-align: center;
    font-size: 0.8em;
    color: var(--admin-muted);
    margin-top: 1.5em;
    padding: 1em 0;
}

/* Section Styling */
#edit-section,
#add-section,
#export-section {
    background: var(--admin-panel-bg);
    box-sizing: border-box;
    border: 1px solid var(--admin-panel-border);
    border-radius: 16px;
    box-shadow: var(--admin-panel-shadow);
    margin: 0 auto;
    max-width: 860px;
    padding: 20px 22px;
    width: min(100%, 860px);
}

#edit-section,
#add-section {
    max-width: 1160px;
    width: min(100%, 1160px);
}

#export-section {
    max-width: 1120px;
    width: min(100%, 1120px);
}

#edit-title h2,
#add-section h2 {
    margin: 0 0 12px;
}

#edit-dates {
    color: var(--admin-muted);
    margin: 0 0 14px;
}

.edit-layout {
    align-items: start;
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

.edit-main-column,
.edit-photo-column {
    min-width: 0;
}

.edit-photo-panel {
    display: grid;
    gap: 14px;
    position: sticky;
    top: 18px;
}

.edit-photo-preview {
    align-items: center;
    background: var(--admin-panel-subtle);
    border: 1px solid var(--admin-panel-border);
    border-radius: 16px;
    display: flex;
    justify-content: center;
    min-height: min(62vh, 640px);
    overflow: hidden;
    padding: 14px;
}

.edit-mode-banner {
    background: #fff6db;
    border: 1px solid #efcc72;
    border-radius: 12px;
    color: #7c4a03;
    margin: 0 0 14px;
    padding: 12px 14px;
}

.edit-mode-banner strong {
    color: inherit;
}

/* Form fields */
#edit-form label,
#add-form label {
    display: block;
    font-weight: bold;
    margin-top: 12px;
    margin-bottom: 5px;
    color: var(--admin-text);
}

#edit-form input[type="text"],
#edit-form input[type="file"],
#edit-form input[type="password"],
#add-form input[type="text"],
#add-form input[type="file"] {
    width: 100%;
}

/* Photo preview */
#current-photo,
#add-current-photo {
    display: block;
    max-width: 100%;
    max-height: min(58vh, 600px);
    object-fit: contain;
    width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

@media (max-width: 900px) {
    .edit-layout {
        display: grid;
        gap: 18px;
        grid-template-columns: minmax(0, 1fr);
    }

    .edit-main-column,
    .edit-photo-column {
        width: 100%;
    }

    .edit-photo-panel {
        position: static;
    }

    .edit-photo-preview {
        min-height: min(48vh, 420px);
    }

    #current-photo,
    #add-current-photo {
        max-height: min(44vh, 380px);
    }
}

@media (max-width: 600px) {
    #edit-section,
    #add-section {
        padding: 16px;
    }

    .edit-layout {
        gap: 14px;
    }

    .edit-photo-preview {
        min-height: 220px;
        padding: 10px;
    }

    #current-photo,
    #add-current-photo {
        max-height: 260px;
    }

    .app-modal-card--messaging {
        max-height: calc(100vh - 20px);
        padding: 12px;
        width: min(100%, 100vw - 20px);
    }

    .messaging-shell {
        grid-template-columns: minmax(0, 1fr);
        height: min(76vh, 680px);
        min-height: 0;
    }

    .messaging-users {
        border-bottom: 1px solid var(--admin-panel-border);
        border-right: 0;
        max-height: 170px;
    }

    .messaging-message {
        max-width: 94%;
    }

    .messaging-compose-actions,
    .messaging-item-search-row {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .messaging-compose-actions button,
    .messaging-item-search-row button {
        flex: 1 1 120px;
    }
}

/* Rotate/Crop button row */
#edit-form .image-tools,
#add-form .image-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.image-tools button {
    flex: 1;
    min-width: 120px;
    padding: 10px;
    background-color: #eef4ff;
    border: 1px solid #d7deea;
    border-radius: 8px;
    color: #24436b;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.image-tools button:hover {
    background-color: #e5eefc;
    border-color: #c6d7ef;
}

.view-item-button {
    background: #eef4ff;
    border-color: #8fb4ef;
    color: #0b4ecc;
}

.view-item-button:hover {
    background: #e5eefc;
    border-color: #7aa4e6;
    box-shadow: 0 4px 10px rgba(15, 98, 254, 0.12);
}


/* Action buttons */
#edit-form .form-actions,
#add-form .form-actions {
    margin-top: 18px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#edit-form .form-actions button,
#add-form .form-actions button {
    flex: 1;
    min-width: 120px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

#edit-form .form-actions button[type="submit"] {
    background-color: #18794e;
    color: white;
}

#add-form .form-actions button[type="submit"] {
    background-color: #18794e;
    color: white;
}

#edit-form #delete-item {
    background-color: var(--admin-danger);
    color: white;
}

#edit-form #show-all-item-data {
    background: #eef4ff;
    border-color: #d7deea;
    color: #24436b;
}

#edit-form #show-all-item-data:hover {
    background: #e5eefc;
    border-color: #c6d7ef;
}

#edit-form #cancel-edit {
    background-color: #6b7280;
    color: white;
}
.auction-filter {
    display: flex;
    align-items: center;
    gap: 8px;
  }

.image-tools button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.login-container {
    background: var(--admin-panel-bg);
    box-sizing: border-box;
    border: 1px solid var(--admin-panel-border);
    box-shadow: var(--admin-panel-shadow);
    padding: 24px;
    border-radius: 16px;
    width: 100%;
    max-width: 760px;
    margin: 24px auto;
    display: grid;
    grid-template-columns: minmax(180px, 0.8fr) minmax(260px, 1fr);
    align-items: center;
    gap: 28px;
}

.login-container h2,
.login-container h3 {
    text-align: left;
    margin: 0 0 12px;
}

.login-container .brand-lockup {
    align-items: center;
    margin: 0;
    text-align: center;
}

.login-container .brand-lockup .app-wordmark {
    font-size: 2rem;
    line-height: 1;
    margin: 0;
}

.login-container .brand-lockup .app-logo {
    display: block;
    width: 160px;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.login-container .brand-lockup .app-tagline {
    font-size: 0.72rem;
    margin-bottom: 0;
}

.login-controls {
    min-width: 0;
}

.login-reason {
    margin: 0 0 10px;
    padding: 9px 11px;
    border-left: 3px solid var(--admin-accent);
    border-radius: 0 6px 6px 0;
    background: color-mix(in srgb, var(--admin-accent) 8%, transparent);
    color: var(--admin-muted);
    font-size: 0.9rem;
    line-height: 1.35;
}

.login-error {
    min-height: 1.2em;
    margin: 4px 0 0;
}

.login-container input,
.login-container select,
.login-container button {
    width: 100%;
    padding: 10px;
    margin: 5px 0;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

.login-container button {
    background: var(--admin-accent);
    color: white;
    border: none;
    cursor: pointer;
}

.login-container button:hover {
    background: var(--admin-accent-strong);
}

@media (max-width: 620px) {
    .login-container {
        max-width: 420px;
        margin: 16px auto;
        padding: 20px;
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .login-container .brand-lockup .app-logo {
        width: 125px;
    }

    .login-container h2,
    .login-container h3 {
        text-align: center;
    }
}

/* ---------------- 1. Responsive layout ---------------- */
@media (max-width: 760px) {
  #wrap          { flex-direction: column; }
  #leftPane,
  #rightPane     { width: 100%; height: auto; }
  #rightPane     { padding: 1rem; }
}

/* ---------------- 2. Scrollable bidder list ----------- */

#bidderTable {
  flex: 1 1 auto;           /* take remaining height */
  overflow-y: auto;
}

/* ---------------- 3. Hide Paddle header/column on XS --- */
@media (max-width: 480px) {
  #bidderTable thead th:first-child,
  #bidderTable tbody td:first-child {
    display: none;          /* hide Paddle # */
  }
}

/* ---------------- 4. Touch-friendly buttons ------------ */
#payButtons button,
#summaryBtn,
#csv {
  font-size: 1rem;
  padding: 10px 20px;
  min-width: 120px;
  margin-bottom: 6px;
}

/* ---------------- 5. Ellipsis Title in Lots table ------ */
#lotsTable td:nth-child(2) {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.is-disabled-access {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

:root[data-theme="dark"] body {
    background:
        radial-gradient(circle at top left, rgba(95, 159, 255, 0.16), transparent 28%),
        radial-gradient(circle at top right, rgba(16, 185, 129, 0.11), transparent 24%),
        linear-gradient(180deg, #0a111c 0%, var(--admin-page-bg) 100%);
}

:root[data-theme="dark"] .sticky-controls {
    background: rgba(10, 16, 27, 0.88);
    border-color: rgba(42, 57, 80, 0.96);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.3);
}

:root[data-theme="dark"] .menu-trigger,
:root[data-theme="dark"] .header-status-pill,
:root[data-theme="dark"] .auction-total-pill,
:root[data-theme="dark"] .messaging-button {
    background: #111b2b;
    border-color: #31425c;
    color: #d9e6f8;
}

:root[data-theme="dark"] .menu-group[open] .menu-trigger,
:root[data-theme="dark"] .menu-choice-button.is-selected,
:root[data-theme="dark"] .menu-item-button.is-current-page,
:root[data-theme="dark"] .menu-item-link.is-current-page,
:root[data-theme="dark"] .move-toggle[aria-expanded="true"] {
    background: #18263a;
    border-color: #47648c;
    color: #f0f6ff;
    box-shadow: inset 0 0 0 1px rgba(95, 159, 255, 0.16);
}

:root[data-theme="dark"] .menu-panel,
:root[data-theme="dark"] .login-container,
:root[data-theme="dark"] #edit-section,
:root[data-theme="dark"] #add-section,
:root[data-theme="dark"] #export-section,
:root[data-theme="dark"] .table-container,
:root[data-theme="dark"] .app-modal-card,
:root[data-theme="dark"] .password-modal-card,
:root[data-theme="dark"] .edit-photo-preview,
:root[data-theme="dark"] .item-context-menu {
    background: var(--admin-panel-bg);
    border-color: var(--admin-panel-border);
    box-shadow: var(--admin-panel-shadow);
}

:root[data-theme="dark"] .menu-item-button,
:root[data-theme="dark"] .menu-item-link,
:root[data-theme="dark"] .menu-choice-button,
:root[data-theme="dark"] .menu-checkbox-row,
:root[data-theme="dark"] .move-panel,
:root[data-theme="dark"] .app-modal-close,
:root[data-theme="dark"] .password-modal-button,
:root[data-theme="dark"] .import-items-actions button,
:root[data-theme="dark"] .image-tools button,
:root[data-theme="dark"] .item-action-button,
:root[data-theme="dark"] .item-context-menu-action,
:root[data-theme="dark"] .btn-undo,
:root[data-theme="dark"] .messaging-user-button,
:root[data-theme="dark"] .messaging-item-result {
    background: #121d2d;
    border-color: #31425c;
    color: var(--admin-text);
}

:root[data-theme="dark"] .menu-item-button:hover,
:root[data-theme="dark"] .menu-item-link:hover,
:root[data-theme="dark"] .menu-choice-button:hover,
:root[data-theme="dark"] .menu-checkbox-row:hover,
:root[data-theme="dark"] .image-tools button:hover,
:root[data-theme="dark"] .item-action-button:hover,
:root[data-theme="dark"] .item-context-menu-action:hover,
:root[data-theme="dark"] .item-context-menu-action:focus-visible,
:root[data-theme="dark"] .btn-undo:hover,
:root[data-theme="dark"] .app-modal-close:hover,
:root[data-theme="dark"] .password-modal-button:hover,
:root[data-theme="dark"] .import-items-actions button:hover,
:root[data-theme="dark"] .messaging-user-button:hover,
:root[data-theme="dark"] .messaging-user-button.is-active,
:root[data-theme="dark"] .messaging-item-result:hover {
    background: #1b2a41;
    border-color: #4a6388;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

:root[data-theme="dark"] .menu-field select,
:root[data-theme="dark"] .move-panel select,
:root[data-theme="dark"] form input[type="text"],
:root[data-theme="dark"] form input[type="file"],
:root[data-theme="dark"] form input[type="password"],
:root[data-theme="dark"] form input[type="number"],
:root[data-theme="dark"] .login-container input,
:root[data-theme="dark"] .login-container select,
:root[data-theme="dark"] .password-modal-input,
:root[data-theme="dark"] .export-range-controls input[type="text"],
:root[data-theme="dark"] .import-file-field input,
:root[data-theme="dark"] .messaging-compose textarea,
:root[data-theme="dark"] .messaging-item-search-row input {
    background: #0b1320;
    border-color: #31425c;
    color: var(--admin-text);
}

:root[data-theme="dark"] .password-modal-button--primary {
    background: var(--admin-accent);
    border-color: var(--admin-accent);
    color: #fff;
    box-shadow: none;
}

:root[data-theme="dark"] .menu-divider,
:root[data-theme="dark"] #itemsTable th,
:root[data-theme="dark"] #itemsTable td,
:root[data-theme="dark"] #feed th,
:root[data-theme="dark"] #feed td,
:root[data-theme="dark"] .app-modal-header,
:root[data-theme="dark"] .item-context-menu-header,
:root[data-theme="dark"] .about-row,
:root[data-theme="dark"] .third-party-notices,
:root[data-theme="dark"] .form-footer,
:root[data-theme="dark"] .messaging-shell,
:root[data-theme="dark"] .messaging-users,
:root[data-theme="dark"] .messaging-users-head,
:root[data-theme="dark"] .messaging-thread-head,
:root[data-theme="dark"] .messaging-compose,
:root[data-theme="dark"] .messaging-item-panel,
:root[data-theme="dark"] .messaging-message-body {
    border-color: #253349;
}

:root[data-theme="dark"] #itemsTable th,
:root[data-theme="dark"] #feed th,
:root[data-theme="dark"] .move-panel,
:root[data-theme="dark"] .app-modal-header,
:root[data-theme="dark"] .about-row,
:root[data-theme="dark"] .third-party-notices summary,
:root[data-theme="dark"] .messaging-users,
:root[data-theme="dark"] .messaging-message-body {
    background: #162234;
}

:root[data-theme="dark"] .messaging-thread {
    background: #0d1726;
}

:root[data-theme="dark"] .messaging-message.is-outgoing .messaging-message-body {
    background: #173258;
    border-color: #2f5f9c;
}

:root[data-theme="dark"] .messaging-message.is-attention .messaging-message-body,
:root[data-theme="dark"] .messaging-message.is-attention.is-outgoing .messaging-message-body {
    background: #3a2319;
    border-color: #d66a4f;
    box-shadow: 0 0 0 2px rgba(214, 106, 79, 0.18);
}

:root[data-theme="dark"] .import-items-table-wrap,
:root[data-theme="dark"] .import-items-table th,
:root[data-theme="dark"] .import-items-table td,
:root[data-theme="dark"] .import-image-preview {
    border-color: #253349;
}

:root[data-theme="dark"] .import-items-table th {
    background: #162234;
}

:root[data-theme="dark"] .import-items-table tr.is-importing td {
    background: #173258;
}

:root[data-theme="dark"] .import-items-table tr.is-imported td {
    background: #173123;
}

:root[data-theme="dark"] .import-items-table tr.is-failed td,
:root[data-theme="dark"] .import-items-table tr.is-invalid td {
    background: #3a2319;
}

:root[data-theme="dark"] .import-image-preview {
    background: #0b1320;
}

:root[data-theme="dark"] .import-row-status[data-state="imported"] {
    color: #7bd99f;
}

:root[data-theme="dark"] .import-items-primary {
    background: #18794e;
    border-color: #18794e !important;
    color: #fff;
}

:root[data-theme="dark"] .messaging-item-link {
    background: #1b2a41;
    border-color: #4a6388;
    color: #d9e6f8;
}

:root[data-theme="dark"] .messaging-button.has-unread {
    background: #392a12;
    border-color: #9b6b20;
    color: #ffd78a;
}

:root[data-theme="dark"] .messaging-broadcast-dot {
    background: #8ab9f2;
    color: #0b1320;
}

:root[data-theme="dark"] #itemsTable tbody tr:hover {
    background: rgba(95, 159, 255, 0.08);
}

:root[data-theme="dark"] .item-row--deleted {
    background: #1a2433;
    color: #93a3ba;
}

:root[data-theme="dark"] .item-row--deleted td {
    background: #1a2433;
    border-color: #2a384d;
}

:root[data-theme="dark"] .item-row--deleted .item-photo-placeholder,
:root[data-theme="dark"] .item-row--deleted .item-status-indicator {
    opacity: 0.55;
}

:root[data-theme="dark"] .item-context-menu-action {
    background: transparent;
}

:root[data-theme="dark"] .item-context-menu-action:disabled:hover {
    background: transparent;
    box-shadow: none;
}

:root[data-theme="dark"] .connection-status-pill.is-connected {
    background: #13251e;
    border-color: #2d6b50;
    color: #9fe3bc;
}

:root[data-theme="dark"] .connection-status-pill.is-disconnected {
    background: #2b1719;
    border-color: #7e3a40;
    color: #ffb3ae;
}

:root[data-theme="dark"] .connection-status-pill.is-checking {
    background: #2a2314;
    border-color: #735d25;
    color: #f2d387;
}

:root[data-theme="dark"] .item-thumb,
:root[data-theme="dark"] #current-photo,
:root[data-theme="dark"] #add-current-photo {
    border-color: #31425c;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] .btn-finalize {
    color: #fff;
}

:root[data-theme="dark"] .btn-undo {
    color: var(--admin-warm);
}

:root[data-theme="dark"] .user-menu-username-row strong,
:root[data-theme="dark"] .about-row strong,
:root[data-theme="dark"] .third-party-notices summary {
    color: #dfeaff;
}

:root[data-theme="dark"] .about-row span,
:root[data-theme="dark"] .message-banner.info {
    color: var(--admin-muted);
}

:root[data-theme="dark"] .third-party-notices pre {
    background: #0b1320;
    color: #d9e6f8;
}

:root[data-theme="dark"] .message-banner.success {
    background: #13251e;
    border-color: #2d6b50;
    color: #9fe3bc;
}

:root[data-theme="dark"] .message-banner.error {
    background: #2b1719;
    border-color: #7e3a40;
    color: #ffb3ae;
}

:root[data-theme="dark"] .message-banner.info {
    background: #162234;
    border-color: #31425c;
}

:root[data-theme="dark"] .edit-mode-banner {
    background: #2a2314;
    border-color: #735d25;
    color: #f2d387;
}

:root[data-theme="dark"] .export-fieldset {
    background: #121d2d;
    border-color: #31425c;
}

:root[data-theme="dark"] .export-fieldset legend {
    color: #dfeaff;
}

:root[data-theme="dark"] .export-choice {
    background: #0b1320;
    border-color: #31425c;
}

:root[data-theme="dark"] .export-choice:hover {
    background: #101a29;
    border-color: #47648c;
}

:root[data-theme="dark"] .export-choice small,
:root[data-theme="dark"] .export-help-text,
:root[data-theme="dark"] #export-job-detail,
:root[data-theme="dark"] .export-panel-header p {
    color: var(--admin-muted);
}

:root[data-theme="dark"] .export-range-controls,
:root[data-theme="dark"] .export-job-status {
    background: #162234;
    border: 1px solid #31425c;
}

:root[data-theme="dark"] #history-modal > div,
:root[data-theme="dark"] #crop-modal > div {
    background: #121d2d !important;
    color: var(--admin-text);
    border: 1px solid #31425c;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.34);
}

:root[data-theme="dark"] #history-modal thead tr {
    background: #162234 !important;
}

:root[data-theme="dark"] #history-modal th,
:root[data-theme="dark"] #history-modal td {
    border-color: #253349;
    color: var(--admin-text);
}

:root[data-theme="dark"] .item-details-table th,
:root[data-theme="dark"] .item-details-table td {
    border-color: #253349;
}

:root[data-theme="dark"] .image-preview-stage {
    background: #162234;
    border-color: #253349;
}

:root[data-theme="dark"] #edit-form #show-all-item-data {
    background: #121d2d;
    border-color: #31425c;
    color: var(--admin-text);
}

:root[data-theme="dark"] #edit-form #show-all-item-data:hover {
    background: #1b2a41;
    border-color: #4a6388;
}

:root[data-theme="dark"] .view-item-button {
    background: #18263a;
    border-color: #47648c;
    color: #f0f6ff;
}

:root[data-theme="dark"] .view-item-button:hover {
    background: #1f314c;
    border-color: #5b7ba8;
}

.admin-inline-modal {
    position: fixed;
    inset: 0;
    align-items: center;
    background: rgba(14, 23, 38, 0.52);
    display: flex;
    justify-content: center;
    padding: 20px;
    z-index: 9999;
}

.admin-inline-card {
    background: var(--admin-panel-bg);
    border: 1px solid var(--admin-panel-border);
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(10, 30, 60, 0.22);
    color: var(--admin-text);
    display: grid;
    gap: 12px;
    padding: 20px;
    width: min(100%, 360px);
}

.admin-inline-card--bid {
    align-items: stretch;
    grid-template-columns: minmax(150px, 0.72fr) minmax(260px, 1fr);
    max-height: min(92vh, 520px);
    width: min(100%, 620px);
}

.admin-bid-entry {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.known-bidder-panel {
    border-right: 1px solid var(--admin-panel-border);
    display: grid;
    gap: 8px;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    padding-right: 14px;
}

.known-bidder-title {
    color: var(--admin-muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.known-bidder-list {
    display: grid;
    gap: 3px;
    max-height: 340px;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.known-bidder-item {
    align-items: baseline;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--admin-text);
    cursor: pointer;
    display: grid;
    gap: 6px;
    grid-template-columns: 44px minmax(0, 1fr);
    line-height: 1.15;
    min-height: 26px;
    padding: 4px 6px;
    text-align: left;
}

.known-bidder-item:hover,
.known-bidder-item:focus-visible {
    background: #eef4ff;
    outline: none;
}

.known-bidder-paddle {
    font-weight: 800;
}

.known-bidder-name {
    color: var(--admin-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.known-bidder-empty {
    color: var(--admin-muted);
    font-size: 0.9rem;
    padding: 4px 0;
}

.admin-inline-card h3 {
    margin: 0;
}

.admin-inline-copy {
    color: var(--admin-muted);
    font-size: 0.92rem;
    margin: -4px 0 0;
}

.admin-inline-field {
    display: grid;
    gap: 6px;
}

.admin-inline-field label {
    color: var(--admin-muted);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.admin-inline-input {
    background: #fff;
    border: 1px solid #cbd5df;
    border-radius: 10px;
    box-sizing: border-box;
    color: var(--admin-text);
    font: inherit;
    min-height: 42px;
    padding: 9px 11px;
    width: 100%;
}

.admin-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.admin-inline-actions button {
    border-radius: 10px;
    font: inherit;
    font-weight: 700;
    min-height: 40px;
    padding: 0 14px;
}

.admin-inline-actions .admin-inline-confirm {
    background: var(--admin-accent);
    border: 1px solid var(--admin-accent);
    color: #fff;
}

.admin-inline-actions .admin-inline-secondary {
    background: #eaf8f0;
    border: 1px solid #b9dfc8;
    color: #1f6f3f;
}

.admin-inline-actions .admin-inline-cancel {
    background: #eef4ff;
    border: 1px solid #d7deea;
    color: #24436b;
}

@media (max-width: 640px) {
    .admin-inline-card--bid {
        grid-template-columns: 1fr;
        max-height: min(94vh, 680px);
    }

    .known-bidder-panel {
        border-bottom: 1px solid var(--admin-panel-border);
        border-right: 0;
        max-height: 170px;
        padding-bottom: 12px;
        padding-right: 0;
    }

    .known-bidder-list {
        max-height: 130px;
    }
}

.retract-preview-card {
    display: grid;
    gap: 16px;
    max-width: 620px;
    width: min(100%, 620px);
}

.retract-preview-lot {
    background: var(--admin-panel-subtle);
    border: 1px solid var(--admin-panel-border);
    border-radius: 14px;
    display: grid;
    gap: 4px;
    padding: 14px 16px;
}

.retract-preview-lot-number {
    color: var(--admin-muted);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.retract-preview-lot-description {
    font-size: 1.05rem;
    font-weight: 700;
}

.retract-preview-lot-price {
    color: var(--admin-muted);
    font-size: 0.95rem;
}

.retract-preview-summary-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.retract-preview-stat {
    background: #f8fbff;
    border: 1px solid #dbe6f5;
    border-radius: 12px;
    display: grid;
    gap: 6px;
    padding: 12px 14px;
}

.retract-preview-stat-label {
    color: var(--admin-muted);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.retract-preview-stat-value {
    color: var(--admin-text);
    font-size: 1rem;
}

.retract-preview-badge {
    border-radius: 999px;
    display: inline-flex;
    padding: 4px 10px;
}

.retract-preview-badge--not_paid {
    background: rgba(15, 98, 254, 0.12);
    color: var(--admin-accent-strong);
}

.retract-preview-badge--part_paid {
    background: rgba(154, 69, 33, 0.14);
    color: var(--admin-warm);
}

.retract-preview-badge--paid_in_full {
    background: rgba(16, 185, 129, 0.16);
    color: #0f7a53;
}

.retract-preview-impact {
    border: 1px solid var(--admin-panel-border);
    border-radius: 14px;
    display: grid;
    gap: 8px;
    padding: 16px;
}

.retract-preview-impact.is-allowed {
    background: rgba(15, 98, 254, 0.05);
}

.retract-preview-impact.is-blocked {
    background: rgba(180, 35, 24, 0.08);
    border-color: rgba(180, 35, 24, 0.26);
}

.retract-preview-impact-label {
    color: var(--admin-muted);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.retract-preview-impact-value {
    font-size: clamp(1.3rem, 2vw, 1.8rem);
    font-weight: 800;
}

.retract-preview-impact-value.is-negative {
    color: var(--admin-danger);
}

.retract-preview-impact-value.is-nonnegative {
    color: var(--admin-accent-strong);
}

.retract-preview-impact-copy {
    color: var(--admin-text);
    margin: 0;
}

.retract-preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.retract-preview-actions button {
    border-radius: 10px;
    font: inherit;
    font-weight: 700;
    min-height: 40px;
    padding: 0 14px;
}

.retract-preview-confirm {
    background: var(--admin-danger);
    border: 1px solid var(--admin-danger);
    color: #fff;
}

.retract-preview-cancel {
    background: #eef4ff;
    border: 1px solid #d7deea;
    color: #24436b;
}

:root[data-theme="dark"] .admin-inline-card {
    background: #121d2d;
    border-color: #31425c;
    box-shadow: 0 28px 56px rgba(0, 0, 0, 0.38);
}

:root[data-theme="dark"] .admin-inline-input {
    background: #0b1320;
    border-color: #31425c;
    color: var(--admin-text);
}

:root[data-theme="dark"] .known-bidder-item:hover,
:root[data-theme="dark"] .known-bidder-item:focus-visible {
    background: #1f314c;
}

:root[data-theme="dark"] .admin-inline-actions .admin-inline-secondary {
    background: #142a24;
    border-color: #2c664e;
    color: #9ce0bd;
}

:root[data-theme="dark"] .admin-inline-actions .admin-inline-cancel {
    background: #121d2d;
    border-color: #31425c;
    color: var(--admin-text);
}

:root[data-theme="dark"] .retract-preview-lot {
    background: #152133;
    border-color: #31425c;
}

:root[data-theme="dark"] .retract-preview-stat {
    background: #152133;
    border-color: #31425c;
}

:root[data-theme="dark"] .retract-preview-badge--not_paid {
    background: rgba(95, 159, 255, 0.18);
    color: #b7d4ff;
}

:root[data-theme="dark"] .retract-preview-badge--part_paid {
    background: rgba(245, 188, 138, 0.14);
    color: #ffd9b4;
}

:root[data-theme="dark"] .retract-preview-badge--paid_in_full {
    background: rgba(73, 191, 138, 0.18);
    color: #9be9c4;
}

:root[data-theme="dark"] .retract-preview-impact.is-allowed {
    background: rgba(95, 159, 255, 0.1);
}

:root[data-theme="dark"] .retract-preview-impact.is-blocked {
    background: rgba(255, 140, 134, 0.1);
    border-color: rgba(255, 140, 134, 0.28);
}

:root[data-theme="dark"] .retract-preview-impact-value.is-nonnegative {
    color: #b7d4ff;
}

:root[data-theme="dark"] .retract-preview-cancel {
    background: #121d2d;
    border-color: #31425c;
    color: var(--admin-text);
}

.modal_default_background {
    background: rgba(14, 23, 38, 0.52) !important;
    }

.modal_default_main {
    background: var(--admin-panel-bg) !important;
    border: 1px solid var(--admin-panel-border) !important;
    border-radius: 16px !important;
    box-shadow: 0 24px 48px rgba(10, 30, 60, 0.22) !important;
    color: var(--admin-text) !important;
    overflow: hidden !important;
}

.modal_default_inner {
    background: transparent !important;
}

.modal_default_content,
.modal_default_input,
.modal_default_buttons {
    padding-left: 18px !important;
    padding-right: 18px !important;
}

.modal_default_content {
    color: var(--admin-text) !important;
    font: inherit !important;
    padding-top: 18px !important;
}

.modal_default_input {
    padding-bottom: 14px !important;
}

.modal_default_buttons {
    display: flex !important;
    gap: 8px !important;
    justify-content: flex-end !important;
    padding-bottom: 18px !important;
}

.modal_default_input input {
    background: #fff !important;
    border: 1px solid #cbd5df !important;
    border-radius: 10px !important;
    box-sizing: border-box !important;
    color: var(--admin-text) !important;
    font: inherit !important;
    min-height: 40px !important;
    padding: 8px 10px !important;
    width: 100% !important;
}

.modal_default_ok,
.modal_default_cancel {
    border-radius: 10px !important;
    font: inherit !important;
    font-weight: 700 !important;
    min-height: 38px !important;
    padding: 0 14px !important;
}

.modal_default_ok {
    background: var(--admin-accent) !important;
    border: 1px solid var(--admin-accent) !important;
    color: #fff !important;
}

.modal_default_cancel {
    background: #eef4ff !important;
    border: 1px solid #d7deea !important;
    color: #24436b !important;
}

:root[data-theme="dark"] .modal_default_main {
    background: #121d2d !important;
    border-color: #31425c !important;
    box-shadow: 0 28px 56px rgba(0, 0, 0, 0.38) !important;
}

:root[data-theme="dark"] .modal_default_input input {
    background: #0b1320 !important;
    border-color: #31425c !important;
    color: var(--admin-text) !important;
}

:root[data-theme="dark"] .modal_default_cancel {
    background: #121d2d !important;
    border-color: #31425c !important;
    color: var(--admin-text) !important;
}
