* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #e8eef8 0%, #f3e9ff 50%, #ede8ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
}

#app {
  width: 100%;
}

.card {
  max-width: 480px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 28px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06), inset 0 1px 2px rgba(255, 255, 255, 0.6);
}

/* ---------- Shared buttons ---------- */

.btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.actions {
  display: flex;
  gap: 10px;
}

.actions .btn {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  font-size: 13px;
}

.btn.confirm,
.btn.retry {
  background: linear-gradient(135deg, #a855f7 0%, #8b5cf6 100%);
  color: white;
  box-shadow: 0 8px 20px rgba(168, 85, 247, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.4);
}

.btn.edit,
.btn.dismiss {
  background: rgba(255, 255, 255, 0.6);
  color: #6366f1;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

/* ---------- Upload view ---------- */

.card.upload-card {
  padding: 3rem 2rem;
  text-align: center;
  animation: float 3s ease-in-out infinite;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card.upload-card:hover {
  animation-play-state: paused;
  transform: translateY(-6px) scale(1.015);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.1), inset 0 1px 2px rgba(255, 255, 255, 0.6);
}

.icon-ring {
  width: 84px;
  height: 84px;
  margin: 0 auto 22px;
  border-radius: 22px;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.8), 0 8px 20px rgba(139, 92, 246, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.icon-ring i {
  font-size: 34px;
  color: #8b5cf6;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.dropzone {
  border-radius: 20px;
  padding: 8px;
  cursor: pointer;
}

.card.upload-card:hover .icon-ring {
  transform: scale(1.08);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.8), 0 10px 26px rgba(139, 92, 246, 0.3);
}

.title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 14px;
  color: #7c7c8e;
  margin-bottom: 24px;
}

.upload-card .btn {
  background: linear-gradient(135deg, #a855f7 0%, #8b5cf6 100%);
  color: white;
  padding: 13px 30px;
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.4);
}

.upload-card .btn i {
  font-size: 16px;
}

.dropzone.drag-over .icon-ring {
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.8), 0 8px 26px rgba(139, 92, 246, 0.35);
}

.file-input {
  display: none;
}

.formats {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}

.fmt {
  font-size: 11px;
  font-weight: 600;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 4px 10px;
  border-radius: 8px;
}

.selected-file {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 12px 14px;
  margin-top: 20px;
  background: rgba(168, 85, 247, 0.06);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 14px;
}

.selected-file .fileicon {
  flex-shrink: 0;
}

.selected-file .meta {
  overflow: hidden;
}

.selected-file .name {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* ---------- Progress / stepper view ---------- */

.card.progress-card {
  padding: 2.2rem;
}

.progress-card .title {
  font-size: 17px;
  font-weight: 600;
  color: #2d2d44;
  margin-bottom: 20px;
  background: none;
  -webkit-text-fill-color: initial;
}

.bar {
  height: 6px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 24px;
}

.fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #8b5cf6 0%, #6366f1 100%);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.5);
  transition: width 0.4s ease;
}

.item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 18px;
}

.item.dim {
  opacity: 0.4;
}

.dot {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 14px;
  background: rgba(200, 200, 220, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05), inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

.dot i {
  font-size: 17px;
  color: #9299a8;
}

.dot.done {
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.55);
}

.dot.done i {
  color: #22c55e;
}

.dot.active {
  background: rgba(168, 85, 247, 0.28);
  border: 1px solid rgba(168, 85, 247, 0.75);
  box-shadow: 0 8px 20px rgba(168, 85, 247, 0.25), inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

.dot.active i {
  color: #8b5cf6;
}

.label {
  font-size: 14px;
  font-weight: 600;
  color: #2d2d44;
  margin-bottom: 2px;
}

.desc {
  font-size: 12px;
  color: #9299a8;
}

.pill {
  background: rgba(168, 85, 247, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(168, 85, 247, 0.3);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13px;
  color: #6366f1;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6366f1;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ---------- Header (file summary) shared by review / rejected views ---------- */

.header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding: 0 2rem 18px;
  padding-top: 2rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.fileicon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fileicon i {
  font-size: 20px;
  color: #8b5cf6;
}

.meta {
  flex: 1;
  overflow: hidden;
}

.name {
  font-size: 16px;
  font-weight: 600;
  color: #2d2d44;
  margin-bottom: 3px;
}

.info {
  font-size: 12px;
  color: #9299a8;
}

.badge {
  background: rgba(251, 191, 36, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #b45309;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.6);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* ---------- Review (pending) view ---------- */

.card.review-card {
  max-width: 720px;
  padding-bottom: 2rem;
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  color: #8b5cf6;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: 4px 0 8px;
}

.table-wrap.line-items-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, 0.4) transparent;
  padding-bottom: 6px;
}

.line-items-wrap::-webkit-scrollbar {
  height: 6px;
}

.line-items-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.line-items-wrap::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.35);
  backdrop-filter: blur(6px);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.line-items-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.6);
  background-clip: padding-box;
}

.line-items-wrap table {
  width: max-content;
  min-width: 100%;
}

.line-items-wrap th,
.line-items-wrap td {
  white-space: nowrap;
}

.review-card .body {
  padding: 0 2rem;
}

.table-wrap {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(168, 85, 247, 0.2);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.8), 0 4px 12px rgba(0, 0, 0, 0.04);
  margin-bottom: 18px;
}

