/* ==========================================================================
   MatchPlanner design system v1
   Source of truth: Claude Design project "MatchPlanner: sistema visual completo"
   (Fundamentos.dc.html, Componentes.dc.html, Pantallas.dc.html).

   One system for both zones: the member-facing app and the management
   dashboard. Every value below is a token; components never hardcode colour.
   ========================================================================== */

/* --------------------------------------------------------------------------
   01 — Tokens, light theme
   -------------------------------------------------------------------------- */

:root {
  /* Neutral ramp: warm ink */
  --mp-ink-900: #0e120f;
  --mp-ink-800: #1a201c;
  --mp-ink-700: #2a312c;
  --mp-slate-600: #5a6560;
  --mp-slate-500: #6b7770;
  --mp-slate-400: #9ca79f;
  --mp-line-200: #e2e6e0;
  --mp-line-100: #edefea;
  --mp-canvas-050: #f6f7f3;

  /* Brand accent: volt. Never used as text colour on white. */
  --mp-volt-400: #c8ff00;
  --mp-volt-500: #a8d900;
  --mp-volt-700: #6e8f00;
  --mp-volt-800: #3e5100;
  --mp-volt-tint: #f0ffc2;
  --mp-volt-tint-strong: #e7f9b4;

  /* Secondary energy / destructive */
  --mp-coral-600: #d93a2b;
  --mp-coral-800: #a32619;
  --mp-coral-tint: #ffe9e5;

  /* Semantic surfaces */
  --mp-canvas: var(--mp-canvas-050);
  --mp-surface: #ffffff;
  --mp-surface-alt: #fafbf8;
  --mp-surface-sunken: var(--mp-canvas-050);
  --mp-surface-inverse: var(--mp-ink-900);
  --mp-surface-nav: var(--mp-ink-800);

  --mp-text: var(--mp-ink-900);
  --mp-text-soft: var(--mp-ink-700);
  --mp-text-muted: var(--mp-slate-500);
  --mp-text-inverse: #f2f5ef;
  --mp-text-inverse-muted: var(--mp-slate-400);

  --mp-line: var(--mp-line-200);
  --mp-line-soft: var(--mp-line-100);

  /* Slot / booking states — colour plus a second signal (border, pattern, icon) */
  --mp-available-bg: #e6f4f1;
  --mp-available-border: #0f8b7e;
  --mp-available-text: #0a6b60;

  --mp-busy-bg: var(--mp-coral-tint);
  --mp-busy-border: var(--mp-coral-600);
  --mp-busy-text: var(--mp-coral-800);

  --mp-blocked-bg: repeating-linear-gradient(135deg, #edefea 0 7px, #e2e6e0 7px 14px);
  --mp-blocked-border: var(--mp-slate-400);
  --mp-blocked-text: var(--mp-slate-600);

  --mp-pending-bg: #fff3d6;
  --mp-pending-border: #b57500;
  --mp-pending-text: #8a5900;

  --mp-selected-bg: var(--mp-volt-400);
  --mp-selected-border: var(--mp-ink-900);
  --mp-selected-text: var(--mp-ink-900);
  --mp-selected-ring: rgba(200, 255, 0, 0.4);

  --mp-neutral-bg: var(--mp-line-100);
  --mp-neutral-text: var(--mp-slate-600);

  /* Focus. Deviates from the spec in dark mode only: an ink outline is
     invisible on a dark canvas, so the token flips to the inverse text
     colour there while keeping the same 2.5px / 2px offset geometry. */
  --mp-focus: var(--mp-ink-900);
  --mp-focus-width: 2.5px;
  --mp-focus-offset: 2px;

  /* Typography */
  --mp-font-display: "Sora", system-ui, -apple-system, sans-serif;
  --mp-font-ui: "Public Sans", system-ui, -apple-system, sans-serif;
  --mp-font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Spacing, 4px scale */
  --mp-space-xs: 4px;
  --mp-space-sm: 8px;
  --mp-space-md: 12px;
  --mp-space-lg: 16px;
  --mp-space-xl: 24px;
  --mp-space-2xl: 32px;
  --mp-space-3xl: 48px;
  --mp-space-4xl: 64px;

  /* Radii */
  --mp-radius-xs: 4px;   /* badge, slot */
  --mp-radius-sm: 8px;   /* input, button */
  --mp-radius-md: 12px;  /* card */
  --mp-radius-lg: 20px;  /* mobile sheet */
  --mp-radius-pill: 999px;

  /* Density: comfortable (member) vs compact (dashboard) */
  --mp-row-height: 56px;
  --mp-control-height: 44px;
  --mp-pad-y: 16px;
  --mp-pad-x: 24px;
  --mp-font-size: 15px;

  --mp-shadow-card: 0 1px 2px rgba(14, 18, 15, 0.04);
  --mp-shadow-raised: 0 12px 32px rgba(14, 18, 15, 0.08);
  --mp-shadow-sheet: 0 -6px 18px rgba(14, 18, 15, 0.06);
}

/* --------------------------------------------------------------------------
   02 — Dark theme
   The volt accent does not change between themes: it is the brand anchor.
   Semantic states gain lightness and lose background saturation to hold AA.
   -------------------------------------------------------------------------- */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --mp-canvas: #0e120f;
    --mp-surface: #171c18;
    --mp-surface-alt: #1f2621;
    --mp-surface-sunken: #1f2621;
    --mp-surface-inverse: #f2f5ef;
    --mp-surface-nav: #171c18;

    --mp-text: #f2f5ef;
    --mp-text-soft: #d7ded8;
    --mp-text-muted: #9ca79f;
    --mp-text-inverse: #0e120f;
    --mp-text-inverse-muted: #5a6560;

    --mp-line: #2d352f;
    --mp-line-soft: #252d27;

    --mp-available-bg: #173a35;
    --mp-available-border: #35c0ae;
    --mp-available-text: #7fe3d6;

    --mp-busy-bg: #3a1c18;
    --mp-busy-border: #ff7a6b;
    --mp-busy-text: #ffa79b;

    --mp-blocked-bg: repeating-linear-gradient(135deg, #1f2621 0 7px, #252d27 7px 14px);
    --mp-blocked-border: #4b554e;
    --mp-blocked-text: #9ca79f;

    --mp-pending-bg: #3a2c0c;
    --mp-pending-border: #ffc24d;
    --mp-pending-text: #ffd98a;

    --mp-selected-border: #f2f5ef;

    --mp-neutral-bg: #252d27;
    --mp-neutral-text: #9ca79f;

    --mp-volt-tint: #2a3300;
    --mp-volt-tint-strong: #384500;
    --mp-volt-800: #d7ff6b;

    --mp-focus: #f2f5ef;

    --mp-shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4);
    --mp-shadow-raised: 0 12px 32px rgba(0, 0, 0, 0.45);
    --mp-shadow-sheet: 0 -6px 18px rgba(0, 0, 0, 0.4);
  }
}

