@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    --bg: #f1f5f9;
    --panel-bg: #ffffff;
    --panel-border: #e2e8f0;
    --panel-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 64px;
    --topbar-height: 56px;
    --content-component-max-width: 1180px;
    --sidebar-bg: #ffffff;
    --sidebar-border: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --accent-color: #4f46e5;
    --accent-hover: #4338ca;
    --danger-color: #dc2626;
    --success-color: #16a34a;
}

body {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.mobile-menu-open {
    overflow: hidden;
}

* {
    box-sizing: border-box;
}

.backoffice-layout {
    display: flex;
    flex: 1;
    position: relative;
}

/* ── Top navigation bar ─────────────────────────────── */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: var(--panel-bg);
    border-bottom: 1px solid var(--panel-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.5rem 0 0.75rem;
    z-index: 40;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.topbar-menu-btn {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
}

.topbar-menu-btn:hover {
    background: #eef2ff;
    color: var(--accent-color);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.015em;
    text-decoration: none;
    user-select: none;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.topbar-brand span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-brand-icon {
    color: var(--accent-color);
    flex-shrink: 0;
}

.topbar-brand-image {
    width: auto;
    height: auto;
    max-width: 120px;
    max-height: 28px;
    object-fit: contain;
    object-position: left center;
    flex-shrink: 0;
    border-radius: 6px;
    display: block;
}

@media (max-width: 640px) {
    .topbar-brand-image {
        max-width: 86px;
        max-height: 24px;
    }
}

.topbar-end {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.topbar-username {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: #f1f5f9;
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    padding: 0.28rem 0.65rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.topbar-logout-btn {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border: 1px solid var(--panel-border);
    background: #f8fafc;
    color: var(--text-secondary);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.topbar-logout-btn svg {
    width: 15px;
    height: 15px;
}

.topbar-logout-btn:hover {
    background: #fef2f2;
    color: var(--danger-color);
    border-color: rgba(220, 38, 38, 0.25);
}

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    transition: none;
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: 0;
    height: calc(100dvh - var(--topbar-height));
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 30;
}

.sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: none;
    z-index: 20;
}

/* backdrop is desktop-only hidden — shown on mobile via sidebar-mobile-open */
.backoffice-layout.sidebar-expanded .sidebar-backdrop {
    opacity: 0;
    pointer-events: none;
}

.backoffice-layout:not(.sidebar-ready) .sidebar,
.backoffice-layout:not(.sidebar-ready) .sidebar-backdrop,
.backoffice-layout:not(.sidebar-ready) .nav-link,
.backoffice-layout:not(.sidebar-ready) .sidebar-toggle {
    transition: none !important;
}


.sidebar-toggle:hover {
    background: #eef2ff;
}

.sidebar-title-mini,
.sidebar-title-full {
    display: none; /* title moved to topbar brand */
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    color: var(--text-secondary);
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    font-weight: 600;
    transition: none;
}

.nav-link-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    flex-shrink: 0;
}

.nav-link-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.backoffice-layout.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
    min-width: var(--sidebar-collapsed-width);
    max-width: var(--sidebar-collapsed-width);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    gap: 0.6rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.backoffice-layout.sidebar-collapsed .sidebar::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* sidebar-collapsed: sidebar-title and sidebar-user no longer exist in sidebar */

.backoffice-layout.sidebar-collapsed .nav-link {
    position: relative;
    justify-content: center;
    padding-left: 0.4rem;
    padding-right: 0.4rem;
    font-size: 0;
}

.backoffice-layout.sidebar-collapsed .nav-link::after {
    display: none;
}

.backoffice-layout.sidebar-collapsed .nav-link-icon {
    margin: 0;
}

/* sidebar-user and sidebar-logout are now in topbar */


.nav-link:hover,
.nav-link.active {
    background: #ede9fe;
    color: var(--accent-color);
}

.main-content {
    flex: 1;
    height: calc(100vh - var(--topbar-height));
    height: calc(100dvh - var(--topbar-height));
    padding: 2.5rem;
    overflow: hidden;
    min-width: 0;
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 1;
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
}

.page-content-component {
    width: min(100%, var(--content-component-max-width));
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: auto;
}

.backoffice-layout.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

.dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.dashboard-heading {
    min-width: 220px;
    flex: 1 1 auto;
}

.dashboard-header-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.75rem;
    min-width: 0;
}

.dashboard-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.35rem 0;
}

.dashboard-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin: 0;
}

.glass-panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--panel-shadow);
    margin-bottom: 0;
    min-height: 0;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.operations-toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-add,