.review-card table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
}

.review-card thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: #8b5cf6;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: rgba(168, 85, 247, 0.1);
  padding: 10px 14px;
  border-bottom: 1px solid rgba(168, 85, 247, 0.2);
}

.review-card thead th:last-child {
  text-align: right;
}

.review-card tbody td {
  padding: 11px 14px;
  font-size: 13px;
  color: #2d2d44;
  border-bottom: 1px solid rgba(168, 85, 247, 0.1);
}

.review-card tbody tr:last-child td {
  border-bottom: none;
}

.review-card tbody tr:nth-child(even) {
  background: rgba(168, 85, 247, 0.04);
}

.field-name {
  font-weight: 500;
  color: #4b4b63;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.field-name i {
  font-size: 14px;
  color: #a78bfa;
}

.value-cell {
  font-weight: 700;
  color: #4c1d95;
}

.value-cell input {
  width: 100%;
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 700;
  color: #4c1d95;
  padding: 2px 0;
}

.value-cell input:not([readonly]) {
  border-bottom: 1px solid #8b5cf6;
}

.value-cell input:focus {
  outline: none;
}

.conf-cell {
  text-align: right;
}

.conf-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.conf-high {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

.conf-mid {
  background: rgba(251, 191, 36, 0.18);
  color: #b45309;
}

.review-card tbody td.value-cell input {
  min-width: 90px;
}

.summary {
  background: rgba(251, 191, 36, 0.1);
  backdrop-filter: blur(10px);
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-left: 4px solid rgba(251, 191, 36, 0.6);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.8), 0 4px 12px rgba(0, 0, 0, 0.04);
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.summary i {
  font-size: 16px;
  color: #b45309;
  margin-top: 1px;
}

.stext {
  font-size: 13px;
  color: #92400e;
  line-height: 1.5;
}

.stext b {
  color: #78350f;
}

/* ---------- Rejected / error view ---------- */

.card.rejected-card {
  padding: 2.4rem 2rem;
}

.rejected-card .header {
  padding: 0 0 18px;
  margin-bottom: 22px;
}

.status-block {
  text-align: center;
  padding: 1.2rem 0.5rem 1.6rem;
}

.status-ring {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 20px;
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.8), 0 8px 20px rgba(100, 116, 139, 0.1);
}

.status-ring.error {
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.status-ring.success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.status-ring i {
  font-size: 30px;
  color: #64748b;
}

.status-ring.error i {
  color: #dc2626;
}

.status-ring.success i {
  color: #22c55e;
}

.status-title {
  font-size: 18px;
  font-weight: 700;
  color: #2d2d44;
  margin-bottom: 8px;
}

.status-text {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.6;
  max-width: 340px;
  margin: 0 auto;
}

.status-text b {
  color: #4b4b63;
}

.expected-wrap {
  background: rgba(99, 102, 241, 0.06);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 20px;
}

.expected-title {
  font-size: 11px;
  font-weight: 700;
  color: #6366f1;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 10px;
}

.expected-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.expected-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #4b4b63;
}

.expected-item i {
  font-size: 15px;
  color: #a78bfa;
}

/* ---------- Notification Side bar ---------- */

#sidebar-toggle,
#home-btn {
  position: fixed;
  top: 16px;
  z-index: 1000;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: background 0.2s ease, border-color 0.2s ease;
}

#sidebar-toggle {
  left: 16px;
}

#home-btn {
  left: 64px;
}

#sidebar-toggle:hover,
#home-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(168, 85, 247, 0.4);
}

#sidebar-toggle i,
#home-btn i {
  font-size: 18px;
  color: #9299a8;
}

#sidebar-toggle .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: red;
  color: white;
  font-size: 0.7rem;
  border-radius: 50%;
  padding: 2px 6px;
}

#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 280px;
  background: #f7f7f7;
  border-right: 1px solid #ddd;
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  z-index: 950;
  padding: 60px 16px 16px;
  overflow-y: auto;
  box-shadow: 8px 0 30px rgba(0, 0, 0, 0.12);
}

#sidebar.open {
  transform: translateX(0);
}

#sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 30, 0.25);
  backdrop-filter: blur(2px);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

#sidebar-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-title {
  font-size: 11px;
  font-weight: 700;
  color: #8b5cf6;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 12px;
}

#sidebar-list {
  list-style: none;
}

#sidebar-list li {
  padding: 10px;
  margin-bottom: 6px;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid #eee;
}

#sidebar-list li:hover {
  background: #eef;
}

/* ---------- Responsive ---------- */

@media (max-width: 560px) {
  body {
    padding: 1.25rem 0.75rem;
  }

  .card {
    border-radius: 20px;
  }

  .card.upload-card {
    padding: 2rem 1.25rem;
  }

  .card.progress-card {
    padding: 1.5rem;
  }

  .card.rejected-card {
    padding: 1.75rem 1.25rem;
  }

  .review-card .header {
    padding: 1.25rem 1.25rem 16px;
    flex-wrap: wrap;
  }

  .review-card .body {
    padding: 0 1.25rem;
  }

  .review-card thead th,
  .review-card tbody td {
    padding: 9px 10px;
    font-size: 12px;
  }

  .actions {
    flex-wrap: wrap;
  }

  .actions .btn {
    flex-basis: 100%;
  }
}

