:root {
  color-scheme: light;
  --bg: #edf2f4;
  --surface: #ffffff;
  --surface-soft: #f7fafb;
  --surface-tint: #e9f5f2;
  --line: #d6e0e5;
  --line-strong: #afc2cc;
  --text: #102431;
  --muted: #5f7180;
  --accent: #087d8f;
  --accent-dark: #075d6b;
  --accent-soft: #dff3f6;
  --danger-soft: #fff6e6;
  --danger: #9b5700;
  --shadow: 0 14px 40px rgba(18, 39, 54, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(237, 242, 244, 0) 260px),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Noto Sans Bengali", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  align-items: center;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-weight: 750;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
  white-space: nowrap;
}

button:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

button.secondary {
  background: #fff;
  color: var(--accent);
}

button.secondary:hover {
  background: var(--accent-soft);
}

input,
select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  min-height: 40px;
  min-width: 0;
  outline: none;
  padding: 8px 10px;
  width: 100%;
}

input::placeholder {
  color: #8b9aa6;
}

input:hover,
select:hover {
  border-color: var(--line-strong);
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(8, 125, 143, 0.16);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 800;
  letter-spacing: 0;
}

h2 {
  font-size: 16px;
  font-weight: 800;
}

p {
  color: var(--muted);
  margin-top: 3px;
}

