:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-start: #0f172a;
    --bg-end: #1e1b4b;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --radius: 14px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

#app-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
    z-index: -1;
}

#app-bg::before,
#app-bg::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    animation: float 22s infinite alternate;
}

#app-bg::before {
    width: 500px;
    height: 500px;
    background: rgba(99, 102, 241, 0.2);
    top: -10%;
    left: -5%;
}

#app-bg::after {
    width: 600px;
    height: 600px;
    background: rgba(16, 185, 129, 0.12);
    bottom: -15%;
    right: -5%;
    animation-delay: -11s;
}

@keyframes float {
    0% {
        transform: translate(0, 0)
    }

    100% {
        transform: translate(40px, 40px)
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

/* ===== TOP STEPS BAR ===== */
.top-steps {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 12px 28px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-woo-config {
    margin-left: auto;
}

#btn-woo-config {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.offline {
    background: #ef4444;
    box-shadow: 0 0 4px rgba(239, 68, 68, 0.6);
}

.status-dot.online {
    background: #10b981;
    box-shadow: 0 0 4px rgba(16, 185, 129, 0.6);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.woo-config-popup {
    position: fixed;
    top: 56px;
    right: 20px;
    z-index: 200;
}

.woo-config-panel {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    width: 360px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease-out;
}

.woo-config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.woo-config-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-mini {
    font-weight: 700;
    font-size: 1.1rem;
    color: #818cf8;
    white-space: nowrap;
}

.logo-mini i {
    margin-right: 6px;
}

.steps-horizontal {
    list-style: none;
    display: flex;
    gap: 4px;
    flex: 1;
}

.step-h {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: default;
    transition: var(--transition);
    white-space: nowrap;
}

.step-h .step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.06);
    transition: var(--transition);
}

.step-h.active {
    color: white;
    background: rgba(99, 102, 241, 0.12);
}

.step-h.active .step-num {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
}

.step-h.completed {
    color: var(--success);
}

.step-h.completed .step-num {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

/* ===== MAIN LAYOUT ===== */
.main-full {
    padding: 0;
}

.step-content {
    animation: fadeIn 0.35s ease-out;
}

.step-content.hidden {
    display: none;
}

.step-inner.narrow {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 24px;
}

.step-inner.full {
    padding: 16px 20px;
}

/* ===== SHARED COMPONENTS ===== */
.header-area {
    margin-bottom: 24px;
}

.header-area h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-area h1 i {
    margin-right: 8px;
    color: var(--primary);
}

.header-area p {
    color: var(--text-muted);
    margin-top: 4px;
}

.mt-2 {
    margin-top: 8px;
}

.mt-4 {
    margin-top: 16px;
}

.hidden {
    display: none !important;
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-info {
    color: #38bdf8;
}

.justify-end {
    display: flex;
    justify-content: flex-end;
}

.space-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
}

.card h3 {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 1rem;
}

.input-group {
    margin-bottom: 12px;
}

.input-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 10px 14px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: white;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.help-text {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Upload */
.upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 48px 32px;
    text-align: center;
    background: rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    margin-bottom: 24px;
}

.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
}

.upload-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 12px;
}

.upload-area h3 {
    font-size: 1.15rem;
    margin-bottom: 6px;
}

.upload-area p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 16px;
    font-size: 0.82rem;
    background: rgba(255, 255, 255, 0.08);
    margin-right: 6px;
}

.badge.bg-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.82rem;
    border-radius: 6px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 3px 12px rgba(99, 102, 241, 0.25);
}

.btn-primary:not(:disabled):hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-secondary:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:not(:disabled):hover {
    background: #059669;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:not(:disabled):hover {
    background: #d97706;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:not(:disabled):hover {
    background: #dc2626;
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px dashed rgba(255, 255, 255, 0.2);
}

.btn-outline:hover {
    border-color: white;
    background: rgba(255, 255, 255, 0.04);
}

.btn-icon-only {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: var(--transition);
    font-size: 0.9rem;
}

.btn-icon-only:hover {
    color: white;
    background: rgba(255, 255, 255, 0.08);
}

