.image-manager-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.image-manager-head h2 {
    margin: 12px 0 2px;
}

.image-manager-head p {
    color: var(--muted);
    margin: 0;
}

.image-manager-head .muted {
    margin-left: 8px;
}

.image-status-panel {
    margin-bottom: 16px;
    border-left: 4px solid var(--ok);
}

.image-status-panel.warning {
    border-left-color: var(--warn);
}

.image-status-panel.error {
    border-left-color: var(--danger);
}

.image-status-panel .text-danger {
    color: var(--danger);
}

.image-toolbar {
    margin-bottom: 16px;
}

.image-selection-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.image-selection-form label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.image-selection-form .input {
    max-width: 320px;
}

.image-offline-note {
    color: var(--warn);
    margin: 12px 0 0;
}

.image-actions-grid {
    margin-bottom: 16px;
}

.image-action-form {
    display: grid;
    gap: 8px;
}

.image-action-form label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text) !important;
    font-weight: 400 !important;
}

.image-empty-state {
    border: 1px dashed var(--border);
    border-radius: 10px;
    color: var(--muted);
    padding: 32px 16px;
    text-align: center;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.image-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-2);
}

.image-thumb {
    align-items: center;
    background: var(--bg-3, var(--bg-1));
    display: flex;
    height: 170px;
    justify-content: center;
    overflow: hidden;
}

.image-thumb img {
    height: 100%;
    object-fit: contain;
    width: 100%;
}

.image-placeholder {
    color: var(--muted);
    font-size: 12px;
}

.image-card-body {
    display: grid;
    gap: 10px;
    padding: 14px;
}

.image-card-body h4 {
    font-size: 14px;
    margin: 0;
    overflow-wrap: anywhere;
}

.image-meta,
.image-badges,
.image-card-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.image-meta {
    color: var(--muted);
    font-size: 11px;
    justify-content: space-between;
}

.image-card-actions .image-action-form {
    flex: 1 1 100%;
    grid-template-columns: minmax(0, 1fr) auto;
}

.machine-product-edit summary {
    display: inline-flex;
    list-style: none;
}

.machine-product-edit summary::-webkit-details-marker {
    display: none;
}

.machine-product-edit-form {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: grid;
    gap: 8px;
    margin-top: 10px;
    min-width: min(520px, 80vw);
    padding: 12px;
}

.machine-product-edit-form label {
    color: var(--muted);
    display: grid;
    font-size: 12px;
    font-weight: 600;
    gap: 4px;
}

.saved-product-picker-card {
    align-items: flex-start;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: inherit;
    cursor: pointer;
    display: flex;
    font-family: inherit;
    gap: 10px;
    padding: 12px;
    text-align: left;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

.saved-product-picker-card:hover,
.saved-product-picker-card:focus-visible {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
    outline: none;
}

.pre-shop-head-actions,
.pre-shop-filter-buttons,
.pre-shop-bulk-panel .panel-inner,
.pre-shop-edit-form {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pre-shop-head-actions {
    justify-content: flex-end;
}

.pre-shop-summary-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    margin: 16px 0;
}

.pre-shop-summary-card {
    display: grid;
    gap: 6px;
    padding: 16px;
}

.pre-shop-summary-card span,
.pre-shop-summary-card small {
    color: var(--muted);
    font-size: 12px;
}

.pre-shop-summary-card strong {
    font-size: 24px;
}

.pre-shop-summary-value {
    grid-column: span 2;
}

.pre-shop-summary-value small {
    line-height: 1.45;
}

.pre-shop-bulk-panel,
.pre-shop-filter-panel {
    margin-bottom: 16px;
}

.pre-shop-bulk-panel .panel-inner {
    justify-content: space-between;
}

.pre-shop-bulk-panel p {
    margin: 4px 0 0;
}

.pre-shop-filters {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: auto minmax(220px, 1fr) auto;
}

.pre-shop-filters label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.pre-shop-filter-buttons .active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.pre-shop-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.pre-shop-card {
    border-left: 4px solid var(--border);
    display: grid;
    gap: 14px;
    padding: 16px;
}

.pre-shop-card.needs-refill {
    border-left-color: var(--warn);
}

.pre-shop-card.stocked {
    border-left-color: var(--ok);
}

.pre-shop-card.no-target {
    opacity: .88;
}

.pre-shop-card-head {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.pre-shop-card-head h4,
.pre-shop-card-head p {
    margin: 0;
}

.pre-shop-card-head p {
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
}

.pre-shop-metrics {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
}

.pre-shop-metrics div {
    background: var(--bg-2);
    border-radius: 8px;
    padding: 9px 10px;
}

.pre-shop-metrics .required-value {
    grid-column: span 2;
}

.pre-shop-metrics dt {
    color: var(--muted);
    font-size: 11px;
}

.pre-shop-metrics dd {
    font-weight: 700;
    margin: 3px 0 0;
}

.pre-shop-progress {
    background: var(--bg-2);
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}

.pre-shop-progress span {
    background: linear-gradient(90deg, var(--warn), var(--ok));
    border-radius: inherit;
    display: block;
    height: 100%;
}

.pre-shop-edit-form {
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.pre-shop-edit-form label {
    color: var(--muted);
    display: grid;
    flex: 1 1 130px;
    font-size: 11px;
    font-weight: 600;
    gap: 4px;
}

@media (max-width: 700px) {
    .image-manager-head {
        align-items: stretch;
        flex-direction: column;
    }

    .image-selection-form {
        align-items: stretch;
        flex-direction: column;
    }

    .image-selection-form .input {
        max-width: none;
    }

    .machine-product-edit-form {
        min-width: 0;
    }

    .pre-shop-summary-grid,
    .pre-shop-filters {
        grid-template-columns: 1fr;
    }

    .pre-shop-summary-value {
        grid-column: auto;
    }

    .pre-shop-head-actions,
    .pre-shop-filter-buttons,
    .pre-shop-bulk-panel .panel-inner {
        align-items: stretch;
        flex-direction: column;
    }

    .pre-shop-head-actions form,
    .pre-shop-head-actions button,
    .pre-shop-filter-buttons button,
    .pre-shop-bulk-panel form,
    .pre-shop-bulk-panel button {
        width: 100%;
    }

    .pre-shop-grid {
        grid-template-columns: 1fr;
    }
}