.btn-primary {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.btn-add::before {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 6px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='M12 5v14'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.btn-add:hover,
.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-view,
.btn-neutral {
    background: #f8fafc;
    color: var(--text-primary);
    border: 1px solid var(--panel-border);
}

.btn-view:hover,
.btn-neutral:hover {
    background: #eef2f7;
    transform: translateY(-1px);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: var(--danger-color);
    color: white;
    transform: translateY(-2px);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.icon-only-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    padding: 0;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-only-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

.icon-only-btn-sm {
    width: 34px;
    height: 34px;
    min-width: 34px;
}

.icon-only-btn-sm svg {
    width: 15px;
    height: 15px;
}

.filters-panel {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.results-summary {
    margin: 1rem 0 0;
    color: var(--text-secondary);
}

/* Shared list-page content layout (Products, Categories, Users, etc.) */
.list-actions-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0;
    flex-wrap: nowrap;
}

.list-actions-bar .btn {
    min-height: 42px;
}

.list-actions-bar .btn-add {
    width: 42px;
    min-width: 42px;
    padding: 0;
    border-radius: 9px;
    font-size: 0;
    line-height: 0;
    flex: 0 0 42px;
}

.list-actions-bar .btn-add::before {
    margin-right: 0;
}

.list-filters-card {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.7rem;
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 0.72rem;
}

.list-filters-card > * {
    flex: 1 1 150px;
    min-width: 120px;
}

.list-filters-card > input[type="text"] {
    flex: 2.2 1 320px;
}

.list-filters-card > .btn {
    flex: 0 0 150px;
}

.list-filters-card > .icon-only-btn {
    flex: 0 0 42px;
    min-width: 42px;
}

.list-filters-card .btn {
    min-height: 42px;
    white-space: nowrap;
}

.list-results-summary {
    margin: 0.55rem 0 0.5rem 0;
    font-size: 0.95rem;
}

.list-bulk-form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 0.9rem;
    min-height: 0;
}

.list-bulk-actions {
    margin-bottom: 1rem;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
}

.list-bulk-actions select[name="bulk_action"] {
    width: auto;
    min-width: 220px;
    flex: 1 1 auto;
}

.list-bulk-actions .btn {
    width: auto;
    flex: 0 0 auto;
}

.list-bulk-actions .bulk-selected-count {
    white-space: nowrap;
}

.list-table-card {
    border: none;
    border-radius: 0;
    background: transparent;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.list-table-card table {
    margin-top: 0;
}

.list-table-card th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f1f5f9;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.list-table-card td:last-child {
    white-space: nowrap;
}

.list-table-card td:last-child {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.list-table-card td .btn {
    padding: 0.5rem 0.8rem;
    border-radius: 7px;
    font-size: 0.9rem;
}

.list-table-card td .icon-only-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
}

.list-table-card td .icon-only-btn svg {
    width: 15px;
    height: 15px;
}

.bulk-actions-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.bulk-selected-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.table-panel {
    overflow-x: auto;
    flex: 1 1 auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.checkbox-cell {
    width: 44px;
    text-align: center;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    width: 100%;
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
    border-color: var(--accent-color);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-secondary);
}

option {
    background: #ffffff;
    color: var(--text-primary);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    min-width: 680px;
}

th {
    text-align: left;
    padding: 1rem;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--panel-border);
}

td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

tr {
    transition: background-color 0.2s ease;
}

tr:hover {
    background: #f8fafc;
}

.sort-link {
    color: var(--text-secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.sort-link:hover {
    color: var(--text-primary);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-public,
.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-hidden,
.status-disabled {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.status-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #fecaca;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.pagination-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-row label {
    font-weight: 600;
    color: var(--text-secondary);
}

.form-error {
    color: var(--danger-color);
    font-size: 0.85rem;
    margin: 0;
}

/* Custom Checkbox */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--panel-border);
    border-radius: 4px;
    cursor: pointer;
    display: grid;
    place-content: center;
    background: #ffffff;
}

input[type="checkbox"]::before {
    content: "";
    width: 10px;
    height: 10px;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em var(--accent-color);
    transform-origin: center;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

input[type="checkbox"]:checked::before {
    transform: scale(1);
}

input[type="checkbox"]:checked {
    border-color: var(--accent-color);
}

.sidebar-footer {
    margin-top: auto;
    padding: 0.85rem 0.7rem 0.2rem;
    border-top: 1px solid var(--sidebar-border);
    display: grid;
    gap: 0.5rem;
}

.sidebar-user {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.25;
}

.sidebar-logout {
    width: 100%;
}

.sidebar-logout-power {
    width: 44px;
    height: 44px;
    margin: 0 auto;
    padding: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef2f7;
    border: 1px solid var(--panel-border);
}

.sidebar-logout-power svg {
    width: 18px;
    height: 18px;
}

.sidebar-logout-power:hover {
    background: #e2e8f0;
}

.form-panel {
    display: grid;
    gap: 1.25rem;
}

/* Shared fix for long backoffice forms: keep scrolling inside glass panel. */
.glass-panel > .form-panel.form-panel-scroll {
    height: 100%;
    min-height: 0;
    overflow: auto;
    padding-right: 0.35rem;
}

.glass-panel > .form-panel-scroll {
    height: 100%;
    min-height: 0;
    overflow: auto;
    padding-right: 0.35rem;
}

.product-form-container {
    max-width: 1000px;
    margin: 0 auto;
}

.modern-form {
    display: grid;
    gap: 1.25rem;
}

.product-form-container .form-section {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--panel-border);
}

.product-form-container .section-title {
    margin: 0 0 1rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid var(--panel-border);
    color: var(--accent-color);
    font-size: 1.08rem;
}

.product-form-container .form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

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

.product-form-container .checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    color: var(--text-primary);
}

.parent-info-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #ffffff;
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 1rem 1.1rem;
}

.parent-info-meta {
    flex: 1;
}

.parent-info-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}

.parent-info-title {
    margin: 0.25rem 0 0;
    font-weight: 600;
}

.parent-info-subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.children-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.children-title {
    margin: 0;
}

.children-empty-note {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.existing-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.image-preview-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--panel-border);
    background: #ffffff;
}

.image-remove-btn {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    z-index: 2;
    width: 1.5rem;
    height: 1.5rem;
    border: 1px solid rgba(15, 23, 42, 0.22);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.image-remove-btn:hover {
    background: rgba(185, 28, 28, 0.85);
}

.image-preview-card img {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.image-info {
    padding: 0.45rem;
    font-size: 0.74rem;
    text-align: center;
    color: var(--text-secondary);
}

.upload-area {
    padding: 1.4rem;
    border: 2px dashed var(--panel-border);
    border-radius: 10px;
    text-align: center;
    background: #ffffff;
}

.upload-area:hover,
.upload-area.highlight {
    border-color: var(--accent-color);
    background: #eef2ff;
}

.upload-instruction {
    margin: 0 0 0.8rem;
    color: var(--text-secondary);
}

.progress-item {
    margin-bottom: 0.8rem;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
    color: var(--text-secondary);
    width: 100%;
}
.progress-info .file-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 1rem;
}

.progress-bar-bg {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.progress-item.completed .progress-bar-fill {
    background: #16a34a;
}

.progress-item.error .progress-bar-fill {
    background: #dc2626;
}

.file-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.sticky-actions {
    position: sticky;
    bottom: 0;
    background: #ffffff;
    border-top: 1px solid var(--panel-border);
    padding: 1.25rem 1rem;
    margin: 2rem -1rem 0 -1rem; /* Negative margin to span full width of form */
    display: flex;
    gap: 0.75rem;
    z-index: 100;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.05);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.attr-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.55rem;
    margin-top: 0.35rem;
}

.attr-checkbox-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: #ffffff;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Make textareas span full width to avoid cramping and overlap */
.form-row:has(textarea),
.form-row-full {
    grid-column: 1 / -1;
}

.form-row-inline {
    grid-template-columns: auto 1fr;
    align-items: center;
    display: grid;
}

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

select[multiple] {
    min-height: 11rem;
}

/* Choices.js Custom Dark Theme Overrides */
.choices__inner,
.choices[data-type*="select-multiple"] .choices__inner,
.choices[data-type*="select-one"] .choices__inner {
    background: #ffffff !important;
    border: 1px solid var(--panel-border) !important;
    border-radius: 8px !important;
    padding: 0.25rem 0.5rem !important;
    min-height: 44px !important;
    color: var(--text-primary) !important;
}

.choices.is-open .choices__inner,
.choices[data-type*="select-multiple"].is-open .choices__inner {
    border-radius: 8px 8px 0 0 !important;
    border-color: var(--accent-color) !important;
}

.choices__list--multiple .choices__item {
    background-color: var(--accent-color) !important;
    border: none !important;
    border-radius: 4px !important;
    color: white !important;
}

.choices[data-type*="select-multiple"] .choices__button,
.choices[data-type*="text"] .choices__button {
    border-left: 1px solid rgba(255, 255, 255, 0.2) !important;
    margin: 0 0 0 8px !important;
    padding-left: 8px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E") !important;
    background-size: 14px 14px !important;
    background-position: center right !important;
    background-repeat: no-repeat !important;
    opacity: 0.8;
}

.choices[data-type*="select-multiple"] .choices__button:hover,
.choices[data-type*="text"] .choices__button:hover {
    opacity: 1;
}

.choices[data-type*="text"] .choices__input,
.choices[data-type*="text"] .choices__input.choices__input--cloned {
    background-color: rgba(168, 85, 247, 0.15) !important;
    color: var(--text-primary) !important;
    border: 1px dashed var(--accent-color) !important;
    border-radius: 4px !important;
    padding: 0.15rem 0.5rem 0.15rem 1.75rem !important;
    margin: 0 !important;
    width: auto !important;
    min-width: 10px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23a855f7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'%3E%3C/line%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E") !important;
    background-size: 14px 14px !important;
    background-position: 8px center !important;
    background-repeat: no-repeat !important;
    outline: none !important;
    box-shadow: none !important;
    transition: background-color 0.2s ease, border-color 0.2s ease !important;
}

.choices[data-type*="text"] .choices__input.choices__input--cloned:focus {
    background-color: rgba(168, 85, 247, 0.25) !important;
    border-style: solid !important;
}

/* Search input styling for select-multiple and select-one */
.choices[data-type*="select-multiple"] .choices__input.choices__input--cloned,
.choices[data-type*="select-one"] .choices__input.choices__input--cloned {
    background-color: #f8fafc !important;
    border: 1px solid var(--panel-border) !important;
    border-radius: 6px !important;
    color: var(--text-primary) !important;
    padding: 0.5rem 0.75rem !important;
    width: 100% !important;
    min-width: 100% !important;
    box-sizing: border-box !important;
    margin-top: 0.25rem !important;
}

.choices[data-type*="select-multiple"] .choices__input.choices__input--cloned:focus,
.choices[data-type*="select-one"] .choices__input.choices__input--cloned:focus {
    outline: none !important;
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15) !important;
}