:root[data-theme="dark"] {
  --mp-canvas: #0e120f;
  --mp-surface: #171c18;
  --mp-surface-alt: #1f2621;
  --mp-surface-sunken: #1f2621;
  --mp-surface-inverse: #f2f5ef;
  --mp-surface-nav: #171c18;

  --mp-text: #f2f5ef;
  --mp-text-soft: #d7ded8;
  --mp-text-muted: #9ca79f;
  --mp-text-inverse: #0e120f;
  --mp-text-inverse-muted: #5a6560;

  --mp-line: #2d352f;
  --mp-line-soft: #252d27;

  --mp-available-bg: #173a35;
  --mp-available-border: #35c0ae;
  --mp-available-text: #7fe3d6;

  --mp-busy-bg: #3a1c18;
  --mp-busy-border: #ff7a6b;
  --mp-busy-text: #ffa79b;

  --mp-blocked-bg: repeating-linear-gradient(135deg, #1f2621 0 7px, #252d27 7px 14px);
  --mp-blocked-border: #4b554e;
  --mp-blocked-text: #9ca79f;

  --mp-pending-bg: #3a2c0c;
  --mp-pending-border: #ffc24d;
  --mp-pending-text: #ffd98a;

  --mp-selected-border: #f2f5ef;

  --mp-neutral-bg: #252d27;
  --mp-neutral-text: #9ca79f;

  --mp-volt-tint: #2a3300;
  --mp-volt-tint-strong: #384500;
  --mp-volt-800: #d7ff6b;

  --mp-focus: #f2f5ef;

  --mp-shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4);
  --mp-shadow-raised: 0 12px 32px rgba(0, 0, 0, 0.45);
  --mp-shadow-sheet: 0 -6px 18px rgba(0, 0, 0, 0.4);
}

/* Compact density: the dashboard opts in on its layout root. */
.mp-density-compact {
  --mp-row-height: 40px;
  --mp-control-height: 36px;
  --mp-pad-y: 8px;
  --mp-pad-x: 12px;
  --mp-font-size: 13.5px;
}

/* --------------------------------------------------------------------------
   03 — Base
   -------------------------------------------------------------------------- */

