/* ============================================================
   APEX AUTO - Layout Only (no colors, no theme)
   ============================================================ */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: sans-serif;
    font-size: var(--fs-md);
    direction: rtl;
}

/* ── Top Bar ── */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    background: #fff;
    border-bottom: 2px solid #333;
    z-index: 1000;
    gap: 8px;
}

.top-bar-left,
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.top-bar-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.logo-text {
    font-size: var(--fs-lg);
    font-weight: 800;
    letter-spacing: 2px;
}

.toggle-btn {
    background: none;
    border: 1px solid #ccc;
    padding: 4px 8px;
    cursor: pointer;
}

.user-badge,
.session-info,
.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    padding: 0 10px;
    border: 1px solid #ccc;
    background: #fff;
    font-size: var(--fs-sm);
    white-space: nowrap;
    cursor: pointer;
}

.btn-logout {
    border-color: #333;
    font-weight: 600;
}

.btn-logout:hover {
    background: #f0f0f0;
}

.session-timer {
    font-family: monospace;
    font-weight: 600;
}

.bottom-bar-admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    padding: 0 10px;
    border: 1px solid var(--primary, #B8960C);
    background: transparent;
    font-size: var(--fs-sm);
    white-space: nowrap;
    cursor: pointer;
    font-family: sans-serif;
    font-weight: 600;
    color: var(--primary, #B8960C);
}

.bottom-bar-admin-btn:hover {
    background: var(--primary-t, rgba(184, 150, 12, 0.08));
}

/* ── Main Layout ── */
.main-container {
    display: flex;
    margin-top: 45px;
    height: calc(100vh - 45px - 36px);
    overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
    position: fixed;
    right: 0;
    top: 45px;
    width: 240px;
    height: calc(100vh - 45px - 36px);
    overflow-y: auto;
    overflow-x: hidden;
    border-left: 2px solid #333;
    background: #fff;
    z-index: 100;
}

.sidebar-header {
    padding: 10px 12px;
    border-bottom: 1px solid #ccc;
    font-weight: 800;
    font-size: var(--fs-base);
    letter-spacing: 2px;
}

.sidebar.collapsed {
    width: 48px;
}

.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-arrow,
.sidebar.collapsed .nav-children,
.sidebar.collapsed .sidebar-header {
    display: none;
}

/* ── Content ── */
.content-area {
    flex: 1;
    margin-right: 240px;
    height: 100%;
    overflow-y: auto;
    background: #fafafa;
}

.content-wrapper {
    padding: 20px;
    padding-bottom: 56px;
    max-width: 1400px;
}

.sidebar.collapsed~.content-area {
    margin-right: 48px;
}

/* ── Bottom Bar ── */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 12px;
    gap: 8px;
    border-top: 1px solid #ccc;
    background: #fff;
    font-size: var(--fs-sm);
    z-index: 1000;
}

/* ── Sidebar Nav ── */
.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #f0f0f0;
}

.nav-link:hover {
    background: #f5f5f5;
}

.nav-link.active {
    font-weight: bold;
    background: #f0f0f0;
}

.nav-children {
    display: none;
    padding-right: 16px;
    border-right: 2px solid #e0e0e0;
}

.nav-children.expanded {
    display: block;
}

.nav-arrow {
    font-size: var(--fs-xs);
    margin-right: auto;
}

.nav-arrow.expanded {
    transform: rotate(90deg);
    display: inline-block;
}

.nav-popup {
    display: none;
    position: fixed;
    background: #fff;
    border: 1px solid #ccc;
    padding: 4px;
    min-width: 180px;
    z-index: 9999;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.15);
}

.nav-popup-item {
    padding: 7px 12px;
    cursor: pointer;
    font-size: var(--fs-base);
}

.nav-popup-item:hover {
    background: #f5f5f5;
}

.nav-popup-group-title {
    padding: 6px 12px;
    font-size: var(--fs-xs);
    font-weight: 700;
    color: #888;
    border-bottom: 1px solid #eee;
}

