.admin-form-page {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.form-page-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
}

.form-page-heading {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.form-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: #fff;
    color: #475569;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}

.form-page-kicker,
.form-section-kicker {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #b45309;
}

.form-page-header h1,
.form-section-header h2 {
    margin: 0 0 8px;
    color: #0f172a;
}

.form-page-header p {
    margin: 0;
    color: #64748b;
}

.form-loading-state {
    display: grid;
    place-items: center;
    gap: 8px;
    min-height: 260px;
    background: #fff;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: #64748b;
}

.form-page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.85fr);
    gap: 20px;
    align-items: start;
}

.form-main-column,
.form-sidebar-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-section-card,
.form-sidebar-card {
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 14px rgba(15, 23, 42, 0.04);
}

.form-section-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 14px;
    padding: 22px 24px 0;
}

.form-section-header.is-split {
    align-items: center;
}

.form-section-body {
    padding: 24px;
}

.form-section-body.compact {
    padding-top: 18px;
}

.form-field,
.form-sidebar-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-field + .form-field {
    margin-top: 18px;
}

.form-field-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.form-count-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: #475569;
    font-size: 0.84rem;
    font-weight: 600;
}

.form-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(92px, 92px));
    gap: 12px;
}

.form-image-card {
    position: relative;
    width: 92px;
}

.form-image-preview,
.form-image-fallback {
    width: 92px;
    height: 92px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    object-fit: cover;
    background: #f8fafc;
}

.form-image-preview.is-primary {
    border-color: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.12);
}

.form-image-badge {
    position: absolute;
    left: 6px;
    bottom: 6px;
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: #1d4ed8;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
}

.form-sidebar-stack {
    padding: 22px;
}

.form-primary-submit,
.form-secondary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 46px;
    border-radius: 14px;
    font-weight: 600;
    text-decoration: none;
}

.form-primary-submit {
    border: none;
    background: #0f172a;
    color: #fff;
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.18);
}

.form-primary-submit:disabled {
    opacity: 0.8;
}

.form-secondary-link {
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: #fff;
    color: #475569;
}

.form-secondary-link.compact {
    min-height: 42px;
}

.form-sidebar-divider {
    height: 1px;
    background: rgba(226, 232, 240, 0.9);
    margin: 4px 0;
}

.form-selection-summary {
    margin-bottom: 10px;
    color: #64748b;
    font-size: 0.88rem;
}

.form-vehicle-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 340px;
    overflow-y: auto;
}

.form-vehicle-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid transparent;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.form-vehicle-option:hover {
    border-color: rgba(148, 163, 184, 0.2);
    background: #f1f5f9;
}