.choices__input::placeholder {
    color: var(--text-secondary) !important;
}

.choices__list--dropdown,
.choices__list[aria-expanded] {
    background: #ffffff !important;
    border: 1px solid var(--accent-color) !important;
    border-top: none !important;
    border-radius: 0 0 8px 8px !important;
    color: var(--text-primary) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15) !important;
    z-index: 10 !important;
    box-sizing: border-box !important;
    width: 100% !important;
    margin-top: -1px !important;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted,
.choices__list[aria-expanded] .choices__item--selectable.is-highlighted {
    background-color: rgba(139, 92, 246, 0.2) !important;
}

.choices__list--dropdown .choices__item,
.choices__list[aria-expanded] .choices__item {
    color: var(--text-primary) !important;
}

.bo-file {
    padding: 0.45rem;
}

.bo-file::file-selector-button {
    background: var(--accent-color);
    color: #ffffff;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0.58rem 0.9rem;
    margin-right: 0.75rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.bo-file::file-selector-button:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.bo-file::-webkit-file-upload-button {
    background: var(--accent-color);
    color: #ffffff;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0.58rem 0.9rem;
    margin-right: 0.75rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.bo-file:hover::-webkit-file-upload-button {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.bo-checkbox {
    width: 20px;
    height: 20px;
}

.bo-inline-check {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    width: fit-content;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
}

.bo-inline-check .bo-checkbox {
    margin: 0;
    flex-shrink: 0;
}

/* ── Landing Page Manager Tab Nav ─────────────────── */
.lpm-tab-nav {
    display: flex;
    gap: 0.25rem;
    border-bottom: 2px solid var(--panel-border);
    margin-bottom: 1.25rem;
    padding-bottom: 0;
}

.lpm-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 0.6rem 1.1rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.lpm-tab-btn:hover {
    color: var(--text-primary);
    background: #f1f5f9;
}

.lpm-tab-btn--active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    background: #fff;
}

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

.landing-section-card {
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 1.1rem;
    background: #f8fafc;
    display: grid;
    gap: 1rem;
}

.landing-manager-scroll {
    height: 100%;
    min-height: 0;
    overflow: auto;
    padding-right: 0.35rem;
}


.landing-section-head h2 {
    margin: 0;
    font-size: 1.1rem;
}

.landing-section-head p {
    margin: 0.35rem 0 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-help {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.form-alert {
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.12);
    color: #fecaca;
    padding: 0.85rem 1rem;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.landing-save-actions {
    position: sticky;
    bottom: 0;
    z-index: 3;
    padding: 0.7rem 0 0;
    background: linear-gradient(to top, #ffffff 72%, rgba(255, 255, 255, 0));
}

.media-slot-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-top: 0.45rem;
    flex-wrap: wrap;
}

.media-slot-actions .btn {
    padding: 0.38rem 0.75rem;
    font-size: 0.83rem;
    border-radius: 8px;
}

.media-apply-status {
    font-size: 0.78rem;
    font-weight: 600;
}

/* ── Schema section image URL field ─────────────────── */
.schema-img-field .schema-img-input-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: nowrap;
}

.schema-img-field .schema-img-input-row input[type="text"] {
    flex: 1 1 0;
    min-width: 0;
}

.schema-img-upload-btn,
.schema-img-pick-btn {
    flex-shrink: 0;
    padding: 0.45rem 0.65rem !important;
    font-size: 0.82rem !important;
    border-radius: 8px;
    line-height: 1;
    width: auto !important;
}

.schema-img-thumb {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid var(--panel-border);
    background: #f1f5f9 center/cover no-repeat;
}

.schema-img-thumb.has-image {
    border-color: var(--accent-color);
}

/* ── Landing section head with button row ───────────── */
.landing-section-head-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.landing-section-head-row .btn {
    flex-shrink: 0;
    padding: 0.45rem 0.85rem;
    font-size: 0.84rem;
    white-space: nowrap;
}

/* ── Image Library Modal ────────────────────────────── */
.img-lib-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.img-lib-overlay[hidden] {
    display: none;
}

body.img-lib-open {
    overflow: hidden;
}

.img-lib-dialog {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    width: min(860px, 100%);
    max-height: min(88vh, 700px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.img-lib-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem 0.75rem;
    border-bottom: 1px solid var(--panel-border);
}

.img-lib-title {
    margin: 0;
    font-size: 1.1rem;
}

.img-lib-close {
    width: 34px;
    height: 34px;
    border: 1px solid var(--panel-border);
    background: #f8fafc;
    color: var(--text-secondary);
    border-radius: 8px;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}

.img-lib-close:hover {
    background: #fef2f2;
    color: var(--danger-color);
    border-color: rgba(220,38,38,0.25);
}

.img-lib-toolbar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--panel-border);
    flex-wrap: wrap;
}

.img-lib-toolbar select {
    width: auto;
    min-width: 160px;
    flex: 1 1 160px;
    padding: 0.45rem 0.75rem;
    font-size: 0.88rem;
}

.img-lib-toolbar .btn {
    flex-shrink: 0;
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
}

.img-lib-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    align-content: start;
}

.img-lib-body > p {
    grid-column: 1 / -1;
}

.img-lib-footer {
    padding: 0.65rem 1.25rem;
    border-top: 1px solid var(--panel-border);
    background: #f8fafc;
}

.img-lib-card {
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    display: flex;
    flex-direction: column;
}

.img-lib-card-thumb {
    width: 100%;
    height: 130px;
    background: #e2e8f0 center/cover no-repeat;
}

.img-lib-card-meta {
    padding: 0.6rem 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.img-lib-slot-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-color);
}