/* ── Icon ── */
.icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ── Buttons ── */
button,
.btn {
    padding: 6px 14px;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
    font-size: var(--fs-base);
    font-family: sans-serif;
}

button:hover,
.btn:hover {
    background: #f0f0f0;
}

button:disabled,
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.topbar-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border: 1px solid #ccc;
    background: #fff;
    font-size: var(--fs-base);
    cursor: pointer;
    white-space: nowrap;
}

.topbar-action-btn:hover {
    background: #f0f0f0;
}

.topbar-action-btn-primary {
    border-color: #333;
    font-weight: 600;
}

/* ── Page Header ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #ccc;
    flex-wrap: wrap;
    gap: 8px;
}

.page-header h1 {
    font-size: var(--fs-xl);
    font-weight: 700;
    margin: 0;
}

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

#page-actions,
#page-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Table ── */
table,
.data-table,
.auctions-table,
.events-table,
.archive-table,
.staging-table,
.lots-table,
.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-base);
    background: #fff;
}

thead tr {
    background: #f5f5f5;
}

th {
    padding: 10px 12px;
    text-align: right;
    font-weight: 600;
    font-size: var(--fs-sm);
    border-bottom: 2px solid #ccc;
    white-space: nowrap;
}

td {
    padding: 9px 12px;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: middle;
}

tbody tr:last-child td {
    border-bottom: none;
}

.col-checkbox,
.row-checkbox {
    width: 36px;
    text-align: center;
}

td img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    display: block;
}

.col-actions {
    white-space: nowrap;
    text-align: center;
}

.col-actions button {
    margin: 0 2px;
}

td[colspan] {
    text-align: center;
    padding: 32px;
    color: #888;
}

/* ── Badge ── */
.badge,
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: var(--fs-xs);
    font-weight: 600;
    white-space: nowrap;
}

/* ── Forms ── */
.form-group {
    margin-bottom: 14px;
}

label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
}

input,
select,
textarea {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #ccc;
    font-family: sans-serif;
    font-size: var(--fs-base);
    background: #fff;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #333;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* ── Modal ── */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal.open {
    display: flex;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: #fff;
    border: 1px solid #333;
    width: 540px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 12px 16px;
    border-bottom: 1px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2,
.modal-header h3 {
    margin: 0;
    font-size: var(--fs-lg);
}

.modal-body {
    padding: 16px;
}

.modal-footer {
    padding: 12px 16px;
    border-top: 1px solid #ccc;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.close-btn {
    background: none;
    border: none;
    font-size: var(--fs-2xl);
    cursor: pointer;
    padding: 0 4px;
}

/* ── Alerts ── */
.alert {
    padding: 8px 12px;
    border: 1px solid #ccc;
    margin-bottom: 12px;
    font-size: var(--fs-base);
}

.alert-success {
    border-color: green;
    color: green;
}

.alert-danger {
    border-color: red;
    color: red;
}

.alert-warning {
    border-color: orange;
    color: orange;
}

.alert-info {
    border-color: blue;
    color: blue;
}

/* ── Utilities ── */
.hidden {
    display: none !important;
}

.w-full {
    width: 100%;
}

.text-center {
    text-align: center;
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gap-1 {
    gap: 4px;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 16px;
}

.mt-1 {
    margin-top: 4px;
}

.mt-2 {
    margin-top: 8px;
}

.mt-3 {
    margin-top: 16px;
}

.mb-1 {
    margin-bottom: 4px;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-3 {
    margin-bottom: 16px;
}

/* ── Login ── */
.login-container {
    width: 400px;
    margin: 80px auto;
    border: 1px solid var(--border);
    padding: 28px;
    background: var(--surface);
    position: relative;
}

.login-container .logo {
    text-align: center;
    margin-bottom: 20px;
}

.login-container .logo img {
    width: 60px;
    height: 60px;
}

.login-container .logo-text {
    font-size: var(--fs-2xl);
    font-weight: 800;
    margin-top: 8px;
}

.step-indicator {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.step-indicator .step {
    padding: 8px 16px;
    cursor: default;
    color: var(--text-3);
    font-size: var(--fs-sm);
}

.step-indicator .step.active {
    font-weight: 600;
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    margin-bottom: -9px;
}

.btn-login {
    width: 100%;
    padding: 10px;
    font-size: var(--fs-lg);
    cursor: pointer;
    font-weight: 600;
}

.info-box {
    margin-top: 12px;
    border: 1px solid var(--border);
    padding: 10px;
    font-size: var(--fs-base);
    color: var(--text-2);
    background: var(--surface-2);
}

.info-box .title {
    font-weight: bold;
    margin-bottom: 4px;
    color: var(--text-1);
}

.countdown {
    margin-top: 8px;
    padding: 8px;
    border: 1px solid var(--border);
    text-align: center;
    color: var(--text-2);
    background: var(--surface-2);
}

.attempts-info {
    margin-top: 6px;
    font-size: var(--fs-base);
    text-align: center;
    color: var(--text-2);
}

.error {
    margin-top: 10px;
    padding: 8px;
    border: 1px solid var(--danger);
    color: var(--danger);
    background: rgba(198, 40, 40, 0.06);
    display: none;
}

.success {
    margin-top: 10px;
    padding: 8px;
    border: 1px solid var(--success);
    color: var(--success);
    background: rgba(46, 125, 50, 0.06);
    display: none;
}

.otp-input {
    text-align: center;
    font-size: var(--fs-2xl);
    letter-spacing: 8px;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    padding-left: 40px;
}

.btn-show-password {
    position: absolute;
    left: 8px;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-3);
    box-shadow: none;
    display: flex;
    align-items: center;
}

.btn-show-password:hover {
    color: var(--primary);
    background: none;
    transform: none;
    box-shadow: none;
}

.remember-row {
    display: flex;
    align-items: center;
    margin: 10px 0;
}

.remember-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: var(--fs-sm);
    color: var(--text-2);
    font-weight: normal;
}

.remember-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* ── Spinner ── */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-top-color: #333;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay,
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #888;
}

/* ── Toast ── */
.toast-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10000;
    pointer-events: none;
}

