﻿/* ============================
   CSS Variables & Reset
   ============================ */
:root {
    --color-bg: #f8f9fa;
    --color-surface: #ffffff;
    --color-primary: #111111;
    --color-primary-hover: #333333;
    --color-accent: #2563eb;
    --color-accent-hover: #1d4ed8;
    --color-danger: #b00020;
    --color-success: #1a7f37;
    --color-warning: #c09000;
    --color-muted: #6b7280;
    --color-border: rgba(0, 0, 0, 0.1);
    --color-border-light: rgba(0, 0, 0, 0.06);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06);
    --shadow-elevated: 0 4px 24px rgba(0, 0, 0, 0.1);
    --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-primary);
    line-height: 1.5;
}

img { max-width: 100%; height: auto; }

/* ============================
   Navbar
   ============================ */
.navbar {
    display: flex;
    align-items: center;
    padding: 0 32px;
    height: 56px;
    background-color: var(--color-primary);
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.navbar a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
}

.navbar a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
}

.nav-user {
    color: #93c5fd;
    font-size: 14px;
    font-weight: 500;
    padding: 0 8px;
}

.brand {
    font-weight: 700;
    font-size: 18px;
    color: #fff !important;
    letter-spacing: -0.3px;
}

/* ============================
   Main Content
   ============================ */
main {
    padding: 32px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.page {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.muted { color: var(--color-muted); }

/* ============================
   Buttons
   ============================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    background: var(--color-primary);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background var(--transition), box-shadow var(--transition);
    line-height: 1.4;
}

.btn:hover {
    background: var(--color-primary-hover);
    box-shadow: var(--shadow-card);
}

.btn.outline, .btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-border);
}

.btn.outline:hover, .btn-outline:hover {
    background: rgba(0, 0, 0, 0.04);
}

.btn.small {
    padding: 7px 14px;
    font-size: 13px;
}

.btn.accent {
    background: var(--color-accent);
}

.btn.accent:hover {
    background: var(--color-accent-hover);
}

.btn.danger {
    background: var(--color-danger);
}

.btn.danger:hover {
    background: #8b0018;
}

/* ============================
   Home Page
   ============================ */
.home {
    max-width: 860px;
    margin: 0 auto;
}

.hero {
    text-align: center;
    padding: 24px 0 32px 0;
}

.hero h1 {
    font-size: 34px;
    letter-spacing: -0.5px;
    margin: 0 0 14px 0;
    line-height: 1.25;
}

.hero-sub {
    font-size: 16px;
    color: var(--color-muted);
    max-width: 620px;
    margin: 0 auto 20px auto;
    line-height: 1.6;
}

.home .cta {
    justify-content: center;
}

/* How It Works */
.how-it-works {
    margin-top: 40px;
}

.how-it-works h2 {
    font-size: 22px;
    margin: 0 0 16px 0;
    text-align: center;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.step-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    text-align: center;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.step-card h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
}

.step-card p {
    margin: 0;
    font-size: 14px;
    color: var(--color-muted);
    line-height: 1.5;
}

/* Features */
.features-section {
    margin-top: 40px;
}

.features-section h2 {
    font-size: 22px;
    margin: 0 0 16px 0;
    text-align: center;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.feature-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
}

.feature-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.feature-card h3 {
    margin: 0 0 6px 0;
    font-size: 15px;
}

.feature-card p {
    margin: 0;
    font-size: 14px;
    color: var(--color-muted);
    line-height: 1.5;
}

/* Sellers CTA */
.home-sellers {
    margin-top: 36px;
}

.home-sellers .highlights p {
    margin: 0;
    font-size: 14px;
    color: var(--color-muted);
    line-height: 1.6;
}

.home h1 {
    margin-top: 8px;
    font-size: 32px;
    letter-spacing: -0.5px;
}

.highlights {
    margin-top: 24px;
    padding: 20px 24px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
}

.highlights h3 { margin: 0 0 10px 0; }

.highlights ul {
    margin: 0;
    padding-left: 20px;
}

.highlights li {
    margin-bottom: 6px;
}

.cta {
    margin-top: 24px;
    display: flex;
    gap: 12px;
}

.note {
    margin-top: 32px;
    color: var(--color-muted);
    font-size: 0.9rem;
    text-align: center;
}

/* Home responsive */
@media (max-width: 700px) {
    .steps-grid { grid-template-columns: 1fr; }
    .features-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 26px; }
}

/* ============================
   Browse Grid / Cards
   ============================ */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 0;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--transition), transform var(--transition);
    display: flex;
    flex-direction: column;
}

