/* ==========================================================================
   UDRS Dashboard — reuses design tokens/buttons/form-control from
   css/styles.css; only dashboard-specific layout lives here.

   Layout is a permanent sidebar above 1024px and an off-canvas drawer below
   it. The previous build used a horizontal row of tabs, which on a phone
   became a cramped scrolling strip where the labels were the smallest
   touchable things on the screen.
   ========================================================================== */
.dash-body {
  background: var(--cream);
}

/* ---------- Login screen ---------- */
.dash-login {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  background-image: radial-gradient(circle at 20% 0%, rgba(212, 160, 60, 0.18), transparent 55%);
  padding: 1.5rem;
}
.dash-login-card {
  background: var(--white);
  border-radius: 0.9rem;
  padding: 2.5rem 2rem;
  max-width: 26rem;
  width: 100%;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  text-align: center;
}
.dash-login-lock {
  width: 3.25rem;
  height: 3.25rem;
  margin: 0 auto 1.1rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 160, 60, 0.15);
  color: var(--gold-dark);
}
.dash-login-card h1 {
  font-family: "Bebas Neue", sans-serif;
  font-size: 2rem;
  color: var(--navy);
  margin-bottom: 0.5rem;
}
.dash-login-card p {
  color: rgba(26, 31, 46, 0.6);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}
.dash-login-card form {
  text-align: left;
}
.dash-error {
  color: #b91c1c;
  font-size: 0.875rem;
  margin-top: 1rem;
  text-align: center;
}
.dash-login-back {
  margin-top: 1.5rem;
  font-size: 0.82rem;
}
.dash-login-back a {
  color: rgba(26, 31, 46, 0.5);
}
.dash-login-back a:hover {
  color: var(--gold-dark);
}

/* ==========================================================================
   App shell
   ========================================================================== */
.dash-app {
  min-height: 100vh;
}
.dash-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
@media (min-width: 1024px) {
  .dash-app {
    display: grid;
    grid-template-columns: 16.5rem 1fr;
  }
}

/* ---------- Sidebar ---------- */
.dash-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: 17rem;
  max-width: 85vw;
  display: flex;
  flex-direction: column;
  background: var(--navy);
  transform: translateX(-100%);
  transition: transform 0.3s var(--ease-smooth);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.dash-sidebar.open {
  transform: translateX(0);
  box-shadow: 24px 0 60px rgba(0, 0, 0, 0.35);
}
@media (min-width: 1024px) {
  .dash-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    width: auto;
    max-width: none;
    transform: none;
    box-shadow: none;
  }
}

/* Dark backdrop behind the open drawer. */
.dash-scrim {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, 0.5);
}
@media (min-width: 1024px) {
  .dash-scrim {
    display: none !important;
  }
}

.dash-brand {
  display: block;
  padding: 1.5rem 1.35rem 1.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}
/* Explicit close affordance for the off-canvas drawer, same reasoning as
   the site nav's own close button: don't make someone hunt for a scrim
   sliver or guess that the hamburger icon (now covered by this very
   drawer) still works. Hidden on desktop, where the sidebar is permanent
   and there's nothing to close. */
.dash-sidebar-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  transition: background 0.2s, color 0.2s;
}
.dash-sidebar-close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--white);
}
.dash-sidebar-close .icon {
  width: 1rem;
  height: 1rem;
}
@media (min-width: 1024px) {
  .dash-sidebar-close {
    display: none;
  }
}
.dash-brand-mark {
  display: block;
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.65rem;
  letter-spacing: 0.1em;
  color: var(--white);
  line-height: 1;
}
.dash-brand-sub {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 0.3rem;
}

