:root {
    --bg-dark: #0a0d14;
    --card-bg: rgba(18, 24, 38, 0.75);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-primary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #ec4899 0%, #8b5cf6 50%, #3b82f6 100%);
    --accent-emerald: #10b981;
    --accent-warning: #f59e0b;
    --accent-rose: #f43f5e;
    --border-radius-lg: 18px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Ambient Background Glow */
.ambient-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.28;
}

.glow-1 {
    width: 600px;
    height: 600px;
    top: -150px;
    left: -100px;
    background: radial-gradient(circle, #8b5cf6, #ec4899);
}

.glow-2 {
    width: 550px;
    height: 550px;
    bottom: -150px;
    right: -100px;
    background: radial-gradient(circle, #3b82f6, #10b981);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 24px 80px;
    position: relative;
    z-index: 1;
}

/* Header */
.app-header {
    margin-bottom: 36px;
    text-align: center;
}

.header-top-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #c4b5fd;
    text-transform: uppercase;
}

.api-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(18, 24, 38, 0.85);
    border: 1px solid var(--card-border);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.api-status-badge:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.status-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: var(--transition);
}

.status-indicator-dot.online {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.status-indicator-dot.offline {
    background: #f43f5e;
    box-shadow: 0 0 8px #f43f5e;
}

.btn-config-api {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    opacity: 0.7;
    transition: var(--transition);
    color: inherit;
    display: flex;
    align-items: center;
}

.btn-config-api:hover {
    opacity: 1;
    transform: rotate(45deg);
}

.brand-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ec4899;
    box-shadow: 0 0 10px #ec4899;
}

.main-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(180deg, #ffffff 30%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}

.subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 680px;
    margin: 0 auto;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 28px;
}

@media (max-width: 960px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Glass Card */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-lg);
    padding: 28px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    transition: var(--transition);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.step-num {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: #fff;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.4);
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.card-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Dropzones */
.dropzone-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 600px) {
    .dropzone-grid {
        grid-template-columns: 1fr;
    }
}

.dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.14);
    border-radius: var(--border-radius-md);
    padding: 22px 16px;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: var(--transition);
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--accent-primary);
    background: rgba(139, 92, 246, 0.08);
    transform: translateY(-2px);
}

.drop-icon {
    color: #a78bfa;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
}

.drop-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.drop-hint {
    display: block;
    font-size: 0.775rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.file-name-badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 0.75rem;
    color: #e2e8f0;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-name-badge.active {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    color: #34d399;
    font-weight: 600;
}

/* Form Controls */
.params-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 28px;
}

@media (max-width: 600px) {
    .params-grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.tooltip {
    cursor: help;
    color: var(--text-muted);
}

.form-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--border-radius-sm);
    padding: 11px 14px;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
    background: rgba(255, 255, 255, 0.08);
}

.input-with-badge {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-badge .form-control {
    width: 100%;
    padding-right: 90px;
}

.input-badge {
    position: absolute;
    right: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #a78bfa;
    background: rgba(139, 92, 246, 0.15);
    padding: 3px 8px;
    border-radius: 4px;
    pointer-events: none;
}

.field-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.badge-ag3 {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #93c5fd;
    margin-left: 8px;
}

/* Buttons */
.form-actions {
    display: flex;
    gap: 12px;
}

.form-actions-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-full {
    width: 100%;
}

.dual-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 650px) {
    .dual-actions-grid {
        grid-template-columns: 1fr;
    }
}

.btn-mode {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-align: left;
}

.mode-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.mode-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mode-title {
    font-size: 0.98rem;
    font-weight: 800;
    color: #fff;
    display: block;
}

.mode-desc {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    display: block;
    line-height: 1.3;
}

.btn-mode-blue {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
    border: 1px solid rgba(96, 165, 250, 0.3);
}

.btn-mode-blue:hover {
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.55);
    transform: translateY(-2px);
    border-color: rgba(96, 165, 250, 0.6);
}

.btn-mode-purple {
    background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 100%);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.35);
    border: 1px solid rgba(167, 139, 250, 0.3);
}

.btn-mode-purple:hover {
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.55);
    transform: translateY(-2px);
    border-color: rgba(167, 139, 250, 0.6);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 20px;
    border-radius: var(--border-radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    flex: 1;
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.35);
}

.btn-primary:hover {
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.55);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
}

.template-guide-box {
    margin-top: 14px;
    margin-bottom: 16px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    padding: 14px;
}

.guide-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #93c5fd;
    margin-bottom: 10px;
}

.guide-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.guide-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #e2e8f0;
    flex-wrap: wrap;
}

.guide-badge {
    background: rgba(37, 99, 235, 0.25);
    border: 1px solid rgba(37, 99, 235, 0.5);
    color: #60a5fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
}

.guide-sheet {
    font-family: monospace;
    font-weight: 600;
    color: #f1f5f9;
}

.guide-arrow {
    color: #94a3b8;
}

.guide-dest {
    color: #cbd5e1;
}

.guide-dest strong {
    color: #34d399;
}

.guide-dest code {
    background: rgba(255, 255, 255, 0.1);
    padding: 1px 5px;
    border-radius: 3px;
    color: #fcd34d;
}

/* Progress Section */
.progress-container {
    margin-bottom: 20px;
}

.progress-bar-wrap {
    height: 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 10px;
    transition: width 0.4s ease;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.progress-msg {
    color: var(--text-secondary);
}

.progress-pct {
    font-weight: 700;
    color: #c4b5fd;
}

/* Console Logs */
.log-console {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--border-radius-sm);
    padding: 14px;
    height: 180px;
    overflow-y: auto;
    font-family: 'Consolas', monospace;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 24px;
}

.log-entry {
    color: #cbd5e1;
    word-break: break-word;
}

.log-info { color: #94a3b8; }
.log-success { color: #34d399; font-weight: 600; }
.log-warn { color: #fbbf24; }
.log-error { color: #f87171; font-weight: 600; }

/* Result Box */
.result-box {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--border-radius-md);
    padding: 20px;
    animation: fadeIn 0.4s ease;
}

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

.result-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.success-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-emerald);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 900;
}

.result-title {
    font-size: 1.05rem;
    font-weight: 700;
}

.result-filename {
    font-size: 0.8rem;
    color: #6ee7b7;
    font-family: monospace;
}

.result-actions {
    display: flex;
    gap: 10px;
}

.btn-download {
    flex: 1;
    background: #059669;
    color: #fff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-download:hover {
    background: #10b981;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.badge-warning {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fbbf24;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.modal-title {
    font-size: 1.35rem;
    font-weight: 700;
}

.modal-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
}

.btn-close:hover {
    color: #fff;
}

.modal-body {
    overflow-y: auto;
    flex: 1;
    margin-bottom: 20px;
}

.sku-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.sku-table th, .sku-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sku-table th {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-weight: 700;
}

.sku-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: #fff;
    padding: 6px 8px;
    font-size: 0.825rem;
    outline: none;
}

.sku-input:focus {
    border-color: var(--accent-primary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