.btn-icon-only.danger:hover {
    color: var(--danger);
}

.actions {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--glass-border);
}

/* ===== MAPPING (Redesigned) ===== */
.mapping-container {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.mapping-header-row {
    display: grid;
    grid-template-columns: 200px 32px 1fr 32px;
    gap: 8px;
    align-items: center;
    padding: 0 8px 12px;
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 10px;
}

.mapping-header-row i {
    margin-right: 6px;
}

.mapping-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Mapping Row */
.mrow {
    display: grid;
    grid-template-columns: 200px 32px 1fr 32px;
    gap: 8px;
    align-items: center;
    padding: 10px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(15, 23, 42, 0.25);
    transition: var(--transition);
}

.mrow:hover {
    border-color: rgba(99, 102, 241, 0.2);
    background: rgba(15, 23, 42, 0.4);
}

/* Left: WooCommerce label */
.mrow-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
}

.mrow-icon {
    color: var(--primary);
    font-size: 0.8rem;
    width: 18px;
    text-align: center;
}

.mrow-req {
    color: var(--danger);
    font-size: 0.75rem;
    margin-left: 2px;
}

/* Arrow */
.mrow-arrow {
    color: rgba(255, 255, 255, 0.15);
    font-size: 0.7rem;
    text-align: center;
}

/* Right: Excel chips area */
.mrow-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    position: relative;
}

.mrow-chips {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    flex: 1;
    min-height: 30px;
    align-items: center;
}

.mrow-empty {
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.82rem;
    font-style: italic;
}

/* Excel column chip */
.excel-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #34d399;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: default;
    transition: var(--transition);
}

.excel-chip:hover {
    background: rgba(16, 185, 129, 0.2);
}

.chip-remove {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    font-size: 0.65rem;
    padding: 1px;
    border-radius: 3px;
    transition: var(--transition);
}

.chip-remove:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* Add column button */
.mrow-add-col {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.mrow-add-col:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
}

/* Separator input */
.mrow-sep {
    width: 40px;
    padding: 4px 6px;
    font-size: 0.75rem;
    text-align: center;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f59e0b;
    border-radius: 4px;
    font-family: monospace;
}

.mrow-sep:focus {
    outline: none;
    border-color: var(--primary);
}

/* Remove button */
.mrow-remove {
    flex-shrink: 0;
}

/* Excel dropdown */
.excel-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 50;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 6px;
    min-width: 220px;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.15s ease-out;
}

.excel-dd-item {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    color: white;
}

.excel-dd-item:hover {
    background: rgba(99, 102, 241, 0.12);
}

.excel-dd-item.used {
    color: rgba(255, 255, 255, 0.25);
    cursor: default;
    text-decoration: line-through;
}

.excel-dd-item.used:hover {
    background: transparent;
}

/* Column preview popup */
.col-preview-popup {
    position: fixed;
    z-index: 200;
    background: #0f172a;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 10px;
    padding: 10px;
    min-width: 200px;
    max-width: 320px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.12s ease-out;
    pointer-events: none;
}

.cpop-header {
    font-size: 0.82rem;
    font-weight: 600;
    color: #818cf8;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 4px;
}

.cpop-row {
    font-size: 0.78rem;
    color: var(--text-muted);
    padding: 3px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cpop-idx {
    display: inline-block;
    width: 18px;
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.7rem;
    margin-right: 4px;
}

/* Add hidden field row */
.mapping-add-hidden {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    margin-top: 6px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.mapping-add-label {
    color: var(--text-muted);
    font-size: 0.82rem;
    white-space: nowrap;
}

.mapping-add-label i {
    margin-right: 4px;
    color: var(--primary);
}

.mapping-hidden-select {
    flex: 1;
    padding: 6px 10px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: white;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.85rem;
}

/* ===== GRID TOOLBAR ===== */
.grid-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.toolbar-left h2 {
    font-size: 1.15rem;
    font-weight: 600;
    white-space: nowrap;
}

.toolbar-left h2 i {
    color: var(--primary);
    margin-right: 6px;
}

#grid-summary {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

#grid-summary .sum-badge {
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
}

.toolbar-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

.toolbar-select {
    padding: 7px 12px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.85rem;
}

/* ===== BULK ACTION BAR ===== */
.bulk-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.bulk-bar span {
    font-weight: 600;
    font-size: 0.9rem;
    color: #818cf8;
}

/* ===== DATA TABLE (Compact) ===== */
.table-container {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    max-height: calc(100vh - 280px);
    overflow: auto;
}

.data-grid.compact {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
    font-size: 0.85rem;
}

.data-grid.compact th,
.data-grid.compact td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    text-align: left;
}