.img-lib-file-name {
    font-size: 0.76rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.img-lib-card-actions {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.img-lib-card-actions .btn {
    flex: 1 1 0;
    padding: 0.35rem 0.55rem;
    font-size: 0.75rem;
    border-radius: 7px;
    text-align: center;
    min-width: 0;
}

@media (max-width: 640px) {
    .img-lib-body {
        grid-template-columns: 1fr 1fr;
    }

    .schema-img-field .schema-img-input-row {
        flex-wrap: wrap;
    }

    .schema-img-thumb {
        display: none;
    }
}

.landing-schema-summary {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.65rem;
    flex-wrap: wrap;
}

.landing-schema-status,
.landing-schema-count {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid var(--panel-border);
    background: #ffffff;
    color: var(--text-secondary);
    padding: 0.25rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 600;
}

.landing-schema-dirty {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid var(--panel-border);
    background: #ffffff;
    color: var(--text-secondary);
    padding: 0.25rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 600;
}

.landing-schema-dirty.is-saved {
    border-color: rgba(22, 163, 74, 0.24);
    color: #15803d;
    background: #f0fdf4;
}

.landing-schema-dirty.is-dirty {
    border-color: rgba(245, 158, 11, 0.28);
    color: #92400e;
    background: #fffbeb;
}

.landing-schema-add-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.landing-schema-add-row select {
    width: auto;
    min-width: 220px;
    flex: 1 1 260px;
}

.landing-schema-status.is-ok {
    border-color: rgba(22, 163, 74, 0.24);
    color: #15803d;
    background: #f0fdf4;
}

.landing-schema-status.is-error {
    border-color: rgba(220, 38, 38, 0.24);
    color: #b91c1c;
    background: #fef2f2;
}

.landing-schema-tools {
    display: grid;
    gap: 0.55rem;
    margin-bottom: 0.55rem;
}

.landing-schema-feedback {
    margin: 0;
    color: #15803d;
    font-size: 0.82rem;
    font-weight: 600;
}

.landing-schema-feedback.is-error {
    color: #b91c1c;
}

.landing-schema-issues {
    margin: 0;
    padding: 0.55rem 0.8rem;
    border-radius: 10px;
    border: 1px solid rgba(220, 38, 38, 0.28);
    background: #fef2f2;
    color: #991b1b;
    font-size: 0.82rem;
    display: grid;
    gap: 0.2rem;
    list-style: disc;
    list-style-position: inside;
}

.landing-schema-issues[hidden] {
    display: none;
}

.landing-schema-issue-link {
    border: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.landing-schema-issue-link:hover {
    color: #7f1d1d;
}

.landing-schema-file-input {
    display: none;
}

.landing-schema-workspace {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: 1fr;
    min-height: 400px;
}

.landing-schema-pane {
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    background: #ffffff;
    padding: 0.65rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.landing-schema-pane-head {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.landing-schema-pane textarea {
    flex: 1;
    min-height: 280px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.83rem;
    line-height: 1.45;
    resize: vertical;
}

.landing-schema-editor {
    display: grid;
    gap: 0.9rem;
    min-height: 280px;
    align-content: start;
}

.landing-schema-preview {
    min-height: 280px;
    display: grid;
    align-content: start;
}

.preview-card {
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: linear-gradient(155deg, #ffffff, #f6f9ff);
    padding: 0.9rem;
    display: grid;
    gap: 0.55rem;
    color: #1f2a37;
}

.preview-card h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.preview-card p {
    margin: 0;
    color: #4b5563;
    font-size: 0.84rem;
}

.preview-card button {
    width: fit-content;
    border: 0;
    border-radius: 999px;
    background: #0f172a;
    color: #ffffff;
    padding: 0.38rem 0.75rem;
    font-size: 0.76rem;
    font-weight: 600;
}

.preview-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.67rem;
    font-weight: 700;
    color: #6366f1;
}

.preview-hero {
    position: relative;
    overflow: hidden;
    min-height: 220px;
}

.preview-hero-media {
    position: absolute;
    inset: 0;
    background: linear-gradient(130deg, #c7d2fe, #dbeafe);
}

.preview-hero-media.has-image {
    background: linear-gradient(130deg, #64748b, #1e293b);
}

.preview-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.16), rgba(15, 23, 42, 0.62));
}

.preview-hero-content {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 0.5rem;
    color: #f8fafc;
}

.preview-hero-content .preview-eyebrow,
.preview-hero-content p {
    color: #e2e8f0;
}

.preview-hero-content button {
    background: #f8fafc;
    color: #111827;
}

.preview-counter {
    font-size: 0.7rem;
    font-weight: 600;
    color: #dbeafe;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
}

.preview-chip {
    border-radius: 8px;
    background: #e2e8f0;
    color: #334155;
    padding: 0.4rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.preview-products {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
}

.preview-product {
    border-radius: 8px;
    height: 48px;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    border: 1px solid #bfdbfe;
}

.preview-faq {
    display: grid;
    gap: 0.45rem;
}

.preview-faq-row {
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #ffffff;
    padding: 0.5rem;
    display: grid;
    gap: 0.2rem;
}

.preview-faq-row strong {
    font-size: 0.77rem;
    color: #1f2937;
}

.preview-faq-row span,
.preview-hint {
    font-size: 0.72rem;
    color: #6b7280;
}

.landing-schema-editor-grid {
    gap: 1rem;
}

.landing-schema-editor-grid textarea {
    min-height: 150px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.83rem;
}

.landing-schema-list {
    flex: 1;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    padding: 0.7rem;
    margin-bottom: 0;
    overflow-y: auto;
}

.landing-schema-search-wrap {
    margin-bottom: 0.6rem;
}

.landing-schema-search {
    width: 100%;
}

.landing-schema-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}

.landing-schema-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    background: #f8fafc;
    padding: 0.55rem 0.65rem;
    cursor: pointer;
}

.landing-schema-item.is-selected {
    border-color: rgba(79, 70, 229, 0.45);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
    background: #eef2ff;
}

.landing-schema-item.is-dragging {
    opacity: 0.55;
}

.landing-schema-item.is-drop-target {
    border-color: rgba(79, 70, 229, 0.5);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
}

.landing-schema-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    border-radius: 999px;
    border: 1px solid rgba(79, 70, 229, 0.25);
    padding: 0.2rem 0.45rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent-color);
    background: #eef2ff;
    cursor: grab;
}

.landing-schema-meta {
    flex: 1;
    min-width: 220px;
    color: var(--text-primary);
    font-size: 0.86rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.landing-schema-item-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.landing-schema-item-btn {
    border: 1px solid var(--panel-border);
    background: #ffffff;
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 0.28rem 0.48rem;
    font: inherit;
    font-size: 0.73rem;
    font-weight: 600;
    cursor: pointer;
}

.landing-schema-item-btn:hover:not(:disabled) {
    background: #eef2ff;
    color: var(--accent-color);
}

.landing-schema-item-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.landing-schema-remove {
    border: 1px solid rgba(220, 38, 38, 0.25);
    background: #fef2f2;
    color: #b91c1c;
    border-radius: 8px;
    padding: 0.35rem 0.6rem;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
}

.landing-schema-remove:hover {
    background: #fee2e2;
}

@media (min-width: 980px) {
    .landing-schema-workspace {
        grid-template-columns: 1fr 1fr;
    }

    .landing-schema-editor-pane {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .landing-schema-item {
        align-items: flex-start;
    }

    .landing-schema-item-controls {
        width: 100%;
        justify-content: flex-start;
    }

    .landing-schema-remove {
        margin-left: auto;
    }

    .preview-products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .preview-hero {
        min-height: 200px;
    }
}

.upload-progress {
    display: grid;
    gap: 0.45rem;
}

.upload-progress-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
    border: 1px solid #cbd5e1;
}

.upload-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent-color), #6366f1);
    transition: width 0.2s ease;
}

