/* ============================================================================
   ATLAS REDESIGN — Showings & Open Houses screen styles  ·  Phase 2
   Branch: atlas-redesign-2026-06-29

   Prefix: .rd-showings. Tokens only (--r-*). Page chrome (header, segmented
   toggle, primary button), the 4-up KPI strip, the two-column body with the
   Upcoming-showings card + Open-houses card + Atlas note. Works in Calm +
   Operator automatically (rides on the --r-* token layer).
   ========================================================================== */

.rd-showings {
  font-family: var(--r-font-body);
  color: var(--r-body);
  padding: var(--r-gutter);
  max-width: var(--r-page-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ---- page header --------------------------------------------------------- */
.rd-sh-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.rd-sh-head-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rd-sh-eyebrow {
  font-family: var(--r-font-mono);
  font-size: var(--r-fs-eyebrow);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--r-clay);
}
.rd-sh-h1 {
  font-family: var(--r-font-display);
  font-size: var(--r-fs-h1);
  font-weight: 600;
  line-height: 1.1;
  color: var(--r-ink);
  margin: 0;
}
.rd-sh-head-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* segmented toggle (visual-only) */
.rd-sh-toggle {
  display: inline-flex;
  gap: 3px;
  background: var(--r-well);
  border: 1px solid var(--r-border);
  border-radius: var(--r-radius-control);
  padding: 3px;
}
.rd-sh-seg {
  appearance: none;
  border: 0;
  background: transparent;
  font-family: var(--r-font-body);
  font-size: var(--r-fs-meta);
  font-weight: 500;
  color: var(--r-muted);
  padding: 6px 14px;
  border-radius: calc(var(--r-radius-control) - 3px);
  cursor: pointer;
  transition: color var(--r-dur) var(--r-ease),
              background var(--r-dur) var(--r-ease),
              box-shadow var(--r-dur) var(--r-ease);
}
.rd-sh-seg:hover { color: var(--r-ink); }
.rd-sh-seg.is-active {
  background: var(--r-surface);
  color: var(--r-primary);
  box-shadow: var(--r-shadow-card);
}
.rd-sh-seg:focus-visible { outline: var(--r-focus); outline-offset: 2px; }

/* primary Schedule button */
.rd-sh-schedule {
  appearance: none;
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--r-font-body);
  font-size: var(--r-fs-body);
  font-weight: 600;
  color: var(--r-primary-ink);
  background: var(--r-primary);
  border-radius: var(--r-radius-control);
  padding: 9px 16px;
  cursor: pointer;
  transition: box-shadow var(--r-dur) var(--r-ease),
              transform var(--r-dur) var(--r-ease),
              filter var(--r-dur) var(--r-ease);
}
.rd-sh-schedule:hover { box-shadow: var(--r-shadow-hover); filter: brightness(1.04); }
.rd-sh-schedule:active { transform: translateY(1px); }
.rd-sh-schedule:focus-visible { outline: var(--r-focus); outline-offset: 2px; }
.rd-sh-schedule i { font-size: 15px; }

/* ---- KPI strip (4-up) ---------------------------------------------------- */
.rd-sh-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.rd-sh-kpi {
  background: var(--r-surface);
  border: 1px solid var(--r-hairline-2);
  border-radius: var(--r-radius-card);
  box-shadow: var(--r-shadow-card);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rd-sh-kpi-label {
  font-family: var(--r-font-mono);
  font-size: var(--r-fs-eyebrow);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--r-faint);
}
.rd-sh-kpi-value {
  font-family: var(--r-font-display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  color: var(--r-ink);
}
.rd-sh-kpi[data-mod="good"] .rd-sh-kpi-value { color: var(--r-primary-2); }
.rd-sh-kpi[data-mod="clay"] .rd-sh-kpi-value { color: var(--r-clay-2); }

/* ---- main grid ----------------------------------------------------------- */
.rd-sh-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  align-items: start;
}
.rd-sh-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---- cards --------------------------------------------------------------- */
.rd-sh-tile {
  background: var(--r-surface);
  border: 1px solid var(--r-border);
  border-radius: var(--r-radius-card);
  box-shadow: var(--r-shadow-card);
  padding: 20px 22px;
}
.rd-sh-card-title {
  font-family: var(--r-font-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--r-ink);
  margin: 0 0 4px;
}

/* the upcoming list scrolls internally; outer frame never scrolls */
.rd-sh-upcoming-body { max-height: 560px; overflow-y: auto; }
.rd-sh-openhouses-body { max-height: 320px; overflow-y: auto; }

/* ---- upcoming-showing row ------------------------------------------------ */
.rd-sh-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 0;
  border-top: 1px solid var(--r-hairline);
}
.rd-sh-row:first-of-type { border-top: 0; }

.rd-sh-date {
  flex: 0 0 54px;
  width: 54px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.rd-sh-date-day {
  font-family: var(--r-font-mono);
  font-size: var(--r-fs-meta);
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--r-primary);
}
.rd-sh-date-time {
  font-family: var(--r-font-mono);
  font-size: var(--r-fs-eyebrow);
  letter-spacing: .02em;
  color: var(--r-muted);
}

.rd-sh-row-main { flex: 1 1 auto; min-width: 0; }
.rd-sh-row-addr {
  font-size: 14px;
  font-weight: 600;
  color: var(--r-ink);
  line-height: 1.3;
}
.rd-sh-row-sub {
  font-size: 12.5px;
  color: var(--r-muted);
  margin-top: 2px;
  line-height: 1.35;
}

/* status pill */
.rd-sh-pill {
  flex: 0 0 auto;
  font-family: var(--r-font-mono);
  font-size: var(--r-fs-eyebrow);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-radius: var(--r-radius-pill);
  padding: 4px 10px;
  white-space: nowrap;
}
.rd-sh-pill[data-tone="good"] {
  background: var(--r-mint-surface);
  color: var(--r-mint-ink);
}
.rd-sh-pill[data-tone="clay"] {
  background: color-mix(in srgb, var(--r-clay) 16%, transparent);
  color: var(--r-clay-2);
}

/* ---- open-house row ------------------------------------------------------ */
.rd-sh-oh-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 0;
  border-top: 1px solid var(--r-hairline);
}
.rd-sh-oh-row:first-of-type { border-top: 0; }
.rd-sh-rsvp {
  flex: 0 0 auto;
  font-family: var(--r-font-mono);
  font-size: var(--r-fs-eyebrow);
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--r-primary);
  background: var(--r-well);
  border-radius: var(--r-radius-pill);
  padding: 4px 10px;
  white-space: nowrap;
}

/* ---- empty states -------------------------------------------------------- */
.rd-sh-empty {
  font-family: var(--r-font-body);
  font-size: var(--r-fs-body);
  color: var(--r-muted);
  margin: 8px 0 2px;
}

/* ---- Atlas note ---------------------------------------------------------- */
.rd-sh-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--r-well);
  border: 1px solid var(--r-border);
  border-radius: var(--r-radius-card);
  padding: 13px 15px;
}
.rd-sh-note-icon {
  flex: 0 0 auto;
  font-size: 16px;
  line-height: 1.4;
  color: var(--r-primary);
}
.rd-sh-note-text {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--r-muted);
  margin: 0;
}

/* ---- responsive ---------------------------------------------------------- */
@media (max-width: 980px) {
  .rd-sh-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .rd-sh-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rd-sh-head { align-items: stretch; }
  .rd-sh-head-right { flex-wrap: wrap; }
}