.data-grid.compact th {
    background: rgba(0, 0, 0, 0.4);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Header action button (e.g. discount icon) */
.th-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #f59e0b;
    font-size: 0.75rem;
    padding: 2px 4px;
    border-radius: 4px;
    transition: var(--transition);
    vertical-align: middle;
    margin-left: 2px;
}

.th-action-btn:hover {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

/* Radio card for discount modal */
.radio-card {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.88rem;
    color: var(--text-muted);
    transition: var(--transition);
    flex: 1;
}

.radio-card:has(input:checked) {
    border-color: var(--primary);
    color: white;
    background: rgba(99, 102, 241, 0.1);
}

.radio-card input {
    accent-color: var(--primary);
}

.radio-card i {
    font-size: 0.8rem;
}

.data-grid.compact tbody tr {
    transition: background 0.15s;
}

.data-grid.compact tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.data-grid.compact tbody tr.selected {
    background: rgba(99, 102, 241, 0.08) !important;
}

.data-grid.compact tbody tr.drag-over {
    border-top: 2px solid var(--primary);
}

/* Thumbnail & Image cell */
.img-cell {
    padding: 4px !important;
}

.img-wrapper {
    width: 40px;
    height: 40px;
    position: relative;
    border-radius: 6px;
    overflow: hidden;
}

.thumb-img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.3);
    display: block;
}

.thumb-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.15);
    font-size: 0.9rem;
}

/* Click to open popup overlay */
.img-wrapper:hover {
    opacity: 0.85;
    transition: opacity 0.15s;
}

/* Editable cells */
.editable-cell {
    cursor: pointer;
    border-radius: 3px;
    transition: var(--transition);
    position: relative;
}

.editable-cell:hover {
    background: rgba(99, 102, 241, 0.06);
}

.editable-cell.locked {
    cursor: default;
}

.editable-cell.locked:hover {
    background: transparent;
}

.editing input {
    width: 100%;
    min-width: 60px;
    background: #0f172a;
    color: white;
    border: 1px solid var(--primary);
    padding: 3px 6px;
    border-radius: 4px;
    outline: none;
    font-size: 0.85rem;
}

/* Cell clear btn */
.cell-clear {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.15);
    cursor: pointer;
    font-size: 0.7rem;
    padding: 2px 4px;
    border-radius: 3px;
    display: none;
}

.editable-cell:hover .cell-clear {
    display: block;
}

.cell-clear:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* Action column */
.actions-cell {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
}

/* Drag handle */
.drag-handle {
    cursor: grab;
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.8rem;
    padding: 4px;
}

.drag-handle:hover {
    color: rgba(255, 255, 255, 0.5);
}

.drag-handle:active {
    cursor: grabbing;
}

/* Type badges */
.type-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.type-simple {
    background: rgba(100, 116, 139, 0.15);
    color: #94a3b8;
}

.type-variable {
    background: rgba(99, 102, 241, 0.12);
    color: #818cf8;
}

.type-variation {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
}

/* Row styles */
.row-variable {
    border-left: 3px solid #6366f1;
}

.row-variation {
    border-left: 3px solid rgba(16, 185, 129, 0.4);
}

/* Checkbox */
.row-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* ===== IMPORT TERMINAL ===== */
.progress-box {
    margin-bottom: 20px;
}

.progress-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
    font-weight: 500;
}

.progress-bar-container {
    height: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #a78bfa);
    border-radius: 5px;
    transition: width 0.3s;
}

