.dash-body {
  min-height: 100vh;
}

.dash-main {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 4rem;
}

.dash-hero {
  margin-bottom: 1.25rem;
}

.dash-hero h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.dash-lede {
  margin: 0;
  color: var(--muted);
  max-width: 36rem;
}

.dash-range-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-bottom: 0.85rem;
}

.dash-mode {
  display: inline-flex;
  padding: 0.2rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  gap: 0.15rem;
}

.dash-mode-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  min-width: 3.6rem;
}

.dash-mode-btn.active {
  background: var(--ink);
  color: var(--bg);
}

.dash-custom-range {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.55rem 0.75rem;
}

.dash-custom-range label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.dash-custom-range input[type="date"] {
  min-width: 9.5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.45rem 0.55rem;
}

.dash-custom-range button {
  appearance: none;
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font: inherit;
  font-weight: 700;
  padding: 0.5rem 0.95rem;
  cursor: pointer;
}

.dash-custom-range[hidden] {
  display: none !important;
}

.dash-day-nav {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.dash-day-btn {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.dash-day-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.dash-day-btn:not(:disabled):hover {
  border-color: var(--accent);
}

.dash-day-label {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  min-width: 7rem;
  text-align: center;
  white-space: nowrap;
}

.dash-summary {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.65rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* Day: hide tips (week-focused). Week: hide decline/watch/rate to keep the strip light. */
.dash-body:not(.dash-mode-week) .dash-stat-week {
  display: none;
}

.dash-body.dash-mode-week .dash-stat-day {
  display: none;
}

.dash-body.dash-mode-week .dash-summary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dash-week-panel {
  margin-bottom: 0.85rem;
  padding: 0.75rem 0.65rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.dash-week-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
  align-items: end;
  height: 7.5rem;
  min-height: 7.5rem;
}

.dash-week-bar {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  cursor: pointer;
  color: inherit;
  min-width: 0;
}

.dash-week-bar:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}

.dash-week-bar .val {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-week-bar .val.is-zero {
  visibility: hidden;
}

.dash-week-bar .fill {
  width: 58%;
  max-width: 1.65rem;
  min-height: 0.2rem;
  height: var(--h, 8%);
  border-radius: 6px 6px 3px 3px;
  background: var(--accent);
  opacity: 0.82;
  transition: height 0.2s ease;
}

.dash-week-bar.is-today .fill {
  opacity: 1;
}

.dash-week-bar.is-empty .fill {
  background: var(--line);
  opacity: 1;
}

.dash-week-bar .lbl {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
  line-height: 1;
}

.dash-week-bar.is-today .lbl {
  color: var(--ink);
}

.dash-week-hint {
  margin: 0.45rem 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

.dash-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.dash-stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.dash-stat strong {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-status {
  min-height: 1.4em;
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.dash-status.err {
  color: var(--danger);
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dash-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.1rem 1.15rem;
  backdrop-filter: blur(8px);
}

.dash-panel h2 {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  letter-spacing: -0.01em;
}

.dash-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.dash-panel-head h2 {
  margin: 0;
}

.dash-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.dash-filters select {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--ink);
}

.dash-link {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.dash-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.dash-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 22rem;
  overflow: auto;
}

.dash-list-item {
  display: grid;
  gap: 0.15rem 0.75rem;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--surface-soft);
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.dash-list-item:hover,
.dash-list-item.active {
  border-color: rgba(13, 143, 130, 0.35);
  background: rgba(13, 143, 130, 0.08);
}

.dash-list-item .row1 {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-weight: 700;
}

.dash-list-item .row2 {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.dash-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dash-tag.ok {
  color: #0a6b52;
}

/* Uber earnings sync badge (isolated; removable with uber-sync feature). */
.uber-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.35rem;
  vertical-align: middle;
  color: #0d8f82;
  font-weight: 600;
  font-size: 0.78rem;
}

.uber-sync-badge svg {
  width: 0.95em;
  height: 0.95em;
  flex-shrink: 0;
}

html[data-theme="dark"] .uber-sync-badge {
  color: #3dbeb3;
}

/* Lyft earnings sync badge (isolated; removable with lyft-sync feature). */
.lyft-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.35rem;
  vertical-align: middle;
  color: #c14f8a;
  font-weight: 600;
  font-size: 0.78rem;
}

.lyft-sync-badge svg {
  width: 0.95em;
  height: 0.95em;
  flex-shrink: 0;
}

html[data-theme="dark"] .lyft-sync-badge {
  color: #e88ab8;
}

.dash-tag.bad {
  color: var(--danger);
}

.dash-tag.watch {
  color: #c47b0a;
}

html[data-theme="dark"] .dash-tag.watch {
  color: #f5a623;
}

.dash-reasons {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.dash-reasons li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

.dash-reasons li:last-child {
  border-bottom: 0;
}

.dash-reasons .count {
  font-family: var(--display);
  font-weight: 700;
}

.dash-offers-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

/*
 * Left list grows with content (page scroll). Right detail sticks in the
 * viewport so the card image / trip data follow as you browse down the list.
 */
.dash-offer-list.dash-list {
  max-height: none;
  overflow: visible;
}

.dash-detail {
  position: sticky;
  top: 1rem;
  z-index: 1;
  align-self: start;
  min-height: 12rem;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.dash-detail h3 {
  font-family: var(--display);
  font-size: 1.05rem;
  margin: 0 0 0.65rem;
}

.dash-detail-meta {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  font-size: 0.95rem;
}

.dash-detail-meta dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}

.dash-detail-meta dd {
  margin: 0 0 0.45rem;
}

.dash-card-img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 8px;
  background: #0b0f14;
  margin-bottom: 0.85rem;
  cursor: zoom-in;
}

.dash-card-img-btn {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0 0 0.85rem;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  border-radius: 8px;
}

.dash-card-img-btn .dash-card-img {
  margin-bottom: 0;
}

.dash-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.dash-lightbox[hidden] {
  display: none;
}

.dash-lightbox-backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(8, 12, 18, 0.72);
  cursor: pointer;
}

.dash-lightbox-panel {
  position: relative;
  z-index: 1;
  max-width: min(920px, 100%);
  max-height: min(90vh, 100%);
  padding: 0.65rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.dash-lightbox-img {
  display: block;
  max-width: 100%;
  max-height: calc(90vh - 2.5rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  background: #0b0f14;
}

.dash-lightbox-close {
  position: absolute;
  top: 0.35rem;
  right: 0.45rem;
  z-index: 2;
  width: 2.1rem;
  height: 2.1rem;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.dash-lightbox-close:hover {
  background: rgba(0, 0, 0, 0.75);
}

.dash-card-missing {
  padding: 1.25rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  margin-bottom: 0.85rem;
  font-size: 0.9rem;
}

.dash-audit {
  margin: 0.85rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.dash-audit h4 {
  margin: 0 0 0.45rem;
  font-family: var(--display);
  font-size: 0.95rem;
}

.dash-audit-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.dash-audit-meta {
  margin: 0;
}

.dash-edit-bar {
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 0.65rem 0;
  border-top: 1px solid var(--line);
}

.dash-edit-bar[hidden] {
  display: none;
}

.dash-edit-toggle {
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  text-align: center;
}

.dash-edit-toggle:hover {
  filter: brightness(1.06);
}

.dash-edit {
  display: grid;
  gap: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}

.dash-edit[hidden] {
  display: none;
}

.dash-edit-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.dash-edit label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.dash-edit input,
.dash-edit select {
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--input-bg);
}

.dash-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.dash-edit-actions button {
  font: inherit;
  font-weight: 700;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--ink);
  cursor: pointer;
}

.dash-edit-actions button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.dash-edit-actions button.danger {
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.35);
}

.dash-edit-msg {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  min-height: 1.2em;
}

.dash-offer-id-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin-top: 0.35rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}

.dash-offer-id-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.dash-offer-id {
  flex: 1 1 12rem;
  min-width: 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink);
  word-break: break-all;
  background: transparent;
}

.dash-offer-id-copy {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--ink);
  cursor: pointer;
}

.dash-offer-id-copy:hover {
  border-color: var(--accent);
}

.dash-edit-msg.ok {
  color: #0a6b52;
}

.dash-edit-msg.err {
  color: var(--danger);
}

@media (max-width: 900px) {
  .dash-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dash-body.dash-mode-week .dash-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dash-grid {
    grid-template-columns: 1fr;
  }

  .dash-week-chart {
    height: 6.5rem;
    min-height: 6.5rem;
  }

  .dash-hero h1 {
    font-size: 1.25rem;
  }

  .dash-lede {
    font-size: 0.92rem;
  }
}

/*
 * Keep offer list + detail side-by-side on car / tablet landscape (in-car browsers
 * often report <900px CSS width). Stack only on narrow portrait phones.
 */
@media (max-width: 640px) and (orientation: portrait) {
  .dash-offers-layout {
    grid-template-columns: 1fr;
  }

  /* Detail above the list, sticks while the long list scrolls the page. */
  .dash-detail {
    order: -1;
    top: 0.65rem;
    max-height: calc(100vh - 1.3rem);
  }
}

@media (max-width: 520px) {
  .dash-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-body.dash-mode-week .dash-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-range-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .dash-mode {
    align-self: center;
  }

  .dash-day-nav {
    justify-content: center;
  }

  .dash-edit-row {
    grid-template-columns: 1fr;
  }
}
