body.admin-body {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 24px 0;
    position: sticky;
    top: 0;
    height: 100vh;
}
.admin-sidebar .brand-name { font-size: 1.05rem; }
.admin-logo { display: block; height: auto; width: auto; max-width: 100%; max-height: 48px; object-fit: contain; margin: 0 auto; }
.admin-logo--login { max-height: 96px; margin: 0 auto 24px; }
.admin-sidebar-header { padding: 0 20px 24px; border-bottom: 1px solid var(--border); margin-bottom: 16px; text-align: center; }
.admin-nav { list-style: none; margin: 0; padding: 0; }
.admin-nav a {
    display: block;
    padding: 12px 20px;
    color: var(--text-muted);
    font-size: 0.94rem;
}
.admin-nav a:hover, .admin-nav a.is-active {
    background: var(--surface-raised);
    color: var(--text);
    text-decoration: none;
    border-left: 3px solid var(--accent);
    padding-left: 17px;
}
/* Logout is a POST form (CSRF-protected) styled to match the nav links. */
.admin-logout-form { margin: 0; }
.admin-logout-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 20px;
    background: none;
    border: 0;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.94rem;
    cursor: pointer;
}
.admin-logout-btn:hover {
    background: var(--surface-raised);
    color: var(--text);
    border-left: 3px solid var(--accent);
    padding-left: 17px;
}

.admin-main {
    flex-grow: 1;
    padding: 32px 40px 60px;
    /* Use the available width, but cap it so rows don't stretch across ultra-wide screens. */
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* Dashboard status sections */
.admin-section { margin-bottom: 40px; }
.admin-section-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-size: 1.15rem;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.admin-section-count {
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--text-muted);
}
.admin-section-empty { color: var(--text-muted); font-size: 0.9rem; margin: 0; }

/* Prominent "delete sold cars" advisory on the Sold Inventory page. */
.sold-tip { padding: 44px 48px; margin-bottom: 40px; }
.sold-tip-title {
    font-size: 2rem;
    line-height: 1.2;
    margin: 0 0 16px;
    color: var(--text);
}
.sold-tip-body {
    margin: 0 0 14px;
    max-width: none;
    font-size: 1.2rem;
    line-height: 1.65;
    color: var(--text-muted);
}
.sold-tip-body:last-child { margin-bottom: 0; }

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 14px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.admin-table th, .admin-table td {
    text-align: left;
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}
.admin-table th {
    background: var(--surface-raised);
    color: var(--text-muted);
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.82rem;
    letter-spacing: 0.3px;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table td.actions { white-space: nowrap; text-align: right; }
.admin-table td.actions a, .admin-table td.actions button {
    font-size: 0.85rem;
    margin-left: 12px;
}
.admin-table td.actions .action-inline { display: inline; margin: 0; }
/* Suggested action: the recommended "Delete Photos" button, accent-filled so it stands out. */
.action-btn--suggested {
    background: var(--accent);
    color: var(--accent-ink) !important;
    border: 0;
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-family: var(--font-display);
    cursor: pointer;
}
.action-btn--suggested:hover { background: var(--accent-dark); }
/* Feature toggle: outlined button; filled when the car is currently featured. */
.action-btn--feature {
    background: transparent;
    color: var(--text) !important;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-family: var(--font-display);
    cursor: pointer;
}
.action-btn--feature:hover { border-color: var(--accent); color: var(--accent) !important; }
.action-btn--feature.is-featured {
    background: var(--accent);
    color: var(--accent-ink) !important;
    border-color: var(--accent);
}
/* "Featured" tag next to a car's name. */
.featured-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    font-family: var(--font-display);
    font-size: 0.7rem;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--accent-ink);
    background: var(--accent);
    border-radius: 20px;
    vertical-align: middle;
}
.admin-thumb {
    width: 64px; height: 48px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg);
}
.admin-thumb img { width: 100%; height: 100%; object-fit: cover; }
/* Brand/favicon placeholder in a thumbnail: contain, don't crop the logo. */
.admin-thumb .no-photo--brand img { width: 80%; height: 80%; object-fit: contain; }

.login-wrap {
    max-width: 480px;
    margin: 8vh auto;
    padding: 0 20px;
}
.login-card { padding: 44px 44px 40px; }

.form-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px;
    margin-bottom: 24px;
}
.form-section h3 { margin-bottom: 18px; font-size: 1rem; color: var(--accent); }

.photo-drop {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 30px;
    text-align: center;
    color: var(--text-muted);
}
.photo-drop input[type="file"] { margin-top: 12px; }

.existing-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}
.existing-photo {
    position: relative;
    width: 110px; height: 82px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}
.existing-photo img { width: 100%; height: 100%; object-fit: cover; }
.existing-photo label {
    position: absolute;
    bottom: 4px; right: 4px;
    background: rgba(20,22,26,0.85);
    color: #e08787;
    font-size: 0.7rem;
    padding: 3px 6px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    margin: 0;
}
.existing-photo input[type="checkbox"] { width: auto; margin: 0; }

.status-pill {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-family: var(--font-display);
}

.feature-toggle-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}
.feature-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.86rem;
    color: var(--text-muted);
    background: var(--bg);
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
    user-select: none;
}
.feature-toggle:hover { border-color: var(--accent); }
.feature-toggle-input:checked + .feature-toggle {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}
.feature-toggle-input:focus-visible + .feature-toggle {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.field-suffix {
    color: var(--text-faint);
    font-size: 0.82rem;
    font-weight: 400;
}

/* Support page: contact details, plan status, what's covered, rates. Cards reuse .form-section. */
.support-intro { color: var(--text-muted); margin: -12px 0 24px; }
.support-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: 0 24px;
}
.support-name { font-size: 1.15rem; color: var(--text); margin: 0 0 16px; }
.support-name span { display: block; font-size: 0.88rem; color: var(--text-muted); }
.support-details {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 8px 18px;
    margin: 0 0 16px;
    font-size: 0.94rem;
}
.support-details dt { color: var(--text-muted); }
.support-details dd { margin: 0; overflow-wrap: anywhere; }
.support-muted { color: var(--text-muted); font-size: 0.9rem; }
.support-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.support-subheading { font-size: 0.95rem; margin: 22px 0 8px; }
.support-list { margin: 0; padding-left: 20px; line-height: 1.6; }
.support-list li { margin-bottom: 6px; }
.support-list--yes, .support-list--no { list-style: none; padding-left: 0; }
.support-list--yes li, .support-list--no li { padding-left: 1.4em; text-indent: -1.4em; } /* wrapped lines align with the text */
.support-list--yes li::before, .support-list--no li::before { display: inline-block; width: 1.4em; text-indent: 0; font-weight: 600; }
.support-list--yes li::before { content: "✓"; color: var(--available); }
.support-list--no li::before { content: "✕"; color: var(--text-faint); }
.support-rates { margin: 8px 0 12px; }
.support-rates .support-price { white-space: nowrap; font-family: var(--font-display); }

@media (max-width: 820px) {
    body.admin-body { flex-direction: column; }
    .admin-sidebar { width: 100%; height: auto; position: static; }
    .admin-main { padding: 24px 18px 50px; }
}