.toast {
    background: #fff;
    border: 1px solid #ccc;
    border-right: 4px solid #333;
    padding: 12px 16px;
    margin-bottom: 8px;
    min-width: 280px;
    max-width: 380px;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.2s ease-out;
}

.toast.success {
    border-right-color: green;
}

.toast.error {
    border-right-color: red;
}

.toast.warning {
    border-right-color: orange;
}

.toast.info {
    border-right-color: blue;
}

.toast-title {
    font-weight: 600;
    font-size: var(--fs-base);
}

.toast-message {
    font-size: var(--fs-sm);
    color: #555;
    margin-top: 2px;
}

.toast-content {
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: var(--fs-xl);
    padding: 0;
}

.toast.removing {
    animation: toastOut 0.2s ease-in forwards;
}

@keyframes toastIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* ── Breadcrumb ── */
#breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--fs-sm);
    white-space: nowrap;
    overflow-x: auto;
}

#breadcrumb a {
    color: inherit;
    text-decoration: none;
}

#breadcrumb a:hover {
    text-decoration: underline;
}

#breadcrumb span {
    color: #888;
}

/* ── Inline Groups (filters, button rows) ── */
.page-actions>div,
.page-actions>h2 {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#vehicles-filters>div,
#vehicles-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.status-filter {
    padding: 3px 10px;
    font-size: var(--fs-sm);
}

.status-filter.active {
    font-weight: 700;
    border-color: var(--primary, #B8960C);
}

/* ── Filters Bar ── */
#vehicles-filters {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border, #ccc);
}

#vehicles-filters input[type="text"] {
    width: 180px;
}

#vehicles-filters input[type="date"] {
    width: 140px;
}

#vehicles-filters select {
    width: auto;
}

/* ══════════════════════════════════════════
   MOBILE / PWA
   ══════════════════════════════════════════ */

