/* ===== NEOX Tracking — Wealify Light Mode  ===== */
:root {
    --primary: #FF5A00;
    --primary-dark: #E65100;
    --primary-light: #FF8A50;
    --accent: #FF9800;
    --success: #10B981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #EF4444;
    --bg: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-input: #F9FAFB;
    --border: #E5E7EB;
    --border-focus: #FF5A00;
    --text: #1F2937;
    --text-muted: #4B5563;
    --text-dim: #9CA3AF;
    --radius: 16px;
    --radius-sm: 8px;
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ===== BG ===== */
.bg-gradient {
    position: fixed; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 20%, rgba(255,90,0,0.06) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(255,152,0,0.04) 0%, transparent 50%);
    z-index: 0; animation: bgShift 20s ease-in-out infinite alternate;
}
.bg-pattern {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(rgba(255,90,0,0.03) 1px, transparent 1px);
    background-size: 40px 40px; z-index: 0;
}
@keyframes bgShift { 0% { transform: translate(0,0); } 100% { transform: translate(-5%,3%); } }

/* ===== CONTAINER ===== */
.container {
    position: relative; z-index: 1;
    max-width: 900px; margin: 0 auto; padding: 40px 20px;
    min-height: 100vh; display: flex; flex-direction: column;
}

/* ===== HEADER ===== */
.header-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 48px; border-bottom: 1px solid var(--border); padding-bottom: 16px; margin-top: -10px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { flex-shrink: 0; }
.logo-title {
    font-size: 22px; font-weight: 800; letter-spacing: -0.02em;
    color: #000; text-transform: uppercase;
}
.nav-links { display: flex; gap: 24px; display: none; /* simple version */ }
@media (min-width: 800px) { .nav-links { display: flex; } }
.nav-link { color: var(--text-muted); text-decoration: none; font-size: 14px; font-weight: 500; }
.header-actions { display: flex; gap: 12px; }
.btn-outline { padding: 8px 24px; border: 1.5px solid var(--primary); color: var(--primary); border-radius: 30px; font-weight: 600; font-size: 13px; text-decoration: none; }
.btn-filled { padding: 8px 24px; background: var(--primary); color: #fff; border-radius: 30px; font-weight: 600; font-size: 13px; text-decoration: none; box-shadow: 0 4px 14px rgba(255,90,0,0.3); }

/* ===== CARD ===== */
.card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 32px;
    box-shadow: var(--shadow); margin-bottom: 24px;
    animation: slideUp 0.4s ease;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ===== STEP HEADER ===== */
.step-header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.step-badge {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--primary);
    color: #fff; font-weight: 700; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
}
.step-title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }

/* ===== FORM ===== */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.form-group { display: flex; flex-direction: column; }
.form-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.label-icon { font-size: 14px; }
.required { color: var(--danger); }
.form-input {
    padding: 10px 14px; background: var(--bg-input); border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text); font-size: 14px;
    font-family: inherit; transition: var(--transition); outline: none;
}
.form-input::placeholder { color: var(--text-dim); }
.form-input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(255,90,0,0.12); }

/* ===== UPLOAD ZONE ===== */
.upload-zone {
    border: 2px dashed var(--border); border-radius: var(--radius);
    padding: 48px 24px; text-align: center; cursor: pointer;
    transition: var(--transition); background: rgba(99,102,241,0.02);
    margin-bottom: 20px;
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary); background: rgba(99,102,241,0.06);
}
.upload-icon { font-size: 48px; margin-bottom: 12px; }
.upload-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.upload-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.upload-link { color: var(--primary-light); cursor: pointer; text-decoration: underline; font-weight: 500; }
.upload-hint { font-size: 11px; color: var(--text-dim); }

/* ===== FILE INFO ===== */
.file-info {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; background: rgba(99,102,241,0.06);
    border: 1px solid rgba(99,102,241,0.15); border-radius: var(--radius-sm);
    margin-bottom: 20px;
}
.file-icon { font-size: 24px; }
.file-details { flex: 1; }
.file-name { display: block; font-size: 14px; font-weight: 500; }
.file-size { font-size: 12px; color: var(--text-dim); }
.file-remove {
    background: none; border: none; color: var(--text-dim);
    cursor: pointer; font-size: 18px; padding: 4px 8px;
    border-radius: 4px; transition: var(--transition);
}
.file-remove:hover { background: rgba(255,255,255,0.05); color: var(--danger); }

/* ===== BUTTONS ===== */
.btn-primary {
    width: 100%; padding: 13px 24px;
    background: var(--primary);
    color: #fff; border: none; border-radius: 30px;
    font-size: 15px; font-weight: 600; font-family: inherit;
    cursor: pointer; transition: var(--transition);
    box-shadow: 0 4px 14px rgba(255,90,0,0.25);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(255,90,0,0.35); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
    padding: 12px 24px; background: rgba(99,102,241,0.1);
    border: 1.5px solid rgba(99,102,241,0.2); border-radius: var(--radius-sm);
    color: var(--primary-light); font-size: 14px; font-weight: 500;
    font-family: inherit; cursor: pointer; transition: var(--transition);
}
.btn-secondary:hover { background: rgba(99,102,241,0.15); border-color: var(--primary); }