body.mp-body {
  margin: 0;
  background: var(--mp-canvas);
  color: var(--mp-text);
  font-family: var(--mp-font-ui);
  font-size: var(--mp-font-size);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Wrapped in :where() so it carries zero specificity: this is the default for
   prose links only, and any component class (button, nav link, tab) must be
   able to override it without an escalation war. */
:where(.mp-body) :where(a) {
  color: var(--mp-text);
  text-decoration-color: var(--mp-volt-500);
}

:where(.mp-body) :where(a):hover {
  color: var(--mp-coral-600);
}

/* One focus treatment everywhere, keyboard only. */
.mp-body :focus-visible {
  outline: var(--mp-focus-width) solid var(--mp-focus);
  outline-offset: var(--mp-focus-offset);
  border-radius: var(--mp-radius-xs);
}

/* Every figure, price and clock time is tabular. */
.mp-num {
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  .mp-body *,
  .mp-body *::before,
  .mp-body *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   04 — Typography
   Headings are set by scale, never by character count, so the three locales
   (es / en / ca) reflow instead of overflowing.
   -------------------------------------------------------------------------- */

.mp-display {
  font-family: var(--mp-font-display);
  font-weight: 700;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0;
  text-wrap: balance;
}

.mp-title {
  font-family: var(--mp-font-display);
  font-weight: 600;
  font-size: clamp(20px, 2.4vw, 26px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
}

.mp-subtitle {
  font-family: var(--mp-font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
  margin: 0;
}

.mp-stat-value {
  font-family: var(--mp-font-display);
  font-weight: 600;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.mp-body-text {
  font-size: 15px;
  line-height: 1.6;
  max-width: 62ch;
  text-wrap: pretty;
}

.mp-ui-text {
  font-size: 14px;
  font-weight: 600;
}

.mp-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--mp-text-muted);
}

.mp-muted {
  color: var(--mp-text-muted);
}

.mp-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--mp-text-muted);
}

/* --------------------------------------------------------------------------
   05 — Layout helpers
   -------------------------------------------------------------------------- */

.mp-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: var(--mp-space-2xl) var(--mp-space-xl) var(--mp-space-4xl);
}

.mp-stack {
  display: flex;
  flex-direction: column;
  gap: var(--mp-space-lg);
}

/* Size modifiers stand on their own: they read as complete classes at the
   call site, so they carry the layout too rather than requiring .mp-stack. */
.mp-stack-sm,
.mp-stack-lg,
.mp-stack-xl {
  display: flex;
  flex-direction: column;
}

.mp-stack-sm { gap: var(--mp-space-sm); }
.mp-stack-lg { gap: var(--mp-space-xl); }
.mp-stack-xl { gap: var(--mp-space-2xl); }

/* Charts need a bounded box: a responsive canvas with maintainAspectRatio off
   grows to fill whatever height its flex parent offers. */
.mp-chart {
  position: relative;
  height: 280px;
  width: 100%;
}

.mp-chart canvas {
  position: absolute;
  inset: 0;
}

.mp-row {
  display: flex;
  align-items: center;
  gap: var(--mp-space-md);
  flex-wrap: wrap;
}

.mp-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--mp-space-md);
  flex-wrap: wrap;
}

.mp-divider {
  height: 1px;
  background: var(--mp-line);
  border: 0;
  margin: 0;
}

/* Auto-fit grids: no fixed column counts, so long translations reflow. */
.mp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--mp-space-lg);
}

.mp-grid-sm {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--mp-space-md);
}

/* --------------------------------------------------------------------------
   06 — Buttons
   -------------------------------------------------------------------------- */

.mp-btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--mp-space-sm);
  min-height: var(--mp-control-height);
  min-width: 44px;
  padding: 11px 18px;
  border-radius: var(--mp-radius-sm);
  border: 1px solid transparent;
  background: var(--mp-surface);
  color: var(--mp-text);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.mp-btn:hover { color: var(--mp-text); }

.mp-btn--primary {
  background: var(--mp-ink-900);
  color: #f2f5ef;
  border-color: var(--mp-ink-900);
}

.mp-btn--primary:hover {
  background: var(--mp-ink-700);
  border-color: var(--mp-ink-700);
  color: #f2f5ef;
}

.mp-btn--accent {
  background: var(--mp-volt-400);
  color: var(--mp-ink-900);
  border: 1.5px solid var(--mp-ink-900);
  font-weight: 700;
}

.mp-btn--accent:hover {
  background: var(--mp-volt-500);
  color: var(--mp-ink-900);
}

.mp-btn--ghost {
  background: var(--mp-surface);
  border-color: var(--mp-line);
  color: var(--mp-text);
}

.mp-btn--ghost:hover {
  border-color: var(--mp-ink-900);
  background: var(--mp-surface-alt);
}

.mp-btn--danger {
  background: var(--mp-surface);
  border-color: var(--mp-coral-600);
  color: var(--mp-coral-800);
}

.mp-btn--danger:hover {
  background: var(--mp-coral-tint);
  color: var(--mp-coral-800);
}

