/* ========== Base ========== */
:root {
  --brand: #1E3A5F;
  --brand-light: #2c5282;
  --accent: #2563eb;
  --success: #16a34a;
  --danger: #dc2626;
  --bg: #f0f4f8;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #cbd5e1;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
}

/* ========== Navbar ========== */
.navbar {
  background: var(--brand);
  padding: 10px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

/* ========== Cards ========== */
.card {
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  background: var(--card-bg);
}

.card-header {
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 13px;
  color: var(--brand);
  padding: 10px 16px;
  border-radius: 10px 10px 0 0 !important;
}

/* ========== Drop zone ========== */
.dropzone {
  border: 2px dashed var(--accent);
  border-radius: 10px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  background: #eff6ff;
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.dropzone:hover, .dropzone.drag-over {
  background: #dbeafe;
  border-color: var(--brand);
  transform: scale(1.01);
}

.dropzone p {
  margin: 0;
  line-height: 1.4;
}

/* ========== Table ========== */
#gastosTable thead tr {
  background: var(--brand);
}

#gastosTable thead th {
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 9px 10px;
  border: none;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--brand);
}

#gastosTable tbody tr {
  transition: background 0.12s;
}

#gastosTable tbody tr:hover {
  background: #eff6ff !important;
}

#gastosTable td {
  vertical-align: middle;
  padding: 7px 10px;
  font-size: 13px;
  border-color: #e2e8f0;
}

.btn-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 15px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.btn-delete:hover {
  color: var(--danger);
  background: #fee2e2;
}

/* ========== Totals bar ========== */
.total-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand);
  color: #fff;
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 600;
}

.total-chip .currency {
  opacity: 0.7;
  font-size: 11px;
}

/* ========== Buttons ========== */
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.btn-success {
  background: var(--success);
  border-color: var(--success);
}
.btn-success:hover {
  background: #15803d;
  border-color: #15803d;
}

/* ========== Toast ========== */
.toast {
  min-width: 280px;
}
.toast.bg-success { color: #fff; }
.toast.bg-danger  { color: #fff; }

/* ========== Misc ========== */
.badge.bg-primary { background: var(--accent) !important; }

#emptyState {
  padding: 60px 20px;
}

.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 0.2rem rgba(37,99,235,0.15);
}

/* Spinner overlay */
#dropzoneLoading {
  flex-direction: column;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Row number badge */
.row-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e2e8f0;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
}

/* Categoria pill */
.cat-pill {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 500;
  white-space: nowrap;
}

.monto-cell {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