.progress-text {
    text-align: right;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.terminal-container {
    background: #000;
    border-radius: 8px;
    border: 1px solid #222;
    overflow: hidden;
    font-family: 'Courier New', monospace;
}

.terminal-header {
    background: #111;
    padding: 6px 14px;
    font-size: 0.8rem;
    color: #666;
    border-bottom: 1px solid #222;
}

.terminal-body {
    padding: 12px;
    height: 280px;
    overflow-y: auto;
}

.log-line {
    margin-bottom: 3px;
    font-size: 0.82rem;
    line-height: 1.3;
}

/* Image count badge */
.img-count-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 4px;
    line-height: 1.2;
}

/* ===== MODAL / POPUP ===== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.modal-panel {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 28px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.modal-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    background: rgba(99, 102, 241, 0.08);
    padding: 8px 12px;
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.modal-hint i {
    margin-right: 4px;
    color: var(--primary);
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Image Gallery */
.img-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
    min-height: 40px;
}

.img-empty {
    grid-column: 1/-1;
    text-align: center;
    padding: 24px;
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
}

.img-empty i {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 6px;
}

.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: var(--transition);
}

.gallery-item.featured {
    border-color: #f59e0b;
}

.gallery-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}

.gallery-item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 6px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}

.gallery-badge {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.gallery-badge.album {
    background: rgba(99, 102, 241, 0.3);
    color: #a78bfa;
}

.gallery-remove {
    font-size: 0.7rem !important;
    padding: 2px !important;
}

/* Add image area */
.img-add-area {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.img-url-input {
    flex: 1;
    padding: 9px 14px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.88rem;
    transition: var(--transition);
}

.img-url-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.img-url-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.img-actions-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

/* Search results */
.popup-search-result {
    margin-bottom: 10px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.search-loading {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88rem;
    padding: 10px;
}

.search-loading i {
    margin-right: 6px;
}

.search-found {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-preview {
    width: 120px;
    height: 80px;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.search-found-actions p {
    color: var(--success);
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.search-notfound {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.search-notfound i {
    margin-right: 4px;
}

.search-notfound button {
    margin: 8px 0;
}

.search-tip {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 6px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

/* ===== STEP 4 IMPORT UI ===== */
.progress-box {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--glass-border);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    text-align: center;
}

.progress-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 20px;
}

.progress-stats .stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 1.8rem;
    font-weight: 700;
}

.progress-stats .stat i {
    font-size: 1.4rem;
}

.progress-stats .stat span {
    font-size: 2rem;
    font-variant-numeric: tabular-nums;
}

.progress-stats .stat:nth-child(1) span {
    color: var(--success);
}

.progress-stats .stat:nth-child(2) span {
    color: var(--danger);
}

.progress-stats .stat:nth-child(3) span {
    color: var(--primary);
}

.progress-bar-container {
    height: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #a855f7);
    border-radius: 10px;
    transition: width 0.4s ease-out;
    position: relative;
    overflow: hidden;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progress-shine 1.5s infinite;
}

@keyframes progress-shine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.progress-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-base);
}

.terminal-container {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.terminal-header {
    background: #1e293b;
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #94a3b8;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 8px;
}

.terminal-header::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 16px 0 0 #f59e0b, 32px 0 0 #10b981;
    margin-right: 28px;
}

.terminal-body {
    height: 350px;
    overflow-y: auto;
    padding: 16px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}

.log-line {
    margin-bottom: 4px;
    word-break: break-all;
}

.log-line.text-info {
    color: #38bdf8;
}

.log-line.text-success {
    color: #34d399;
}

.log-line.text-danger {
    color: #f87171;
}

.log-line.text-warning {
    color: #fbbf24;
}

/* Error Row */
tr.row-error td {
    background-color: rgba(239, 68, 68, 0.15) !important;
    border-bottom: 1px solid rgba(239, 68, 68, 0.4) !important;
}

tr.row-error input.edit-input {
    border: 1px solid rgba(239, 68, 68, 0.8) !important;
    background: rgba(239, 68, 68, 0.1) !important;
}

/* Custom Alert Modal - Redesigned */
.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease-out;
}

.custom-alert-overlay.show {
    opacity: 1;
    visibility: visible;
}

.custom-alert-box {
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    padding: 0;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    position: relative;
    transform: translateY(20px) scale(0.95);
    transition: all 0.25s ease-out;
    overflow: hidden;
}

.custom-alert-overlay.show .custom-alert-box {
    transform: translateY(0) scale(1);
}

.custom-alert-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.custom-alert-close:hover {
    color: white;
    background: rgba(239, 68, 68, 0.2);
}

.custom-alert-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 24px 0;
}

.custom-alert-header i {
    font-size: 1.5rem;
    color: #f59e0b;
}

.custom-alert-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.custom-alert-body {
    font-size: 0.92rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    padding: 16px 24px;
}

.custom-alert-footer {
    display: flex;
    justify-content: flex-end;
    padding: 0 24px 20px;
}

.custom-alert-footer .btn {
    min-width: 100px;
    border-radius: 10px;
    font-weight: 600;
    padding: 10px 24px;
}

/* Scroll wrap in datagrid */
.val-scroll-wrap {
    display: inline-block;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
    vertical-align: middle;
}

.val-scroll-txt {
    display: inline-block;
}

/* ===== Modal System ===== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease-out;
}

.modal-panel {
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.modal-hint {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.82rem;
    color: #94a3b8;
    margin-bottom: 12px;
}

.modal-hint i {
    color: #6366f1;
    margin-right: 4px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ===== Image Gallery in Popup ===== */
.img-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 80px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    margin-bottom: 12px;
}

