@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #17203A;
  --navy: #131B33;
  --muted: #6B7280;
  --bg: #F5F6FA;
  --card-bg: #FFFFFF;
  --border: #E7E9F0;

  --green-bg: #E7F7ED;
  --green-text: #1B8A44;
  --green-border: #BFE8CE;

  --red-bg: #FDEBEB;
  --red-text: #C0392B;
  --red-border: #F5C6C2;

  --orange-bg: #FFF3E0;
  --orange-text: #C9760B;
  --orange-border: #F7D9A8;

  --gray-bg: #F0F1F4;
  --gray-text: #6B7280;
  --gray-border: #DFE1E8;

  --accent: #2F6FED;
}

* { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }

body {
  background: var(--bg);
  color: var(--ink);
}

/* ---------- Login ---------- */
.login-body { background: var(--navy); }
.login-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 2.25rem 2rem;
  width: 100%;
  max-width: 360px;
}
.brand-mark {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.4rem;
}
.brand-mark-sm {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--accent); color: #fff; font-size: .85rem; font-weight: 800;
  margin-right: 4px;
}

/* ---------- Navbar ---------- */
.app-navbar { background: var(--navy); }

/* ---------- Summary cards ---------- */
.summary-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  user-select: none;
}
.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(23,32,58,0.08);
}
.summary-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(47,111,237,0.15);
}
.summary-amount {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.summary-label {
  font-size: .82rem;
  color: var(--muted);
  margin-top: .35rem;
  font-weight: 500;
}
.card-total .summary-amount { color: var(--ink); }
.card-received .summary-amount { color: var(--green-text); }
.card-pending .summary-amount { color: var(--red-text); }
.card-notgen .summary-amount { color: var(--gray-text); }
.card-notgen { background: var(--gray-bg); border-color: var(--gray-border); }

/* ---------- Table ---------- */
.bills-table-wrap {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.bills-table thead th {
  background: #FAFBFD;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  padding: .85rem 1rem;
}
.bills-table tbody td {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: .92rem;
}
.bills-table tbody tr:last-child td { border-bottom: none; }

.status-cell {
  border-radius: 8px;
}
.status-badge {
  display: inline-block;
  padding: .3rem .65rem;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
}
.status-received { background: var(--green-bg); color: var(--green-text); border: 1px solid var(--green-border); }
.status-pending   { background: var(--red-bg); color: var(--red-text); border: 1px solid var(--red-border); }
.status-partial   { background: var(--orange-bg); color: var(--orange-text); border: 1px solid var(--orange-border); }
.status-notgen    { background: var(--gray-bg); color: var(--gray-text); border: 1px solid var(--gray-border); }

tr.row-received td.status-cell { background: var(--green-bg); }
tr.row-pending   td.status-cell { background: var(--red-bg); }
tr.row-partial   td.status-cell { background: var(--orange-bg); }
tr.row-notgen    td.status-cell { background: var(--gray-bg); }

.btn-toggle {
  font-size: .8rem;
  font-weight: 600;
  border-radius: 8px;
  padding: .35rem .7rem;
}

/* ---------- Mobile bill cards ---------- */
.bill-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .9rem 1rem;
  margin-bottom: .65rem;
}
.bill-card.row-received { border-left: 4px solid var(--green-text); }
.bill-card.row-pending   { border-left: 4px solid var(--red-text); }
.bill-card.row-partial   { border-left: 4px solid var(--orange-text); }
.bill-card.row-notgen    { border-left: 4px solid var(--gray-text); }

.btn-part {
  font-size: .8rem;
  font-weight: 600;
  border-radius: 8px;
  padding: .35rem .7rem;
}
.bills-table { table-layout: fixed; }
.bills-table td { word-wrap: break-word; }
.bills-table .bc-actions { display: flex; gap: .35rem; flex-wrap: nowrap; }
.bills-table .btn-toggle,
.bills-table .btn-part {
  white-space: nowrap;
  padding-left: .5rem;
  padding-right: .5rem;
  font-size: .76rem;
}

.bc-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.bc-sub {
  font-size: .78rem;
  color: var(--muted);
  margin-top: .2rem;
}
.bill-card .bc-top {
  display: flex; justify-content: space-between; align-items: flex-start;
}
.bill-card .bc-school {
  font-weight: 600; font-size: .95rem; color: var(--ink);
}
.bill-card .bc-amount {
  font-weight: 800; font-size: 1.05rem;
}
.bill-card .bc-bottom {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: .6rem;
}
