/* Custom UI kit for the RT Auction admin screens (prefix: rt-). No wp-components dependency. */
#rtapw-app { --rt-bg: #fff; --rt-line: #dcdcde; --rt-text: #1d2327; --rt-muted: #646970; --rt-primary: #2271b1; --rt-primary-d: #135e96;
    --rt-danger: #b32d2e; --rt-radius: 8px; color: var(--rt-text); font-size: 13px; }
#rtapw-app *, #rtapw-app *::before, #rtapw-app *::after { box-sizing: border-box; }
.rt-screen { max-width: 1280px; margin-top: 16px; }
.rt-screen--narrow { max-width: 760px; }
.rt-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.rt-title h1 { margin: 0; padding: 0; font-size: 23px; font-weight: 400; }
.rt-muted { color: var(--rt-muted); display: block; font-size: 12px; }
.rt-error { color: var(--rt-danger); }
.rt-empty { text-align: center; padding: 28px !important; color: var(--rt-muted); }

/* buttons */
.rt-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 1px solid var(--rt-primary); border-radius: 4px; background: #f6f7f7;
    color: var(--rt-primary); font: inherit; line-height: 1; text-decoration: none; cursor: pointer; white-space: nowrap; }
.rt-btn:hover:not(:disabled) { background: #f0f0f1; border-color: var(--rt-primary-d); color: var(--rt-primary-d); }
.rt-btn:focus-visible { outline: 2px solid var(--rt-primary); outline-offset: 2px; }
.rt-btn:disabled { opacity: .5; cursor: not-allowed; }
.rt-btn--primary { background: var(--rt-primary); color: #fff; }
.rt-btn--primary:hover:not(:disabled) { background: var(--rt-primary-d); color: #fff; }
.rt-btn--ghost { border-color: transparent; background: transparent; }
.rt-btn--link { border: 0; background: none; min-height: 0; padding: 0; text-decoration: underline; }
.rt-btn--sm { min-height: 26px; padding: 0 8px; font-size: 12px; }
.rt-btn--danger { color: var(--rt-danger); border-color: var(--rt-danger); }
.rt-btn--danger.rt-btn--ghost { border-color: transparent; }
.rt-btn--primary.rt-btn--danger { background: var(--rt-danger); color: #fff; }
.rt-btn--danger:hover:not(:disabled) { color: #8a2424; border-color: #8a2424; }
.rt-btn--primary.rt-btn--danger:hover:not(:disabled) { background: #8a2424; color: #fff; }

.rt-spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(128,128,128,.35); border-top-color: currentColor; border-radius: 50%; animation: rt-spin .7s linear infinite; }
@keyframes rt-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .rt-spinner { animation-duration: 2s; } }

/* cards, notices */
.rt-card { background: var(--rt-bg); border: 1px solid var(--rt-line); border-radius: var(--rt-radius); margin-bottom: 16px; }
.rt-card__head { padding: 12px 16px; border-bottom: 1px solid var(--rt-line); }
.rt-card__head h2 { margin: 0; font-size: 14px; }
.rt-card__body { padding: 16px; }
.rt-card__body.is-flush { padding: 0; }
.rt-notice { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 14px; border-left: 4px solid var(--rt-primary); background: #fff; border-radius: 4px; box-shadow: 0 1px 1px rgba(0,0,0,.04); }
.rt-notice--success { border-color: #00a32a; } .rt-notice--error { border-color: var(--rt-danger); }
.rt-notice__x { border: 0; background: none; font-size: 18px; line-height: 1; cursor: pointer; color: var(--rt-muted); }

/* toolbar / tabs */
.rt-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.rt-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.rt-tab { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid transparent; border-radius: 999px; background: none; font: inherit; cursor: pointer; color: var(--rt-text); }
.rt-tab:hover { background: #f0f0f1; }
.rt-tab.is-active { background: var(--rt-primary); color: #fff; }
.rt-tab:focus-visible { outline: 2px solid var(--rt-primary); outline-offset: 2px; }
.rt-count { padding: 0 7px; border-radius: 10px; background: rgba(0,0,0,.08); font-size: 11px; }
.is-active .rt-count { background: rgba(255,255,255,.25); }
.rt-search .rt-input { min-width: 240px; }

/* inputs */
.rt-input { width: 100%; max-width: 280px; min-height: 34px; padding: 0 10px; border: 1px solid #8c8f94; border-radius: 4px; font: inherit; background: #fff; color: var(--rt-text); }
.rt-input:focus { outline: 2px solid var(--rt-primary); outline-offset: 0; border-color: var(--rt-primary); }
.rt-input.is-invalid { border-color: var(--rt-danger); }
.rt-fields { display: grid; gap: 20px; }
.rt-field { display: grid; gap: 4px; }
.rt-field__label { font-weight: 600; display: block; }
.rt-field__help { color: var(--rt-muted); font-size: 12px; display: block; }
.rt-field--toggle { grid-template-columns: auto 1fr; align-items: start; column-gap: 12px; }
.rt-field--toggle label { cursor: pointer; }
.rt-switch { position: relative; width: 40px; height: 22px; padding: 0; border: 0; border-radius: 11px; background: #8c8f94; cursor: pointer; transition: background .15s; flex: none; }
.rt-switch.is-on { background: var(--rt-primary); }
.rt-switch__knob { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.rt-switch.is-on .rt-switch__knob { transform: translateX(18px); }
.rt-switch:focus-visible { outline: 2px solid var(--rt-primary); outline-offset: 2px; }
.rt-footer { display: flex; justify-content: flex-end; }

/* table */
.rt-scroll { overflow-x: auto; }
.rt-table { width: 100%; border-collapse: collapse; }
.rt-table th { text-align: left; padding: 10px 14px; font-weight: 600; background: #f6f7f7; border-bottom: 1px solid var(--rt-line); white-space: nowrap; }
.rt-table td { padding: 10px 14px; border-bottom: 1px solid #f0f0f1; vertical-align: middle; }
.rt-table.is-loading tbody { opacity: .55; }
.rt-table tbody tr:hover { background: #fafafa; }
.rt-table--inner { width: auto; min-width: 560px; border: 1px solid var(--rt-line); }
.rt-expand > td { background: #f6f7f7; }
.rt-product { display: flex; align-items: center; gap: 10px; }
.rt-product img { border-radius: 4px; object-fit: cover; }
.rt-row-actions { display: flex; flex-wrap: wrap; gap: 2px; }
.rt-pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 16px 0; }

/* pills */
.rt-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #e5e7eb; color: #374151; }
.rt-pill--live { background: #dcfce7; color: #166534; } .rt-pill--upcoming { background: #dbeafe; color: #1e40af; }
.rt-pill--ended, .rt-pill--sold, .rt-pill--closing { background: #e0e7ff; color: #3730a3; }
.rt-pill--no_bids, .rt-pill--reserve_not_met, .rt-pill--unpaid, .rt-pill--cancelled { background: #fee2e2; color: #991b1b; }

/* modal */
.rt-overlay { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.5); padding: 16px; }
.rt-modal { width: 100%; max-width: 420px; background: #fff; border-radius: var(--rt-radius); padding: 20px 24px; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.rt-modal:focus { outline: none; }
.rt-modal h2 { margin: 0 0 8px; font-size: 18px; }
.rt-modal__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
@media (max-width: 782px) { .rt-title { flex-wrap: wrap; } .rt-search .rt-input { min-width: 0; width: 100%; max-width: none; } }

/* dashboard */
.rt-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.rt-tile { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--rt-bg); border: 1px solid var(--rt-line); border-radius: var(--rt-radius); }
.rt-tile__label { color: var(--rt-muted); font-size: 12px; }
.rt-tile__value { font-size: 24px; line-height: 1.2; }
.rt-tile__hint { color: var(--rt-muted); font-size: 12px; }
.rt-tile--good .rt-tile__value { color: #166534; }
.rt-tile--warn { border-color: #dba617; background: #fcf9e8; }
.rt-grid2 { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }
@media (max-width: 960px) { .rt-grid2 { grid-template-columns: 1fr; } }
.rt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rt-list li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding-bottom: 8px; border-bottom: 1px solid #f0f0f1; }
.rt-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.rt-chart { margin: 0; position: relative; }
.rt-chart__bar { fill: var(--rt-primary); }
.rt-chart__bar:hover { fill: var(--rt-primary-d); }
.rt-chart__grid { stroke: #e5e5e5; stroke-width: 1; }
.rt-chart__axis { position: relative; height: 18px; font-size: 11px; color: var(--rt-muted); }
.rt-chart__axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.rt-chart__max { position: absolute; top: 0; right: 0; font-size: 11px; color: var(--rt-muted); }
