/* Sales dashboard — metrics + quick links (both open modes) */

.dash {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px 48px;
  padding-bottom: calc(48px + var(--safe-b));
}

.dash-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.dash-modes {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  padding: 3px;
  gap: 2px;
}

.dash-modes a {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink-soft);
}

.dash-modes a.is-active {
  background: var(--forest);
  color: #fff;
}

.dash-modes a:not(.is-active):hover {
  color: var(--ink);
  background: var(--sky);
}

.dash-mode-note {
  margin: 0 0 18px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.dash-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

@media (min-width: 640px) {
  .dash-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.dash-metric {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 14px 12px;
  box-shadow: var(--shadow-sm);
}

.dash-metric__value {
  display: block;
  font-family: var(--display);
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--forest);
}

.dash-metric__label {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.dash-metric__hint {
  display: block;
  margin-top: 2px;
  font-size: 0.7rem;
  color: var(--ink-soft);
}

.dash-metric--accent {
  background: linear-gradient(160deg, #fff 35%, #eef7f2 100%);
  border-color: color-mix(in srgb, var(--moss) 28%, var(--line));
}

.dash-source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 14px;
}

.dash-source[data-source='live'] {
  color: var(--moss);
}

.dash-source[data-source='sample'] {
  color: var(--warm);
}

.dash-section {
  margin-bottom: 22px;
}

.dash-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.dash-section__head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.dash-section__head span {
  font-size: 0.75rem;
  color: var(--muted);
}

.dash-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

@media (min-width: 560px) {
  .dash-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 840px) {
  .dash-links {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.dash-link {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  width: 100%;
  padding: 12px 12px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
  font: inherit;
}

.dash-link:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--moss) 35%, var(--line));
  box-shadow: var(--shadow);
}

.dash-link__body {
  min-width: 0;
  flex: 1;
}

.dash-link__title {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}

.dash-link__hint {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--muted);
}

.dash-link__icon {
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 0.85rem;
  opacity: 0.55;
}

.dash-footer {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
}

.dash-footer a {
  color: var(--moss);
  font-weight: 600;
}

/* Stay mode — modal shell */
.dash-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  flex-direction: column;
  background: rgba(16, 36, 31, 0.35);
  backdrop-filter: blur(4px);
  padding: 10px;
  padding-bottom: calc(10px + var(--safe-b));
}

.dash-modal.is-open {
  display: flex;
}

.dash-modal__panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.dash-modal__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  flex-shrink: 0;
}

.dash-modal__title {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-modal__btn {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
}

.dash-modal__btn:hover {
  background: var(--sky);
  color: var(--ink);
}

.dash-modal__btn--close:hover {
  background: #fdecea;
  border-color: #f0c2bc;
  color: var(--hot);
}

.dash-modal__frame-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  background: var(--paper);
}

.dash-modal__frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.dash-modal__blocked {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: var(--paper-2);
}

.dash-modal__blocked.is-visible {
  display: flex;
}

.dash-modal__blocked p {
  margin: 0;
  max-width: 28rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.dash-modal__blocked .dash-modal__btn {
  background: var(--forest);
  color: #fff;
  border-color: var(--forest);
}

body.dash-modal-open {
  overflow: hidden;
}

/* Primary desk pills — canonical rules live in desk-shell.css (plan-selector shell). */
.desk-primary {
  /* fallback if desk-shell.css not loaded */
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.desk-primary::-webkit-scrollbar {
  display: none;
}

/* Brand mark as home link */
.brand a.brand-home {
  display: flex;
  align-items: center;
  gap: inherit;
  text-decoration: none;
  color: inherit;
}
.brand a.brand-home:hover .brand-text strong {
  color: var(--moss, #2f6b57);
}

/* Sales page tiles */
.sales-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 640px) {
  .sales-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.sales-tile-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sales-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  min-height: 140px;
  padding: 18px 18px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  text-align: left;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
  transition: transform 0.12s, box-shadow 0.12s;
}
.sales-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.sales-tile--call {
  background: linear-gradient(160deg, #fff 40%, #eef7f2 100%);
}
.sales-tile--pipe {
  background: linear-gradient(160deg, #fff 40%, #eef2f7 100%);
}
.sales-tile--crm {
  background: linear-gradient(160deg, #fff 40%, #f3ead6 100%);
}
.sales-tile--cal {
  background: linear-gradient(160deg, #fff 40%, #e8f0f8 100%);
}
.sales-tile--nav {
  background: linear-gradient(160deg, #fff 40%, #eef7f2 100%);
  border-color: color-mix(in srgb, var(--moss) 30%, var(--line));
}
.sales-tile__kicker {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--moss);
}
.sales-tile__title {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--forest);
}
.sales-tile__hint {
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.4;
  flex: 1;
}
.sales-tile__cta {
  margin-top: 4px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--moss);
}
.sales-tile-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sales-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}
.sales-chip:hover {
  border-color: var(--moss);
  color: var(--ink);
}

/* Non-Dawn: hide / mask sales numbers */
body.desk-no-metrics .dash-metrics {
  opacity: 0.85;
}
body.desk-no-metrics .dash-metric__value {
  filter: blur(0);
  letter-spacing: 0.08em;
}
body.desk-no-metrics #metrics-ban {
  display: block;
}
#metrics-ban {
  display: none;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8f3e4;
  border: 1px solid color-mix(in srgb, var(--amber) 40%, var(--line));
  font-size: 0.8125rem;
  color: var(--ink-soft);
  font-weight: 600;
}
.dash-source[data-source='hidden'] {
  color: var(--muted);
}
