/* Header */
header.container {
    max-height: 200px;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.header-logo {
    height: 60px;
    max-height: 160px;
    width: auto;
    vertical-align: middle;
}

/* Re-scrape bar */
.rescrape-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.5rem 0 0;
}
.rescrape-bar form {
    margin: 0;
}
.rescrape-label {
    font-size: 0.85em;
    color: #555;
    margin-right: 0.25rem;
}
.rescrape-bar .rescrape-btn {
    padding: 0.2rem 0.6rem;
    font-size: 0.8em;
    margin: 0;
    line-height: 1.4;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    background: #6c757d;
    color: #fff;
}
.badge.bat { background: #d4831f; }
.badge.cab { background: #2563eb; }
.badge.carsandbids { background: #2563eb; }
.badge.pcarmarket { background: #b91c1c; }
.badge.retail { background: #059669; }

/* Status badges */
.badge.status-live { background: #16a34a; }
.badge.status-sold { background: #7c3aed; }
.badge.status-no_sale { background: #dc2626; }
.badge.status-offer { background: #ea580c; }
.badge.status-withdrawn { background: #6b7280; }
.badge.status-error { background: #dc2626; }
.badge.status-pending { background: #ca8a04; }

/* Confidence badges */
.badge.confidence-high { background: #16a34a; }
.badge.confidence-medium { background: #ca8a04; }
.badge.confidence-low { background: #dc2626; }

/* Relevance badges */
.badge.relevance-exact { background: #16a34a; }
.badge.relevance-close { background: #ca8a04; }
.badge.relevance-loose { background: #6b7280; }

/* Alert icon */
.alert-icon {
    color: #dc2626;
    font-size: 1.1em;
}

/* Big numbers in rec cards */
.big-number {
    font-size: 1.8em;
    font-weight: 700;
    margin: 0.5rem 0;
}

/* Rec card */
.rec-card {
    border: 2px solid var(--pico-primary);
    border-radius: 8px;
    padding: 1rem;
}
.rec-reasoning {
    font-style: italic;
    color: #475569;
    font-size: 0.9em;
}

/* Risk list */
.risk-list {
    list-style: none;
    padding: 0;
}
.risk-list > li {
    padding: 0.4rem 0;
}
.risk-ok {
    color: #16a34a;
}
.risk-alert {
    color: #dc2626;
    font-weight: 600;
}

/* Over bid warnings */
.over-recommended {
    color: #ea580c !important;
}
.over-max {
    color: #dc2626 !important;
}
.over-warning {
    color: #dc2626;
    font-weight: 600;
    font-size: 0.85em;
}

/* Dashboard table links */
table a {
    text-decoration: none;
}

/* Error banner on detail page */
.error-banner {
    background: #fef2f2;
    border: 1px solid #dc2626;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}
.error-banner p {
    color: #dc2626;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

/* Original URL link under vehicle name */
.original-url {
    color: #6b7280;
    font-size: 0.9em;
    text-decoration: none;
}
.original-url:hover {
    text-decoration: underline;
}

/* Error reason text */
.error-reason {
    color: #dc2626;
    font-size: 0.8em;
}

/* Inline retry button */
.retry-btn {
    font-size: 0.75em;
    padding: 2px 10px;
    margin-left: 6px;
    vertical-align: middle;
}

/* Dashboard thumbnail */
.thumb-cell {
    position: relative;
    width: 100px;
    min-width: 100px;
    padding: 4px !important;
}
.listing-thumb {
    width: 96px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}
.listing-thumb-placeholder {
    width: 96px;
    height: 64px;
    background: #e5e7eb;
    border-radius: 6px;
}
.badge-overlay {
    position: absolute;
    bottom: 6px;
    left: 6px;
    font-size: 0.65em;
    padding: 1px 5px;
}

/* Detail top bar */
.detail-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.rescrape-btn {
    font-size: 0.85em;
    padding: 4px 14px;
    margin: 0;
}

/* Detail hero — two-column layout */
.detail-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    align-items: start;
}
@media (max-width: 768px) {
    .detail-hero {
        grid-template-columns: 1fr;
    }
}
.detail-hero-left {
    min-height: 200px;
}
.detail-cover {
    width: 100%;
    height: 100%;
    min-height: 280px;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}
.detail-cover-placeholder {
    width: 100%;
    min-height: 280px;
    background: #e5e7eb;
    border-radius: 8px;
}
.detail-hero-right {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.detail-title {
    margin: 0;
    font-size: 1.5em;
    line-height: 1.2;
}
.detail-subtitle {
    margin: 0 0 0.25rem 0;
}

/* Specs table in hero */
.detail-specs {
    font-size: 0.9em;
    margin: 0;
}
.detail-specs th {
    font-weight: 600;
    color: #64748b;
    text-align: left;
    padding: 4px 10px 4px 0;
    white-space: nowrap;
    width: 1%;
}
.detail-specs td {
    padding: 4px 16px 4px 0;
}

/* Auction bar inside hero right */
.detail-auction-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    margin-top: 0.25rem;
    font-size: 1em;
}
.current-bid-label strong {
    font-size: 1.2em;
}
.end-time-label {
    color: #475569;
    font-size: 0.9em;
}
.countdown {
    font-weight: 600;
    color: #dc2626;
}

/* Dashboard Ends column — fixed width to prevent layout shift */
.ends-col {
    width: 170px;
    min-width: 170px;
    max-width: 170px;
    font-size: 0.8em;
    white-space: nowrap;
}
.ends-date {
    display: block;
    line-height: 1.3;
}
.ends-col .countdown {
    display: block;
    font-size: 0.9em;
    min-width: 120px;
}

/* Dashboard action buttons */
.actions-cell {
    padding: 4px !important;
    width: 70px;
    min-width: 70px;
}
.actions-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
}
.actions-bar form {
    margin: 0;
}
.action-btn {
    font-size: 0.65em;
    padding: 1px 4px;
    margin: 0;
    line-height: 1.4;
    width: 100%;
    text-align: center;
}
.action-delete {
    color: #dc2626;
    border-color: #dc2626;
}
.action-delete:hover {
    background: #dc2626;
    color: #fff;
}

/* Dashboard table — horizontal scroll on narrow screens */
.dashboard-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Mobile: convert table to card layout */
@media (max-width: 768px) {
    .dashboard-table thead { display: none; }
    .dashboard-table,
    .dashboard-table tbody,
    .dashboard-table tr,
    .dashboard-table td {
        display: block;
        width: 100%;
    }
    .dashboard-table tr {
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        padding: 0.75rem;
        margin-bottom: 0.75rem;
        position: relative;
    }
    .dashboard-table td {
        padding: 2px 0 !important;
        text-align: left !important;
    }
    .dashboard-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #64748b;
        font-size: 0.8em;
        margin-right: 0.5rem;
    }
    .dashboard-table .thumb-cell {
        width: auto;
        min-width: auto;
        float: left;
        margin-right: 0.75rem;
        margin-bottom: 0.5rem;
    }
    .dashboard-table .actions-cell {
        width: auto;
        min-width: auto;
        margin-top: 0.5rem;
        border-top: 1px solid #e5e7eb;
        padding-top: 0.5rem !important;
    }
    .dashboard-table .actions-bar {
        grid-template-columns: repeat(4, auto);
        justify-content: start;
        gap: 4px;
    }
    .dashboard-table .action-btn {
        width: auto;
        padding: 2px 8px;
    }
    .ends-col {
        width: auto !important;
        min-width: auto !important;
        max-width: none !important;
    }
}

/* Fee table */
.fee-table th {
    text-align: left;
    font-weight: 600;
    color: #64748b;
}
