/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Nunito', sans-serif; background: #f1f5f9; color: #1e293b; min-height: 100vh; }

/* ── Login Page ───────────────────────────────────────────────────────────── */
.login-page { background: #f1f5f9; }
.login-layout { display: flex; min-height: 100vh; }

.login-left {
  flex: 1;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #3b82f6 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 3rem;
}
.login-left-content { max-width: 420px; color: white; }
.brand-logo { display: flex; align-items: center; gap: .75rem; margin-bottom: 2rem; font-size: 1.25rem; font-weight: 700; }
.login-left h1 { font-size: 2.5rem; font-weight: 800; line-height: 1.2; margin-bottom: 1rem; }
.login-left p { font-size: 1rem; opacity: .85; line-height: 1.6; margin-bottom: 2.5rem; }
.stats { display: flex; gap: 1rem; }
.stat-card {
  background: rgba(255,255,255,.15); border-radius: 12px; padding: 1rem 1.25rem;
  display: flex; flex-direction: column; align-items: center; gap: .25rem; flex: 1;
}
.stat-num { font-size: 1.5rem; font-weight: 800; }
.stat-label { font-size: .75rem; opacity: .8; }

.login-right { flex: 1; display: flex; align-items: center; justify-content: center; padding: 3rem; }
.login-box { background: white; border-radius: 16px; padding: 2.5rem; width: 100%; max-width: 400px; box-shadow: 0 4px 24px rgba(0,0,0,.08); }
.login-box h2 { font-size: 1.75rem; font-weight: 800; margin-bottom: .5rem; }
.login-sub { color: #64748b; margin-bottom: 1.5rem; }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: .5rem; font-size: .9rem; }
.form-group input {
  width: 100%; padding: .75rem 1rem; border: 2px solid #e2e8f0; border-radius: 10px;
  font-size: 1rem; font-family: inherit; transition: border-color .2s;
}
.form-group input:focus { outline: none; border-color: #2563eb; }
.login-footer { text-align: center; color: #94a3b8; font-size: .8rem; margin-top: 1.5rem; }

/* ── App Header ───────────────────────────────────────────────────────────── */
.app-header { background: white; border-bottom: 1px solid #e2e8f0; position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: 900px; margin: 0 auto; padding: .875rem 1.5rem; display: flex; align-items: center; justify-content: space-between; }
.header-brand { display: flex; align-items: center; gap: .625rem; }
.header-title { font-weight: 800; font-size: 1.1rem; color: #1e293b; }
.header-sep { color: #cbd5e1; }
.header-sub { color: #64748b; font-size: .9rem; }
.btn-logout { color: #64748b; text-decoration: none; font-size: .875rem; font-weight: 600; display: flex; align-items: center; gap: .375rem; }
.btn-logout:hover { color: #1e293b; }

/* ── Main ─────────────────────────────────────────────────────────────────── */
.app-main { max-width: 900px; margin: 2rem auto; padding: 0 1.5rem 4rem; position: relative; }

/* ── Step Cards ───────────────────────────────────────────────────────────── */
.step-card { background: white; border-radius: 16px; padding: 2rem; box-shadow: 0 2px 12px rgba(0,0,0,.06); margin-bottom: 1.5rem; }
.step-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 1.25rem; display: flex; align-items: center; gap: .75rem; }
.step-badge {
  background: #2563eb; color: white; width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 700; flex-shrink: 0;
}

/* ── Env Grid ─────────────────────────────────────────────────────────────── */
.env-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.env-card {
  border: 2px solid #e2e8f0; border-radius: 12px; padding: 1rem 1.25rem;
  display: flex; align-items: center; gap: .875rem; cursor: pointer; transition: all .2s;
}
.env-card input { display: none; }
.env-card:hover { border-color: #93c5fd; }
.env-card.selected { border-color: #2563eb; background: #eff6ff; }
.env-card strong { display: block; font-weight: 700; }
.env-card small { color: #64748b; font-size: .8rem; }
.env-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.env-dot.staging { background: #10b981; }
.env-dot.prod { background: #ef4444; }

/* ── Dropzone ─────────────────────────────────────────────────────────────── */
.dropzone {
  border: 2px dashed #cbd5e1; border-radius: 12px; padding: 2.5rem 1rem;
  text-align: center; cursor: pointer; transition: all .2s; margin-bottom: 1rem;
}
.dropzone:hover, .dropzone.dragover { border-color: #2563eb; background: #eff6ff; }
.dropzone-inner { display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.dropzone-inner p { font-weight: 600; color: #475569; line-height: 1.5; }
.dropzone-inner small { color: #94a3b8; }
.file-info { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: .75rem 1rem; color: #166534; font-weight: 600; margin-bottom: 1rem; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn-primary {
  background: #2563eb; color: white; border: none; border-radius: 10px;
  padding: .875rem 2rem; font-size: 1rem; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: background .2s; display: inline-flex; align-items: center; gap: .5rem;
}
.btn-primary:hover:not(:disabled) { background: #1d4ed8; }
.btn-primary:disabled { background: #94a3b8; cursor: not-allowed; }
.btn-primary.btn-full { width: 100%; justify-content: center; }
.btn-secondary {
  background: white; color: #475569; border: 2px solid #e2e8f0; border-radius: 10px;
  padding: .75rem 1.5rem; font-size: .9rem; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: all .2s;
}
.btn-secondary:hover { border-color: #94a3b8; color: #1e293b; }
.btn-import { width: 100%; justify-content: center; font-size: 1.05rem; padding: 1rem; }

/* ── Preview ──────────────────────────────────────────────────────────────── */
.preview-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.preview-header .step-title { margin-bottom: 0; }
.summary-bar {
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 1rem 1.25rem; margin-bottom: 1rem; display: flex; gap: 2rem; flex-wrap: wrap;
}
.summary-item { display: flex; flex-direction: column; gap: .2rem; }
.summary-item .s-label { font-size: .75rem; color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.summary-item .s-value { font-size: 1.25rem; font-weight: 800; color: #1e293b; }
.summary-item .s-value.green { color: #059669; }
.summary-item .s-value.red { color: #dc2626; }

.customer-table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.customer-table th { background: #f8fafc; padding: .625rem .875rem; text-align: left; font-size: .8rem; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .05em; border-bottom: 2px solid #e2e8f0; }
.customer-table td { padding: .625rem .875rem; border-bottom: 1px solid #f1f5f9; font-size: .9rem; vertical-align: middle; }
.customer-table tr:hover td { background: #f8fafc; }
.badge-found { background: #dcfce7; color: #166534; border-radius: 6px; padding: .2rem .6rem; font-size: .75rem; font-weight: 700; }
.badge-missing { background: #fee2e2; color: #991b1b; border-radius: 6px; padding: .2rem .6rem; font-size: .75rem; font-weight: 700; }
.import-footer { margin-top: 1.5rem; border-top: 1px solid #f1f5f9; padding-top: 1.5rem; }

/* ── Result ───────────────────────────────────────────────────────────────── */
.result-summary { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 12px; padding: 1.5rem; margin-top: 1rem; }
.result-summary h3 { color: #166534; font-size: 1.25rem; margin-bottom: .75rem; }
.result-list { list-style: none; display: flex; flex-direction: column; gap: .375rem; }
.result-list li { font-size: .9rem; color: #166534; }
.result-errors { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 12px; padding: 1.25rem; margin-top: 1rem; }
.result-errors h4 { color: #9a3412; margin-bottom: .5rem; }
.result-errors ul { list-style: none; display: flex; flex-direction: column; gap: .25rem; }
.result-errors li { font-size: .85rem; color: #9a3412; }

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.alert { border-radius: 8px; padding: .75rem 1rem; margin-bottom: 1rem; font-size: .9rem; font-weight: 600; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }

/* ── Loading ──────────────────────────────────────────────────────────────── */
.loading-overlay {
  position: fixed; inset: 0; background: rgba(255,255,255,.85);
  display: flex; align-items: center; justify-content: center; z-index: 999;
}
.loading-box { text-align: center; }
.spinner {
  width: 48px; height: 48px; border: 4px solid #e2e8f0; border-top-color: #2563eb;
  border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-box p { font-weight: 700; color: #475569; }

/* ── Utilities ────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

@media (max-width: 640px) {
  .login-left { display: none; }
  .env-grid { grid-template-columns: 1fr; }
  .summary-bar { gap: 1rem; }
}
