:root {
  --bg: #0f172a;
  --card: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --primary: #10b981;
  --primary-600: #059669;
  --border: #1f2937;
  --danger: #ef4444;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: radial-gradient(1000px 600px at 10% 10%, #111827, #0b1225), var(--bg);
  color: var(--text);
}

.container { max-width: 960px; margin: 0 auto; padding: 24px; }
header { margin-bottom: 16px; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.header-actions { display: flex; gap: 8px; align-items: center; }

h1 { margin: 0 0 4px; font-size: 28px; }
.subtitle { margin: 0; color: var(--muted); }

.card { background: rgba(17,24,39,0.75); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 16px; backdrop-filter: blur(6px); }

label { display: block; margin-bottom: 6px; color: var(--muted); }
input[type="email"], input[type="text"], input[type="file"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0b1225;
  color: var(--text);
}

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.upload-row { display: flex; gap: 8px; align-items: center; }

.button, button, .primary, .ghost {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: #0d1328; color: var(--text); cursor: pointer; text-decoration: none;
}
button.primary, .button.primary { background: linear-gradient(135deg, var(--primary), var(--primary-600)); border: none; color: #00140f; font-weight: 600; }
button.ghost { background: transparent; }
button:disabled { opacity: 0.6; cursor: not-allowed; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.list li:last-child { border-bottom: none; }

.file-label { position: relative; display: inline-flex; }
.file-label input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-label span { display: inline-flex; align-items: center; padding: 10px 14px; border: 1px dashed var(--border); border-radius: 10px; }

.progress { display: flex; gap: 12px; align-items: center; }
.spinner { width: 28px; height: 28px; border: 3px solid rgba(255,255,255,0.15); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.scroll { max-height: 260px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 8px; }

/* Utility spacing + sizing (replace inline styles) */
.mt-6 { margin-top: 6px; }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.minw-120 { min-width: 120px; }
.minw-220 { min-width: 220px; }
.maxw-240 { max-width: 240px; }
.maxw-260 { max-width: 260px; }
.w-full { width: 100%; }

/* Horizontal rule replacement */
.hr-muted { border: none; border-top: 1px solid var(--border); opacity: 0.4; margin: 14px 0; }

/* Table styling for mapping editor */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 6px; border-bottom: 1px dashed var(--border); }
.table th { border-bottom: 1px solid var(--border); }

/* Progress bar styles for login */
.progress-track { width: 180px; height: 6px; background: #0b1225; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.progress-bar { height: 100%; width: 30%; background: linear-gradient(90deg, var(--primary), var(--primary-600)); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0% { transform: translateX(-60%); } 50% { transform: translateX(10%); } 100% { transform: translateX(120%); } }

/* Tabs */
.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tab { background: #0d1328; border: 1px solid var(--border); color: var(--text); padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.tab.active { background: linear-gradient(135deg, var(--primary), var(--primary-600)); color: #00140f; border: none; font-weight: 600; }

/* Pager */
.pager { display: flex; align-items: center; gap: 8px; }

/* Pagination chips */
.pagination { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.page-btn {
  min-width: 34px; height: 34px; padding: 0 10px;
  border-radius: 999px; border: 1px solid var(--border);
  background: #0d1328; color: var(--text);
}
.page-btn.active { background: linear-gradient(135deg, var(--primary), var(--primary-600)); color: #00140f; border: none; font-weight: 600; }

/* Danger buttons */
button.danger, .button.danger { background: linear-gradient(135deg, var(--danger), #b91c1c); border: none; color: #fff; font-weight: 600; }
button.danger.ghost { background: transparent; border: 1px solid #7f1d1d; color: #fecaca; }

/* Layout helpers */
.between { justify-content: space-between; }
.end { justify-content: flex-end; }
.gap-8 { gap: 8px; }
.mt-12 { margin-top: 12px; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-dialog { width: 420px; max-width: 90vw; background: rgba(17,24,39,0.92); border: 1px solid var(--border); border-radius: 12px; padding: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }

/* ===== STUNNING LOGIN PAGE ===== */
.login-page { 
  min-height: 100vh; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  overflow: hidden;
  position: relative;
}

/* Animated gradient orbs background */
.animated-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation: float 20s ease-in-out infinite;
}
.orb-1 { 
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(16,185,129,0.4), transparent);
  top: -250px; left: -250px;
  animation-delay: 0s;
}
.orb-2 { 
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(5,150,105,0.3), transparent);
  bottom: -200px; right: -200px;
  animation-delay: 7s;
}
.orb-3 { 
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(6,95,70,0.3), transparent);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: 14s;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* Login container */
.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  padding: 24px;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Login card with glassmorphism */
.login-card {
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 24px;
  padding: 40px 32px;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 1px 0 rgba(255, 255, 255, 0.1) inset;
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 200px;
  background: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.15), transparent 70%);
  pointer-events: none;
}

/* Brand header */
.brand-header {
  text-align: center;
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
}
.logo-circle {
  width: 72px; height: 72px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.1));
  border: 2px solid rgba(16, 185, 129, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse-glow 3s ease-in-out infinite;
}
.logo-circle svg { 
  width: 36px; height: 36px;
  color: var(--primary);
  filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.5));
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); }
}
.brand-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px;
  background: linear-gradient(135deg, #fff, #e5e7eb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}
.brand-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}

/* Form step with slide animation */
.form-step {
  position: relative;
  animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* OTP header with success indicator */
.otp-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 12px;
  margin-bottom: 24px;
  animation: slideIn 0.4s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}
.check-icon {
  width: 24px; height: 24px;
  color: var(--primary);
  flex-shrink: 0;
}
.otp-sent-msg {
  margin: 0;
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
}

/* Input groups */
.input-group {
  margin-bottom: 20px;
}
.input-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.label-icon {
  width: 18px; height: 18px;
  color: var(--primary);
}

/* Modern input styling */
.modern-input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(11, 18, 37, 0.6);
  border: 2px solid rgba(31, 41, 55, 0.8);
  border-radius: 12px;
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}
.modern-input::placeholder {
  color: var(--muted);
  opacity: 0.6;
}
.modern-input:focus {
  background: rgba(11, 18, 37, 0.8);
  border-color: var(--primary);
  box-shadow: 
    0 0 0 4px rgba(16, 185, 129, 0.1),
    0 1px 2px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}