.dash-nav {
  flex: 1;
  padding: 1rem 0.75rem;
}
.dash-nav-heading {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.32);
  padding: 0 0.6rem;
  margin: 1.1rem 0 0.4rem;
}
.dash-nav-heading:first-child {
  margin-top: 0;
}
.dash-nav .dash-tab {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  /* 44px min so a sidebar item is a comfortable thumb target on a phone. */
  min-height: 2.75rem;
  padding: 0.6rem 0.6rem;
  border-radius: 0.45rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  color: rgba(255, 255, 255, 0.7);
  background: none;
  border: 0;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.dash-nav .dash-tab > span:first-of-type {
  flex: 1;
}
.dash-nav .dash-tab .icon {
  width: 1.05rem;
  height: 1.05rem;
  opacity: 0.7;
}
.dash-nav .dash-tab:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
}
.dash-nav .dash-tab.active {
  background: rgba(212, 160, 60, 0.14);
  color: var(--white);
  font-weight: 600;
  /* Gold rail rather than a full gold fill: marks position without turning
     the item into a second call-to-action competing with Publish. */
  box-shadow: inset 3px 0 0 var(--gold);
}
.dash-nav .dash-tab.active .icon {
  color: var(--gold);
  opacity: 1;
}
.dash-nav-count {
  min-width: 1.4rem;
  padding: 0.05rem 0.4rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  color: rgba(255, 255, 255, 0.75);
}
.dash-nav-count:empty {
  display: none;
}
.dash-nav .dash-tab.active .dash-nav-count {
  background: var(--gold);
  color: var(--navy);
}

.dash-sidebar-foot {
  padding: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.dash-side-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  min-height: 2.6rem;
  padding: 0.55rem 0.6rem;
  border-radius: 0.45rem;
  font-family: inherit;
  font-size: 0.85rem;
  text-align: left;
  color: rgba(255, 255, 255, 0.55);
  background: none;
  border: 0;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.dash-side-link .icon {
  width: 1rem;
  height: 1rem;
}
.dash-side-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
}

/* ---------- Top bar ---------- */
.dash-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: rgba(245, 240, 232, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(26, 31, 46, 0.08);
}
@media (min-width: 1024px) {
  .dash-topbar {
    padding: 1.15rem 2rem;
  }
}
.dash-burger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-left: -0.5rem;
  flex-shrink: 0;
  border-radius: 0.5rem;
  color: var(--navy);
  background: rgba(26, 31, 46, 0.06);
}
@media (min-width: 1024px) {
  .dash-burger {
    display: none;
  }
}
.dash-topbar-title {
  flex: 1;
  min-width: 0;
}
.dash-topbar-title h1 {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--navy);
  letter-spacing: 0.02em;
}
.dash-topbar-sub {
  font-size: 0.78rem;
  color: rgba(26, 31, 46, 0.5);
  margin-top: 0.1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.dash-user-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  background: var(--navy);
  color: var(--gold);
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dash-user-meta {
  display: none;
  flex-direction: column;
  line-height: 1.25;
}
.dash-user-meta b {
  font-size: 0.85rem;
  color: var(--navy);
}
.dash-user-meta span {
  font-size: 0.72rem;
  color: rgba(26, 31, 46, 0.45);
}
@media (min-width: 640px) {
  .dash-user-meta {
    display: flex;
  }
}

/* ---------- Main region ---------- */
.dash-main {
  flex: 1;
  padding: 1.25rem 1rem;
  /* Room for the fixed publish bar plus the iOS home indicator. */
  padding-bottom: calc(7rem + env(safe-area-inset-bottom));
}
@media (min-width: 1024px) {
  .dash-main {
    padding: 2rem;
    padding-bottom: 7rem;
  }
}
.dash-tab-panel {
  display: none;
}
.dash-tab-panel.active {
  display: block;
}

/* ---------- Content tab ---------- */
.dash-page-picker {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.dash-page-picker label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--navy);
}
.dash-page-picker select {
  max-width: 16rem;
}
.dash-page-status {
  font-size: 0.8rem;
  color: rgba(26, 31, 46, 0.5);
}
.dash-page-status.is-draft {
  color: var(--gold-dark);
  font-weight: 600;
}

.dash-editor {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.dash-section {
  background: var(--white);
  border-radius: 0.7rem;
  padding: 1.35rem;
  box-shadow: 0 4px 16px rgba(26, 31, 46, 0.06);
}
.dash-section > h3 {
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(26, 31, 46, 0.08);
}
.dash-field {
  margin-bottom: 1rem;
}
.dash-field:last-child {
  margin-bottom: 0;
}
.dash-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(26, 31, 46, 0.6);
  margin-bottom: 0.35rem;
}
.dash-field-hint {
  font-size: 0.74rem;
  color: rgba(26, 31, 46, 0.45);
  margin-top: 0.3rem;
  line-height: 1.5;
}
.dash-field textarea.form-control {
  min-height: 4.5rem;
  resize: vertical;
}