.img-empty {
    width: 100%;
    text-align: center;
    padding: 24px;
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
}

.img-empty i {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

.gallery-item {
    position: relative;
    width: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: grab;
    transition: all 0.2s;
    background: rgba(0, 0, 0, 0.3);
}

.gallery-item:active {
    cursor: grabbing;
}

.gallery-item.featured {
    border-color: #f59e0b;
}

.gallery-item.drag-over {
    border-color: #6366f1;
    transform: scale(1.05);
}

.gallery-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    display: block;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.gallery-item-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 6px;
    background: rgba(0, 0, 0, 0.5);
}

.gallery-badge {
    font-size: 0.65rem;
    font-weight: 600;
    color: #f59e0b;
}

.gallery-badge.album {
    color: #94a3b8;
}

.gallery-remove {
    font-size: 0.65rem !important;
    padding: 2px !important;
    opacity: 0;
    transition: opacity 0.2s;
}

.gallery-item:hover .gallery-remove {
    opacity: 1;
}

/* Image add area */
.img-add-area {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.img-url-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    color: white;
    font-size: 0.85rem;
}

.img-url-input:focus {
    border-color: var(--primary);
    outline: none;
}

.img-actions-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

/* Search result */
.popup-search-result {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.search-loading {
    color: #94a3b8;
    font-size: 0.85rem;
}

.search-loading i {
    margin-right: 6px;
}

.search-found {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-preview {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
}

.search-found-actions p {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 6px;
}

.search-notfound {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #94a3b8;
}

.search-tip {
    width: 100%;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 4px;
}

/* ===== Lightbox ===== */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
    animation: fadeIn 0.2s ease-out;
}

.lightbox-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* ===== Resize Modal (Enhanced) ===== */
.resize-tabs {
    display: flex;
    gap: 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 16px;
}

.resize-tab {
    flex: 1;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-muted);
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.resize-tab:hover {
    background: rgba(99, 102, 241, 0.08);
    color: #c7d2fe;
}

.resize-tab.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(139, 92, 246, 0.15));
    color: white;
    font-weight: 600;
    box-shadow: inset 0 -2px 0 var(--primary);
}

.resize-tab-content {
    display: none;
}

.resize-tab-content.active {
    display: block;
    animation: fadeIn 0.25s ease-out;
}

/* Template Cards */
.resize-templates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 6px;
}

.resize-tpl-card {
    background: rgba(0, 0, 0, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.25s;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.resize-tpl-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), transparent);
    opacity: 0;
    transition: opacity 0.25s;
}

.resize-tpl-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.resize-tpl-card:hover::before {
    opacity: 1;
}

.resize-tpl-card.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.12);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.3), 0 4px 16px rgba(99, 102, 241, 0.15);
}