/* ── Install Toast (corner) ── */
#pwa-install-bar {
    display: none;
    position: fixed;
    top: 56px;
    left: 16px;
    width: 280px;
    padding: 12px 14px;
    border-radius: 10px;
    border-left: 3px solid var(--primary, #B8960C);
    z-index: 1100;
    align-items: center;
    gap: 10px;
    font-size: var(--fs-sm);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
    animation: pwaSlideIn 0.25s ease-out;
}

@keyframes pwaSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#pwa-install-bar.visible {
    display: flex;
}

#pwa-install-bar .install-text {
    flex: 1;
    line-height: 1.4;
}

#pwa-install-bar .install-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
}

/* ── Touch ── */
.touch-active {
    opacity: 0.7;
    transform: scale(0.97);
}

.mobile-input {
    font-size: var(--fs-lg) !important;
}

/* 16px — prevents iOS zoom */

@media (max-width: 768px) {

    /* ── Layout ── */
    .sidebar {
        transform: translateX(100%);
        transition: transform 0.25s ease;
        z-index: 500;
        width: 280px !important;
    }

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

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 499;
    }

    .sidebar-overlay.visible {
        display: block;
    }

    .content-area {
        margin-right: 0 !important;
    }

    .main-container {
        height: calc(100vh - 45px - 36px);
    }

    /* ── Top Bar ── */
    .user-badge,
    .session-info {
        display: none;
    }

    .logo-text {
        font-size: var(--fs-base);
        letter-spacing: 1px;
    }

    #breadcrumb {
        display: none;
    }

    /* ── Content ── */
    .content-wrapper {
        padding: 12px;
        padding-bottom: 80px;
    }

    /* ── Page Header ── */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header h1 {
        font-size: var(--fs-lg);
    }

    .page-actions {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    /* ── Tables → Card layout ── */
    table,
    .data-table,
    .auctions-table,
    .events-table,
    .archive-table,
    .staging-table,
    .lots-table,
    .preview-table {
        display: block;
    }

    thead {
        display: none;
    }

    tbody {
        display: block;
    }

    tbody tr {
        display: block;
        border: 1px solid var(--border, #ccc);
        margin-bottom: 10px;
        padding: 10px;
        background: var(--surface, #fff);
    }

    td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 5px 0;
        border-bottom: 1px solid var(--border, #eee);
        font-size: var(--fs-sm);
        text-align: right;
    }

    td:last-child {
        border-bottom: none;
    }

    td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: var(--fs-xs);
        color: var(--text-2, #555);
        flex-shrink: 0;
        margin-left: 8px;
    }

    td[colspan] {
        justify-content: center;
    }

    td[colspan]::before {
        display: none;
    }

    .col-actions {
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 4px;
    }

    .col-actions::before {
        display: none;
    }

    /* ── Forms ── */
    .form-row {
        flex-direction: column;
    }

    input,
    select,
    textarea {
        font-size: var(--fs-lg);
    }

    /* prevent zoom on iOS */

    /* ── Modal ── */
    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0;
        max-height: 95vh;
        border-radius: 12px 12px 0 0;
    }

    .modal-overlay,
    .modal {
        align-items: flex-end;
    }

    /* ── Bottom Bar ── */
    .bottom-bar {
        font-size: var(--fs-xs);
        padding: 0 8px;
    }

    .btn-logout span {
        display: none;
    }

    .bottom-bar-admin-btn span {
        display: none;
    }

    /* ── Filters ── */
    #vehicles-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
    }

    #vehicles-filters input[type="text"] {
        width: 140px;
    }

    #vehicles-filters input[type="date"] {
        width: 120px;
    }

    /* ── Install toast ── */
    #pwa-install-bar {
        top: 56px;
        left: 8px;
        right: 8px;
        width: auto;
    }
}

/* ── Dashboard ── */
.apex-dashboard {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: stretch;
}

.hero-stats>* {
    flex: 1 1 180px;
    min-width: 0;
    box-sizing: border-box;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.section-title {
    font-size: var(--fs-base);
    font-weight: 600;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    max-width: 360px;
    min-height: 38px;
}

.search-bar .icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--text-2);
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: var(--fs-base);
    font-family: sans-serif;
    padding: 0;
    width: 100%;
}