.mp-btn--lg {
  min-height: 52px;
  font-size: 15px;
  padding: 0 22px;
}

.mp-btn--sm {
  min-height: 36px;
  font-size: 13px;
  padding: 6px 12px;
}

.mp-btn--block {
  width: 100%;
}

.mp-btn:disabled,
.mp-btn[aria-disabled="true"] {
  background: var(--mp-line-100);
  border-color: var(--mp-line);
  color: var(--mp-text-muted);
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   07 — Cards
   -------------------------------------------------------------------------- */

.mp-card {
  background: var(--mp-surface);
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius-md);
  box-shadow: var(--mp-shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.mp-card__body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: var(--mp-space-md);
  flex: 1;
}

.mp-card__footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--mp-space-md);
  padding-top: var(--mp-space-md);
  border-top: 1px solid var(--mp-line);
}

/* The volt cap is the card's only brand mark. */
.mp-card--accent::before {
  content: "";
  display: block;
  height: 8px;
  background: var(--mp-volt-400);
}

.mp-card--selected {
  border: 1.5px solid var(--mp-ink-900);
  box-shadow: 0 0 0 3px var(--mp-selected-ring);
}

.mp-card--unavailable {
  background: var(--mp-surface-alt);
  opacity: 0.75;
}

.mp-card--unavailable.mp-card--accent::before {
  background: var(--mp-blocked-bg);
}

.mp-card--inverse {
  background: var(--mp-ink-900);
  border-color: var(--mp-ink-900);
  color: #f2f5ef;
}

.mp-card--inverse .mp-label,
.mp-card--inverse .mp-muted {
  color: var(--mp-slate-400);
}

.mp-card--inverse .mp-stat-value {
  color: #f2f5ef;
}

.mp-price {
  font-family: var(--mp-font-display);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   08 — Slot selector
   Grid of bookable time slots. Each state carries a second signal beyond hue:
   available a solid border, busy a strikethrough, blocked a hatch, pending a
   dot. Unavailable slots stay focusable so a screen reader can say why.
   -------------------------------------------------------------------------- */

.mp-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
  gap: var(--mp-space-sm);
}

.mp-slot {
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
  text-align: left;
  padding: var(--mp-space-md);
  min-height: 64px;
  border-radius: var(--mp-radius-sm);
  border: 1.5px solid var(--mp-line);
  background: var(--mp-surface);
  color: var(--mp-text);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.mp-slot__time {
  font-weight: 700;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.mp-slot__meta {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.mp-slot--available {
  background: var(--mp-available-bg);
  border-color: var(--mp-available-border);
  color: var(--mp-available-text);
}

.mp-slot--available:hover {
  filter: brightness(0.97);
}

.mp-slot--busy {
  background: var(--mp-busy-bg);
  border-color: var(--mp-busy-border);
  color: var(--mp-busy-text);
  cursor: not-allowed;
}

.mp-slot--busy .mp-slot__time {
  text-decoration: line-through;
}

.mp-slot--blocked {
  background: var(--mp-blocked-bg);
  border: 1.5px dashed var(--mp-blocked-border);
  color: var(--mp-blocked-text);
  cursor: not-allowed;
}

.mp-slot--pending {
  background: var(--mp-pending-bg);
  border-color: var(--mp-pending-border);
  color: var(--mp-pending-text);
  cursor: not-allowed;
}

.mp-slot--pending .mp-slot__meta::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: var(--mp-radius-pill);
  background: var(--mp-pending-border);
  margin-right: 6px;
  vertical-align: middle;
}

.mp-slot--selected,
.mp-slot--available[aria-pressed="true"] {
  background: var(--mp-selected-bg);
  border: 1.5px solid var(--mp-selected-border);
  color: var(--mp-selected-text);
  box-shadow: 0 0 0 3px var(--mp-selected-ring);
}

.mp-slot--selected .mp-slot__meta {
  font-weight: 700;
}

/* Centred variant used by the narrow mobile grid. */
.mp-slots--centered .mp-slot {
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 60px;
}

.mp-legend {
  display: flex;
  gap: var(--mp-space-lg);
  flex-wrap: wrap;
}

.mp-legend__item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--mp-text-soft);
}

.mp-legend__swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex: none;
}

.mp-legend__swatch--available {
  background: var(--mp-available-bg);
  border: 1.5px solid var(--mp-available-border);
}

.mp-legend__swatch--busy {
  background: var(--mp-busy-bg);
  border: 1.5px solid var(--mp-busy-border);
}

.mp-legend__swatch--blocked {
  background: var(--mp-line-100);
  border: 1.5px dashed var(--mp-blocked-border);
}

/* --------------------------------------------------------------------------
   09 — Step indicator
   -------------------------------------------------------------------------- */

.mp-steps {
  display: flex;
  align-items: flex-start;
}