.card:hover {
    box-shadow: var(--shadow-elevated);
    transform: translateY(-2px);
}

.card-photo {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #e5e7eb;
    display: block;
}

.card-photo-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 14px;
}

.card-body {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-body h3 {
    margin: 0 0 6px 0;
    font-size: 17px;
    line-height: 1.3;
}

.card-body p {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: var(--color-muted);
}

.card-body .price {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-primary);
    margin: 8px 0;
}

.card-body .btn {
    margin-top: auto;
    align-self: flex-start;
}

/* ============================
   Detail Page
   ============================ */
.back-link {
    display: inline-block;
    margin-bottom: 16px;
    text-decoration: none;
    color: var(--color-muted);
    font-size: 14px;
    transition: color var(--transition);
}

.back-link:hover { color: var(--color-primary); }

.vehicle-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.vehicle-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 0;
    background: var(--color-surface);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.vehicle-card-content {
    padding: 20px 24px;
}

.vehicle-photos {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.vehicle-photos img {
    width: 100%;
    max-width: 500px;
    height: 300px;
    object-fit: cover;
    scroll-snap-align: start;
    flex-shrink: 0;
}

.vehicle-photos-single img {
    max-width: 100%;
}

.vehicle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.vehicle-header h2 {
    margin: 0;
    font-size: 22px;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge.active {
    background: rgba(40, 167, 69, .12);
    color: var(--color-success);
}

.badge.ended {
    background: rgba(176, 0, 32, .12);
    color: var(--color-danger);
}

.vehicle-title {
    color: var(--color-muted);
    margin-bottom: 12px;
}

.vehicle-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.detail-row {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 12px;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.detail-value {
    font-size: 17px;
    font-weight: 600;
    margin-top: 2px;
}

.vehicle-card-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border-light);
}

.vehicle-card-actions .btn {
    width: 100%;
}

/* ============================
   Create Listing Page
   ============================ */
.create-listings-page .forms-root {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}

.listing-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--color-border-light);
}

.listing-card h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
}

.listing-card label {
    font-size: 13px;
    color: var(--color-muted);
    display: block;
    margin-top: 10px;
    margin-bottom: 4px;
    font-weight: 500;
}

.listing-card input,
.listing-card select,
.listing-card textarea {
    padding: 9px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    width: 100%;
    font-size: 14px;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--color-surface);
}

/* Exclude file inputs inside upload areas from normal form input styling */
.listing-card .photo-upload-area input[type="file"] {
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.listing-card input:focus,
.listing-card select:focus,
.listing-card textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.listing-card textarea {
    resize: vertical;
    min-height: 70px;
}

.listing-card .row {
    display: flex;
    gap: 12px;
}

.listing-card .row > div {
    flex: 1;
}

.listing-card .remove {
    margin-top: 12px;
    background: none;
    border: 1px solid var(--color-border);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--color-danger);
    transition: background var(--transition);
}

.listing-card .remove:hover {
    background: rgba(176, 0, 32, 0.06);
}

.listing-card hr {
    margin: 16px 0 0 0;
    border: none;
    border-top: 1px solid var(--color-border-light);
}

/* Photo upload area in listing card */
.photo-upload-area {
    margin-top: 12px;
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    position: relative;
    overflow: hidden;
}

.photo-upload-area:hover,
.photo-upload-area.dragover {
    border-color: var(--color-accent);
    background: rgba(37, 99, 235, 0.04);
}

.photo-upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: none;
}

.photo-upload-area .upload-text {
    font-size: 14px;
    color: var(--color-muted);
}

.photo-upload-area .upload-text strong {
    color: var(--color-accent);
}

.photo-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.photo-preview-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 1;
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-preview-item .remove-photo {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background var(--transition);
}