.topbar {
  align-items: center;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 14px clamp(14px, 2vw, 24px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: 250px;
}

.brand-mark {
  align-items: center;
  background: linear-gradient(135deg, var(--accent), #0b6f62);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(8, 125, 143, 0.22);
  color: #fff;
  display: flex;
  flex: 0 0 42px;
  font-weight: 900;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.status-strip {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(125px, 1fr));
  max-width: 650px;
  width: min(52%, 650px);
}

.status-card {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 9px 11px;
}

.status-card span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-card strong {
  display: block;
  font-size: 15px;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
  padding: 16px;
}

.filters,
.results {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.filters {
  align-self: start;
  max-height: calc(100vh - 92px);
  overflow: auto;
  padding: 14px;
  position: sticky;
  top: 78px;
  scrollbar-gutter: stable;
}

.results {
  min-height: calc(100vh - 112px);
  min-width: 0;
  padding: 14px;
}

.section-title,
.result-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 12px;
}

.row,
.grid {
  display: grid;
  gap: 10px;
}

.priority {
  grid-template-columns: minmax(0, 1fr) 92px;
  margin-bottom: 12px;
}

.filter-group {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.filter-group + .filter-group,
.more-filters {
  margin-top: 12px;
}

.group-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  color: #243f50;
  display: grid;
  font-weight: 750;
  gap: 5px;
  min-width: 0;
}

.more-filters {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.more-filters summary {
  border-radius: 8px;
  color: var(--accent-dark);
  cursor: pointer;
  font-weight: 800;
  list-style: none;
  padding: 8px 0;
}

.more-filters summary::-webkit-details-marker {
  display: none;
}

.more-filters summary::after {
  content: "+";
  float: right;
  font-weight: 900;
}

.more-filters[open] summary::after {
  content: "-";
}

.actions {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
}

.actions button:first-child {
  min-width: 112px;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.result-list {
  display: grid;
  gap: 10px;
}

.person {
  background:
    linear-gradient(180deg, rgba(247, 250, 251, 0.85), #fff 58px),
    #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.person:hover {
  border-color: var(--line-strong);
  box-shadow: 0 8px 22px rgba(18, 39, 54, 0.07);
}

.person-head {
  align-items: center;
  border-bottom: 1px solid #edf2f5;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 12px;
}

.person-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.person-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-main strong {
  color: var(--text);
  font-size: 20px;
  line-height: 1.15;
  min-width: 0;
  overflow-wrap: anywhere;
}

.person-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.voter-chip {
  background: var(--surface-tint);
  border: 1px solid #c8e4dd;
  border-radius: 999px;
  color: #126052;
  font-weight: 850;
  padding: 5px 10px;
}

.copy-person {
  min-height: 32px;
  padding: 6px 10px;
}

.facts {
  background: #fff;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 12px;
}

.fact {
  background: var(--surface-soft);
  border: 1px solid #e1eaee;
  border-radius: 8px;
  min-width: 0;
  padding: 8px 10px;
}

.fact span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.fact strong {
  display: block;
  font-size: 15px;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.fields {
  display: grid;
  gap: 9px 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0 12px 12px;
}

.field {
  min-width: 0;
}

.field b {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 1px;
}

.field span {
  overflow-wrap: anywhere;
}

.empty,
.error {
  align-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  justify-content: center;
  min-height: 190px;
  padding: 18px;
  text-align: center;
}

.error {
  background: var(--danger-soft);
  border-color: #dfb76e;
  color: var(--danger);
}

@media (max-width: 1240px) {
  .layout {
    grid-template-columns: minmax(340px, 390px) minmax(0, 1fr);
  }

  .fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .brand {
    min-width: 0;
  }

  .status-strip {
    width: 100%;
    max-width: none;
  }

  .layout {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .filters {
    max-height: none;
    overflow: visible;
    position: static;
  }

  .results {
    min-height: 440px;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 13px;
  }

  .topbar {
    padding: 12px;
  }

  .status-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .status-card {
    padding: 8px;
  }

  .status-card strong {
    font-size: 13px;
  }

  .layout {
    gap: 12px;
  }

  .filters,
  .results {
    padding: 12px;
  }

  .section-title,
  .result-head,
  .actions,
  .result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .priority,
  .grid,
  .fields {
    grid-template-columns: 1fr;
  }

  .person-head,
  .person-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .facts,
  .fields {
    grid-template-columns: 1fr;
  }

  .copy-person {
    width: auto;
  }

  button {
    width: 100%;
  }

  .person-actions,
  .person-actions .copy-person {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .brand-mark {
    flex-basis: 38px;
    height: 38px;
    width: 38px;
  }

  .status-strip {
    grid-template-columns: 1fr;
  }
}

.result-list {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}

.person {
  background: #fff;
  border: 1px solid #cfdde4;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(18, 39, 54, 0.08);
  overflow: hidden;
  padding: 0;
}

.person:hover {
  border-color: #95b5c1;
  box-shadow: 0 16px 34px rgba(18, 39, 54, 0.12);
}

.person-head {
  align-items: center;
  background: linear-gradient(135deg, #ecf8f5, #f7fbfc);
  border-bottom: 1px solid #dce8ed;
  display: grid;
  gap: 10px;
  grid-template-columns: 46px minmax(0, 1fr);
  padding: 14px;
}

.avatar {
  align-items: center;
  background: linear-gradient(135deg, var(--accent), #0c6a5d);
  border-radius: 50%;
  color: #fff;
  display: flex;
  font-size: 20px;
  font-weight: 900;
  height: 46px;
  justify-content: center;
  width: 46px;
}

.person-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.person-kicker {
  color: #536b78;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-main strong {
  color: #0d2635;
  font-size: 21px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.facts {
  background: #fff;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 12px 14px 0;
}

.fact {
  background: #f4f8fa;
  border: 1px solid #dbe7ec;
  border-radius: 8px;
  min-height: 58px;
  min-width: 0;
  padding: 8px 10px;
}

.fact span,
.detail-item span,
.address-line span {
  color: #5d7280;
  display: block;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.fact strong {
  color: #061c29;
  display: block;
  font-size: 16px;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.detail-list {
  display: grid;
  gap: 8px 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 12px 14px;
}

.detail-item {
  border-bottom: 1px solid #edf3f5;
  min-width: 0;
  padding-bottom: 7px;
}

.detail-item b,
.address-line b {
  color: #17313f;
  display: block;
  font-size: 14px;
  font-weight: 750;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.address-line {
  background: #f8fbfc;
  border-top: 1px solid #edf3f5;
  padding: 10px 14px;
}

.person-actions {
  background: #fff;
  border-top: 1px solid #edf3f5;
  display: block;
  padding: 12px 14px 14px;
}

.copy-person {
  border-radius: 8px;
  min-height: 38px;
  padding: 8px 12px;
  width: 100%;
}

@media (max-width: 720px) {
  .result-list {
    grid-template-columns: 1fr;
  }

  .person-head {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .avatar {
    height: 42px;
    width: 42px;
  }

  .facts,
  .detail-list {
    grid-template-columns: 1fr;
  }
}

/* Full-width professional workspace layout */
.layout {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
  margin: 0 auto;
  max-width: 1720px;
  padding: 18px 22px;
}

.filters {
  max-height: none;
  overflow: visible;
  padding: 16px;
  position: static;
  top: auto;
}

.filters .section-title {
  margin-bottom: 14px;
}

.filters .section-title h2::after {
  color: var(--muted);
  content: "  •  Use location filters for contains search";
  font-size: 13px;
  font-weight: 650;
}

.priority {
  background: linear-gradient(135deg, #e8f7f9, #f5fbfc);
  border: 1px solid #c4e4ea;
  border-radius: 8px;
  grid-template-columns: minmax(260px, 1fr) 120px;
  margin-bottom: 14px;
  padding: 12px;
}

.filter-group {
  background: #fbfdfe;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.filter-group + .filter-group,
.more-filters {
  margin-top: 12px;
}

.filters .grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.more-filters {
  background: #fbfdfe;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px 12px;
}

.more-filters summary {
  padding: 8px 0 12px;
}

.actions {
  border-top: 0;
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 0;
}

.actions button {
  min-width: 120px;
}

.results {
  min-height: calc(100vh - 360px);
  padding: 16px;
}

.result-head {
  background: #fbfdfe;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 14px;
  padding: 12px;
}

.result-list {
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
}

.person-main strong {
  font-size: 19px;
}

.fact strong {
  font-size: 15px;
}

@media (min-width: 1500px) {
  .result-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .layout {
    padding: 12px;
  }

  .priority {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .filters .section-title h2::after {
    content: "";
  }

  .actions,
  .result-head,
  .result-actions {
    align-items: stretch;
  }

  .actions button {
    width: 100%;
  }
}
