/* ==========================================================================
   Dashboard — header, headline tiles with sparklines, and the card grid
   ========================================================================== */

/* Header ------------------------------------------------------------------- */
.dash-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.dash-header__date { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.dash-header h1 { margin-top: 6px; font-size: 30px; font-weight: 700; letter-spacing: -.035em; }
.dash-header__summary { margin: 6px 0 0; color: var(--text-2); }
.dash-header__summary strong { color: var(--text); }
.dash-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dash-action {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  font-weight: 600; color: var(--text); box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.dash-action .icon { color: var(--brand); }
.dash-action:hover { border-color: rgba(var(--brand-rgb), .4); box-shadow: 0 6px 16px rgba(var(--brand-rgb), .12); transform: translateY(-1px); }
.dash-action--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.dash-action--primary .icon { color: #fff; }
.dash-action--primary:hover { background: var(--brand-hover); }

/* Headline tiles ------------------------------------------------------------ */
.dash-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 18px; }
.dash-tile {
  position: relative; display: flex; flex-direction: column; gap: 4px; min-height: 150px; padding: 18px 20px 0;
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: inherit; overflow: hidden;
  transition: box-shadow .15s, transform .1s;
}
.dash-tile:hover { box-shadow: 0 12px 28px rgba(15, 23, 42, .08); transform: translateY(-1px); }
.dash-tile__label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.dash-tile__label .icon { color: var(--muted); }
.dash-tile__value { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; }
.dash-delta { font-size: 12px; font-weight: 700; color: var(--text-2); }
.dash-delta small { font-weight: 500; color: var(--muted); }
.dash-delta--up { color: var(--green); }
.dash-delta--down { color: var(--red); }
.sparkline { display: block; width: calc(100% + 40px); height: 40px; margin: auto -20px 0; }
.dash-tile__meter { height: 6px; margin: auto 0 18px; border-radius: 99px; background: var(--amber-soft); overflow: hidden; }
.dash-tile__meter span { display: block; height: 100%; background: var(--red); border-radius: inherit; }

/* Card grid ----------------------------------------------------------------- */
.dash-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.dash-row--main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.dash-row--three { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.dash-card { display: flex; flex-direction: column; min-width: 0; }
.dash-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px 12px; }
.dash-card__head h2 { font-size: 15px; }
.dash-card__head small { display: block; margin-top: 2px; font-size: 12px; }
.dash-card__foot { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 12px; margin-top: auto; padding: 14px 20px; border-top: 1px solid var(--border); }
.dash-card__foot small { display: block; font-size: 11px; color: var(--muted); }
.dash-card__foot strong { font-family: var(--display); font-size: 16px; }
.dash-link { font-size: 12px; font-weight: 600; color: var(--brand); white-space: nowrap; }
.dash-legend { display: flex; gap: 12px; font-size: 12px; color: var(--text-2); }
.dash-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dash-legend i { width: 10px; height: 10px; border-radius: 3px; }
.dash-card > .empty { flex: 1; justify-content: center; }

/* Revenue / attendance bars */
.dash-bars { display: flex; align-items: flex-end; gap: 14px; height: 230px; padding: 8px 20px 12px; }
.dash-bars--days { gap: 6px; }
.dash-bars__col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.dash-bars__total { font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.dash-bars__col.is-current .dash-bars__total { color: var(--brand); }
.dash-bars__stack { flex: 1; width: min(56px, 100%); display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
.dash-bars__stack span { display: block; width: 100%; border-radius: 6px; min-height: 2px; }
.dash-bars__memberships { background: rgba(var(--brand-rgb), .3); }
.dash-bars__shop { background: #c7d2fe; }
.dash-bars__col.is-current .dash-bars__memberships { background: var(--brand); box-shadow: 0 6px 18px rgba(var(--brand-rgb), .3); }
.dash-bars__col.is-current .dash-bars__shop { background: #a5b4fc; }
.dash-bars__label { font-size: 12px; color: var(--muted); }

/* Needs attention */
.dash-todo { list-style: none; margin: 0; padding: 0 12px 12px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; max-height: 360px; }
.dash-todo__item { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 8px; border-radius: 12px; }
.dash-todo__item:hover { background: var(--surface-2); }
.dash-todo__item strong { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-todo__item small { display: block; font-size: 12px; color: var(--muted); }
.dash-todo__icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; }
.dash-todo__item--renew .dash-todo__icon { background: var(--amber-soft); color: var(--amber); }
.dash-todo__item--due .dash-todo__icon { background: var(--red-soft); color: var(--red); }
.dash-todo__item--lead .dash-todo__icon { background: var(--blue-soft); color: var(--blue); }
.dash-todo__item--stock .dash-todo__icon { background: rgba(190, 24, 93, .1); color: #be185d; }
.dash-todo__item--class .dash-todo__icon { background: var(--violet-soft); color: var(--violet); }

/* Membership health donut */
.dash-health { display: flex; align-items: center; gap: 20px; padding: 6px 20px 18px; }
.dash-donut { position: relative; flex-shrink: 0; width: 130px; height: 130px; border-radius: 50%; }
.dash-donut span { position: absolute; inset: 18px; display: grid; place-content: center; text-align: center; border-radius: 50%; background: var(--surface); }
.dash-donut strong { font-family: var(--display); font-size: 26px; line-height: 1; }
.dash-donut small { font-size: 11px; color: var(--muted); }
.dash-health__legend { list-style: none; margin: 0; padding: 0; flex: 1; display: flex; flex-direction: column; gap: 9px; font-size: 13px; }
.dash-health__legend li { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; color: var(--text-2); }
.dash-health__legend i { width: 10px; height: 10px; border-radius: 3px; }
.dash-health__legend strong { color: var(--text); font-family: var(--display); }

/* Today's classes */
.dash-classes { list-style: none; margin: 0; padding: 0 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.dash-classes__row { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; border-left: 3px solid var(--class-color); color: inherit; }
.dash-classes__row:hover { background: var(--surface-2); }
.dash-classes__row.is-past { opacity: .55; }
.dash-classes__time { font-family: var(--display); font-weight: 700; font-size: 16px; line-height: 1; }
.dash-classes__time small { display: block; font-family: "Inter", sans-serif; font-size: 10px; font-weight: 600; color: var(--muted); }
.dash-classes__main strong { display: block; font-size: 13px; }
.dash-classes__main small { font-size: 12px; color: var(--muted); }
.dash-classes__bar { display: block; height: 4px; margin-top: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.dash-classes__bar span { display: block; height: 100%; background: var(--class-color); }

/* Leads funnel */
.dash-funnel { list-style: none; margin: 0; padding: 4px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.dash-funnel li { display: grid; grid-template-columns: 100px 1fr 28px; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.dash-funnel strong { text-align: right; color: var(--text); font-family: var(--display); }
.dash-funnel__bar { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.dash-funnel__bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #818cf8, var(--brand)); }

/* Activity timeline */
.dash-timeline { list-style: none; margin: 0; padding: 0 20px 16px; display: flex; flex-direction: column; }
.dash-timeline li { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 8px 0; }
.dash-timeline li:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 36px; bottom: -8px; width: 2px; background: var(--surface-3); }
.dash-timeline__icon { position: relative; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--event-color); background: color-mix(in srgb, var(--event-color) 13%, var(--surface)); }
.dash-timeline strong { display: block; font-size: 13px; }
.dash-timeline strong a:hover { color: var(--brand); }
.dash-timeline small { font-size: 12px; color: var(--muted); }

/* Top plans */
.dash-plans { list-style: none; margin: 0; padding: 0 20px 18px; display: flex; flex-direction: column; gap: 14px; }
.dash-plans strong { font-size: 13px; }
.dash-plans small { margin-left: 6px; font-size: 12px; color: var(--muted); }
.dash-plans__bar { display: block; height: 8px; margin-top: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.dash-plans__bar span { display: block; height: 100%; border-radius: inherit; background: var(--green); }

/* Responsive ---------------------------------------------------------------- */
@media (max-width: 1100px) {
  .dash-row--main { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 700px) {
  .dash-row--three { grid-template-columns: minmax(0, 1fr); }
  .dash-header h1 { font-size: 25px; }
  .dash-action { flex: 1 1 calc(50% - 8px); justify-content: center; }
  .dash-bars { gap: 6px; height: 190px; padding-inline: 12px; }
  .dash-bars__total { display: none; }
  .dash-health { flex-direction: column; align-items: stretch; }
  .dash-donut { align-self: center; }
}
