:root {
  --navy: #0A1F44;
  --teal: #00B4D8;
  --bg: #F8F9FA;
  --border: #E2E5EA;
  --text: #1B2430;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, Segoe UI, Roboto, sans-serif; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }

.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--navy); }
.login-card { background: white; padding: 40px; border-radius: 12px; text-align: center; width: 320px; }
.login-card h1 { margin: 0 0 4px; color: var(--navy); }
.subtitle { color: #667; margin-bottom: 24px; }
.error { color: #C0392B; font-size: 14px; }

.topbar { display: flex; justify-content: space-between; align-items: center; background: var(--navy); color: white; padding: 14px 24px; }
.brand { font-weight: 600; }
.who { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.link-btn { background: none; border: none; color: var(--teal); cursor: pointer; text-decoration: underline; }

main { max-width: 1100px; margin: 24px auto; padding: 0 16px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.card { background: white; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.card .label { font-size: 12px; color: #667; text-transform: uppercase; letter-spacing: .03em; }
.card .value { font-size: 22px; font-weight: 700; color: var(--navy); margin-top: 4px; }

.panel { background: white; border: 1px solid var(--border); border-radius: 10px; padding: 18px; margin-bottom: 24px; }
.panel-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.panel-header h2 { margin: 0; font-size: 16px; }

.upload-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.upload-form input, .upload-form select { padding: 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }
.upload-form button { background: var(--teal); color: white; border: none; padding: 9px 16px; border-radius: 6px; cursor: pointer; }
#upload-msg { font-size: 13px; color: #667; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters input, .filters select { padding: 6px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.filters button { padding: 6px 12px; border-radius: 6px; border: 1px solid var(--navy); background: white; cursor: pointer; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: #667; font-weight: 600; }
select.inline { padding: 4px; border-radius: 4px; border: 1px solid var(--border); font-size: 12px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.badge-paid { background: #E6F6EA; color: #1E7A34; }
.badge-unpaid { background: #FDECEC; color: #C0392B; }
.badge-partial { background: #FFF6E0; color: #B8860B; }
.badge-writeoff { background: #EEE; color: #666; }