.mp-step {
  display: flex;
  flex-direction: column;
  gap: var(--mp-space-sm);
  align-items: center;
  flex: 1;
}

.mp-step__track {
  display: flex;
  align-items: center;
  width: 100%;
}

.mp-step__line {
  flex: 1;
  height: 2px;
  background: var(--mp-line);
}

.mp-step__line--filled { background: var(--mp-ink-900); }
.mp-step__line--empty { background: transparent; }

.mp-step__dot {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: var(--mp-radius-pill);
  background: var(--mp-surface);
  border: 2px solid var(--mp-line);
  color: var(--mp-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
}

.mp-step__label {
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  padding: 0 6px;
  color: var(--mp-text-muted);
}

.mp-step--done .mp-step__dot {
  background: var(--mp-ink-900);
  border-color: var(--mp-ink-900);
  color: var(--mp-volt-400);
}

.mp-step--done .mp-step__label { color: var(--mp-text); }

.mp-step--current .mp-step__dot {
  background: var(--mp-volt-400);
  border: 2px solid var(--mp-ink-900);
  color: var(--mp-ink-900);
  box-shadow: 0 0 0 4px rgba(200, 255, 0, 0.35);
}

.mp-step--current .mp-step__label {
  color: var(--mp-text);
  font-weight: 700;
}

/* Compact variant: one line plus a bar, for mobile. */
.mp-progress {
  display: flex;
  flex-direction: column;
  gap: var(--mp-space-sm);
}

.mp-progress__bar {
  height: 6px;
  border-radius: var(--mp-radius-pill);
  background: var(--mp-line);
  overflow: hidden;
}

.mp-progress__fill {
  height: 100%;
  background: var(--mp-volt-400);
  border-right: 1.5px solid var(--mp-ink-900);
}

/* --------------------------------------------------------------------------
   10 — Metric card
   -------------------------------------------------------------------------- */

.mp-stat {
  background: var(--mp-surface);
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius-md);
  padding: var(--mp-space-lg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mp-stat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--mp-space-sm);
}

.mp-stat__icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--mp-volt-tint);
  border: 1px solid var(--mp-volt-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--mp-volt-800);
  flex: none;
}

.mp-stat__foot {
  font-size: 12.5px;
  color: var(--mp-text-muted);
}

.mp-stat__delta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--mp-available-text);
}

/* Una caída se lee en rojo; el verde por defecto la disfrazaría de subida. */
.mp-stat__delta--down {
  color: var(--mp-busy-text);
}

.mp-stat--inverse {
  background: var(--mp-ink-900);
  border: 1.5px solid var(--mp-ink-900);
  color: #f2f5ef;
}

.mp-stat--inverse .mp-label,
.mp-stat--inverse .mp-stat__foot {
  color: var(--mp-slate-400);
}

.mp-stat--inverse .mp-stat-value { color: #f2f5ef; }

.mp-stat--inverse .mp-stat__icon {
  background: var(--mp-volt-400);
  border-color: var(--mp-volt-400);
}

/* La tarjeta destacada es tinta oscura sobre página clara. En tema oscuro la
   página ya es tinta, así que la tarjeta desaparecía: quedaba una cifra
   flotando sin caja. Ahí destaca al revés, con el borde del acento. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mp-stat--inverse {
    background: var(--mp-surface-alt);
    border-color: var(--mp-volt-500);
  }
}

:root[data-theme="dark"] .mp-stat--inverse {
  background: var(--mp-surface-alt);
  border-color: var(--mp-volt-500);
}

/* Inline sparkline, no library. */
.mp-spark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 24px;
}

.mp-spark__bar {
  flex: 1;
  background: var(--mp-line);
  border-radius: 2px;
}

.mp-spark__bar--current {
  background: var(--mp-volt-400);
  border: 1px solid var(--mp-volt-500);
}

/* --------------------------------------------------------------------------
   11 — Badges and chips
   -------------------------------------------------------------------------- */

.mp-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 10px;
  border-radius: var(--mp-radius-xs);
  background: var(--mp-neutral-bg);
  color: var(--mp-neutral-text);
  white-space: nowrap;
}

.mp-badge--confirmed {
  background: var(--mp-available-bg);
  color: var(--mp-available-text);
}

.mp-badge--pending {
  background: var(--mp-pending-bg);
  color: var(--mp-pending-text);
}

.mp-badge--cancelled {
  background: var(--mp-busy-bg);
  color: var(--mp-busy-text);
}

.mp-badge--finished {
  background: var(--mp-neutral-bg);
  color: var(--mp-neutral-text);
}

.mp-badge--live {
  background: var(--mp-volt-400);
  color: var(--mp-ink-900);
  border: 1px solid var(--mp-ink-900);
}