.upload-progress-text {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
}

.inline-images-panel {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--panel-border);
}

.inline-images-header {
    margin-bottom: 1rem;
}

.inline-images-header h2 {
    margin: 0 0 0.35rem;
}

.inline-images-header p {
    margin: 0;
    color: var(--text-secondary);
}

.product-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.product-image-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem;
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    background: var(--panel-bg);
}

.product-image-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
}

.product-image-meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    color: var(--text-secondary);
    word-break: break-word;
}

.product-image-delete-form {
    margin-top: auto;
}

.inline-empty-state {
    color: var(--text-secondary);
}

.danger-panel {
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.1);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.danger-panel h3 {
    margin: 0 0 0.45rem 0;
    color: #fecaca;
}

.danger-panel p {
    margin: 0;
    color: #fca5a5;
}

.delete-target-card {
    margin-bottom: 1rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    padding: 1rem;
    display: grid;
    gap: 0.75rem;
}

.stat-card h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-secondary);
}

.stat-value {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
}

.stat-meta {
    margin: 0;
    color: var(--text-secondary);
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
}

.login-card {
    width: min(460px, 100%);
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    box-shadow: var(--panel-shadow);
    border-radius: 16px;
    padding: 2rem;
}

.login-title {
    margin: 0;
    font-size: 2rem;
}

.login-subtitle {
    margin: 0.35rem 0 1.5rem 0;
    color: var(--text-secondary);
}

.login-form {
    display: grid;
    gap: 1rem;
}

.login-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.login-art {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.login-art::before,
.login-art::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    filter: blur(42px);
    opacity: 0.6;
}

.login-art::before {
    width: 360px;
    height: 360px;
    left: -70px;
    top: -80px;
    background: rgba(16, 185, 129, 0.35);
}

.login-art::after {
    width: 300px;
    height: 300px;
    right: -70px;
    bottom: -50px;
    background: rgba(139, 92, 246, 0.35);
}

.wizard-shell {
    display: grid;
    gap: 1.4rem;
}

.wizard-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    background: var(--panel-bg);
}

.wizard-title {
    margin: 0;
    font-size: 1.55rem;
}

.wizard-subtitle {
    margin: 0.35rem 0 0;
    color: var(--text-secondary);
}

.wizard-progress-pill {
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.14);
    border-radius: 999px;
    padding: 0.42rem 0.72rem;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.stepper {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
}

.step {
    border-radius: 10px;
    border: 1px solid var(--panel-border);
    padding: 0.65rem 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-align: center;
    background: #f8fafc;
}

.step.completed {
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.12);
}

.step.active {
    color: #ffffff;
    border-color: rgba(139, 92, 246, 0.55);
    background: rgba(139, 92, 246, 0.2);
    box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.2);
}

.wizard-form {
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    padding: 1.25rem;
    background: var(--panel-bg);
}

.wizard-grid {
    gap: 1rem 1.25rem;
}

.wizard-actions {
    justify-content: flex-end;
    border-top: 1px solid var(--panel-border);
    padding-top: 1rem;
}

.wizard-actions-left {
    justify-content: flex-start;
}

.wizard-upload-panel {
    gap: 1rem;
}

.wizard-upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.wizard-gallery-head h3 {
    margin: 0;
    font-size: 1.1rem;
}

.wizard-gallery-head p {
    margin: 0.35rem 0 0;
    color: var(--text-secondary);
}

.wizard-image-grid {
    margin-top: 1rem;
}

