/* Dashboards about one thing: a worker's trade (user_professions/show), one
   site as its worker sees it (assignments/show), and one store customer
   (store_customers/show). They sit on the site or store dashboard styles
   (.site-dashboard / .store-dashboard); this adds what those don't have. */

.entity-dash {
  --ed-border:  rgba(128, 128, 128, 0.3);
  --ed-muted:   #7a7870;
  --ed-success: #15803d;
  --ed-danger:  #b91c1c;
  --ed-warning: #d97706;
  --ed-radius:  8px;
}

/* Links here are text links, not the global filled link (2rem top margin, fill). */
.entity-dash a.kpi-link,
.entity-dash a.wk-cell-link,
.entity-dash a.wk-list__main {
  margin: 0;
  padding: 0;
  background: none;
  border-radius: 0;
  font-family: inherit;
}

.entity-dash a.kpi-link:hover,
.entity-dash a.wk-cell-link:hover { background: none; color: var(--major-link); text-decoration: underline; }

.entity-dash a.wk-cell-link { color: inherit; font-weight: 600; }

.entity-dash .sidebar ul li a.wk-back { margin-top: 0.75rem; opacity: 0.85; }

/* A small header button (the dashboards' .action-btn is a 60px quick-action tile). */
.entity-dash .action-btn.wk-btn-sm {
  display: inline-flex;
  align-items: center;
  min-height: 0;
  margin: 0;
  padding: 0.35rem 0.8rem;
  font-size: 0.78rem;
  white-space: nowrap;
}

/* button_to's form: not the global 16–22rem centred form. */
.entity-dash form.wk-inline-form {
  display: inline-flex;
  width: auto;
  min-width: 0;
  max-width: none;
  margin: 0;
  gap: 0;
}

.entity-dash .wk-callout--invite { border-left: 3px solid var(--ed-warning); }
.entity-dash .wk-callout:not(.wk-callout--invite) { border-left: 3px solid var(--ed-success); }
.entity-dash .wk-callout__body { margin: 0; padding: 0.75rem 1rem 1rem; font-size: 0.82rem; line-height: 1.4; }

/* Cards share the row rather than leaving a gap at the end. */
.entity-dash .kpi-strip:not(.is-filtering) { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

/* A note in a card's header (the store's .text-muted doesn't size it). */
.entity-dash .card-header .text-muted { font-size: 0.78rem; font-weight: 400; }

/* A KPI card whose value is a word ("Active", "Added"), not a number. */
.entity-dash .kpi-value.wk-kpi-word { font-size: 1.15rem; line-height: 1.3; }

.entity-dash .status-pill--status-done { background: #dbeafe; color: #1d4ed8; }

/* ── Rows of sites (invites, on site now, contacts) ── */
.entity-dash .wk-list { list-style: none; margin: 0; padding: 0; }

.entity-dash .wk-list__row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--ed-border);
}
.entity-dash .wk-list__row:last-child { border-bottom: none; }
.entity-dash .wk-list__row:has(a.wk-list__main:hover) { background: rgba(0, 150, 255, 0.08); }

.entity-dash .wk-list__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  color: inherit;
  font-weight: inherit;
}
.entity-dash a.wk-list__main:hover { background: none; color: inherit; }

.entity-dash .wk-list__title { font-size: 0.9rem; font-weight: 700; line-height: 1.3; }
.entity-dash .wk-list__meta  { font-size: 0.78rem; line-height: 1.3; color: var(--ed-muted); }

.entity-dash .wk-list__figures {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 0.82rem;
  line-height: 1.3;
}
.entity-dash .wk-list__figures small { font-size: 0.75rem; color: var(--ed-muted); }
.entity-dash .wk-list__go { font-size: 1.2rem; line-height: 1; opacity: 0.5; }

/* ── Rows that open a site (row_link_controller.js) ── */
.entity-dash tr.is-row-link { cursor: pointer; }
.entity-dash tr.is-row-link:hover td { background: rgba(0, 150, 255, 0.08); }
.entity-dash tr.is-row-link:focus-visible { outline: 2px solid var(--major-link); outline-offset: -2px; }
.entity-dash tr.wk-row-mine td { background: rgba(0, 150, 255, 0.06); }
.entity-dash .data-table .badge { margin-left: 0.4rem; }

/* ── Last two weeks, one dot a day ── */
.entity-dash .wk-fortnight {
  list-style: none;
  margin: 0;
  padding: 0.85rem 1rem 1rem;
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 0.25rem;
}

.entity-dash .wk-fortnight__day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.entity-dash .wk-fortnight__dow,
.entity-dash .wk-fortnight__date { font-size: 0.68rem; line-height: 1; color: var(--ed-muted); }

.entity-dash .wk-day {
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  border: 1.5px solid rgba(128, 128, 128, 0.55);
  vertical-align: middle;
}
.entity-dash .wk-day--present { background: var(--ed-success); border-color: var(--ed-success); }
.entity-dash .wk-day--absent  { background: var(--ed-danger);  border-color: var(--ed-danger); }
.entity-dash .wk-day--off     { background: transparent; }

.entity-dash .wk-legend { display: flex; align-items: center; gap: 0.35rem; font-size: 0.72rem; color: var(--ed-muted); }
.entity-dash .wk-legend .wk-day { width: 0.65rem; height: 0.65rem; margin-left: 0.4rem; }

/* ── Credentials ── */
.entity-dash .wk-creds {
  list-style: none;
  margin: 0;
  padding: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.entity-dash .wk-creds__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem;
  border: 1px solid var(--ed-border);
  border-radius: var(--ed-radius);
  font-size: 0.8rem;
  font-weight: 600;
}

.entity-dash .wk-form-card__body { padding: 1rem; }
.entity-dash .wk-form-card__body form { margin-inline: 0; }
.entity-dash .wk-form-title { margin: 0 0 0.75rem; font-size: 0.9rem; }

/* ── A customer's last six months: one bar a month ── */
.entity-dash .cd-months {
  list-style: none;
  margin: 0;
  padding: 1rem 1rem 0.75rem;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: end;
  height: 9rem;
}

.entity-dash .cd-months__month {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 0.3rem;
}

.entity-dash .cd-months__bar {
  width: min(2.5rem, 100%);
  border-radius: 4px 4px 0 0;
  background: var(--major-link, #0096ff);
  opacity: 0.8;
}

.entity-dash .cd-months__value { font-size: 0.72rem; line-height: 1; font-weight: 600; }
.entity-dash .cd-months__label { font-size: 0.7rem; line-height: 1; color: var(--ed-muted); text-transform: uppercase; }

/* Two cards side by side on wide screens */
.entity-dash .cd-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 1.25rem;
  align-items: start;
}

/* The bar heights are a share of the tallest; the value line needs room above. */
.entity-dash .cd-months__month { padding-top: 1rem; }

@media (max-width: 830px) {
  .entity-dash .wk-legend { display: none; }
  .entity-dash .wk-fortnight { padding-inline: 0.5rem; gap: 0.1rem; }
  .entity-dash .wk-list__row { padding-inline: 0.75rem; }
}
