:root {
  --blue: #0b5cad;
  --bg: #f4f6f9;
  --ink: #1f2933;
  --muted: #7b8794;
  --line: #e4e7eb;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
.muted { color: var(--muted); font-size: 13px; }
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
}
button {
  background: var(--blue);
  color: #fff;
  border: 0;
  padding: 9px 16px;
  border-radius: 7px;
  font-size: 14px;
  cursor: pointer;
}
button:disabled { opacity: .5; cursor: not-allowed; }
button.ghost { background: transparent; color: var(--blue); border: 1px solid var(--line); }
input {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 14px;
  margin-right: 8px;
}

/* Login */
.login-page { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.login-card { width: 320px; text-align: center; }
.login-card h1 { font-size: 20px; margin: 0 0 4px; }
.login-card input { width: 100%; margin: 12px 0; }
.login-card button { width: 100%; }
.error { color: #c0392b; font-size: 13px; }

/* Topbar */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 12px 20px;
}
.wrap { max-width: 860px; margin: 20px auto; padding: 0 16px; }

.summary { display: flex; gap: 40px; }
.big { font-size: 24px; font-weight: 700; color: var(--blue); }

.warn { border-left: 4px solid #e6a23c; }

.disclaimer { background: #fff8e6; border: 1px solid #f0d98c; color: #7a5b00; font-size: 13px; }
.history { background: #eef6ee; border: 1px solid #cbe3cb; }
.advice-row { font-size: 13px; margin-top: 6px; color: #2c5d2c; }
table.bills tr.done { opacity: 0.55; }

/* Vendor blocks */
.vendor-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.vendor-name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.vendor-total { font-weight: 700; }
table.bills { width: 100%; border-collapse: collapse; font-size: 14px; }
table.bills td { padding: 6px 8px; border-top: 1px solid var(--line); }
table.bills td.amt { text-align: right; font-variant-numeric: tabular-nums; }
td.paycell { white-space: nowrap; text-align: right; }
.paylabel { font-size: 12px; color: var(--muted); margin-right: 4px; }
.pay-amt { width: 100px; text-align: right; margin-right: 0; }
.pay-amt:disabled { background: #f4f6f9; color: #aab2bd; }
.paidbadge {
  display: inline-block; background: #e6f4ea; color: #1e7e34;
  font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 20px;
}
.declinedbadge {
  display: inline-block; background: #fde8e8; color: #c0392b;
  font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 20px;
}
.resnote { font-size: 11px; color: #555; font-style: italic; margin-left: 4px; }
.resline { margin-bottom: 6px; text-align: right; }

.bucket { font-size: 11px; padding: 2px 7px; border-radius: 20px; background: #eef2f7; }
.b-Current { background: #e6f4ea; color: #1e7e34; }
.b-1-30 { background: #fff6e6; color: #b8860b; }
.b-31-60 { background: #fdeede; color: #c0651a; }
.b-61-90 { background: #fde8e8; color: #c0392b; }
.b-90plus { background: #f8d7da; color: #a4151b; }

/* Submit bar */
.submitbar { display: flex; justify-content: space-between; align-items: center; position: sticky; bottom: 12px; }
.submit-right { text-align: right; }
.seltotal { margin-bottom: 8px; font-size: 14px; }

/* Toast */
.toast { padding: 12px 16px; border-radius: 8px; text-align: center; }
.toast.ok { background: #e6f4ea; color: #1e7e34; }
.toast.err { background: #fde8e8; color: #c0392b; }
