:root {
  --brand: #1c3d5a;
  --brand-light: #2f5d84;
  --accent: #c9a227;
  --bg: #f5f6f8;
  --card-bg: #ffffff;
  --border: #e2e5ea;
  --text: #23272f;
  --muted: #6b7280;
  --yes: #1a7f37;
  --no: #b42318;
  --maybe: #92720a;
}

* { box-sizing: border-box; }

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

.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.page-header h1 {
  margin: 8px 0 4px;
  font-size: 28px;
  color: var(--brand);
}

.subtitle {
  color: var(--muted);
  margin: 0 0 16px;
}

.back-link {
  color: var(--brand-light);
  text-decoration: none;
  font-size: 14px;
}
.back-link:hover { text-decoration: underline; }

.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.agent-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 12px;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow .15s ease, transform .15s ease;
}
.agent-card:hover {
  box-shadow: 0 4px 14px rgba(28,61,90,0.12);
  transform: translateY(-2px);
}

.agent-initial {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 18px;
}

.agent-name {
  font-weight: 600;
}

.footer {
  margin-top: 40px;
  text-align: center;
}
.footer a {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}
.footer a:hover { text-decoration: underline; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-top: 20px;
}

.card h2 {
  margin-top: 0;
  font-size: 18px;
  color: var(--brand);
}

.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.form-row label {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.form-row label.full-width { flex-basis: 100%; }

.form-row input[type=text],
.form-row input[type=date],
.form-row input[type=tel],
.form-row input[type=email],
.form-row select,
.form-row textarea {
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.checkbox-label {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
}
.checkbox-label input { width: auto; }

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn-primary {
  background: var(--brand);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}
.btn-primary:hover { background: var(--brand-light); }

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--border);
  padding: 9px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.btn-secondary:hover { border-color: var(--brand); }

.table-scroll { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.muted { color: var(--muted); }

.feedback-cell { max-width: 280px; white-space: pre-wrap; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-yes { background: #e6f4ea; color: var(--yes); }
.badge-no { background: #fbe9e7; color: var(--no); }
.badge-maybe { background: #fdf3d9; color: var(--maybe); }

.row-actions { display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.row-actions a { color: var(--brand-light); font-size: 13px; text-decoration: none; }
.row-actions a:hover { text-decoration: underline; }

.link-btn {
  background: none;
  border: none;
  color: var(--no);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.link-btn:hover { text-decoration: underline; }

.empty-state { color: var(--muted); font-style: italic; }

.house-group { margin-bottom: 28px; }
.house-group:last-child { margin-bottom: 0; }

.house-heading {
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--brand);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.house-count {
  color: var(--muted);
  font-weight: 400;
  font-size: 13px;
}

.house-grid { margin-top: 0; }

.house-card-address {
  font-weight: 600;
  text-align: center;
  font-size: 14px;
}

.house-card-count {
  color: var(--muted);
  font-size: 12px;
}

.bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-danger {
  background: var(--no);
  color: white;
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.btn-danger:disabled {
  background: #e3b7b0;
  cursor: not-allowed;
}
