/* Account, surgeon and distributor cards, Find, and the full distributor scorecard
   (src/components/entityCard.js, src/screens/scorecard.js). A bottom sheet on a phone, a
   right-hand side panel on a computer. */

/* A name that opens a card: looks like the text it replaces, underlined on hover. */
.card-link {
  background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left;
  cursor: pointer; text-decoration: underline; text-decoration-color: var(--border);
  text-underline-offset: 3px;
}
.card-link:hover { color: var(--zv-blue); text-decoration-color: var(--zv-blue); }
.card-link:focus-visible { outline: 2px solid var(--zv-blue); outline-offset: 2px; border-radius: 2px; }

/* On a deal card (My Deals) and a board card the names are small text with buttons close
   below, so a full 44px tap area does not fit without making every card taller. Each name's
   tap area reaches into the empty space around it instead: the card's top padding, half the
   gap between the two lines, and the gap below. Padding grows the button and the matching
   negative margin keeps the text where it was, so the card looks the same. The numbers
   follow .deal-card and .dc-* in deals.css and .b-card in board.css; change them together. */
.dc-surgeon .card-link, .dc-sub .card-link, .bc-surgeon .card-link, .bc-sub .card-link {
  --up: 0px; --down: 0px;
  padding: var(--up) 0 var(--down); margin: calc(var(--up) * -1) 0 calc(var(--down) * -1);
}
.dc-surgeon .card-link { --up: 12px; --down: 1px; } /* .deal-card top padding; half of .dc-sub's 2px margin */
.dc-sub .card-link { --up: 1px; --down: 8px; }      /* the other half; .dc-controls' 8px top margin */
.bc-surgeon .card-link { --up: 10px; --down: 2px; } /* .b-card top padding; half its 4px gap */
.bc-sub .card-link { --up: 2px; --down: 2px; }      /* half the 4px gap on each side */

/* Find, in the header on every screen. */
.hdr-find {
  display: none; align-items: center; gap: 6px; margin-left: auto; min-height: 40px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--panel); color: var(--text-strong);
  font: 600 13px var(--font-body); cursor: pointer;
}
body.signed-in .hdr-find { display: inline-flex; }
.hdr-find:focus-visible { outline: 2px solid var(--zv-blue); outline-offset: 2px; }
@media (max-width: 640px) { .hdr-find span { display: none; } .hdr-find { min-width: 44px; min-height: 44px; justify-content: center; } }

.ec-find { max-width: 560px; }
.ec-find .zi-input { width: 100%; margin: 8px 0 10px; }
.ec-results { list-style: none; margin: 0 0 8px; padding: 0; }
.ec-results li { padding: 8px 2px; border-top: 1px solid var(--border-soft, var(--border)); font-size: 15px; }

/* The card. */
.ec-kind { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--zv-red); }
.ec-title { font: 700 20px/1.25 var(--font-display, inherit); color: var(--text-bright, var(--text-strong)); margin: 2px 0 4px; }
.ec-title:focus { outline: none; }
.ec-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 8px; }
.ec-stat { background: var(--panel-2); border-radius: 8px; padding: 10px; }
.ec-stat-v { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ec-stat-l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.ec-stat-s { font-size: 12px; margin-top: 4px; color: var(--muted); }
.ec-up { color: #157347; }
.ec-down { color: var(--zv-red-deep); }
.ec-spark { display: block; margin: 4px 0 8px; }
.ec-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.ec-actions:empty { display: none; }
.ec-btn { min-height: 44px; padding: 0 14px; border: 1px solid var(--zv-blue); border-radius: 8px; background: var(--panel); color: var(--zv-blue); font-weight: 700; cursor: pointer; }
.ec-section { margin-top: 16px; }
.ec-h { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-strong); margin: 0 0 6px; }
/* min-width 0: components.css gives every table 900px for the wide data tables. */
.ec-table { width: 100%; min-width: 0; border-collapse: collapse; font-size: 14px; }
.ec-table th { text-align: left; font-size: 11px; color: var(--muted); text-transform: uppercase; padding: 4px 6px; }
.ec-table td { padding: 7px 6px; border-top: 1px solid var(--border-soft, var(--border)); vertical-align: top; }
.ec-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ec-gaps { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.7; }
@media (max-width: 420px) { .ec-stats { grid-template-columns: 1fr 1fr; } }

/* On a computer the card is a side panel on the right, so the screen behind stays readable. */
@media (min-width: 900px) {
  .ec-bg { align-items: stretch; justify-content: flex-end; }
  .ec-bg .ec-sheet { max-width: 520px; max-height: 100vh; height: 100vh; border-radius: 0; padding: 20px 22px; }
  .ec-bg .sheet-grip { display: none; }
}

/* The full-page distributor scorecard. */
.sc-head { margin: 4px 0 12px; }
.sc-title { font: 700 26px/1.2 var(--font-display, inherit); margin: 2px 0 4px; }
.sc-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 1000px) { .sc-grid { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); } }
.sc-side { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; align-self: start; }

/* Sales screen: the accounts behind the latest quarter's retention. */
.ret-lists { display: grid; grid-template-columns: 1fr; gap: 8px 24px; }
@media (min-width: 900px) { .ret-lists { grid-template-columns: 1fr 1fr; } }

/* Cards: categories not bought from Zavation, each opening our product lines for it. */
.ec-gap { border-top: 1px solid var(--border-soft, var(--border)); }
.ec-gap summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; font-size: 15px; list-style: none; }
.ec-gap summary::-webkit-details-marker { display: none; }
.ec-gap summary::after { content: "+"; color: var(--zv-blue); font-weight: 700; }
.ec-gap[open] summary::after { content: "\2212"; }
.ec-gap ul { margin: 0 0 10px; padding-left: 18px; font-size: 14px; line-height: 1.7; color: var(--text-strong); }

/* Surgeon Intelligence: public talks and writing. */
.si-public { list-style: none; margin: 0; padding: 0; }
.si-public li { padding: 8px 0; border-top: 1px solid var(--border-soft, var(--border)); font-size: 14px; line-height: 1.5; }