.dash-array-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.dash-array-item {
  border: 1px solid rgba(26, 31, 46, 0.1);
  border-radius: 0.5rem;
  padding: 1rem;
  position: relative;
}
.dash-array-item-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.dash-icon-btn {
  width: 2.4rem;
  height: 2.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.35rem;
  border: 1px solid rgba(26, 31, 46, 0.15);
  background: var(--white);
  color: rgba(26, 31, 46, 0.6);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.15s;
  flex-shrink: 0;
}
.dash-icon-btn:hover {
  background: var(--cream);
  color: var(--navy);
}
.dash-icon-btn.danger:hover {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}
.dash-add-item-btn {
  align-self: flex-start;
}

.dash-image-field {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  border-radius: 0.5rem;
  border: 2px dashed transparent;
  padding: 0.35rem;
  margin: -0.35rem;
  transition: border-color 0.15s, background-color 0.15s;
}
.dash-image-field.is-dragover {
  border-color: var(--gold);
  background: rgba(212, 160, 60, 0.08);
}
.dash-image-preview {
  width: 5rem;
  height: 5rem;
  border-radius: 0.4rem;
  object-fit: cover;
  border: 1px solid rgba(26, 31, 46, 0.1);
  background: var(--cream);
  flex-shrink: 0;
}
.dash-image-field-controls {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
  min-width: 12rem;
}
.dash-image-field-controls input[type="file"] {
  font-size: 0.8rem;
}
.dash-image-hint {
  font-size: 0.75rem;
  color: rgba(26, 31, 46, 0.45);
}
.dash-image-hint.is-error {
  color: #b91c1c;
  font-weight: 600;
}

.dash-save-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---------- Publish bar ---------- */
.dash-publish-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: var(--navy);
  border-top: 2px solid var(--gold);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.15);
}
.dash-publish-inner {
  max-width: 72rem;
  margin-inline: auto;
  padding: 0.85rem 1rem;
  padding-bottom: calc(0.85rem + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}
@media (min-width: 1024px) {
  .dash-publish-inner {
    padding: 1rem 2rem;
  }
}
.dash-publish-inner span {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.82rem;
  min-width: 0;
}
.dash-publish-inner span.is-pending,
.dash-publish-inner span.is-draft {
  color: var(--gold);
  font-weight: 600;
}
.dash-publish-inner span.is-error {
  color: #f87171;
  font-weight: 600;
}
.dash-publish-inner span.is-live {
  color: #4ade80;
  font-weight: 600;
}
.dash-publish-inner .btn {
  flex-shrink: 0;
  padding: 0.75rem 1.25rem;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.dash-publish-inner .btn:disabled {
  opacity: 0.7;
  cursor: default;
}

/* ---------- Session-expired reauth ----------
   Same card as the login screen, but as an overlay on top of the app
   instead of a full-screen replacement -- the whole point is that the
   page underneath (and everything typed into it) is still there. */
.dash-reauth-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 18, 28, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.dash-reauth-overlay .dash-login-card {
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   Stat cards & charts
   ========================================================================== */
.dash-stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
@media (min-width: 640px) {
  .dash-stats-row {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
  .dash-stats-row--six {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 1280px) {
  .dash-stats-row--six {
    grid-template-columns: repeat(6, 1fr);
  }
}
.dash-stat-card {
  background: var(--white);
  border-radius: 0.7rem;
  padding: 1.1rem 1rem;
  box-shadow: 0 4px 16px rgba(26, 31, 46, 0.06);
}
.dash-stat-card.is-accent {
  background: var(--navy);
}
.dash-stat-card.is-accent .dash-stat-value {
  color: var(--gold);
}
.dash-stat-card.is-accent .dash-stat-label,
.dash-stat-card.is-accent .dash-stat-sub {
  color: rgba(255, 255, 255, 0.7);
}
.dash-stat-value {
  display: block;
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.85rem;
  color: var(--navy);
  line-height: 1.05;
  word-break: break-word;
}
.dash-stat-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  color: rgba(26, 31, 46, 0.6);
  margin-top: 0.35rem;
}
.dash-stat-sub {
  display: block;
  font-size: 0.68rem;
  color: rgba(26, 31, 46, 0.4);
  margin-top: 0.15rem;
}

.dash-charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
@media (min-width: 1024px) {
  .dash-charts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.dash-chart-card {
  background: var(--white);
  border-radius: 0.7rem;
  padding: 1.35rem;
  box-shadow: 0 4px 16px rgba(26, 31, 46, 0.06);
}
.dash-chart-card h3 {
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 1.15rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid rgba(26, 31, 46, 0.08);
}

.dash-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.dash-bar-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr 2rem;
  align-items: center;
  gap: 0.5rem;
}
@media (min-width: 640px) {
  .dash-bar-row {
    grid-template-columns: 9rem 1fr 2.5rem;
    gap: 0.75rem;
  }
}
.dash-bar-label {
  font-size: 0.78rem;
  color: rgba(26, 31, 46, 0.7);
}
.dash-bar-track {
  background: var(--cream);
  border-radius: 9999px;
  height: 0.9rem;
  overflow: hidden;
}
.dash-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.4s ease;
}
.dash-bar-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy);
  text-align: right;
}

.dash-pie-wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.dash-pie {
  width: 9rem;
  height: 9rem;
  border-radius: 50%;
  flex-shrink: 0;
}
.dash-chart-legend {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-width: 10rem;
}
.dash-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: rgba(26, 31, 46, 0.75);
}
.dash-legend-swatch {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 9999px;
  flex-shrink: 0;
}