.modern-input:hover:not(:focus) {
  border-color: rgba(16, 185, 129, 0.4);
}
.otp-input {
  text-align: center;
  font-size: 28px;
  letter-spacing: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Primary button with arrow and animations */
.btn-primary {
  width: 100%;
  padding: 14px 20px;
  margin-top: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  border: none;
  border-radius: 12px;
  color: #00140f;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 4px 12px rgba(16, 185, 129, 0.3),
    0 1px 2px rgba(0, 0, 0, 0.1);
}
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s ease;
}
.btn-primary:hover::before {
  left: 100%;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 8px 20px rgba(16, 185, 129, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.1);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.btn-with-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-arrow {
  width: 20px; height: 20px;
  transition: transform 0.3s ease;
}
.btn-primary:hover .btn-arrow {
  transform: translateX(4px);
}

/* Status message */
.status-message {
  margin: 12px 0 0;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  min-height: 20px;
  animation: fadeIn 0.3s ease;
}
.status-message:not(:empty) {
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

/* Modern loading state */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 20px;
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.1);
  border-radius: 12px;
  animation: fadeIn 0.3s ease;
}
.pulse-loader {
  display: flex;
  gap: 6px;
}
.pulse-loader span {
  width: 8px; height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulse-dot 1.4s ease-in-out infinite;
}
.pulse-loader span:nth-child(2) { animation-delay: 0.2s; }
.pulse-loader span:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse-dot {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40% { transform: scale(1.2); opacity: 1; }
}
.loading-text {
  margin: 0;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
}

/* Login footer */
.login-footer {
  margin-top: 24px;
  text-align: center;
  animation: fadeIn 0.6s ease 0.3s both;
}
.login-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

/* Responsive adjustments for login */
@media (max-width: 600px) {
  .upload-row { flex-direction: column; align-items: stretch; }
  .header-row { flex-direction: column; align-items: flex-start; }
  
  .login-container { padding: 16px; max-width: 100%; }
  .login-card { padding: 32px 24px; border-radius: 20px; }
  .brand-title { font-size: 24px; }
  .logo-circle { width: 64px; height: 64px; }
  .logo-circle svg { width: 32px; height: 32px; }
  .orb-1 { width: 300px; height: 300px; top: -150px; left: -150px; }
  .orb-2 { width: 250px; height: 250px; bottom: -125px; right: -125px; }
  .orb-3 { width: 200px; height: 200px; }
}

@media (max-width: 400px) {
  .otp-input { font-size: 24px; letter-spacing: 8px; }
}

/* ===== STUNNING APP PAGE ===== */
.app-page {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* App container */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* App header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
  padding: 20px 24px;
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: slideDown 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand-icon {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.1));
  border: 2px solid rgba(16, 185, 129, 0.3);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-icon svg {
  width: 28px; height: 28px;
  color: var(--primary);
}
.app-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #fff, #e5e7eb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}
.app-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