.category-editor-card,
.category-editor-card * {
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

.category-editor-card {
    border-radius: 20px;
}

.category-editor-card .form-section-header {
    padding: 20px 22px 0;
}

.category-editor-card .form-section-kicker {
    margin-bottom: 6px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #475569;
}

.category-editor-card .form-section-header h2 {
    margin-bottom: 0;
    font-size: 1.28rem;
    font-weight: 700;
    line-height: 1.25;
    color: #0f172a;
}

.category-editor-card .form-section-body {
    padding: 22px;
}

.category-editor-card .form-label {
    margin-bottom: 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: #334155;
}

.category-editor-card .form-text {
    font-size: 0.82rem;
    color: #64748b;
}

.category-editor-card .form-control,
.category-editor-card .form-select {
    min-height: 46px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: #f8fafc;
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: none;
}

.category-editor-card .form-control:focus,
.category-editor-card .form-select:focus {
    border-color: rgba(59, 111, 232, 0.42);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(59, 111, 232, 0.12);
}

.category-editor-card .form-control[readonly] {
    background: #f1f5f9;
    color: #64748b;
}

.category-editor-card .form-primary-submit {
    width: auto;
    min-width: 180px;
    min-height: 48px;
    padding: 0 20px;
    border-radius: 12px;
    background: #1d4ed8;
    box-shadow: 0 14px 28px rgba(29, 78, 216, 0.18);
    font-size: 0.95rem;
    font-weight: 700;
}

.category-editor-card .form-primary-submit:hover:not(:disabled) {
    background: #1e40af;
}

.category-editor-preview {
    padding-top: 4px;
}

/* ── Admin-scoped form controls ───────────────────────────── */

.admin-page .form-control,
.admin-page .form-select {
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: #f8fafc;
    color: #0f172a;
    font-size: 0.92rem;
    font-weight: 500;
    box-shadow: none;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.admin-page .form-control:focus,
.admin-page .form-select:focus {
    border-color: rgba(59, 111, 232, 0.42);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(59, 111, 232, 0.12);
    outline: none;
}

.admin-page .form-control[readonly],
.admin-page .form-control:disabled,
.admin-page .form-select:disabled {
    background: #f1f5f9;
    color: #64748b;
    opacity: 1;
}

.admin-page .form-label {
    font-size: 0.84rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.admin-page .form-text {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 4px;
}

.admin-page .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.admin-page .btn-primary {
    background: #0f3d2e;
    border-color: #0f3d2e;
    color: #fff;
    box-shadow: 0 10px 24px rgba(15, 61, 46, 0.18);
}

.admin-page .btn-primary:hover:not(:disabled) {
    background: #1f6f5a;
    border-color: #1f6f5a;
    color: #fff;
    transform: translateY(-1px);
}

.admin-page .btn-primary:disabled {
    opacity: 0.7;
}

.admin-page .btn-secondary,
.admin-page .btn-outline-secondary {
    border-color: rgba(148, 163, 184, 0.4);
    color: #475569;
    background: #fff;
}

.admin-page .btn-secondary:hover,
.admin-page .btn-outline-secondary:hover {
    background: #f8fafc;
    border-color: rgba(148, 163, 184, 0.6);
    color: #334155;
}

.admin-page .btn-outline-danger {
    border-color: rgba(220, 38, 38, 0.3);
    color: #dc2626;
    background: #fff;
}

.admin-page .btn-outline-danger:hover {
    background: #fef2f2;
    border-color: rgba(220, 38, 38, 0.5);
}

.admin-page .btn-outline-primary {
    border-color: rgba(29, 78, 216, 0.3);
    color: #1d4ed8;
    background: #fff;
}

.admin-page .btn-outline-primary:hover {
    background: #eff6ff;
    border-color: rgba(29, 78, 216, 0.5);
}

.admin-page .form-check-input:checked {
    background-color: #0f3d2e;
    border-color: #0f3d2e;
}

.admin-page .form-check-label {
    font-size: 0.9rem;
    color: #334155;
}

.admin-page .form-check-input[type="radio"]:checked {
    background-color: #0f3d2e;
    border-color: #0f3d2e;
}

/* ── Enrichment image picker ──────────────────────────────── */

.enrichment-image-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.enrichment-image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.15s, opacity 0.15s;
}

.enrichment-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.enrichment-image-item:hover {
    border-color: rgba(29, 78, 216, 0.4);
}

.enrichment-image-item.is-selected {
    border-color: #1d4ed8;
}

.enrichment-image-check {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1d4ed8;
    color: #fff;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    line-height: 1;
}

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

    .form-field-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .form-page-heading {
        flex-direction: column;
    }

    .form-page-header,
    .form-field-grid {
        grid-template-columns: 1fr;
        display: grid;
    }
}

/* ── Account manage section ──────────────────────────────── */

.account-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.account-section-head h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px;
}

.account-section-head p {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0;
}

.account-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #64748b;
    padding: 20px 0;
}

.account-empty {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 40px 0;
    color: #64748b;
    font-size: 0.875rem;
}

.account-under-construction {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 60px 20px;
    text-align: center;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
}

.account-under-construction svg {
    width: 48px;
    height: 48px;
}

.account-under-construction h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #334155;
    margin: 0;
}

.account-under-construction p {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
}

/* ── Account nav divider ─────────────────────────────────── */

.account-nav-divider {
    height: 1px;
    background: rgba(148, 163, 184, 0.2);
    margin: 4px 0;
    border: none;
}

/* ── Favorites manage list ───────────────────────────────── */

.fav-manage-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: rgba(148, 163, 184, 0.15);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    overflow: hidden;
}

.fav-manage-item {
    display: grid;
    grid-template-columns: 52px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #fff;
}

.fav-manage-item:hover {
    background: #f8fafc;
}

.fav-manage-image {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    overflow: hidden;
    background: #f1f5f9;
    flex-shrink: 0;
}

.fav-manage-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fav-manage-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #94a3b8;
}

.fav-manage-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.fav-manage-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fav-manage-name:hover {
    color: #0f3d2e;
    text-decoration: underline;
}

.fav-manage-sku {
    font-size: 0.72rem;
    color: #94a3b8;
}

.fav-manage-price {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
}