/* Fundraising goal + key-value summary */
.dash-goal-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.6rem;
}
.dash-goal-label {
  font-weight: 600;
  color: var(--navy);
}
.dash-goal-pct {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.6rem;
  color: var(--gold-dark);
}
.dash-goal-track {
  background: var(--cream);
  border-radius: 9999px;
  height: 1.1rem;
  overflow: hidden;
}
.dash-goal-track.sm {
  height: 0.6rem;
}
.dash-goal-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, var(--gold), var(--gold-dark));
  transition: width 0.5s ease;
}
.dash-goal-foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
}

.dash-kv {
  display: flex;
  flex-direction: column;
}
.dash-kv-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(26, 31, 46, 0.06);
}
.dash-kv-row:last-child {
  border-bottom: 0;
}
.dash-kv-key {
  font-size: 0.85rem;
  color: rgba(26, 31, 46, 0.6);
}
.dash-kv-val {
  font-weight: 700;
  color: var(--navy);
  text-align: right;
}

.dash-project-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.dash-project-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
  color: var(--navy);
}

.dash-activity {
  display: flex;
  flex-direction: column;
}
.dash-activity-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(26, 31, 46, 0.06);
}
.dash-activity-row:last-child {
  border-bottom: 0;
}
.dash-activity-icon {
  flex-shrink: 0;
  font-size: 1rem;
}
.dash-activity-text {
  flex: 1;
  font-size: 0.85rem;
  color: rgba(26, 31, 46, 0.8);
}
.dash-activity-date {
  font-size: 0.72rem;
  color: rgba(26, 31, 46, 0.4);
  white-space: nowrap;
}

.muted {
  color: rgba(26, 31, 46, 0.5);
}

/* Tab intro heading */
.dash-tab-intro {
  margin-bottom: 1.1rem;
}
.dash-tab-intro h2 {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.5rem;
  color: var(--navy);
  letter-spacing: 0.02em;
}
.dash-tab-intro p {
  font-size: 0.85rem;
  margin-top: 0.15rem;
  color: rgba(26, 31, 46, 0.55);
}