.search-clear {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    color: #aaa;
    box-shadow: none;
}

.search-clear:hover {
    color: var(--danger, #C62828);
    background: none;
    transform: none;
    box-shadow: none;
}

.stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    border: 1px solid;
    padding: 16px;
    min-width: 0;
    box-sizing: border-box;
}

.stat-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-value {
    font-size: var(--fs-2xl);
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: var(--fs-sm);
}

.stat-trend {
    font-size: var(--fs-xs);
    height: 16px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 12px;
}

.dashboard-card {
    grid-column: span 4;
    border: 1px solid;
    padding: 16px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid;
}

.card-header h3 {
    font-size: var(--fs-base);
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-content {
    font-size: var(--fs-base);
}

.live-ticker {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    height: 36px;
    overflow: hidden;
    border: 1px solid;
}

.ticker-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.ticker-content {
    flex: 1;
    overflow: hidden;
    cursor: pointer;
}

.ticker-items {
    font-size: var(--fs-sm);
    white-space: nowrap;
    display: inline-flex;
    gap: 32px;
    animation: ticker-scroll 20s linear infinite;
}

.ticker-items:hover {
    animation-play-state: paused;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

@keyframes ticker-scroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

.live-ticker.expanded {
    height: auto;
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 10px 16px;
    gap: 8px;
}

.live-ticker.expanded .ticker-content {
    overflow: visible;
}

.live-ticker.expanded .ticker-items {
    animation: none;
    white-space: normal;
    flex-wrap: wrap;
    gap: 8px;
}

.live-ticker.expanded .ticker-item {
    padding: 4px 10px;
    font-size: var(--fs-sm);
    border: 1px solid;
}

.chart-filters {
    display: flex;
    gap: 4px;
}

.filter-btn {
    padding: 2px 8px;
    font-size: var(--fs-xs);
    border-radius: 20px;
    border: 1px solid;
    cursor: pointer;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 8px;
    border: 1px solid;
    cursor: pointer;
    font-size: var(--fs-sm);
    font-family: sans-serif;
}

.auction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid;
}

.auction-item:last-child {
    border-bottom: none;
}

.auction-info {
    display: flex;
    flex-direction: column;
}

.auction-title {
    font-weight: 600;
    font-size: var(--fs-base);
}

.auction-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-sm);
    margin-top: 3px;
}

.auction-price {
    text-align: left;
    flex-shrink: 0;
}

.current-price {
    font-weight: 700;
    font-size: var(--fs-md);
}

.time-left {
    font-size: var(--fs-xs);
    margin-top: 2px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-content {
    display: flex;
    flex-direction: column;
}

.activity-text {
    font-size: var(--fs-sm);
}

.activity-time {
    font-size: var(--fs-xs);
    margin-top: 2px;
}

.bidder-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid;
}

.bidder-item:last-child {
    border-bottom: none;
}

.bidder-rank {
    font-weight: 700;
    font-size: var(--fs-sm);
    min-width: 24px;
}

.bidder-info {
    display: flex;
    flex-direction: column;
}

.bidder-name {
    font-size: var(--fs-base);
    font-weight: 500;
}

.bidder-stats {
    font-size: var(--fs-xs);
    margin-top: 2px;
}

.bidder-badge {
    margin-right: auto;
    font-size: var(--fs-lg);
}

.pending-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid;
    margin-bottom: 8px;
    cursor: pointer;
}

.pending-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pending-content {
    display: flex;
    flex-direction: column;
}

.pending-title {
    font-size: var(--fs-base);
    font-weight: 500;
}

.pending-count {
    font-size: var(--fs-xs);
    margin-top: 2px;
}

.pending-arrow {
    color: inherit;
    margin-right: auto;
}

@media (max-width: 1024px) {
    .dashboard-card {
        grid-column: span 6;
    }
}

@media (max-width: 640px) {
    .dashboard-card {
        grid-column: span 12;
    }

    .hero-stats {
        grid-template-columns: 1fr 1fr;
    }
}

/* ── Settings Page ── */
.settings-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-xl);
    font-weight: 700;
    margin: 0;
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.info-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1px solid;
}