.mp-badge--outline {
  background: var(--mp-surface);
  border: 1px solid var(--mp-line);
  color: var(--mp-text-soft);
}

.mp-badge--membership {
  background: var(--mp-volt-tint);
  border: 1px solid var(--mp-volt-500);
  color: var(--mp-volt-800);
  border-radius: var(--mp-radius-pill);
}

.mp-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--mp-radius-pill);
  background: var(--mp-surface-sunken);
  border: 1px solid var(--mp-line);
  color: var(--mp-text);
  text-decoration: none;
}

.mp-filter {
  display: inline-flex;
  align-items: center;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--mp-radius-pill);
  background: var(--mp-surface);
  border: 1px solid var(--mp-line);
  color: var(--mp-text);
  text-decoration: none;
  cursor: pointer;
}

.mp-filter--active {
  background: var(--mp-ink-900);
  border-color: var(--mp-ink-900);
  color: #f2f5ef;
}

/* Segmented control (Próximas / Pasadas). */
.mp-segmented {
  display: flex;
  gap: 6px;
  background: var(--mp-line);
  padding: 4px;
  border-radius: var(--mp-radius-pill);
}

.mp-segmented__item {
  flex: 1;
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px;
  border-radius: var(--mp-radius-pill);
  color: var(--mp-slate-600);
  text-decoration: none;
}

.mp-segmented__item--active {
  background: var(--mp-surface);
  color: var(--mp-text);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(14, 18, 15, 0.1);
}

/* --------------------------------------------------------------------------
   12 — Form controls
   -------------------------------------------------------------------------- */

.mp-input,
.mp-select {
  font-family: inherit;
  font-size: 14px;
  color: var(--mp-text);
  padding: 10px 12px;
  min-height: var(--mp-control-height);
  border-radius: var(--mp-radius-sm);
  border: 1px solid var(--mp-line);
  background: var(--mp-surface);
  width: 100%;
  box-sizing: border-box;
}

.mp-input::placeholder { color: var(--mp-text-muted); }

.mp-input:hover,
.mp-select:hover { border-color: var(--mp-slate-400); }

.mp-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mp-field__label {
  font-size: 12px;
  font-weight: 700;
  color: var(--mp-text-soft);
}

/* Extras / options rendered as selectable pills. */
.mp-option {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--mp-radius-sm);
  border: 1px solid var(--mp-line);
  background: var(--mp-surface);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--mp-text-soft);
  cursor: pointer;
}

.mp-option__box {
  width: 18px;
  height: 18px;
  border-radius: var(--mp-radius-xs);
  border: 1.5px solid var(--mp-slate-400);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex: none;
}

.mp-option--checked {
  border: 1.5px solid var(--mp-ink-900);
  background: var(--mp-volt-tint);
  color: var(--mp-text);
}

.mp-option--checked .mp-option__box {
  background: var(--mp-ink-900);
  border-color: var(--mp-ink-900);
  color: var(--mp-volt-400);
}

/* --------------------------------------------------------------------------
   13 — Dense data table
   40px rows, sticky header, the time column pinned during horizontal scroll.
   -------------------------------------------------------------------------- */

.mp-table-wrap {
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius-md);
  background: var(--mp-surface);
  overflow: hidden;
}

.mp-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--mp-space-md);
  padding: var(--mp-space-md) var(--mp-space-lg);
  border-bottom: 1px solid var(--mp-line);
  flex-wrap: wrap;
}

.mp-table-scroll {
  overflow-x: auto;
}

.mp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.mp-table th {
  text-align: left;
  padding: 9px var(--mp-space-lg);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mp-text-muted);
  background: var(--mp-surface-sunken);
  border-bottom: 1px solid var(--mp-line);
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
}

.mp-table td {
  padding: 10px var(--mp-space-lg);
  border-bottom: 1px solid var(--mp-line-soft);
  vertical-align: middle;
}

.mp-table tbody tr:hover { background: var(--mp-surface-alt); }

.mp-table tbody tr.mp-table__row--current {
  background: var(--mp-volt-tint);
}

.mp-table tbody tr.mp-table__row--current:hover {
  background: var(--mp-volt-tint-strong);
}

.mp-table .mp-cell--num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.mp-table .mp-cell--time {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.mp-table .mp-cell--void {
  color: var(--mp-text-muted);
  text-decoration: line-through;
}

.mp-table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--mp-space-md);
  padding: 10px var(--mp-space-lg);
  border-top: 1px solid var(--mp-line);
  background: var(--mp-surface-alt);
  font-size: 12.5px;
  color: var(--mp-text-muted);
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   14 — Dashboard shell and sidebar
   Fourteen sections grouped by what the staff does, not by data model.
   -------------------------------------------------------------------------- */

