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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  min-height: 100vh;
  padding: 20px;
  background: #f5f5f5;
}

.container {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  padding: 20px;
  max-width: 800px;
  width: 100%;
  margin: 0 auto 20px;
}

h1 {
  color: #222;
  margin-bottom: 12px;
  font-size: 32px;
  letter-spacing: -0.2px;
  font-weight: 700;
}

.subtitle {
  color: #666;
  margin-bottom: 30px;
  font-size: 14px;
}

.upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border: 2px dashed rgba(28,118,0,0.9);
  border-radius: 12px;
  padding: 34px;
  text-align: center;
  margin-bottom: 20px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(245,255,243,0.6), rgba(255,255,255,0.4));
  box-shadow: 0 6px 18px rgba(28,118,0,0.04);
}

.upload-area:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(28,118,0,0.06);
  background: linear-gradient(180deg, rgba(245,255,243,0.85), #fff);
}

.upload-area.dragover {
  background: #f2fff4;
  border-color: rgb(28, 118, 0);
  transform: scale(1.02);
}

.upload-area:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(28,118,0,0.08);
  transform: translateY(-2px);
}

input[type="file"] {
  display: none;
}

.btn {
  background: rgb(28, 118, 0);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.2s;
  display: inline-block;
  margin-top: 10px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.results {
  margin-top: 30px;
  display: none;
}

.results.show {
  display: block;
}

.stats-container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.stat {
  flex: 1;
  min-width: 120px;
  text-align: center;
  background: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.summary {
  background: #f8f9ff;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
}

.summary h3 {
  text-align: center;
  margin-bottom: 20px;
}

.transaction-list {
  max-height: 400px;
  overflow-y: auto;
}

.transaction {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.transaction-info {
  flex: 1;
}

.transaction-desc {
  font-weight: 500;
  color: #333;
  margin-bottom: 5px;
}

.transaction-meta {
  font-size: 12px;
  color: #666;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  margin-right: 5px;
}

.badge-success {
  background: #d4edda;
  color: #155724;
}

.badge-warning {
  background: #fff3cd;
  color: #856404;
}

.badge-info {
  background: #d1ecf1;
  color: #0c5460;
}

.badge-danger {
  background: #f8d7da;
  color: #721c24;
}

.loading {
  display: none;
  text-align: center;
  padding: 20px;
}

.loading.show {
  display: block;
}

.progress-bar-container {
  width: 100%;
  max-width: 400px;
  height: 20px;
  background-color: #f0f0f0;
  border-radius: 10px;
  overflow: hidden;
  margin: 0 auto 10px;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background-color: rgb(28, 118, 0);
  transition: width 0.3s ease;
}

.amount {
  font-weight: 600;
  color: #333;
}

/* Transactions table styling */
.transactions-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  box-shadow: 0 6px 20px rgba(102,126,234,0.06);
  border-radius: 8px;
  overflow: hidden;
  min-width: 700px;
}

.transactions-table thead {
  background: #f1f4ff;
}

.transactions-table thead th {
  text-align: left;
  padding: 12px 16px;
  font-size: 13px;
  color: #334155;
  font-weight: 600;
  border-bottom: 1px solid #e6e9f2;
  position: sticky;
  top: 0;
  z-index: 1;
}

.transactions-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #f7f9ff;
  font-size: 13px;
  color: #333;
  vertical-align: middle;
  white-space: nowrap;
}

.transactions-table tbody tr:hover {
  background: #fbfdff;
}

.transactions-table tbody tr:last-child td {
  border-bottom: none;
}

/* Cell-specific */
.desc-cell {
  max-width: 320px;
  white-space: normal;
  word-break: break-word;
  color: #222;
}

.date-cell {
  width: 120px;
  color: #666;
}

.amount-cell {
  width: 120px;
  text-align: right;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", monospace;
}

/* Amount color helpers — use in script when needed */
.amount-positive {
  color: #16a34a; /* green */
}

.amount-negative {
  color: #dc2626; /* red */
}

.category-cell,
.subcategory-cell {
  width: 150px;
  color: #444;
}

.status-cell {
  width: 120px;
  text-align: center;
}

/* Responsive tweaks */
@media (max-width: 720px) {
  .transactions-table { min-width: 600px; font-size: 13px; }
  .container { padding: 20px; }
}

#resultsContainer {
  display: none;
}

#resultsContainer.show {
  display: block;
}

.title-accent {
  color: rgb(28, 118, 0);
  margin-right: 6px;
}

.upload-area .upload-icon {
  width: 44px;
  height: 44px;
  color: rgb(28,118,0);
  opacity: 0.95;
}

.upload-area .upload-text {
  font-size: 15px;
  color: #1f2937;
  font-weight: 600;
}

.upload-area .support-text {
  font-size: 13px;
  color: #718096;
}

#fileName {
  color: #4a5568;
  font-size: 14px;
  margin-top: 8px;
}