/* Toolbar (filters + actions) */
.dash-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  background: var(--white);
  border-radius: 0.7rem;
  padding: 1rem;
  box-shadow: 0 4px 16px rgba(26, 31, 46, 0.06);
  margin-bottom: 1rem;
}
.dash-toolbar-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.dash-toolbar-field.grow {
  flex: 1;
  min-width: 10rem;
}
.dash-toolbar-field > span {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(26, 31, 46, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dash-toolbar .form-control {
  min-width: 8rem;
}
.dash-toolbar .btn {
  padding: 0.7rem 1rem;
  min-height: 2.75rem;
}
@media (max-width: 639px) {
  /* One control per row beats four squeezed onto one. */
  .dash-toolbar-field,
  .dash-toolbar .btn {
    width: 100%;
  }
  .dash-toolbar .form-control {
    min-width: 0;
  }
}
.dash-summary-line {
  font-size: 0.85rem;
  color: rgba(26, 31, 46, 0.6);
  margin: 0 0.25rem 0.75rem;
  font-weight: 600;
}

/* ==========================================================================
   Data tables
   Above 768px these are ordinary tables. Below it each row restacks into a
   card with the column name printed beside each value, so a phone never has
   to sideways-scroll a six-column table to find an amount.
   ========================================================================== */
.dash-table-wrap {
  background: var(--white);
  border-radius: 0.7rem;
  box-shadow: 0 4px 16px rgba(26, 31, 46, 0.06);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 40rem;
}
.dash-table th,
.dash-table td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(26, 31, 46, 0.07);
  vertical-align: middle;
}
.dash-table th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(26, 31, 46, 0.5);
  background: var(--cream);
  position: sticky;
  top: 0;
}
.dash-table tbody tr:hover {
  background: rgba(212, 160, 60, 0.05);
}
.dash-table td.right,
.dash-table th.right {
  text-align: right;
}
.dash-table td.strong {
  font-weight: 700;
  color: var(--navy);
}
.dash-table td.is-anon {
  color: rgba(26, 31, 46, 0.4);
  font-style: italic;
}
.dash-cell-input {
  padding: 0.5rem;
  font-size: 0.82rem;
  width: 4.5rem;
}
.dash-cell-input.wide {
  width: 9rem;
}

@media (max-width: 767px) {
  .dash-table-wrap {
    background: none;
    box-shadow: none;
    overflow-x: visible;
  }
  .dash-table {
    min-width: 0;
    display: block;
  }
  .dash-table thead {
    display: none;
  }
  .dash-table tbody,
  .dash-table tr,
  .dash-table td {
    display: block;
    width: auto;
  }
  .dash-table tr {
    background: var(--white);
    border-radius: 0.7rem;
    box-shadow: 0 2px 10px rgba(26, 31, 46, 0.06);
    padding: 0.35rem 0.9rem;
    margin-bottom: 0.75rem;
  }
  .dash-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid rgba(26, 31, 46, 0.06);
    text-align: right;
  }
  .dash-table tr td:last-child {
    border-bottom: 0;
  }
  /* JS stamps data-label on each cell from its column heading. */
  .dash-table td::before {
    content: attr(data-label);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(26, 31, 46, 0.45);
    text-align: left;
    flex-shrink: 0;
  }
  .dash-table td:empty {
    display: none;
  }
  .dash-cell-input,
  .dash-cell-input.wide {
    width: 7rem;
  }
}

.dash-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
}
.dash-badge.is-recurring {
  background: rgba(212, 160, 60, 0.18);
  color: var(--gold-dark);
}
.dash-badge.is-once {
  background: rgba(26, 31, 46, 0.08);
  color: rgba(26, 31, 46, 0.6);
}

.dash-mini-btn {
  padding: 0.5rem 0.85rem;
  border-radius: 0.35rem;
  border: 1px solid rgba(26, 31, 46, 0.15);
  background: var(--white);
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.dash-mini-btn:hover {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
#vol-save-btn.is-dirty {
  box-shadow: 0 0 0 3px rgba(212, 160, 60, 0.35);
}

/* Reports grid */
.dash-report-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 640px) {
  .dash-report-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1280px) {
  .dash-report-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.dash-report-card {
  background: var(--white);
  border-radius: 0.7rem;
  padding: 1.35rem;
  box-shadow: 0 4px 16px rgba(26, 31, 46, 0.06);
  display: flex;
  flex-direction: column;
}
.dash-report-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.4rem;
}
.dash-report-card p {
  font-size: 0.82rem;
  flex: 1;
  margin-bottom: 1rem;
  color: rgba(26, 31, 46, 0.6);
}
.dash-report-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.dash-report-actions .btn {
  padding: 0.65rem 0.9rem;
  font-size: 0.82rem;
  min-height: 2.75rem;
}

/* Figures / campaign editor */
.dash-figures {
  margin-top: 1.25rem;
}
.dash-figures-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.dash-figures-head h3 {
  margin-bottom: 0;
  border-bottom: 0;
  padding-bottom: 0;
}
.dash-figures-body {
  margin-top: 1.25rem;
}
.dash-figures-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 640px) {
  .dash-figures-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .dash-figures-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}