.photo-preview-item .remove-photo:hover {
    background: var(--color-danger);
}

.actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
}

.status {
    margin-top: 14px;
    font-weight: 600;
    font-size: 14px;
}

.status.error {
    color: var(--color-danger);
}

.status.success {
    color: var(--color-success);
}

/* ============================
   Dashboard
   ============================ */
.dashboard-header { margin-bottom: 16px; }
.dashboard-header h1 { margin-bottom: 4px; }

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 16px 0 12px 0;
}

.dashboard-cards .card {
    padding: 18px;
    box-shadow: none;
    border: 1px solid var(--color-border);
}

.dashboard-cards .card:hover {
    transform: none;
    box-shadow: none;
}

.card-label {
    font-size: 13px;
    color: var(--color-muted);
    font-weight: 500;
}

.card-value {
    font-size: 28px;
    font-weight: 700;
    margin-top: 6px;
}

.card-sub {
    font-size: 12px;
    color: var(--color-muted);
    margin-top: 4px;
}

.dashboard-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 14px 0 20px 0;
}

.divider {
    margin: 20px 0;
    border: none;
    border-top: 1px solid var(--color-border-light);
}

.section { margin-top: 24px; }
.section-header { margin-bottom: 10px; }
.section-header h2 { margin: 0 0 4px 0; }

/* ============================
   Tables
   ============================ */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.table th, .table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--color-border-light);
}

.table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--color-muted);
    font-weight: 600;
    background: rgba(0, 0, 0, 0.02);
}

.table td {
    font-size: 14px;
}

.table tbody tr:hover {
    background: rgba(0, 0, 0, 0.015);
}

.link {
    text-decoration: none;
    color: var(--color-accent);
    font-weight: 500;
    font-size: 13px;
}

.link:hover { text-decoration: underline; }

.link.danger { color: var(--color-danger); }

.sep { margin: 0 6px; opacity: .3; }

.delete-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
    text-decoration: none;
    color: var(--color-danger);
    font-weight: 500;
    font-size: 13px;
}

.delete-btn:hover { text-decoration: underline; }

/* ============================
   Alerts
   ============================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    margin: 10px 0;
    font-size: 14px;
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
    color: #92700c;
}

.alert-success {
    background: rgba(40, 167, 69, 0.1);
    border-color: rgba(40, 167, 69, 0.3);
    color: var(--color-success);
}

.alert-danger {
    background: rgba(176, 0, 32, 0.1);
    border-color: rgba(176, 0, 32, 0.3);
    color: var(--color-danger);
}

/* ============================
   Auth Forms
   ============================ */
.auth-page {
    max-width: 420px;
    margin: 40px auto;
}

.auth-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-card);
}

.auth-card h2 {
    margin: 0 0 8px 0;
}

.auth-card label {
    display: block;
    margin-top: 14px;
    margin-bottom: 4px;
    font-size: 13px;
    color: var(--color-muted);
    font-weight: 500;
}

.auth-card input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.auth-card input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.auth-card button[type="submit"] {
    margin-top: 20px;
    width: 100%;
    padding: 11px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background var(--transition);
}

.auth-card button[type="submit"]:hover {
    background: var(--color-primary-hover);
}

.auth-card p {
    margin-top: 16px;
    font-size: 14px;
    text-align: center;
}

.auth-card p a {
    color: var(--color-accent);
    text-decoration: none;
}

.auth-card p a:hover { text-decoration: underline; }

/* ============================
   Admin Dashboard
   ============================ */
.role-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
    margin-right: 4px;
}

.badge-buyer {
    background: rgba(37, 99, 235, 0.1);
    color: var(--color-accent);
}

.badge-seller {
    background: rgba(26, 127, 55, 0.1);
    color: var(--color-success);
}

.badge-admin {
    background: rgba(176, 0, 32, 0.1);
    color: var(--color-danger);
}

/* ============================
   Navbar Profile Dropdown
   ============================ */
.nav-profile-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-avatar-btn {
    background: none;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: border-color var(--transition);
}

.nav-avatar-btn:hover {
    border-color: rgba(255, 255, 255, 0.6);
}

