:root {
  --ink: #10212b;
  --muted: #5c6f78;
  --line: #dbe4e8;
  --paper: #f4f7f8;
  --card: #ffffff;
  --teal: #0f766e;
  --teal-soft: #d9f2ee;
  --amber: #b45309;
  --amber-soft: #fef0d8;
  --red: #b42318;
  --red-soft: #fee4e2;
  --blue: #175cd3;
  --green: #067647;
  --green-soft: #dcfae6;
  --shadow: 0 12px 30px rgba(16, 33, 43, 0.07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1100px 500px at 85% -10%, #d9f2ee 0%, transparent 55%),
    radial-gradient(900px 450px at -10% 10%, #e3edff 0%, transparent 50%),
    var(--paper);
  min-height: 100vh;
}

.wrap { width: min(1240px, calc(100% - 40px)); margin: 0 auto; }

.site-header { padding: 42px 0 26px; }
.header-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 { margin: 0; font-size: clamp(32px, 5vw, 48px); letter-spacing: -0.03em; }
.subtitle { margin: 10px 0 0; color: var(--muted); font-size: 16px; }

.header-mark {
  width: 64px; height: 64px;
  border-radius: 20px;
  display: grid; place-items: center;
  font-size: 30px; color: #fff;
  background: linear-gradient(145deg, #0f766e, #0b4f4a);
  box-shadow: var(--shadow);
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}

.stat span { display: block; font-size: 26px; font-weight: 750; letter-spacing: -0.03em; }
.stat small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
.stat-called { background: var(--green-soft); border-color: #a9e5c3; }
.stat-callable { background: var(--teal-soft); border-color: #a7ded6; }
.stat-gap { background: var(--amber-soft); border-color: #f5d9a8; }

.toolbar {
  display: grid;
  grid-template-columns: minmax(210px, 2fr) repeat(5, minmax(120px, 1fr));
  gap: 8px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  backdrop-filter: blur(8px);
}

.toolbar input,
.toolbar select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
  font: inherit;
  font-size: 13.5px;
}

.toolbar input:focus,
.toolbar select:focus { outline: 2px solid #8ad5cc; outline-offset: 1px; }

.result-line { margin: 16px 2px 10px; color: var(--muted); font-size: 13px; }

.board {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.board-head,
.row-main {
  display: grid;
  grid-template-columns: 46px minmax(210px, 1.5fr) 150px minmax(190px, 1.1fr) minmax(190px, 1.1fr) 88px 34px;
  align-items: center;
  column-gap: 12px;
}

.board-head {
  padding: 11px 16px;
  background: #f7fafb;
  border-bottom: 1px solid var(--line);
  color: #7a8b93;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.row { border-bottom: 1px solid #edf2f4; }
.row:last-child { border-bottom: 0; }
.row:hover .row-main { background: #fbfdfd; }

.row-main { padding: 12px 16px; min-height: 64px; }
.row.is-called .row-main { background: #f7fbf9; }
.row.is-called .company-name { text-decoration: line-through; color: #667a72; text-decoration-thickness: 1px; }

.call-box {
  width: 30px; height: 30px;
  border: 1.5px solid #b9c7cd;
  background: #fff;
  border-radius: 8px;
  display: grid; place-items: center;
  color: transparent;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: 120ms ease;
}

.call-box:hover { border-color: var(--teal); background: #f2fbf9; }
.row.is-called .call-box { background: var(--green); border-color: var(--green); color: #fff; }

.company { min-width: 0; }
.company-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14.5px;
  font-weight: 750;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.contact-line {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  background: #eef2f4;
  color: var(--muted);
}

.pill.priority-a, .pill.web-none, .pill.web-social-only, .pill.web-outdated, .pill.web-parked {
  background: var(--red-soft); color: var(--red);
}
.pill.priority-b, .pill.web-review { background: var(--amber-soft); color: var(--amber); }
.pill.priority-c, .pill.web-current { background: var(--green-soft); color: var(--green); }

.trade-cell { color: var(--muted); font-size: 12.5px; }
.web-cell { min-width: 0; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.web-cell a {
  color: var(--blue);
  font-size: 12.5px;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.web-cell a:hover { text-decoration: underline; }
.web-cell .muted { font-size: 12px; }

.phone-cell { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.call-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--teal);
  color: #fff;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.call-btn:hover { background: #0b5f59; }
.phone-number { font-size: 12.5px; color: var(--ink); white-space: nowrap; }
.no-phone { font-size: 12.5px; color: var(--muted); }
.find-link { font-size: 12px; color: var(--blue); text-decoration: none; white-space: nowrap; }
.find-link:hover { text-decoration: underline; }

.expand {
  border: 0;
  background: transparent;
  color: #8a9aa2;
  font-size: 16px;
  cursor: pointer;
  width: 30px; height: 30px;
  border-radius: 8px;
}
.expand:hover { background: #eef5f4; color: var(--teal); }

.row-details {
  display: none;
  padding: 2px 16px 18px 74px;
  background: #fbfdfd;
  border-top: 1px dashed #e3ebee;
}
.row.open .row-details { display: block; }

.detail-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(220px, 1fr);
  gap: 12px 28px;
  padding-top: 12px;
}

.detail-block { font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.detail-block strong { display: block; color: var(--ink); font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 3px; }
.detail-block a { color: var(--blue); text-decoration: none; }
.detail-block a:hover { text-decoration: underline; }

.notes {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 10px;
  font: inherit;
  font-size: 12.5px;
  resize: vertical;
  min-height: 60px;
  color: var(--ink);
  background: #fff;
}
.notes:focus { outline: 2px solid #8ad5cc; outline-offset: 1px; }

.empty { padding: 34px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: 14px; }

.footer { display: flex; justify-content: space-between; gap: 10px; color: #8a9aa2; font-size: 12px; padding: 24px 0 30px; }

.toast {
  position: fixed; left: 50%; bottom: 22px;
  transform: translate(-50%, 20px);
  background: var(--ink); color: #fff;
  border-radius: 10px; padding: 10px 16px;
  font-size: 13px; opacity: 0; pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

@media (max-width: 1050px) {
  .toolbar { grid-template-columns: 1fr 1fr 1fr; }
  .board-head, .row-main { grid-template-columns: 42px minmax(180px, 1.5fr) 130px minmax(170px, 1fr) 88px 32px; }
  .board-head span:nth-child(5), .row-main .web-cell { display: none; }
}

@media (max-width: 760px) {
  .wrap { width: min(100% - 24px, 1240px); }
  .stats { grid-template-columns: 1fr 1fr; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .board-head { display: none; }
  .row-main {
    grid-template-columns: 40px 1fr auto;
    row-gap: 8px;
    padding: 14px;
  }
  .trade-cell, .web-cell { grid-column: 2 / 4; }
  .phone-cell { grid-column: 2 / 4; }
  .priority-cell { grid-column: 3; grid-row: 1; justify-self: end; }
  .expand { grid-column: 3; grid-row: 2; justify-self: end; }
  .row-details { padding: 0 14px 16px 54px; }
  .detail-grid { grid-template-columns: 1fr; }
  .header-mark { display: none; }
}