.info-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-label {
    font-size: var(--fs-sm);
}

.info-value {
    font-size: var(--fs-2xl);
    font-weight: 700;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.settings-card {
    border: 1px solid;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.settings-card h3 {
    font-size: var(--fs-base);
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.setting-item label {
    font-size: var(--fs-sm);
    font-weight: 500;
}

.checkbox-item {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid;
}

.checkbox-item:last-child {
    border-bottom: none;
}

.checkbox-item label {
    margin: 0;
    font-size: var(--fs-base);
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    cursor: pointer;
}

.settings-actions {
    display: flex;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid;
}

.btn-save,
.btn-reset,
.btn-reset-theme {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border: 1px solid;
    cursor: pointer;
    font-size: var(--fs-base);
    font-family: sans-serif;
}

.btn-reset-theme {
    padding: 6px 14px;
    font-size: var(--fs-sm);
    align-self: flex-start;
    margin-top: auto;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Tabs ── */
.tab-bar {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid;
    margin-bottom: 16px;
}

.tab-btn {
    padding: 12px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: var(--fs-base);
    font-family: sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-bottom: 3px solid transparent;
}

.main-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.sub-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.sub-tab-btn {
    padding: 4px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: transparent;
    cursor: pointer;
    font-size: var(--fs-sm);
}

.status-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.filters-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.search-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid;
    padding: 4px 10px;
    flex: 1;
    min-width: 200px;
}

.search-wrapper input {
    border: none;
    background: transparent;
    outline: none;
    flex: 1;
    font-size: var(--fs-base);
    font-family: sans-serif;
}

.clear-search {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}

.realtime-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-sm);
    margin-bottom: 8px;
}

.realtime-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Command Palette ── */
.command-palette {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
}

.command-palette.open {
    display: block;
}

.command-palette-overlay {
    position: fixed;
    inset: 0;
}

.command-palette-content {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 560px;
    max-width: 90vw;
    border: 1px solid;
    overflow: hidden;
}

.command-palette-search {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid;
}

.command-palette-search input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: var(--fs-lg);
    outline: none;
    font-family: sans-serif;
}

.command-palette-results {
    max-height: 360px;
    overflow-y: auto;
}

.command-palette-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 8px;
}

.command-palette-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
}

.command-palette-section-header {
    padding: 6px 16px;
    font-size: var(--fs-xs);
    font-weight: 700;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    padding: 10px 0;
}

.page-nav,
.page-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
    font-size: var(--fs-sm);
    font-family: sans-serif;
}