.resize-tpl-card.selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 8px;
    right: 10px;
    color: var(--primary);
    font-size: 0.75rem;
    background: rgba(99, 102, 241, 0.2);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resize-tpl-icon {
    font-size: 1.6rem;
    margin-bottom: 8px;
    display: block;
    position: relative;
    z-index: 1;
}

.resize-tpl-name {
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 3px;
    color: white;
    position: relative;
    z-index: 1;
}

.resize-tpl-size {
    font-size: 0.75rem;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
}

/* Custom Dimension Controls */
.resize-dim-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.resize-dim-field {
    flex: 1;
}

.resize-dim-field label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 500;
}

.resize-dim-field input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    color: white;
    font-size: 0.88rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.resize-dim-field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.resize-link-btn {
    margin-top: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.resize-link-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.resize-link-btn.linked {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.15);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.2);
}

/* Padding Slider */
.resize-padding-row {
    margin-bottom: 16px;
}

.resize-padding-row label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.resize-padding-row label span {
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

.resize-slider {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    outline: none;
    transition: background 0.2s;
}

.resize-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
    transition: transform 0.15s;
}

.resize-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.resize-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
}

/* Background Section */
.resize-bg-section {
    margin-bottom: 16px;
}

.resize-bg-section>label {
    display: block;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.resize-bg-options {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.resize-bg-opt {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.78rem;
    font-family: inherit;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.resize-bg-opt:hover {
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.resize-bg-opt.active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.12);
    color: white;
}

.resize-bg-config {
    padding: 10px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.resize-bg-config .color-picker-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.resize-bg-config .color-picker-row input[type="color"] {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    padding: 2px;
    background: transparent;
    flex-shrink: 0;
}

.resize-bg-config .hex-input {
    width: 100px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 7px 10px;
    color: white;
    font-size: 0.82rem;
    font-family: 'Consolas', monospace;
}

.resize-bg-config .hex-input:focus {
    outline: none;
    border-color: var(--primary);
}

.resize-bg-config .color-swatch-row {
    display: flex;
    gap: 5px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.resize-bg-config .color-swatch {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.resize-bg-config .color-swatch:hover {
    transform: scale(1.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.resize-bg-config .color-swatch.active {
    border-color: white;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

/* Gradient controls */
.resize-gradient-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.resize-gradient-row input[type="color"] {
    width: 36px;
    height: 36px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    padding: 2px;
    background: transparent;
    flex-shrink: 0;
}

.resize-gradient-row select {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 7px 10px;
    color: white;
    font-size: 0.82rem;
    font-family: inherit;
}

.resize-gradient-preview {
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 6px;
}

/* Preview Area */
.resize-preview-area {
    margin-top: 14px;
    text-align: center;
}

.resize-preview-area .preview-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.resize-preview-area .preview-label .preview-dims {
    background: rgba(99, 102, 241, 0.15);
    color: #a78bfa;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.resize-preview-area canvas {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    max-width: 100%;
    max-height: 240px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Result View */
.resize-result-view {
    text-align: center;
    padding: 10px 0;
}

.resize-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin: 14px 0;
    max-height: 360px;
    overflow-y: auto;
    padding: 4px;
}

.resize-result-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s;
}

.resize-result-item:hover {
    border-color: rgba(99, 102, 241, 0.2);
    transform: translateY(-1px);
}

.resize-result-item canvas {
    width: 100%;
    aspect-ratio: var(--result-ratio, 1);
    display: block;
    cursor: pointer;
}

.resize-result-item .result-name {
    padding: 6px 8px;
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.resize-result-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    margin-bottom: 12px;
    font-size: 0.88rem;
    font-weight: 500;
}

.resize-result-status.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.resize-result-status.processing {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: #a78bfa;
}

/* Resize field general */
.resize-field label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.resize-field input,
.resize-field select {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    color: white;
    font-size: 0.85rem;
}

.color-picker-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-picker-wrap input[type="color"] {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    background: transparent;
}

.color-picker-wrap span {
    font-size: 0.82rem;
    color: var(--text-muted);
}