:root {
  --brand: #164194;
  --ink: #1d2327;
  --muted: #69737a;
  --line: #e4e8eb;
  --bg: #f6f8f9;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
header {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0.9rem 1.5rem; background: var(--brand); color: #fff;
}
header h1 { font-size: 1.2rem; margin: 0; font-weight: 600; }
.who { font-size: 0.9rem; display: flex; gap: 0.75rem; align-items: center; }
.who button { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.6); border-radius: 4px; padding: .25rem .6rem; cursor: pointer; }
main { max-width: 1200px; margin: 0 auto; padding: 1.25rem 1.5rem 3rem; }
.muted { color: var(--muted); }

.controls { display: flex; gap: .6rem; flex-wrap: wrap; }
.controls input { flex: 1 1 320px; }
.controls input, .controls select {
  font: inherit; padding: .6rem .75rem; border: 1px solid #c9d1d6; border-radius: 6px; background: #fff;
}
.controls input:focus, .controls select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

#az { display: flex; flex-wrap: wrap; gap: 2px; margin: .9rem 0 .4rem; }
#az button {
  font: inherit; font-size: .85rem; min-width: 2rem; padding: .3rem .4rem; border: 0; border-radius: 4px;
  background: transparent; color: var(--brand); cursor: pointer;
}
#az button:hover { background: #e4eaf6; }
#az button[aria-pressed="true"] { background: var(--brand); color: #fff; }
#count { font-size: .85rem; margin: .4rem 0 .8rem; }

.head, .row {
  display: grid; grid-template-columns: var(--cols, 56px 2.2fr 1.3fr 1fr 1fr 2fr); gap: 1rem; align-items: center;
}
.head { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 0 1rem .4rem; }
#list { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.row { padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.avatar {
  width: 48px; height: 48px; border-radius: 50%; overflow: hidden; background: #dbe3f3; color: var(--brand);
  display: grid; place-items: center; font-weight: 600;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.name { display: flex; flex-direction: column; }
.job { color: var(--muted); font-size: .9rem; }
.email { display: flex; gap: .75rem; align-items: center; min-width: 0; }
.email a:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a { color: var(--brand); }
[hidden] { display: none !important; }

@media (max-width: 760px) {
  .head { display: none; }
  .row { grid-template-columns: 48px 1fr; row-gap: .2rem; }
  .row > :not(.avatar):not(.name) { grid-column: 2; font-size: .9rem; }
  .row > .phone:empty { display: none; }
  .avatar { grid-row: span 5; align-self: start; }
}