.wizard-image-card {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.wizard-inline-form {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.wizard-inline-form input[type='text'] {
    min-width: 0;
}

.wizard-order-form {
    justify-content: flex-start;
}

.wizard-delete-form {
    margin-top: 0.35rem;
}

.wizard-next-form {
    margin-top: 1.4rem;
    display: flex;
    justify-content: flex-end;
}

.wizard-price-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 1200px) {
    .main-content {
        padding: 2rem;
    }

    .dashboard-title {
        font-size: 2rem;
    }

    .glass-panel {
        padding: 1.5rem;
        }

    .list-filters-card > input[type="text"] {
        flex-basis: 260px;
    }

}

@media (max-width: 980px) {
    /* Sidebar becomes a fixed left drawer; topbar handles the toggle */
    .sidebar {
        width: min(var(--sidebar-width), calc(100vw - 2.5rem));
        min-width: min(var(--sidebar-width), calc(100vw - 2.5rem));
        max-width: min(var(--sidebar-width), calc(100vw - 2.5rem));
        transform: translateX(-100%);
        box-shadow: 4px 0 20px rgba(15, 23, 42, 0.1);
        /* width/height inherited from base — stays fixed left */
    }

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

    .backoffice-layout.sidebar-mobile-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    /* Reset desktop-collapsed overrides on mobile (JS clears the class anyway) */
    .backoffice-layout.sidebar-collapsed .sidebar {
        width: min(var(--sidebar-width), calc(100vw - 2.5rem));
        min-width: min(var(--sidebar-width), calc(100vw - 2.5rem));
        max-width: min(var(--sidebar-width), calc(100vw - 2.5rem));
        padding: 1rem 0.75rem;
        gap: 0.25rem;
        scrollbar-width: auto;
        -ms-overflow-style: auto;
    }

    .backoffice-layout.sidebar-collapsed .sidebar::-webkit-scrollbar {
        width: auto;
        height: auto;
    }

    .backoffice-layout.sidebar-collapsed .nav-link {
        justify-content: flex-start;
        font-size: inherit;
        padding: 0.65rem 0.85rem;
    }

    .main-content {
        padding: 1.5rem;
        margin-left: 0;
        justify-content: stretch;
    }

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

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

    .wizard-upload-grid,
    .wizard-price-grid,
    .stepper {
        grid-template-columns: 1fr;
    }

    table {
        min-width: 620px;
    }

    .list-actions-bar {
        justify-content: stretch;
        flex-wrap: wrap;
    }

    .list-actions-bar .btn {
        flex: 1;
    }

    .list-actions-bar .btn-add {
        flex: 0 0 42px;
    }

    .list-filters-card > * {
        flex: 1 1 calc(50% - 0.35rem);
    }

    .list-filters-card > input[type="text"] {
        flex: 1 1 100%;
    }

    .list-filters-card > select {
        flex: 1 1 calc(100% - 110px);
    }

    .list-filters-card > .icon-only-btn {
        flex: 0 0 42px;
    }

    .list-table-card {
        max-height: none;
        overflow-x: auto;
        overflow-y: visible;
    }

    .table-panel {
        max-height: none;
    }
}

@media (max-width: 640px) {

    .topbar {
        padding: 0 0.875rem 0 0.5rem;
        gap: 0.5rem;
    }

    .topbar-brand {
        gap: 0.4rem;
        font-size: 0.95rem;
    }

    .topbar-username {
        display: none;
    }

    .main-content {
        height: auto;
        min-height: calc(100dvh - var(--topbar-height));
        padding: 1rem;
        margin-left: 0;
    }



    .glass-panel {
        padding: 1rem;
    }

    .operations-toolbar,
    .filters-panel,
    .form-actions,
    .login-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .dashboard-header-actions > * {
        width: 100%;
    }

    .dashboard-title {
        font-size: 1.8rem;
    }

    .dashboard-subtitle {
        font-size: 1rem;
    }

    .btn {
        width: 100%;
    }

    .login-card {
        padding: 1.25rem;
    }

    th,
    td {
        padding: 0.75rem;
    }

    .wizard-topline {
        flex-direction: column;
        align-items: flex-start;
    }

    .wizard-inline-form,
    .wizard-order-form {
        flex-direction: column;
        align-items: stretch;
    }

    .pagination-bar {
        justify-content: stretch;
    }

    .list-filters-card > * {
        flex: 1 1 100%;
    }

    .list-filters-card > select {
        flex: 1 1 calc(100% - 110px);
    }

    .list-filters-card > .icon-only-btn {
        flex: 0 0 42px;
    }

    .list-results-summary {
        font-size: 0.9rem;
    }

    .list-actions-bar .btn-add {
        width: 42px;
    }

    .list-bulk-actions {
        flex-wrap: wrap;
    }

    .list-bulk-actions select[name="bulk_action"],
    .list-bulk-actions .btn {
        width: 100%;
    }



    table {
        min-width: 560px;
    }

    .list-table-card td:last-child {
        gap: 0.35rem;
    }

    .list-table-card td .icon-only-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

    .list-table-card td .icon-only-btn svg {
        width: 14px;
        height: 14px;
    }
}

/* ═══════════════════════════════════════════════════════════
   LANDING PAGE MANAGER — Complete UI
   ═══════════════════════════════════════════════════════════ */

/* ── Tab Navigation ─────────────────────────────────────── */
.lpm-tab-nav {
    display: flex;
    gap: 0.25rem;
    border-bottom: 2px solid var(--panel-border);
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

.lpm-tab-btn {
    position: relative;
    padding: 0.65rem 1.1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: color 0.2s, background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.lpm-tab-btn svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.lpm-tab-btn:hover {
    color: var(--accent-color);
    background: rgba(79, 70, 229, 0.05);
}

.lpm-tab-btn--active {
    color: var(--accent-color);
    background: rgba(79, 70, 229, 0.08);
}

.lpm-tab-btn--active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-color);
    border-radius: 2px 2px 0 0;
}

.lpm-tab-panel {
    animation: lpmFadeIn 0.18s ease;
}

@keyframes lpmFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Section Cards ──────────────────────────────────────── */
.landing-section-card {
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    background: #fafbfc;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.landing-section-head {
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--panel-border);
    background: #f8fafc;
}

.landing-section-head h2 {
    margin: 0 0 0.2rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.landing-section-head p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.landing-section-head-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.landing-section-body {
    padding: 1.5rem;
}

/* ── Toggle Switch (Section Visibility) ─────────────────── */
.lpm-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.5rem;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
}

.lpm-toggle-label {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.lpm-toggle-label strong {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
}

.lpm-toggle-label span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.lpm-toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    flex-shrink: 0;
}

.lpm-toggle-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
}

.lpm-toggle-switch input[type="checkbox"]::before {
    display: none;
}

.lpm-toggle-track {
    width: 42px;
    height: 24px;
    background: #cbd5e1;
    border-radius: 999px;
    transition: background 0.2s;
    position: relative;
    flex-shrink: 0;
}

.lpm-toggle-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.lpm-toggle-switch input[type="checkbox"]:checked ~ .lpm-toggle-track {
    background: var(--accent-color);
}

.lpm-toggle-switch input[type="checkbox"]:checked ~ .lpm-toggle-track::after {
    transform: translateX(18px);
}

.lpm-toggle-text {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 32px;
}

/* ── Form Grid inside section body ─────────────────────── */
.lpm-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 1.5rem;
    padding: 1.5rem;
}

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

.lpm-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.lpm-field label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.lpm-field .form-help {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
}

.lpm-field .form-error {
    font-size: 0.8rem;
    color: var(--danger-color);
    margin: 0;
}

/* ── Alignment Pill Picker ──────────────────────────────── */
.lpm-alignment-picker {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.lpm-alignment-picker .lpm-pill-option {
    display: none;
}

.lpm-alignment-picker .lpm-pill-label {
    padding: 0.45rem 1rem;
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    background: #ffffff;
    transition: all 0.15s;
    user-select: none;
}

.lpm-alignment-picker .lpm-pill-option:checked + .lpm-pill-label {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #ffffff;
}

/* ── Slider Input ───────────────────────────────────────── */
.lpm-slider-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.lpm-slider-wrap input[type="range"] {
    flex: 1;
    height: 4px;
    accent-color: var(--accent-color);
    padding: 0;
    border: none;
    background: transparent;
    width: auto;
}

.lpm-slider-val {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 2.5rem;
    text-align: right;
}

/* ── Image Slot (with drag-drop area) ──────────────────── */
.lpm-image-slot {
    border: 2px dashed var(--panel-border);
    border-radius: 10px;
    background: #f8fafc;
    overflow: hidden;
    transition: border-color 0.2s;
}

.lpm-image-slot:hover,
.lpm-image-slot.drag-over {
    border-color: var(--accent-color);
    background: rgba(79, 70, 229, 0.03);
}

.lpm-image-slot-preview {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.lpm-image-slot-preview-placeholder {
    width: 100%;
    height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
}

.lpm-image-slot-preview-placeholder svg {
    width: 32px;
    height: 32px;
    opacity: 0.5;
}

.lpm-image-slot-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-top: 1px solid var(--panel-border);
    background: #ffffff;
    flex-wrap: wrap;
    align-items: center;
}

.lpm-image-slot-actions .btn {
    padding: 0.4rem 0.85rem;
    font-size: 0.82rem;
    border-radius: 6px;
}

.lpm-image-slot-url {
    flex: 1;
    min-width: 0;
    font-size: 0.8rem;
    padding: 0.4rem 0.65rem;
    border-radius: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-secondary);
    border: 1px solid var(--panel-border);
    background: #f8fafc;
}

