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

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #f5f6fa;
  color: #2d3436;
  min-height: 100vh;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #2d3436;
}

.subtitle {
  color: #636e72;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* Drop zone */
.drop-zone {
  border: 2px dashed #b2bec3;
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: #0984e3;
  background: #f0f8ff;
}

.drop-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.drop-zone p {
  color: #636e72;
}

.drop-hint {
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

/* Loading */
.loading {
  text-align: center;
  padding: 3rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #dfe6e9;
  border-top-color: #0984e3;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Summary cards */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.card {
  background: #fff;
  border-radius: 10px;
  padding: 1.25rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card-label {
  font-size: 0.8rem;
  color: #636e72;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.card-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.card-count {
  font-size: 0.8rem;
  color: #b2bec3;
  margin-top: 0.25rem;
}

.card-credit .card-value { color: #00b894; }
.card-debit .card-value { color: #d63031; }
.card-balance .card-value { color: #2d3436; }
.card-balance.positive .card-value { color: #00b894; }
.card-balance.negative .card-value { color: #d63031; }

/* Actions */
.actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.btn {
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-primary {
  background: #0984e3;
  color: #fff;
}

.btn-primary:hover { background: #0773c5; }

.btn-secondary {
  background: #dfe6e9;
  color: #2d3436;
}

.btn-secondary:hover { background: #b2bec3; }

/* Table */
.table-section h2 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.table-wrapper {
  overflow-x: auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th {
  background: #f5f6fa;
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-weight: 600;
  color: #636e72;
  border-bottom: 2px solid #dfe6e9;
  white-space: nowrap;
}

td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #f0f0f0;
}

tr:last-child td { border-bottom: none; }

.col-amount { text-align: right; }

td.amount {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

td.amount.credit { color: #00b894; }
td.amount.debit { color: #d63031; }

td.dc-badge {
  text-align: center;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-c { background: #e8f8f5; color: #00b894; }
.badge-d { background: #fde8e8; color: #d63031; }

/* Combined download */
.combined-download {
  text-align: center;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #e8f8f5;
  border-radius: 10px;
  border: 2px solid #00b894;
}

.combined-download .btn {
  font-size: 1rem;
  padding: 0.8rem 2rem;
}

/* File sections */
.file-section {
  margin-bottom: 1.5rem;
}

.file-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: #fff;
  border-radius: 10px 10px 0 0;
  border-bottom: 2px solid #dfe6e9;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.file-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.file-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.file-stats {
  font-size: 0.8rem;
  color: #b2bec3;
}

.badge-bank {
  background: #e8f0fe;
  color: #0984e3;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}

.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
}

.file-section .table-wrapper {
  border-radius: 0 0 10px 10px;
}

/* Error */
.error {
  text-align: center;
  padding: 2rem;
  background: #fde8e8;
  border-radius: 10px;
  color: #d63031;
}

.error .btn { margin-top: 1rem; }

/* Footer */
footer {
  text-align: center;
  margin-top: 3rem;
  color: #b2bec3;
  font-size: 0.8rem;
}

.hidden { display: none !important; }

/* Responsive */
@media (max-width: 640px) {
  .summary-cards { grid-template-columns: 1fr; }
  .actions { flex-direction: column; }
  .container { padding: 1rem 0.75rem; }
  header h1 { font-size: 1.3rem; }
}
