@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700&family=Barlow+Semi+Condensed:wght@500;600;700&family=Noto+Sans:wght@400;500;600;700&display=swap');

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

:root {
  --primary: #ed1c24;
  --primary-dark: #6d0000;
  --primary-light: #fef2f2;
  --accent: #00B5E2;
  --accent-light: #e8f8fc;
  --green: #16a34a;
  --green-light: #f0fdf4;
  --red: #dc2626;
  --red-light: #fef2f2;
  --orange: #ea580c;
  --orange-light: #fff7ed;
  --charcoal: #231f20;
  --gray-50: #f3f1f2;
  --gray-100: #e8e6e7;
  --gray-200: #d5d3d4;
  --gray-300: #c9cace;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4a4546;
  --gray-700: #374151;
  --gray-800: #231f20;
  --gray-900: #111827;
  --radius: 8px;
}

body {
  font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.5;
}

/* Layout */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 3px solid var(--primary);
  margin-bottom: 32px;
}

header h1 {
  font-family: 'Barlow Semi Condensed', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--charcoal);
}

header .subtitle {
  font-size: 13px;
  color: var(--gray-600);
}

header .logo {
  height: 48px;
  width: auto;
}

header .header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Section cards */
.section {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.section h2 {
  font-family: 'Barlow Semi Condensed', sans-serif;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--charcoal);
}

/* Bank grid */
.bank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.bank-card {
  position: relative;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  background: var(--gray-50);
}

.bank-card .bank-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--gray-800);
}

.bank-card .bank-format {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}

.bank-delete-btn {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  color: var(--gray-300);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.15s;
}

.bank-delete-btn:hover {
  color: var(--red);
  background: var(--red-light);
}

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  background: white;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.drop-zone p {
  color: var(--gray-500);
  font-size: 14px;
}

.drop-zone .icon {
  font-size: 32px;
  margin-bottom: 8px;
  display: block;
}

.drop-zone input[type="file"] {
  display: none;
}

/* File list */
.file-list {
  margin-top: 16px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 13px;
  background: white;
}

.file-item .file-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.file-item .file-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item .file-status {
  font-size: 12px;
  color: var(--gray-500);
  white-space: nowrap;
}

.file-item .file-bank {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
}

.file-item.success { border-left: 3px solid var(--green); }
.file-item.error { border-left: 3px solid var(--red); }
.file-item.warning { border-left: 3px solid var(--orange); }
.file-item.processing { border-left: 3px solid var(--accent); }

.file-item .remove-btn {
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  font-size: 18px;
  padding: 0 4px;
}

.file-item .remove-btn:hover { color: var(--red); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

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

.btn-primary {
  font-family: 'Barlow Condensed', sans-serif;
  background: var(--primary);
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }

.btn-green {
  background: var(--green);
  color: white;
}

.btn-green:hover:not(:disabled) { background: #15803d; }

.btn-outline {
  background: white;
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}

.btn-outline:hover:not(:disabled) {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

/* Summary bar */
.summary {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.summary.success { background: var(--green-light); color: var(--green); }
.summary.warning { background: var(--orange-light); color: var(--orange); }
.summary.error { background: var(--red-light); color: var(--red); }

/* Bank confirmation bar */
.file-item.needs-confirm {
  border-left: 3px solid var(--accent);
}

.bank-confirm-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 8px;
  background: var(--accent-light);
  border: 1px solid #b3e5f5;
  border-radius: 6px;
  font-size: 13px;
}

.bank-confirm-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bank-confirm-label {
  color: var(--gray-500);
  font-size: 12px;
}

.bank-confirm-name {
  font-weight: 600;
  color: var(--charcoal);
}

.bank-confirm-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.bank-select {
  padding: 6px 10px;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  font-size: 12px;
  background: white;
}

/* Add Bank Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal {
  background: white;
  border-radius: 12px;
  padding: 32px;
  max-width: 520px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal h2 {
  font-size: 18px;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 4px;
}

.form-group input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 14px;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(237, 28, 36, 0.1);
}

.step-indicator {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.step {
  flex: 1;
  height: 4px;
  background: var(--gray-200);
  border-radius: 2px;
}

.step.active { background: var(--primary); }
.step.done { background: var(--green); }

/* Validation banner */
.validation-banner {
  margin-bottom: 8px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  overflow: hidden;
  background: white;
}

.validation-banner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  background: #fffbeb;
  cursor: pointer;
  font-size: 12px;
  color: #92400e;
}

.validation-banner-header:hover {
  background: #fef3c7;
}

.validation-details {
  padding: 8px 14px;
  background: var(--gray-50);
  font-size: 11px;
  color: var(--gray-600);
  display: none;
  max-height: 200px;
  overflow-y: auto;
  border-top: 1px solid var(--gray-200);
}

.validation-details > div {
  padding: 2px 0;
  border-bottom: 1px solid var(--gray-100);
}

.validation-details > div:last-child { border-bottom: none; }

.validation-details.show { display: block; }

.validation-toggle {
  font-size: 11px;
  color: var(--primary);
  cursor: pointer;
  background: none;
  border: none;
  white-space: nowrap;
  font-weight: 500;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--gray-300);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Footer */
.footer {
  text-align: center;
  padding: 24px 0 8px;
  font-size: 12px;
  color: var(--gray-500);
}

.footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.footer a:hover { text-decoration: underline; }

/* Modal title */
.modal h2 {
  font-family: 'Barlow Semi Condensed', sans-serif;
  color: var(--charcoal);
}

/* Responsive */
@media (max-width: 640px) {
  .container { padding: 16px; }
  .bank-grid { grid-template-columns: 1fr 1fr; }
  .drop-zone { padding: 32px 16px; }
  header .logo { height: 36px; }
  .bank-confirm-bar { flex-direction: column; align-items: flex-start; }
  .bank-confirm-actions { width: 100%; }
  .bank-select { flex: 1; }
}