.dash-figures-sub {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--navy);
  margin: 1.5rem 0 0.75rem;
}
.dash-inline-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.dash-inline-row .form-control {
  flex: 1;
  min-width: 7rem;
}

/* Callout explaining a setting's consequence on the public site. */
.dash-note {
  display: flex;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-radius: 0.5rem;
  background: rgba(212, 160, 60, 0.1);
  border: 1px solid rgba(212, 160, 60, 0.3);
  font-size: 0.82rem;
  line-height: 1.6;
  color: rgba(26, 31, 46, 0.75);
  margin-bottom: 1.25rem;
}
.dash-note .icon {
  width: 1rem;
  height: 1rem;
  color: var(--gold-dark);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

/* ---------- Submissions tab ---------- */
.dash-subtabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 0.25rem;
}
.dash-subtabs::-webkit-scrollbar {
  display: none;
}
.dash-subtab {
  flex-shrink: 0;
  padding: 0.6rem 1rem;
  min-height: 2.6rem;
  border-radius: 9999px;
  border: 1px solid rgba(26, 31, 46, 0.15);
  background: var(--white);
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(26, 31, 46, 0.6);
  cursor: pointer;
  transition: all 0.15s;
}
.dash-subtab.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.dash-submissions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.dash-submission-card {
  background: var(--white);
  border-radius: 0.7rem;
  padding: 1.1rem 1.25rem;
  box-shadow: 0 2px 10px rgba(26, 31, 46, 0.05);
}
.dash-submission-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}
.dash-submission-head .name {
  font-weight: 700;
  color: var(--navy);
}
.dash-submission-head .date {
  font-size: 0.75rem;
  color: rgba(26, 31, 46, 0.45);
}
.dash-submission-field {
  display: flex;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: rgba(26, 31, 46, 0.75);
  padding: 0.2rem 0;
  flex-wrap: wrap;
}
.dash-submission-field .k {
  font-weight: 600;
  color: rgba(26, 31, 46, 0.5);
  min-width: 6.5rem;
}
.dash-submission-field .v {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}
.dash-submission-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(26, 31, 46, 0.07);
}
.dash-submission-actions a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.dash-empty-state {
  color: rgba(26, 31, 46, 0.45);
  font-size: 0.9rem;
  text-align: center;
  padding: 3rem 1rem;
  background: var(--white);
  border-radius: 0.7rem;
}

/* ==========================================================================
   Recording donations that arrived outside PayFast
   Card gifts log themselves via the ITN webhook; EFT and cash have to be
   entered by hand, so the form lives right above the table it feeds.
   ========================================================================== */
.dash-offline-form {
  background: var(--white);
  border: 1px solid rgba(26, 31, 46, 0.1);
  border-radius: 0.7rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 16px rgba(26, 31, 46, 0.06);
}
.dash-offline-form > summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--navy);
  list-style: none;
}
.dash-offline-form > summary::-webkit-details-marker { display: none; }
.dash-offline-form[open] > summary { margin-bottom: 1rem; }
.dash-offline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.75rem;
}
.dash-offline-check {
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem !important;
}
.dash-offline-check input { width: 1rem; height: 1rem; accent-color: var(--gold); }
.dash-offline-check span { text-transform: none !important; letter-spacing: 0 !important; }
.dash-offline-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.dash-offline-msg { font-size: 0.82rem; margin: 0; }
.dash-offline-msg.is-ok { color: #15803d; }
.dash-offline-msg.is-error { color: #b91c1c; }

/* Hand-entered gifts stay visually distinct from bank-confirmed ones. */
.dash-badge.is-card {
  background: rgba(26, 31, 46, 0.08);
  color: rgba(26, 31, 46, 0.65);
}
.dash-badge.is-offline {
  background: rgba(91, 140, 90, 0.18);
  color: #3f6b3e;
}
.dash-mini-btn.danger { color: #b91c1c; }

.dash-page-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.dash-page-status-warn {
  color: #b45309;
  font-weight: 700;
}
.dash-page-status .dash-mini-btn {
  font-size: 0.72rem;
}

/* Page-content status. Saving is publishing now, so these three states are
   the whole story: unsaved edits, live, or a save that failed. */
.dash-page-status.is-live {
  color: #15803d;
  font-weight: 600;
}
.dash-page-status.is-error {
  color: #b91c1c;
  font-weight: 600;
}