.btn-loading { display: flex; align-items: center; justify-content: center; gap: 8px; }
.spinner { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.action-row { display: flex; justify-content: space-between; gap: 16px; margin-top: 20px; }
.action-row .btn-primary { flex: 1; }

.error-msg { color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 18px; }

/* ===== STATS ===== */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-card {
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 16px; text-align: center;
}
.stat-card.stat-success { border-color: rgba(16,185,129,0.2); background: var(--success-bg); }
.stat-card.stat-warning { border-color: rgba(245,158,11,0.2); background: var(--warning-bg); }
.stat-value { font-size: 28px; font-weight: 700; margin-bottom: 2px; }
.stat-success .stat-value { color: var(--success); }
.stat-warning .stat-value { color: var(--warning); }
.stat-label { font-size: 12px; color: var(--text-muted); }

/* ===== PREVIEW TABLE ===== */
.table-wrapper {
    overflow-x: auto; border: 1px solid var(--border);
    border-radius: var(--radius-sm); margin-bottom: 8px;
}
.preview-table {
    width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap;
}
.preview-table th {
    background: rgba(99,102,241,0.08); color: var(--text-muted);
    font-weight: 600; text-transform: uppercase; font-size: 11px;
    letter-spacing: 0.05em; padding: 10px 12px; text-align: left;
    border-bottom: 1px solid var(--border); position: sticky; top: 0;
}
.preview-table td {
    padding: 8px 12px; border-bottom: 1px solid rgba(45,45,74,0.5);
}
.preview-table tr:hover td { background: rgba(99,102,241,0.03); }
.preview-table .row-duplicate td { background: rgba(245,158,11,0.04); }

.td-address { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.td-code { font-family: 'SF Mono', 'Fira Code', monospace; letter-spacing: 0.3px; color: var(--primary-light); }

.badge-new {
    display: inline-block; padding: 2px 8px; border-radius: 20px;
    font-size: 11px; font-weight: 600;
    background: var(--success-bg); color: var(--success);
    border: 1px solid rgba(16,185,129,0.2);
}
.badge-dup {
    display: inline-block; padding: 2px 8px; border-radius: 20px;
    font-size: 11px; font-weight: 600;
    background: var(--warning-bg); color: var(--warning);
    border: 1px solid rgba(245,158,11,0.2);
}
.badge-provider {
    display: inline-block; padding: 2px 8px; border-radius: 4px;
    font-size: 11px; font-weight: 500;
    background: rgba(99,102,241,0.08); color: var(--text-muted);
}

.preview-note { font-size: 12px; color: var(--text-dim); text-align: center; margin: 8px 0; }

/* ===== LARK DUP STYLES ===== */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-card.stat-danger { border-color: rgba(239,68,68,0.2); background: rgba(239,68,68,0.06); }
.stat-danger .stat-value { color: var(--danger); }

.badge-lark-dup {
    display: inline-block; padding: 2px 8px; border-radius: 20px;
    font-size: 11px; font-weight: 600;
    background: rgba(239,68,68,0.1); color: var(--danger);
    border: 1px solid rgba(239,68,68,0.25);
}
.preview-table .row-lark-dup td { background: rgba(239,68,68,0.06); }

.alert-danger {
    padding: 14px 18px; background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.2); border-radius: var(--radius-sm);
    color: #FCA5A5; font-size: 13px; margin-bottom: 16px; line-height: 1.5;
}

/* 24hTrack status badges */
.badge-delivered {
    display: inline-block; padding: 2px 8px; border-radius: 20px;
    font-size: 11px; font-weight: 600;
    background: rgba(16,185,129,0.1); color: var(--success);
    border: 1px solid rgba(16,185,129,0.25);
}
.badge-fail {
    display: inline-block; padding: 2px 8px; border-radius: 20px;
    font-size: 11px; font-weight: 600;
    background: rgba(239,68,68,0.1); color: var(--danger);
    border: 1px solid rgba(239,68,68,0.25);
}
.badge-pending {
    display: inline-block; padding: 2px 8px; border-radius: 20px;
    font-size: 11px; font-weight: 600;
    background: rgba(100,116,139,0.1); color: var(--text-dim);
    border: 1px solid rgba(100,116,139,0.2);
}
.preview-table .row-fail td { background: rgba(239,68,68,0.03); }

/* ===== SUCCESS ===== */
.success-card { text-align: center; }
.success-icon { font-size: 56px; margin-bottom: 16px; }
.success-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.success-message { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; line-height: 1.6; }
.success-details {
    background: var(--bg-input); border-radius: var(--radius-sm);
    padding: 16px; margin-bottom: 24px; text-align: left;
}
.detail-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; font-size: 13px; border-bottom: 1px solid var(--border);
}
.detail-row:last-child { border-bottom: none; }
.detail-row span { color: var(--text-muted); }
.detail-row strong { color: var(--text); font-family: 'SF Mono', monospace; font-size: 12px; }

/* ===== FOOTER ===== */
.footer { margin-top: auto; padding-top: 40px; text-align: center; }
.footer p { font-size: 12px; color: var(--text-dim); }
.footer a { color: var(--primary-light); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .container { padding: 24px 16px; }
    .card { padding: 24px 16px; }
    .form-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .action-row { flex-direction: column-reverse; }
    .upload-zone { padding: 32px 16px; }
}