/* ── Category Cards Grid ────────────────────────────────── */
.lpm-category-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    padding: 1.5rem;
}

.lpm-category-card {
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    background: #ffffff;
    overflow: hidden;
}

.lpm-category-card-head {
    padding: 0.65rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--panel-border);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lpm-category-card-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.lpm-category-card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ── Live Preview ───────────────────────────────────────── */
.lpm-preview-panel {
    background: var(--text-primary);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.15);
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    margin-bottom: 1.5rem;
}

.lpm-preview-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    background: #1e293b;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.lpm-preview-bar-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.lpm-preview-bar-dots {
    display: flex;
    gap: 0.35rem;
}

.lpm-preview-bar-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.lpm-preview-bar-dot:nth-child(1) { background: #ef4444; }
.lpm-preview-bar-dot:nth-child(2) { background: #f59e0b; }
.lpm-preview-bar-dot:nth-child(3) { background: #22c55e; }

.lpm-preview-hero {
    position: relative;
    height: 300px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;
}

.lpm-preview-hero-bg {
    position: absolute;
    inset: 0;
    object-fit: cover;
    width: 100%;
    height: 100%;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.lpm-preview-hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    transition: opacity 0.3s;
}

.lpm-preview-hero-content {
    position: relative;
    z-index: 1;
    max-width: 340px;
}

.lpm-preview-hero-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 0.5rem;
    line-height: 1.3;
}

.lpm-preview-hero-sub {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.75);
    margin: 0 0 0.85rem;
    line-height: 1.5;
}

.lpm-preview-hero-btn {
    display: inline-block;
    padding: 0.45rem 1.1rem;
    background: #A6892B;
    color: #000;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ── Schema editor (improved) ───────────────────────────── */
.landing-schema-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.82rem;
    margin-bottom: 0.75rem;
}

.landing-schema-status {
    padding: 0.22rem 0.6rem;
    border-radius: 6px;
    font-weight: 700;
    background: rgba(22, 163, 74, 0.1);
    color: var(--success-color);
    font-size: 0.78rem;
}

.landing-schema-status.is-error {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger-color);
}

.landing-schema-count {
    color: var(--text-secondary);
    font-weight: 600;
}

.landing-schema-dirty {
    padding: 0.22rem 0.6rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    background: #f1f5f9;
    color: var(--text-secondary);
}

.landing-schema-dirty.is-dirty {
    background: rgba(234, 179, 8, 0.12);
    color: #92400e;
}

.landing-schema-dirty.is-saved {
    background: rgba(22, 163, 74, 0.08);
    color: var(--success-color);
}

.landing-schema-add-row {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 0.75rem;
}

.landing-schema-add-row select {
    width: auto;
    flex: 1;
    min-width: 160px;
    max-width: 260px;
}

.landing-schema-tools {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    align-items: center;
}

.landing-schema-tools .btn {
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
}

.landing-schema-tools .form-help {
    flex-basis: 100%;
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
}

.landing-schema-feedback {
    font-size: 0.82rem;
    color: var(--success-color);
    min-height: 1.2rem;
    margin: 0.25rem 0 0;
}

.landing-schema-feedback.is-error {
    color: var(--danger-color);
}

.landing-schema-issues {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.landing-schema-issues li {
    font-size: 0.8rem;
    color: var(--danger-color);
}

.landing-schema-issue-link {
    background: none;
    border: none;
    color: var(--danger-color);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    font-family: inherit;
}

.landing-schema-search-wrap {
    padding: 0.5rem;
    border-bottom: 1px solid var(--panel-border);
}

.landing-schema-search {
    width: 100%;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
}

/* ── Page Builder (No-Code Schema Editor) ──────────────── */
.builder-workspace {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 0;
    background: #ffffff;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    overflow: hidden;
    min-height: 600px;
}

.builder-sidebar {
    background: #f8fafc;
    border-right: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
}

.builder-sidebar-head {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--panel-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f1f5f9;
}

.builder-sidebar-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    margin: 0;
}