/* Action buttons in header */
.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(31, 41, 55, 0.6);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.action-btn svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
}
.action-btn:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}
.logout-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* Modern cards */
.app-main {
  display: grid;
  gap: 24px;
}
.modern-card {
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 20px;
  padding: 28px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  position: relative;
  overflow: hidden;
  animation: fadeIn 0.6s ease;
  animation-fill-mode: both;
}
.upload-card { animation-delay: 0.1s; }
.progress-card { animation-delay: 0.2s; }

.modern-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 120px;
  background: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.1), transparent 70%);
  pointer-events: none;
}

/* Card header */
.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}
.card-icon {
  width: 24px; height: 24px;
  color: var(--primary);
  flex-shrink: 0;
}
.card-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

/* Upload zone */
.upload-zone {
  display: grid;
  gap: 16px;
  position: relative;
  z-index: 1;
}
.file-drop-area {
  position: relative;
  padding: 40px;
  background: rgba(11, 18, 37, 0.6);
  border: 2px dashed rgba(16, 185, 129, 0.3);
  border-radius: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.file-drop-area:hover {
  background: rgba(11, 18, 37, 0.8);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
  transform: translateY(-2px);
}
.upload-icon {
  width: 48px; height: 48px;
  color: var(--primary);
  animation: float-gentle 3s ease-in-out infinite;
}
@keyframes float-gentle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.file-message {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}
.file-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.file-hint {
  font-size: 13px;
  color: var(--muted);
}
.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.file-name {
  display: block;
  margin-top: 8px;
  padding: 8px 16px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-name:empty { display: none; }

/* Process button */
.btn-process {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  border: none;
  border-radius: 14px;
  color: #00140f;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
  position: relative;
  overflow: hidden;
}
.btn-process::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s ease;
}
.btn-process:hover::before {
  left: 100%;
}
.btn-process:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(16, 185, 129, 0.4);
}
.btn-process:active {
  transform: translateY(-1px);
}
.btn-process:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.btn-icon {
  width: 22px; height: 22px;
}

/* Info badge */
.info-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.info-badge svg {
  width: 18px; height: 18px;
  color: var(--primary);
  flex-shrink: 0;
}

/* Progress content */
.progress-content {
  position: relative;
  z-index: 1;
}
.progress-display {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  background: rgba(11, 18, 37, 0.5);
  border: 1px solid rgba(31, 41, 55, 0.8);
  border-radius: 14px;
  min-height: 100px;
}
.progress-info {
  flex: 1;
}
.stage-text {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.details-text,
.count-text {
  margin: 4px 0;
  font-size: 14px;
  color: var(--muted);
}

/* Prominent stats block */
.stats-block {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.stat {
  background: rgba(11, 18, 37, 0.6);
  border: 1px solid rgba(31, 41, 55, 0.8);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}
.stat-num {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}
.stat-label {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

@media (max-width: 520px) {
  .stats-block { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Download section */
.download-section {
  margin-top: 20px;
  padding: 24px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 14px;
  animation: slideIn 0.5s ease;
}
.success-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.success-icon {
  width: 28px; height: 28px;
  color: var(--primary);
  flex-shrink: 0;
}
.success-indicator p {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
}
.btn-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  border: none;
  border-radius: 12px;
  color: #00140f;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

/* Responsive app page */
@media (max-width: 768px) {
  .app-container { padding: 16px; }
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .brand-section { width: 100%; }
  .header-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .modern-card { padding: 20px; }
  .file-drop-area { padding: 32px 20px; }
  .app-title { font-size: 20px; }
  .brand-icon { width: 44px; height: 44px; }
  .brand-icon svg { width: 24px; height: 24px; }
}

@media (max-width: 480px) {
  .action-btn span { display: none; }
  .action-btn { padding: 10px 12px; }
  .upload-icon { width: 40px; height: 40px; }
  .file-label { font-size: 15px; }
  .file-hint { font-size: 12px; }
  .btn-process { font-size: 15px; padding: 14px 20px; }
}

/* ===== STUNNING ADMIN PAGE ===== */
.admin-page {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.admin-container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Admin header - same as app header */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding: 20px 24px;
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: slideDown 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.admin-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #fff, #e5e7eb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}
.admin-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

/* Admin tabs */
.admin-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  padding: 8px;
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: 16px;
  animation: fadeIn 0.6s ease 0.2s both;
}
.admin-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: transparent;
  border: none;
  border-radius: 12px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.admin-tab svg {
  width: 20px;
  height: 20px;
}
.admin-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  color: #00140f;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.admin-tab:not(.active):hover {
  background: rgba(16, 185, 129, 0.1);
  color: var(--text);
}

/* Admin cards */
.admin-main {
  display: grid;
  gap: 24px;
}
.admin-card {
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 20px;
  padding: 28px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  position: relative;
  overflow: hidden;
  animation: fadeIn 0.6s ease;
  animation-fill-mode: both;
}
.admin-card:nth-child(1) { animation-delay: 0.1s; }
.admin-card:nth-child(2) { animation-delay: 0.2s; }
.admin-card:nth-child(3) { animation-delay: 0.3s; }

.admin-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 120px;
  background: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.1), transparent 70%);
  pointer-events: none;
}

.card-description {
  margin: -8px 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

/* Input row */
.input-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}
.admin-input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(11, 18, 37, 0.6);
  border: 2px solid rgba(31, 41, 55, 0.8);
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}
.admin-input::placeholder {
  color: var(--muted);
  opacity: 0.6;
}
.admin-input:focus {
  background: rgba(11, 18, 37, 0.8);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

/* User list */
.user-list {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
  z-index: 1;
}
.user-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  margin-bottom: 8px;
  background: rgba(11, 18, 37, 0.5);
  border: 1px solid rgba(31, 41, 55, 0.6);
  border-radius: 10px;
  animation: slideIn 0.3s ease;
}
.user-list li span {
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

/* File upload grid */
.file-upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}
.file-upload-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px;
  background: rgba(11, 18, 37, 0.6);
  border: 2px dashed rgba(16, 185, 129, 0.3);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
}
.file-upload-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.file-upload-btn svg {
  width: 32px;
  height: 32px;
  color: var(--primary);
  transition: transform 0.3s ease;
}
.file-upload-btn span {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}
.file-upload-btn:hover {
  background: rgba(11, 18, 37, 0.8);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
  transform: translateY(-2px);
}
.file-upload-btn:hover svg {
  transform: translateY(-3px);
}
.file-upload-btn.secondary {
  border-style: solid;
  border-color: rgba(31, 41, 55, 0.6);
}

