/* Homebuyer Qualification App - minimal styling */
:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #dc2626;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px;
}

.topbar {
  background: var(--topbar-bg, #0b1220);
  color: #fff;
  padding: 10px 16px;
}

.topbar .inner {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { font-weight: 700; letter-spacing: 0.2px; display:flex; align-items:center; gap:10px; }
.brand .logo { height: 28px; width: auto; display:block; }
.brand-link { color:#fff; text-decoration:none; }
.brand-link:hover { text-decoration:none; opacity:0.95; }
.nav a { color: #fff; margin-left: 12px; opacity: 0.9; }
.nav a:hover { opacity: 1; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.card + .card { margin-top: 16px; }

.h1 { font-size: 26px; margin: 0 0 6px 0; }
.sub { color: var(--muted); margin: 0 0 16px 0; }

.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

label { display: block; font-weight: 600; margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  padding: 10px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
}
textarea { min-height: 90px; }

.help { color: var(--muted); font-size: 13px; margin-top: 4px; }

.btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--primary);
  color: #fff;
  font-weight: 650;
  cursor: pointer;
  font-size: 14px;
}
.btn:hover { background: var(--primary-hover); }
.btn.secondary { background: #fff; color: var(--text); border-color: var(--border); }
.btn.secondary:hover { background: #f3f4f6; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { filter: brightness(0.95); }

.btn-row {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  background: #f9fafb;
}

hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th, .table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table th { text-align: left; color: var(--muted); font-weight: 700; }

.notice {
  border-left: 4px solid var(--primary);
  background: #eff6ff;
  padding: 10px 12px;
  border-radius: 10px;
  margin: 12px 0;
}

.notice.warn {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.notice.danger {
  border-left-color: var(--danger);
  background: #fef2f2;
}

.small { font-size: 13px; color: var(--muted); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 9999;
}
.modal {
  width: min(560px, 100%);
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  border: 1px solid var(--border);
}
.modal h3 { margin: 0 0 8px 0; }
.modal .btn-row { justify-content: flex-end; }

.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 10px 12px;
  border-radius: 10px;
  color: #991b1b;
  margin-bottom: 12px;
}

.success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 10px 12px;
  border-radius: 10px;
  color: #065f46;
  margin-bottom: 12px;
}


/* Forms */
.checkbox { display:flex; gap:10px; align-items:flex-start; font-weight:600; margin: 12px 0; }
.checkbox input { width:auto; margin-top:3px; }
.hidden { display:none; }

/* County/city selectors */
.chips { display:flex; flex-wrap:wrap; gap:8px; border:1px solid var(--border); padding:10px; border-radius:10px; background:#fff; max-height:260px; overflow:auto; }

/* County list: show as full-width rows with the checkbox on the left */
.chips.county-list { display:block; }
.chips.county-list .chip { display:flex; align-items:center; gap:10px; width:100%; border:0; border-bottom:1px solid var(--border); border-radius:0; padding:10px 6px; background:transparent; }
.chips.county-list .chip:last-child { border-bottom:0; }
.chips.county-list .chip input { margin:0; }
.chip { display:inline-flex; align-items:center; gap:8px; padding:6px 10px; border:1px solid var(--border); border-radius:999px; cursor:pointer; user-select:none; background:#f9fafb; }
.chip input { width:auto; }
.chip:hover { background:#f3f4f6; }

@media print {
  .topbar, .btn-row, .no-print { display:none !important; }
  body { background:#fff; }
  .card { border:none; box-shadow:none; }
}


/* Admin dashboard charts */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.metric {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.muted {
  color: var(--muted);
}
.barlist .row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}
.barlist .label {
  width: 130px;
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.barlist .bar {
  flex: 1;
  height: 10px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.barlist .bar > span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  background: #fff;
}
.notice.danger {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239;
}
svg.spark {
  width: 100%;
  height: 110px;
  display: block;
}


/* Footer */
.footer{
  margin-top:30px;
  padding:16px 0;
  background: var(--topbar-bg, #0b1220);
  color:#fff;
  font-size:13px;
}
.footer-inner{
  max-width:980px;
  margin:0 auto;
  padding:0 16px;
}
.footer a{ color:#fff; text-decoration: underline; }
.footer a:hover{ opacity: 0.95; }
/* --- Follow-ups UI enhancements --- */
.table-wrap { overflow-x: auto; }

.btn.tiny {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.2;
}

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
  margin-left: 6px;
  vertical-align: middle;
}

.pill-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.pill-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.pill-danger  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.pill-muted   { background: #f3f4f6; border-color: #e5e7eb; color: #374151; }

/* Ensure footer isn't hidden behind long content / fixed elements */
.footer { position: relative; z-index: 1; }