.builder-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.builder-add-area {
    padding: 1rem;
    border-top: 1px solid var(--panel-border);
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.builder-main {
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.builder-main-head {
    padding: 1.15rem 1.5rem;
    border-bottom: 1px solid var(--panel-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.builder-main-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.builder-main-type {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #ede9fe;
    color: var(--accent-color);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.builder-main-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.builder-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    text-align: center;
    gap: 1rem;
}

.builder-empty-state svg {
    width: 48px;
    height: 48px;
    opacity: 0.3;
}

/* Field styling for no-code editor */
.builder-field-group {
    margin-bottom: 1.5rem;
}

.builder-field-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.builder-field-help {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.builder-image-picker {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: #f8fafc;
}

.builder-image-thumb {
    width: 64px;
    height: 64px;
    border-radius: 6px;
    background-color: #e2e8f0;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.builder-image-thumb.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

.builder-image-thumb.empty svg {
    width: 24px;
    height: 24px;
}

.builder-image-actions {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.builder-array-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.builder-array-item {
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
}

.builder-array-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    background: #f1f5f9;
    border-bottom: 1px solid var(--panel-border);
    font-size: 0.8rem;
    font-weight: 600;
}

.builder-array-item-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (max-width: 980px) {
    .builder-workspace {
        grid-template-columns: 1fr;
        grid-template-rows: 400px 1fr;
    }
    .builder-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--panel-border);
    }
}

.lpm-section-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s;
    user-select: none;
}

.lpm-section-item:hover {
    background: #f1f5f9;
}

.lpm-section-item.is-selected {
    background: rgba(79, 70, 229, 0.06);
    border-color: rgba(79, 70, 229, 0.2);
}

.lpm-section-item.is-hidden {
    opacity: 0.5;
}

.lpm-section-drag-handle {
    cursor: grab;
    color: var(--text-secondary);
    opacity: 0.45;
    flex-shrink: 0;
    display: flex;
}

.lpm-section-drag-handle svg {
    width: 14px;
    height: 14px;
}

.lpm-section-type-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.18rem 0.5rem;
    border-radius: 4px;
    background: #ede9fe;
    color: var(--accent-color);
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.lpm-section-id {
    flex: 1;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.lpm-section-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.lpm-section-action-btn {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 5px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: background 0.15s, color 0.15s;
}

.lpm-section-action-btn:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.lpm-section-action-btn.delete-btn:hover {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger-color);
}

.lpm-section-action-btn svg {
    width: 13px;
    height: 13px;
}

/* ── Editor Fields ─────────────────────────────────────── */
.lpm-editor-field-group {
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.lpm-editor-field-group-head {
    padding: 0.45rem 0.75rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--panel-border);
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.lpm-editor-field-group-body {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.lpm-editor-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.lpm-editor-field label {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.lpm-editor-field input,
.lpm-editor-field textarea,
.lpm-editor-field select {
    font-size: 0.84rem;
    padding: 0.45rem 0.65rem;
}

/* ── Media Slot (inside Media tab) ─────────────────────── */
.media-slot-group {
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    background: #ffffff;
    overflow: hidden;
}

.media-slot-group > label {
    display: block;
    padding: 0.6rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--panel-border);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
}

.media-slot-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    padding: 0.6rem 1rem;
    border-top: 1px solid var(--panel-border);
    background: #fafbfc;
}

.media-slot-actions .btn {
    padding: 0.4rem 0.85rem;
    font-size: 0.82rem;
}

.media-apply-status {
    font-size: 0.8rem;
    color: var(--success-color);
    font-weight: 600;
}

.lpm-media-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    padding: 1.5rem;
}

/* ── Upload Progress ────────────────────────────────────── */
.upload-progress {
    margin-top: 1rem;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 1rem;
    background: #f8fafc;
}

.upload-progress-track {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.upload-progress-fill {
    height: 100%;
    background: var(--accent-color);
    border-radius: 3px;
    transition: width 0.3s;
}

.upload-progress-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ── Save Actions Bar ───────────────────────────────────── */
.landing-save-actions {
    position: sticky;
    bottom: 0;
    z-index: 10;
    padding: 0.9rem 1.5rem;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(6px);
    border-top: 1px solid var(--panel-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1.5rem 0 0;
    border-radius: 0 0 12px 12px;
}

.landing-save-actions .btn {
    min-width: 160px;
}

.landing-save-status {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ── Image Library Modal ────────────────────────────────── */
.img-lib-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(3px);
}

.img-lib-dialog {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    width: min(700px, 100%);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.img-lib-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--panel-border);
}

.img-lib-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.img-lib-close {
    width: 34px;
    height: 34px;
    border: 1px solid var(--panel-border);
    background: #f8fafc;
    border-radius: 8px;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: background 0.15s, color 0.15s;
}

.img-lib-close:hover {
    background: #fef2f2;
    color: var(--danger-color);
    border-color: rgba(220,38,38,0.2);
}

.img-lib-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.5rem;
    border-bottom: 1px solid var(--panel-border);
    background: #f8fafc;
    flex-wrap: wrap;
}

.img-lib-toolbar select {
    width: auto;
    flex: 1;
    min-width: 150px;
    font-size: 0.88rem;
    padding: 0.5rem 0.75rem;
}

.img-lib-toolbar .btn {
    flex-shrink: 0;
    font-size: 0.88rem;
    padding: 0.5rem 1rem;
}

.img-lib-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    align-content: start;
}

.img-lib-body > p {
    grid-column: 1 / -1;
}

.img-lib-card {
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.img-lib-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: rgba(79,70,229,0.2);
}

.img-lib-card-thumb {
    width: 100%;
    aspect-ratio: 4/3;
    background-size: cover;
    background-position: center;
    background-color: #f1f5f9;
    transition: opacity 0.15s;
}

.img-lib-card-meta {
    padding: 0.65rem 0.75rem;
    border-top: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.img-lib-slot-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-color);
    background: rgba(79,70,229,0.08);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    align-self: flex-start;
}

.img-lib-file-name {
    font-size: 0.78rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.img-lib-card-actions {
    display: flex;
    gap: 0.35rem;
}

.img-lib-copy-btn,
.img-lib-use-btn,
.img-lib-del-btn {
    flex: 1;
    font-size: 0.74rem;
    padding: 0.35rem 0.45rem;
    border-radius: 6px;
}

.img-lib-footer {
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--panel-border);
    background: #f8fafc;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* ── Form Panel scroll on landing manager ───────────────── */
.landing-manager-scroll {
    flex: 1;
    overflow: visible;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 980px) {
    .lpm-form-grid,
    .lpm-category-grid,
    .lpm-media-grid,
    .landing-schema-workspace {
        grid-template-columns: 1fr;
    }

    .img-lib-body {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .lpm-tab-btn {
        font-size: 0.82rem;
        padding: 0.55rem 0.8rem;
    }

    .landing-save-actions {
        margin: 1rem 0 0;
        padding: 0.75rem 1rem;
    }

    .img-lib-body {
        grid-template-columns: 1fr 1fr;
    }

    .img-lib-dialog {
        border-radius: 12px;
    }
}

/* UI Component: File Input */
.custom-file-upload {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    padding: 8px;
    cursor: pointer;
}
.custom-file-upload:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}
.custom-file-upload:hover .custom-file-btn {
    background: #e2e8f0;
    border-color: #94a3b8;
    color: #0f172a;
}
.custom-file-input {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0; cursor: pointer;
}
.custom-file-btn {
    background: #f1f5f9;
    color: #475569;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 12px;
    font-weight: 600;
    pointer-events: none;
    border: 1px solid #cbd5e1;
    transition: all 0.2s ease;
}
.custom-file-text {
    color: #111827;
    font-size: 14px;
    flex: 1;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* UI Component: Custom Dropdown */
.custom-select-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.list-filters-card > .custom-select-wrapper {
    flex: 1 1 150px;
    min-width: 120px;
}

@media (max-width: 980px) {
    .list-filters-card > .custom-select-wrapper {
        flex: 1 1 calc(100% - 110px);
    }
}
@media (max-width: 640px) {
    .list-filters-card > .custom-select-wrapper {
        flex: 1 1 calc(100% - 110px);
    }
}

.list-bulk-actions .custom-select-wrapper {
    width: auto;
    min-width: 220px;
}

.custom-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 0.55rem 0.85rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
    min-height: 40px;
}

.custom-select-trigger:hover {
    border-color: #cbd5e1;
}

.custom-select-wrapper.is-open .custom-select-trigger {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.custom-select-trigger svg {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.custom-select-wrapper.is-open .custom-select-trigger svg {
    transform: rotate(180deg);
}

.custom-select-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    margin: 0;
    padding: 0.35rem 0;
    list-style: none;
}

.custom-select-wrapper.is-open .custom-select-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-select-option {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.custom-select-option:hover {
    background-color: #f8fafc;
}

.custom-select-option.is-selected {
    background-color: #f1f5f9;
    color: var(--accent-color);
    font-weight: 600;
}

/* ── Button Loading Spinner (global) ── */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}
.btn-loading::after {
    content: '';
    position: absolute;
    right: 0.625rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0.875rem;
    height: 0.875rem;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 9999px;
    animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin { to { transform: translateY(-50%) rotate(360deg); } }

/* ── Tabs Navigation ── */
.nav-tabs {
    display: flex;
    gap: 1.5rem;
    padding: 0;
    margin: 0 0 1.5rem 0;
    list-style: none;
    border-bottom: 2px solid var(--panel-border);
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
}
.nav-tabs::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}
.tab-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px; /* overlap the border-bottom of .nav-tabs */
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}
.tab-link:hover {
    color: var(--text-primary);
}
.tab-link.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    font-weight: 600;
}
.tab-link.has-error {
    color: var(--danger-color);
}
.tab-link.has-error.active {
    border-bottom-color: var(--danger-color);
}
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}
.tab-content.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.5 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
    background-color: #cbd5e1 !important;
    box-shadow: none !important;
}