/* Buttons */
.btn-add, .btn-infer, .btn-save {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  border: none;
  border-radius: 12px;
  color: #00140f;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.btn-add svg, .btn-infer svg, .btn-save svg {
  width: 18px;
  height: 18px;
}
.btn-add:hover, .btn-infer:hover, .btn-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(31, 41, 55, 0.6);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-secondary svg {
  width: 16px;
  height: 16px;
}
.btn-secondary:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--primary);
  transform: translateY(-1px);
}
.btn-danger {
  background: linear-gradient(135deg, var(--danger), #b91c1c);
  border: none;
  color: #fff;
}
.btn-danger:hover {
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}
.btn-danger-ghost {
  background: transparent;
  border: 1px solid rgba(127, 29, 29, 0.5);
  color: #fca5a5;
}
.btn-danger-ghost:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
}

/* Section divider */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.2), transparent);
  margin: 24px 0;
}

/* Config rows */
.config-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.config-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.config-label svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
}
.config-input {
  max-width: 260px;
}

/* Info box */
.info-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 12px;
  position: relative;
  z-index: 1;
}
.info-box svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}
.info-box p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* Mapping scroll */
.mapping-scroll {
  max-height: 400px;
  overflow: auto;
  padding: 16px;
  background: rgba(11, 18, 37, 0.5);
  border: 1px solid rgba(31, 41, 55, 0.6);
  border-radius: 14px;
  position: relative;
  z-index: 1;
}

/* Action row */
.action-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

/* Template rows */
.template-save-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.template-actions-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.admin-select {
  flex: 1;
  min-width: 220px;
  padding: 10px 14px;
  background: rgba(11, 18, 37, 0.6);
  border: 2px solid rgba(31, 41, 55, 0.8);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
}
.admin-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

/* Analytics toolbar */
.analytics-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.toolbar-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Analytics table wrapper */
.analytics-table-wrapper {
  max-height: 500px;
  overflow: auto;
  padding: 16px;
  background: rgba(11, 18, 37, 0.5);
  border: 1px solid rgba(31, 41, 55, 0.6);
  border-radius: 14px;
  position: relative;
  z-index: 1;
}

/* Status text */
.status-text {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  margin: 8px 0;
}
.status-text:not(:empty) {
  padding: 8px 12px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 8px;
  color: var(--primary);
}

/* Responsive admin */
@media (max-width: 900px) {
  .file-upload-grid {
    grid-template-columns: 1fr;
  }
  .admin-tabs {
    flex-direction: column;
  }
  .template-actions-row {
    flex-direction: column;
    align-items: stretch;
  }
  .template-actions-row button {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .admin-container { padding: 16px; }
  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .admin-card { padding: 20px; }
  .config-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .config-label {
    min-width: auto;
  }
  .config-input {
    max-width: 100%;
    width: 100%;
  }
  .analytics-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar-group {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .input-row {
    flex-direction: column;
  }
  .admin-input {
    width: 100%;
  }
  .admin-tab span {
    display: none;
  }
}