.mp-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: var(--mp-space-xl);
  align-items: start;
  padding: var(--mp-space-lg);
  min-height: 100vh;
  box-sizing: border-box;
}

.mp-sidebar {
  background: var(--mp-ink-800);
  border-radius: var(--mp-radius-md);
  padding: var(--mp-space-lg) var(--mp-space-md);
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: var(--mp-space-lg);
  max-height: calc(100vh - 2 * var(--mp-space-lg));
  overflow-y: auto;
}

.mp-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 var(--mp-space-sm);
  text-decoration: none;
}

.mp-sidebar__mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--mp-volt-400);
  color: var(--mp-ink-900);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mp-font-display);
  font-weight: 700;
  font-size: 14px;
  flex: none;
}

.mp-sidebar__name {
  font-family: var(--mp-font-display);
  font-weight: 600;
  font-size: 14px;
  color: #f2f5ef;
}

.mp-sidebar__center {
  font-size: 11px;
  color: var(--mp-slate-400);
}

.mp-sidebar__group {
  display: flex;
  flex-direction: column;
  gap: var(--mp-space-xs);
}

.mp-sidebar__group-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  /* El gris medio se quedaba en 3,55:1 sobre la tinta de la barra, por debajo
     del mínimo legible para un texto tan pequeño. */
  color: var(--mp-slate-400);
  padding: 6px 10px;
}

.mp-sidebar__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--mp-radius-sm);
  color: #f2f5ef;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
}

.mp-sidebar__link:hover {
  background: var(--mp-ink-700);
  color: #f2f5ef;
}

/* The active section is the sidebar's only volt element, so the view always
   says where you are. */
.mp-sidebar__link--active,
.mp-sidebar__link--active:hover {
  background: var(--mp-volt-400);
  color: var(--mp-ink-900);
  font-weight: 700;
}

.mp-sidebar__count {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--mp-radius-pill);
  background: var(--mp-coral-600);
  color: #fff;
}

.mp-dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--mp-space-lg);
  flex-wrap: wrap;
  margin-bottom: var(--mp-space-xl);
}

/* Below 1100px the sidebar becomes a horizontal rail; below 768px the labels
   stay but the grid collapses to one column. */
@media (max-width: 1100px) {
  .mp-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .mp-sidebar {
    position: static;
    max-height: none;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--mp-space-md);
  }

  .mp-sidebar__group {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .mp-sidebar__group-title {
    padding: 0 4px 0 0;
  }
}

/* --------------------------------------------------------------------------
   15 — Member top nav and mobile tab bar
   -------------------------------------------------------------------------- */

.mp-topnav {
  background: var(--mp-ink-900);
  padding: 0 var(--mp-space-xl);
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--mp-space-lg);
  flex-wrap: wrap;
}

.mp-topnav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.mp-topnav__mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--mp-volt-400);
  color: var(--mp-ink-900);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mp-font-display);
  font-weight: 700;
  font-size: 13px;
  flex: none;
}

.mp-topnav__name {
  font-family: var(--mp-font-display);
  font-weight: 600;
  font-size: 15px;
  color: #f2f5ef;
}

.mp-topnav__links {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

.mp-topnav__link {
  font-size: 13.5px;
  color: #f2f5ef;
  padding: 4px 0;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.mp-topnav__link:hover {
  color: var(--mp-volt-400);
}

.mp-topnav__link--active {
  font-weight: 700;
  color: var(--mp-volt-400);
  border-bottom-color: var(--mp-volt-400);
}

/* Wallet balance pill, always visible while booking. */
.mp-balance {
  display: inline-flex;
  align-items: center;
  gap: var(--mp-space-sm);
  background: #1f2621;
  border: 1px solid #2d352f;
  padding: 7px 12px;
  border-radius: var(--mp-radius-pill);
  text-decoration: none;
}

.mp-balance__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mp-slate-400);
}

.mp-balance__value {
  font-size: 14px;
  font-weight: 700;
  color: var(--mp-volt-400);
  font-variant-numeric: tabular-nums;
}

.mp-balance__add {
  font-size: 12px;
  font-weight: 700;
  color: var(--mp-ink-900);
  background: var(--mp-volt-400);
  border-radius: 6px;
  padding: 2px 7px;
}

/* Five destinations at most, 60px touch target, label always visible:
   icons alone do not survive three locales. */