.page-nav:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.page-number.active {
    font-weight: 700;
    border-color: var(--primary, #B8960C);
}

.page-ellipsis {
    padding: 0 4px;
    color: #aaa;
    font-size: var(--fs-sm);
}

.auctions-table-view {
    display: block;
}

/* ── Financial Operations ── */
.btn-assign {
    padding: 5px 10px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--primary, #B8960C);
}

.btn-details {
    padding: 5px 10px;
    cursor: pointer;
    border: 1px solid var(--border, #ccc);
}

.status-in_review {
    background: rgba(0, 150, 255, 0.12);
    color: #1565C0;
}

/* ── System Admin Hub ── */
.system-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.system-admin-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 16px;
    border: 1px solid var(--border, #ccc);
    background: var(--surface, #fff);
    cursor: pointer;
    transition: background 0.15s;
}

.system-admin-card:hover {
    background: var(--surface-2, #f5f5f5);
}

.system-admin-card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--primary, #B8960C);
    color: var(--primary, #B8960C);
    flex-shrink: 0;
}

.system-admin-card-icon .icon {
    width: 20px;
    height: 20px;
}

.system-admin-card-body {
    flex: 1;
}

.system-admin-card-title {
    font-size: var(--fs-md);
    font-weight: 600;
    margin-bottom: 3px;
}

.system-admin-card-desc {
    font-size: var(--fs-sm);
    color: var(--text-2, #666);
}

.system-admin-card-arrow {
    width: 14px;
    height: 14px;
    color: var(--text-3, #aaa);
    flex-shrink: 0;
    transform: scaleX(-1);
}

.thumb {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: var(--radius);
}

#plate-photo-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#plate-photo-modal .modal-content {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    max-width: 600px;
    width: 90%;
}

#plate-photo-modal .modal-photo {
    width: 100%;
    border-radius: var(--radius);
}

.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

/* Vehicle modals */
.studio-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.input-warning {
    border: 2px solid var(--warning) !important;
}

.readonly-field {
    background: var(--surface-2);
}

.vin-status {
    font-size: 12px;
}

.vin-status.pending {
    color: var(--warning);
}

.vin-status.success {
    color: var(--success);
}

.vin-status.warning {
    color: var(--warning);
}

.vin-status.error {
    color: var(--danger);
}

.tab-btn.active {
    border-bottom: 3px solid var(--primary);
    color: var(--text-1);
}

.tab-btn {
    border-bottom: 3px solid transparent;
    color: var(--text-3);
}

.tab-content[hidden] {
    display: none;
}

.icon-lg {
    width: 48px;
    height: 48px;
}

/* Modal sizes & structure */
.modal-content.modal-lg {
    width: min(860px, 95vw);
}

.modal-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
}

.modal-tabs .tab-btn {
    padding: 10px 16px;
    border: none;
    background: none;
    border-bottom: 3px solid transparent;
    color: var(--text-3);
    cursor: pointer;
}

.modal-tabs .tab-btn.active {
    border-bottom-color: var(--primary);
    color: var(--text-1);
}

/* Form grid — 2 columns */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

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

.form-group label {
    font-size: 13px;
    color: var(--text-2);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-1);
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
}

.form-group-full {
    grid-column: 1 / -1;
}

/* Media grid — 4 slots */
.media-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.media-slot label {
    display: block;
    font-size: 13px;
    color: var(--text-2);
    margin-bottom: 4px;
    text-align: center;
}

.media-preview {
    aspect-ratio: 4/3;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    background: var(--surface-2);
}

.media-preview:hover {
    border-color: var(--primary);
}

.media-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

    .media-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Image Studio */
.studio-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.studio-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.studio-path {
    font-size: 13px;
    color: var(--text-2);
    padding: 6px 10px;
    background: var(--surface-2);
    border-radius: var(--radius);
}

.studio-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.studio-card {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--border);
    transition: transform 0.15s;
}

.studio-card:hover {
    transform: scale(1.05);
}

.studio-card.accepted {
    border: 3px solid var(--success);
}

.studio-card.needs-crop {
    border: 3px solid var(--warning);
}

.studio-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.studio-badge {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: var(--warning);
    color: #fff;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 3px;
}

.studio-edit-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--warning);
    border: none;
    padding: 4px 6px;
    border-radius: 3px;
    cursor: pointer;
}

.studio-preview {
    border: 3px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.studio-preview.ok {
    border-color: var(--success);
}

.studio-preview.warn {
    border-color: var(--warning);
}

.studio-preview img {
    width: 100%;
    display: block;
}

.studio-preview-info {
    padding: 8px;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.studio-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-1);
    padding: 12px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 99999;
    transition: opacity 0.3s;
}

.studio-toast.hide {
    opacity: 0;
}

/* Studio Editor */
.studio-editor .editor-body {
    display: flex;
    gap: 16px;
    padding: 16px;
    min-height: 400px;
}

.editor-tools {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.editor-section {
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.editor-section h4 {
    font-size: 13px;
    color: var(--text-2);
    margin-bottom: 6px;
}

.editor-canvas {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border-radius: var(--radius);
    overflow: hidden;
}

.editor-canvas img {
    max-width: 100%;
    max-height: 500px;
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.btn-block {
    width: 100%;
}

/* Cropper page */
.cropper-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cropper-wrapper {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    max-height: 500px;
}

.cropper-wrapper img {
    display: block;
    max-width: 100%;
}

.image-info {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-2);
}

.progress-bar {
    height: 6px;
    background: var(--surface-2);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0;
    transition: width 0.3s;
}