.nav-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.nav-avatar-initials {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-elevated);
    z-index: 200;
    padding: 6px 0;
}

.nav-dropdown-menu.show {
    display: block;
}

/* ============================
   Bell / Notification Popup
   ============================ */
.nav-bell-wrap {
    position: relative;
}

.nav-bell-btn {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.nav-bell-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-bell-icon {
    width: 20px;
    height: 20px;
    stroke: rgba(255, 255, 255, 0.85);
}

.nav-bell-badge {
    position: absolute;
    top: 1px;
    right: 1px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
}

.nav-notification-popup {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-elevated);
    z-index: 200;
    overflow: hidden;
}

.nav-notification-popup.show {
    display: block;
}

.nav-notification-header {
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--color-border);
}

.nav-notification-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
}

.nav-notification-list {
    max-height: 300px;
    overflow-y: auto;
}

.nav-notification-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    transition: background var(--transition);
    cursor: default;
}

.nav-notification-item:last-child {
    border-bottom: none;
}

.nav-notification-item:hover {
    background: var(--color-bg);
}

.nav-notification-item.unread {
    background: rgba(59, 130, 246, 0.05);
}

.nav-notification-item.unread:hover {
    background: rgba(59, 130, 246, 0.1);
}

.nav-notification-dot {
    width: 8px;
    height: 8px;
    min-width: 8px;
    border-radius: 50%;
    background: transparent;
    margin-top: 5px;
}

.nav-notification-item.unread .nav-notification-dot {
    background: #3b82f6;
}

.nav-notification-body {
    flex: 1;
    min-width: 0;
}

.nav-notification-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 2px;
}

.nav-notification-text {
    font-size: 12px;
    color: var(--color-muted);
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.nav-notification-time {
    font-size: 11px;
    color: var(--color-muted);
    margin-top: 3px;
}

.nav-notification-footer {
    padding: 10px 16px;
    text-align: center;
    border-top: 1px solid var(--color-border);
}

.nav-notification-footer a {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-primary) !important;
    padding: 0 !important;
    background: none !important;
}

.nav-notification-footer a:hover {
    text-decoration: underline;
    background: none !important;
}

.nav-dropdown-menu a {
    display: block;
    padding: 9px 16px;
    color: var(--color-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background var(--transition);
}

.nav-dropdown-menu a:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--color-primary);
}

.nav-dropdown-menu hr {
    margin: 4px 0;
    border: none;
    border-top: 1px solid var(--color-border-light);
}

/* ============================
   Profile Page
   ============================ */
.profile-section {
    margin-bottom: 8px;
}

.profile-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    box-shadow: var(--shadow-card);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
}

.profile-avatar-wrap {
    flex-shrink: 0;
}

.profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--color-border);
}

.profile-avatar-placeholder {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-size: 36px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--color-border);
}

.profile-info {
    flex: 1;
}

.profile-name {
    margin: 0 0 4px 0;
    font-size: 26px;
    letter-spacing: -0.3px;
}

.profile-meta {
    margin-bottom: 10px;
}

.profile-email {
    font-size: 14px;
    color: var(--color-muted);
}

.email-verified {
    color: var(--color-success);
    font-size: 12px;
    font-weight: 600;
    margin-left: 6px;
}

.email-unverified {
    color: var(--color-warning);
    font-size: 12px;
    font-weight: 600;
    margin-left: 6px;
}

.profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.profile-role-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    border: 1.5px solid;
}

.profile-role-admin {
    color: var(--color-danger);
    border-color: var(--color-danger);
    background: rgba(176, 0, 32, 0.06);
}

.profile-role-seller {
    color: var(--color-accent);
    border-color: var(--color-accent);
    background: rgba(37, 99, 235, 0.06);
}

.profile-role-buyer {
    color: #9ca3af;
    border-color: #d1d5db;
    background: rgba(156, 163, 175, 0.08);
}

.profile-status-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

.profile-status-active {
    background: rgba(40, 167, 69, 0.15);
    color: #1a7f37;
}

.profile-status-suspended {
    background: rgba(176, 0, 32, 0.12);
    color: var(--color-danger);
}

.profile-actions {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border-light);
}

/* ============================
   Edit Profile Page
   ============================ */