.mp-tabbar {
  display: none;
  position: fixed;
  inset: auto 0 0 0;
  z-index: 40;
  background: var(--mp-surface);
  border-top: 1px solid var(--mp-line);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.mp-tabbar__item {
  flex: 1;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-decoration: none;
  color: var(--mp-text-muted);
  border-top: 3px solid transparent;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  position: relative;
}

.mp-tabbar__item--active {
  color: var(--mp-text);
  font-weight: 700;
  border-top-color: var(--mp-volt-400);
  background: var(--mp-volt-tint);
}

.mp-tabbar__dot {
  position: absolute;
  top: 8px;
  right: 22%;
  width: 8px;
  height: 8px;
  border-radius: var(--mp-radius-pill);
  background: var(--mp-coral-600);
}

@media (max-width: 767px) {
  .mp-tabbar { display: flex; }
  .mp-body--has-tabbar { padding-bottom: 76px; }
  .mp-topnav__links { display: none; }
}

/* --------------------------------------------------------------------------
   16 — Sticky summary and mobile action sheet
   -------------------------------------------------------------------------- */

.mp-summary {
  position: sticky;
  top: var(--mp-space-xl);
  background: var(--mp-surface);
  border: 1.5px solid var(--mp-ink-900);
  border-radius: var(--mp-radius-md);
  overflow: hidden;
}

.mp-summary::before {
  content: "";
  display: block;
  height: 6px;
  background: var(--mp-volt-400);
}

.mp-summary__body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mp-summary__line {
  display: flex;
  justify-content: space-between;
  gap: var(--mp-space-md);
  font-size: 13.5px;
}

.mp-summary__line--discount { color: var(--mp-available-text); }

.mp-summary__total {
  font-family: var(--mp-font-display);
  font-weight: 600;
  font-size: 26px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.mp-sheet {
  border-top: 1px solid var(--mp-line);
  background: var(--mp-surface);
  border-radius: var(--mp-radius-lg) var(--mp-radius-lg) 0 0;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--mp-shadow-sheet);
}

/* --------------------------------------------------------------------------
   17 — Callouts
   -------------------------------------------------------------------------- */

.mp-note {
  font-size: 13px;
  line-height: 1.6;
  color: var(--mp-text-soft);
  background: var(--mp-surface-sunken);
  border-left: 3px solid var(--mp-volt-400);
  padding: 10px 14px;
  border-radius: 0 var(--mp-radius-sm) var(--mp-radius-sm) 0;
  margin: 0;
}

.mp-note--warning {
  background: var(--mp-pending-bg);
  border-left-color: var(--mp-pending-border);
  color: var(--mp-pending-text);
}

.mp-note--danger {
  background: var(--mp-busy-bg);
  border-left-color: var(--mp-busy-border);
  color: var(--mp-busy-text);
}

.mp-note--info {
  background: var(--mp-available-bg);
  border-left-color: var(--mp-available-border);
  color: var(--mp-available-text);
}

.mp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--mp-space-md);
  text-align: center;
  padding: var(--mp-space-3xl) var(--mp-space-xl);
  color: var(--mp-text-muted);
}

/* Screen-reader-only text for state that is otherwise only visual. */
.mp-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Two-column split that collapses on narrow viewports (main + rail). */
.mp-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--mp-space-lg);
  align-items: start;
}

@media (min-width: 992px) {
  .mp-split { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); }
}

/* --------------------------------------------------------------------------
   18 — Authentication screens
   One centred card shared by sign-in, sign-up and the password reset flow.
   -------------------------------------------------------------------------- */

.mp-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  padding: var(--mp-space-3xl) var(--mp-space-xl);
}

.mp-auth__card {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: var(--mp-space-xl);
}

.mp-auth__head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
}

.mp-auth__form {
  display: flex;
  flex-direction: column;
  gap: var(--mp-space-lg);
}

.mp-auth__foot {
  text-align: center;
  font-size: 13.5px;
  color: var(--mp-text-muted);
}

.mp-field__error {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--mp-busy-text);
}

.mp-field__error ul,
.mp-field__help ul {
  margin: 0;
  padding-left: 1.1em;
}

.mp-field__help {
  font-size: 12px;
  color: var(--mp-text-muted);
}

.mp-input--invalid {
  border-color: var(--mp-busy-border);
}

/* ---------------------------------------------------------------------------
   19 · Plano de la instalación
   Elegir la pista señalándola. Los pines tienen que leerse sobre una foto
   cualquiera, así que llevan fondo propio y borde, no sólo color.
   ------------------------------------------------------------------------- */

.mp-facility-map {
  margin-bottom: var(--mp-space-4);
}

.mp-map-pin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--mp-text);
  background: var(--mp-surface);
  border: 1px solid var(--mp-line);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 18%);
  cursor: pointer;
  /* Un nombre largo no puede comerse el plano ni empujar el pin fuera de él. */
  max-width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-map-pin:hover,
.mp-map-pin:focus-visible {
  border-color: var(--mp-volt-500);
}

.mp-map-pin--active {
  color: var(--mp-ink-900);
  background: var(--mp-volt-500);
  border-color: var(--mp-ink-900);
}