.profile-edit-page {
    max-width: 600px;
}

.profile-edit-page h1 {
    margin-bottom: 4px;
}

.profile-edit-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-top: 16px;
    box-shadow: var(--shadow-card);
}

.profile-edit-card h3 {
    margin: 0 0 10px 0;
    font-size: 15px;
}

.profile-edit-card input[type="text"],
.profile-edit-card input[type="email"],
.profile-edit-card input[type="url"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.profile-edit-card input[type="text"]:focus,
.profile-edit-card input[type="email"]:focus,
.profile-edit-card input[type="url"]:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.profile-edit-avatar-row {
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile-edit-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-border);
}

.profile-edit-avatar-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--color-border);
    flex-shrink: 0;
}

.profile-edit-upload {
    flex: 1;
}

.profile-edit-upload label {
    font-size: 13px;
    color: var(--color-muted);
    font-weight: 500;
    display: block;
    margin-bottom: 4px;
}

/* ============================
   Buyer Dashboard
   ============================ */
.buyer-dashboard {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.buyer-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    position: sticky;
    top: 72px;
}

.buyer-sidebar-title {
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--color-muted);
    font-weight: 600;
    margin-bottom: 10px;
}

.buyer-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.buyer-sidebar-nav a,
.buyer-sidebar-nav span {
    display: block;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    color: var(--color-primary);
    transition: background var(--transition);
}

.buyer-sidebar-nav a:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--color-primary);
}

.buyer-sidebar-nav a.active {
    background: var(--color-primary);
    color: #fff;
}

.buyer-sidebar-nav span.disabled {
    color: var(--color-muted);
    cursor: default;
}

.buyer-content {
    flex: 1;
    min-width: 0;
}

.buyer-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.buyer-kpi-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 16px 18px;
}

.buyer-kpi-label {
    font-size: 12px;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
    margin-bottom: 8px;
}

.buyer-kpi-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
}

.badge.winning {
    background: rgba(40, 167, 69, .12);
    color: var(--color-success);
}

.badge.outbid {
    background: rgba(192, 144, 0, .12);
    color: var(--color-warning);
}

.notification-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notification-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
}

.notification-item.unread {
    border-left: 3px solid var(--color-accent);
    background: rgba(37, 99, 235, 0.03);
}

.notification-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.notification-message {
    font-size: 13px;
    color: var(--color-muted);
    margin-bottom: 4px;
}

.notification-time {
    font-size: 12px;
    color: var(--color-muted);
}

.buyer-empty-state {
    padding: 20px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-muted);
    font-size: 14px;
}

/* Watchlist card grid (buyer dashboard) */
.watchlist-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.watchlist-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.watchlist-card-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.watchlist-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
}

.watchlist-card-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Watchlist heart button (Browse card corner) */
.card-photo-wrap {
    position: relative;
}

.watchlist-icon-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    cursor: pointer;
    font-size: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
    transition: transform var(--transition), background var(--transition);
    color: var(--color-muted);
    line-height: 1;
}

.watchlist-icon-btn:hover {
    background: #fff;
    transform: scale(1.12);
}

.watchlist-icon-btn.active {
    color: #e53e3e;
}

.watchlist-icon-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

/* Watch text button (Browse Detail) */
.watchlist-text-btn.active {
    color: #e53e3e;
    border-color: #e53e3e;
}

.watchlist-text-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

/* ============================
   Responsive
   ============================ */
@media (max-width: 900px) {
    main { padding: 24px 20px; }
    .dashboard-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
    .buyer-dashboard { flex-direction: column; }
    .buyer-sidebar { width: 100%; position: static; }
    .buyer-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .navbar { padding: 0 16px; }
    .nav-links { gap: 2px; }
    .navbar a { padding: 6px 8px; font-size: 13px; }
    main { padding: 16px; }
    .dashboard-cards { grid-template-columns: 1fr; }
    .grid { grid-template-columns: 1fr; }
    .listing-card .row { flex-direction: column; }
    .vehicle-details { grid-template-columns: repeat(2, 1fr); }
    .table { font-size: 13px; }
    .table th, .table td { padding: 8px 10px; }
}

