/* ---------------------------------------------------------------- fuentes */

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/bricolage-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/bricolage-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

/* ----------------------------------------------------------------- tokens */

:root {
  color-scheme: dark;

  --bg: #050a16;
  --surface: #0b1730;
  --surface-soft: rgba(121, 169, 255, 0.08);
  --surface-glass: rgba(8, 18, 38, 0.76);
  --ink: #e9f2ff;
  --muted: #8ea6ca;
  --line: rgba(138, 180, 255, 0.13);
  --line-strong: rgba(138, 180, 255, 0.24);

  --accent: #4d8dff;
  --accent-2: #5ad4ff;
  --accent-ink: #041022;
  --accent-soft: rgba(77, 141, 255, 0.16);
  --accent-line: rgba(77, 141, 255, 0.36);

  --green: #5be3b3;
  --green-soft: rgba(91, 227, 179, 0.12);
  --green-line: rgba(91, 227, 179, 0.26);

  --pending: #8fa6c9;
  --pending-soft: rgba(143, 166, 201, 0.12);
  --pending-line: rgba(143, 166, 201, 0.22);

  --danger: #ff6f91;
  --danger-soft: rgba(255, 111, 145, 0.12);
  --danger-line: rgba(255, 111, 145, 0.26);

  --warn: #ffc46b;
  --warn-soft: rgba(255, 196, 107, 0.12);

  --waitlist: #ffd60a;
  --waitlist-soft: rgba(255, 214, 10, 0.14);
  --waitlist-line: rgba(255, 214, 10, 0.4);

  --shadow-lg: 0 34px 90px rgba(0, 6, 22, 0.62),
    0 2px 12px rgba(0, 4, 16, 0.42);
  --shadow-md: 0 18px 44px rgba(0, 6, 22, 0.46);
  --shadow-sm: 0 8px 22px rgba(0, 6, 22, 0.34);

  --tab-active-bg: #4d8dff;
  --tab-active-ink: #041022;
  --switch-active-bg: rgba(77, 141, 255, 0.2);
  --sheet-bg: #0a1630;

  --font-display: "Bricolage Grotesque", "Trebuchet MS", "Segoe UI", sans-serif;
  --font-body: "Manrope", "Segoe UI", "Helvetica Neue", system-ui, sans-serif;

  --page: 1180px;
  --pad: clamp(16px, 3.2vw, 32px);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 13px;
  --pill: 999px;
}

/* ------------------------------------------------------------------ base */

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(60% 52% at 8% 0%, rgba(56, 116, 255, 0.34), transparent 68%),
    radial-gradient(46% 42% at 98% 6%, rgba(0, 210, 255, 0.16), transparent 70%),
    radial-gradient(62% 55% at 76% 100%, rgba(104, 63, 255, 0.22), transparent 72%),
    linear-gradient(155deg, #040914 0%, #071329 48%, #040a16 100%);
  background-attachment: fixed;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}


h1,
h2,
p {
  margin: 0;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.page {
  width: min(var(--page), calc(100% - 2 * var(--pad)));
  margin-inline: auto;
  padding-bottom: 108px;
}

/* ---------------------------------------------------------------- topbar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #fffaf7;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 10px 24px rgba(77, 141, 255, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.brand-mark svg {
  width: 23px;
  height: 23px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-kicker {
  color: var(--muted);
  font-size: 0.71rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 12px 5px 25px;
  border-radius: var(--pill);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.71rem;
  font-weight: 700;
  white-space: nowrap;
  backdrop-filter: blur(10px);
}

.pill::before {
  content: "";
  position: absolute;
  left: 11px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

.pill.is-live {
  color: var(--green);
  background: var(--green-soft);
  border-color: var(--green-line);
}

.pill.is-live::before {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-line);
}

.pill.is-safe {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: rgba(155, 103, 0, 0.18);
}

.pill.is-safe::before {
  background: var(--warn);
}

.refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 10px;
  border: 0;
  border-radius: var(--pill);
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  transition: background-color 140ms ease, color 140ms ease;
}

.refresh svg {
  width: 15px;
  height: 15px;
}

.refresh:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.clock {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ----------------------------------------------------------------- intro */

.intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.intro-copy {
  min-width: 0;
  max-width: 680px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--pill);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 0 3px var(--accent-soft);
}

h1 {
  margin: 14px 0 8px;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6.4vw, 4.4rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.05em;
}

.summary {
  display: flex;
  align-items: center;
  gap: 8px 16px;
  flex-wrap: wrap;
  min-height: 1.5em;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
}

.summary-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  white-space: nowrap;
}

.summary-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pending);
}

.summary-item.booked {
  color: var(--green);
}

.summary-item.booked .summary-dot {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.summary-item.pending {
  color: var(--pending);
}

.summary-item.pending .summary-dot {
  background: var(--pending);
}

.summary-item.waitlisted {
  color: var(--waitlist);
}

.summary-item.waitlisted .summary-dot {
  background: var(--waitlist);
  box-shadow: 0 0 0 3px var(--waitlist-soft);
}

.summary-item.failed {
  color: var(--danger);
}

.summary-item.failed .summary-dot {
  background: var(--danger);
}

.summary-empty {
  color: var(--muted);
}

.intro-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.dashboard-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.quiet-action {
  min-height: 32px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.66rem;
  font-weight: 650;
  backdrop-filter: blur(12px);
  transition: background-color 140ms ease, color 140ms ease,
    border-color 140ms ease;
}

.quiet-action:hover {
  border-color: var(--accent-line);
  background: var(--surface);
  color: var(--accent);
}

.view-switch {
  display: inline-flex;
  padding: 4px;
  border-radius: var(--pill);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.view-switch button {
  min-height: 33px;
  padding: 6px 15px;
  border: 0;
  border-radius: var(--pill);
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  transition: background-color 160ms ease, color 160ms ease,
    box-shadow 160ms ease;
}

.view-switch button.is-active {
  background: var(--switch-active-bg);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.range h2 {
  margin: 0 6px;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.5vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  backdrop-filter: blur(10px);
  transition: background-color 150ms ease, color 150ms ease,
    box-shadow 150ms ease, transform 150ms ease;
}

.nav svg {
  width: 17px;
  height: 17px;
}

.nav:hover {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.today {
  min-height: 38px;
  padding: 7px 15px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
  transition: background-color 150ms ease, box-shadow 150ms ease;
}

.today:hover {
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.hint {
  margin: 14px 0 18px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
}

/* ---------------------------------------------------------- calendar card */

.calendar-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-xl);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.88),
    rgba(255, 255, 255, 0.62)
  );
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
  animation: rise 420ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@media all {
  :root[data-theme="dark"] .calendar-card {
    border-color: rgba(255, 255, 255, 0.07);
    background: linear-gradient(
      180deg,
      rgba(11, 24, 50, 0.94),
      rgba(8, 18, 38, 0.78)
    );
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.calendar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 17px 22px 4px;
}

.calendar-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.label-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid var(--line-strong);
}

.legend-dot.is-pending {
  background: var(--pending);
  border-color: var(--pending);
}

.legend-dot.is-booked {
  background: var(--green);
  border-color: var(--green);
}

.legend-dot.is-waitlisted {
  background: var(--waitlist);
  border-color: var(--waitlist);
}

.legend-dot.is-failed {
  background: var(--danger);
  border-color: var(--danger);
}

.legend-repeat {
  color: var(--muted);
  font-size: 0.66rem;
}

.calendar {
  min-height: 340px;
  padding: 4px 10px 10px;
}

.calendar-state {
  padding: 82px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
}

.calendar-state.error {
  color: var(--danger);
}

.calendar-state .bar {
  position: relative;
  width: 140px;
  height: 4px;
  margin: 18px auto 0;
  overflow: hidden;
  border-radius: var(--pill);
  background: var(--line);
}

.calendar-state .bar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.2s ease-in-out infinite;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

/* ------------------------------------------------------------------ week */

.day-tabs {
  display: flex;
  justify-content: center;
  gap: 7px;
  max-width: 840px;
  margin: 0 auto;
  padding: 12px 16px 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.day-tabs::-webkit-scrollbar {
  display: none;
}

.day-tab {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 9px 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  transition: background-color 150ms ease, color 150ms ease,
    border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.day-tab:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}

.tab-weekday {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: capitalize;
}

.day-tab strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.16rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.tab-count {
  min-width: 17px;
  height: 17px;
  margin-top: 2px;
  padding: 0 4px;
  border-radius: var(--pill);
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: var(--muted);
  font-size: 0.54rem;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}

.tab-count.is-empty {
  visibility: hidden;
}

.day-tab.is-active {
  border-color: transparent;
  background: var(--tab-active-bg);
  color: var(--tab-active-ink);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.day-tab.is-active strong {
  color: var(--tab-active-ink);
}

.day-tab.is-active .tab-weekday {
  color: var(--tab-active-ink);
  opacity: 0.72;
}

.day-tab.is-active .tab-count {
  background: color-mix(in srgb, var(--tab-active-ink) 14%, transparent);
  color: var(--tab-active-ink);
}

.day-panel {
  padding: 2px 18px 18px;
}

.day-panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 4px 0 12px;
}

.day-panel-title-row {
  display: flex;
  align-items: baseline;
  gap: 9px;
  flex-wrap: wrap;
  min-width: 0;
}

.day-panel-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.today-badge {
  padding: 3px 8px;
  border-radius: var(--pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.6rem;
  font-weight: 700;
}

.day-panel-meta {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 700;
  white-space: nowrap;
}

.class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 8px;
  min-width: 0;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  padding: 8px;
  align-items: start;
}

.day-col {
  min-width: 0;
  padding: 12px 10px 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
}

@media all {
  :root[data-theme="dark"] .day-col {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }
}

.day-head {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 0 4px 9px;
}

.day-weekday {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: capitalize;
}

.day-number {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.03em;
}

.day-month {
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 600;
}

.day-head.is-today .day-number,
.day-head.is-today .day-weekday {
  color: var(--accent);
}

.day-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0 2px;
}

.time-group {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  padding: 6px 0;
  align-items: start;
}

.time-label {
  padding-top: 12px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.class-stack {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 1px 2px rgba(33, 43, 37, 0.04);
  transition: transform 150ms ease, box-shadow 150ms ease,
    background-color 150ms ease, border-color 150ms ease;
}

.chip:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.chip:active {
  transform: scale(0.99);
}

.chip-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: transparent;
}

.chip.is-pending .chip-indicator {
  border-color: var(--pending);
  background: var(--pending);
  box-shadow: 0 0 0 3px var(--pending-line);
}

.chip.is-booked .chip-indicator {
  border-color: var(--green);
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-line);
}

.chip.is-failed .chip-indicator {
  border-color: var(--danger);
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-line);
}

.chip.is-full:not(.is-booked):not(.is-failed):not(.is-waitlisted) .chip-indicator {
  border-color: var(--warn);
  background: var(--warn);
}

.chip-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.chip-name {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
  text-overflow: clip;
  white-space: normal;
}

.chip-repeat {
  flex: 0 0 auto;
  margin-top: 1px;
  padding: 0 4px;
  border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.45);
  color: currentColor;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1.5;
  opacity: 0.75;
}

@media all {
  :root[data-theme="dark"] .chip-repeat {
    background: rgba(0, 0, 0, 0.2);
  }
}

.chip-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.chip-meta {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-state {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.55);
  color: inherit;
  font-size: 0.56rem;
  font-weight: 700;
  white-space: nowrap;
}

@media all {
  :root[data-theme="dark"] .chip-state {
    background: rgba(0, 0, 0, 0.18);
  }
}

.chip.is-pending {
  border-color: transparent;
  background: var(--pending-soft);
  color: var(--pending);
}

.chip.is-pending .chip-meta {
  color: color-mix(in srgb, var(--pending) 72%, transparent);
}

.chip.is-booked {
  border-color: var(--green-line);
  background: var(--green-soft);
  color: var(--green);
}

.chip.is-booked .chip-meta {
  color: color-mix(in srgb, var(--green) 74%, transparent);
}

.chip.is-failed {
  border-color: var(--danger-line);
  background: var(--danger-soft);
  color: var(--danger);
}

.chip.is-failed .chip-meta {
  color: color-mix(in srgb, var(--danger) 78%, transparent);
}

.chip.is-waitlisted {
  border-color: var(--waitlist-line);
  background: var(--waitlist-soft);
  color: var(--waitlist);
}

.chip.is-waitlisted .chip-indicator {
  border-color: var(--waitlist);
  background: var(--waitlist);
  box-shadow: 0 0 0 3px var(--waitlist-line);
}

.chip.is-waitlisted .chip-meta {
  color: color-mix(in srgb, var(--waitlist) 72%, var(--ink));
}

.chip.is-staged {
  border-style: dashed;
  border-color: var(--pending);
}

.chip.is-past {
  opacity: 0.42;
  filter: saturate(0.55);
}

.chip.is-past:hover {
  transform: none;
  box-shadow: none;
}

.chip.is-full:not(.is-booked):not(.is-failed):not(.is-waitlisted) .chip-meta {
  color: var(--warn);
}

.day-empty,
.day-error {
  padding: 16px 4px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  text-align: center;
}

.day-error {
  color: var(--danger);
}

/* ------------------------------------------------------------------ mes */

.month-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  padding: 4px 14px 6px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
}

.month-weekdays span {
  padding: 7px 2px;
  text-align: center;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
  padding: 0 14px 12px;
}

.month-day {
  min-height: 118px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  color: var(--ink);
  text-align: left;
  transition: transform 150ms ease, box-shadow 150ms ease,
    background-color 150ms ease, border-color 150ms ease;
}

.month-day:hover {
  transform: translateY(-2px);
  background: var(--surface);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.month-day.is-outside {
  opacity: 0.36;
}

.month-day.is-today {
  border-color: var(--accent-line);
  background: linear-gradient(180deg, var(--accent-soft), transparent);
}

.month-day-num {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

.month-day.is-today .month-day-num {
  color: var(--accent);
}

.month-day-count {
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 600;
}

.month-day.has-error .month-day-count {
  color: var(--danger);
}

.mini-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  margin-top: 1px;
}

.mini {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--pending-soft);
  color: var(--pending);
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini.is-booked {
  background: var(--green-soft);
  color: var(--green);
}

.mini.is-failed {
  background: var(--danger-soft);
  color: var(--danger);
}

.mini-more {
  color: var(--muted);
  font-size: 0.57rem;
  font-weight: 700;
}

.mini-dots {
  display: none;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.mini-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pending);
}

.mini-dot.is-booked {
  background: var(--green);
}

.mini-dot.is-failed {
  background: var(--danger);
}

.month-hint {
  margin: 0 16px 14px;
  padding-top: 2px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 500;
}

/* ---------------------------------------------------------------- footer */

.footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 500;
}

/* -------------------------------------------------------------- save bar */

.savebar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  width: min(560px, calc(100% - 34px));
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--pill);
  background: rgba(5, 12, 28, 0.9);
  color: #f7f8f5;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(20px);
}

.savebar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 9px 10px 9px 20px;
}

.save-count {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
}

.save-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* -------------------------------------------------------------- dialog */

.sheet {
  width: min(480px, calc(100vw - 28px));
  max-height: min(90vh, 760px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  background: var(--sheet-bg);
  color: var(--ink);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.28);
}

.sheet::backdrop {
  background: rgba(12, 17, 14, 0.4);
  backdrop-filter: blur(6px);
}

@media all {
  :root[data-theme="dark"] .sheet {
    border-color: rgba(255, 255, 255, 0.08);
  }
}

.sheet[open] {
  animation: sheet-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.sheet-inner {
  position: relative;
  max-height: min(90vh, 760px);
  overflow-y: auto;
  padding: 28px 24px 22px;
}

.sheet-handle {
  display: none;
}

.sheet-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  transition: background-color 140ms ease, color 140ms ease;
}

.sheet-close svg {
  width: 16px;
  height: 16px;
}

.sheet-close:hover {
  background: var(--surface);
  color: var(--ink);
}

.sheet-head {
  padding-right: 36px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.sheet-kicker {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.sheet-head h2 {
  margin: 4px 0 5px;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.sheet-date {
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 500;
}

.sheet-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.71rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.sheet-current {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.79rem;
  font-weight: 500;
  line-height: 1.5;
}

.sheet-current.is-warning {
  border-color: transparent;
  background: var(--warn-soft);
  color: var(--warn);
}

.sheet-current.is-bad {
  border-color: transparent;
  background: var(--danger-soft);
  color: var(--danger);
}

.sheet-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.sheet-option {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  color: var(--ink);
  text-align: left;
  transition: transform 150ms ease, background-color 150ms ease,
    border-color 150ms ease, box-shadow 150ms ease;
}

.sheet-option:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.sheet-option strong {
  color: inherit;
  font-size: 0.88rem;
  font-weight: 700;
}

.sheet-option span {
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 500;
}

.sheet-option.is-current {
  border-color: var(--accent-line);
  background: linear-gradient(
    135deg,
    rgba(77, 141, 255, 0.18),
    rgba(90, 212, 255, 0.06)
  );
}

.sheet-option.is-current strong {
  color: var(--accent);
}

.sheet-option.is-current span {
  color: color-mix(in srgb, var(--accent) 72%, var(--muted));
}

.sheet-option:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sheet-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.sheet-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.71rem;
  font-weight: 500;
  line-height: 1.5;
}

.sheet-check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  cursor: pointer;
}

.sheet-check input {
  width: 17px;
  min-height: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--accent);
}

.sheet-check span {
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 600;
}

/* --------------------------------------------------------------- botones */

button.primary,
button.secondary,
button.ghost,
button.danger,
button.today,
button.nav {
  border-radius: var(--pill);
  font-family: var(--font-body);
  transition: background-color 150ms ease, color 150ms ease,
    box-shadow 150ms ease, transform 150ms ease, border-color 150ms ease;
}

button.primary {
  min-height: 38px;
  padding: 8px 18px;
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  box-shadow: 0 9px 22px rgba(77, 141, 255, 0.36);
  font-size: 0.8rem;
  font-weight: 700;
}

button.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(77, 141, 255, 0.44);
}

button.primary:active {
  transform: scale(0.98);
}

button.secondary {
  min-height: 38px;
  padding: 8px 15px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  font-size: 0.79rem;
  font-weight: 700;
}

button.ghost {
  min-height: 32px;
  padding: 6px 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

button.ghost:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

button.ghost.light {
  color: rgba(255, 255, 255, 0.7);
}

button.ghost.light:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

button.danger {
  min-height: 34px;
  padding: 7px 13px;
  border: 0;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.75rem;
  font-weight: 700;
}

button.danger:hover {
  filter: brightness(0.97);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ----------------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 60;
  max-width: min(540px, calc(100vw - 32px));
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--pill);
  background: rgba(5, 12, 28, 0.92);
  color: #f7f8f5;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 1000px) {
  .intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
  }

  .intro-side {
    width: 100%;
    align-items: flex-start;
  }
}

@media (max-width: 900px) {
  .hint {
    max-width: none;
  }

  .day-tabs {
    justify-content: flex-start;
    gap: 5px;
    max-width: none;
    margin: 0;
    padding: 12px 10px 6px;
  }

  .day-tab {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 3px;
    border-radius: 12px;
    font-size: 0.58rem;
  }

  .day-tab strong {
    font-size: 1.02rem;
  }

  .tab-weekday {
    font-size: 0.58rem;
  }

  .tab-count {
    min-width: 15px;
    height: 15px;
    line-height: 15px;
    font-size: 0.5rem;
  }

  .day-panel {
    padding: 2px 10px 14px;
  }

  .day-panel-head {
    padding: 2px 0 10px;
  }

  .day-panel-title {
    font-size: 1.38rem;
  }

  .day-panel-meta {
    padding: 3px 8px;
    font-size: 0.6rem;
  }

  .class-grid {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .time-group {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 9px;
    padding: 5px 0;
  }

  .time-label {
    padding-top: 11px;
    font-size: 0.62rem;
  }

  .chip {
    padding: 9px 10px;
  }

  .chip-name {
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
  }

  .chip-meta {
    white-space: normal;
  }

  .month-weekdays {
    padding: 4px 8px 4px;
    font-size: 0.56rem;
  }

  .month-weekdays span {
    padding: 6px 1px;
  }

  .month-grid {
    gap: 5px;
    padding: 0 8px 10px;
  }

  .month-day {
    min-height: 76px;
    padding: 6px;
    border-radius: 12px;
  }

  .month-day-num {
    font-size: 0.82rem;
  }

  .month-day-count {
    font-size: 0.55rem;
    font-weight: 500;
  }

  .mini-list {
    display: none;
  }

  .mini-dots {
    display: flex;
  }

  .month-hint {
    margin: 0 12px 12px;
    font-size: 0.66rem;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .topbar-status {
    justify-content: flex-start;
  }

  .calendar-card {
    border-radius: 24px;
  }

  .calendar-top {
    padding: 14px 15px 2px;
  }

  .calendar {
    padding: 2px 6px 8px;
  }

  .view-switch {
    width: 100%;
  }

  .view-switch button {
    flex: 1;
    justify-content: center;
  }

  .range {
    width: 100%;
  }

  .range h2 {
    flex: 1;
    margin: 0 2px;
    font-size: 1.15rem;
  }

  .today {
    padding: 7px 12px;
  }

  .intro {
    margin-top: 24px;
  }

  .intro-side {
    gap: 10px;
  }

  .summary {
    font-size: 0.8rem;
  }

  .refresh span {
    display: none;
  }

  .refresh {
    width: 32px;
    height: 32px;
    justify-content: center;
    padding: 0;
  }
}

@media (max-width: 640px) {
  .savebar {
    bottom: 12px;
    width: calc(100% - 20px);
    border-radius: 24px;
  }

  .savebar-inner {
    min-height: 54px;
    padding: 8px 8px 8px 16px;
  }

  .save-count {
    font-size: 0.7rem;
  }

  .savebar button.primary {
    padding: 8px 15px;
  }

  .sheet {
    width: 100%;
    max-width: none;
    max-height: 92vh;
    margin: auto auto 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 28px 28px 0 0;
  }

  .sheet-inner {
    max-height: 92vh;
    padding: 22px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  }

  .sheet-handle {
    display: block;
    width: 42px;
    height: 4px;
    margin: 0 auto 16px;
    border-radius: var(--pill);
    background: var(--line-strong);
  }

  .sheet-head h2 {
    font-size: 1.6rem;
  }

  .toast {
    bottom: 84px;
  }
}

@media (max-width: 420px) {
  h1 {
    font-size: 2.7rem;
  }

  .brand-kicker {
    font-size: 0.67rem;
  }

  .clock {
    font-size: 0.72rem;
  }

  .calendar-top {
    gap: 8px;
  }

  .legend {
    gap: 9px;
    font-size: 0.63rem;
  }

  .legend-repeat {
    display: none;
  }
}

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

/* ================================================================ shell === */

.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--bg);
}

.boot-mark {
  width: 34px;
  height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.auth-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: clamp(24px, 6vw, 64px) var(--pad);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.auth-brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.auth-brand-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.auth-brand-place {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
}

.auth-card {
  width: min(420px, 100%);
  padding: clamp(24px, 5vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-xl);
  background: var(--surface-glass);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(22px);
  animation: rise 380ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@media all {
  :root[data-theme="dark"] .auth-card {
    border-color: rgba(255, 255, 255, 0.07);
  }
}

.auth-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 22px;
}

.auth-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.4rem);
  font-weight: 650;
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.auth-head p {
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 500;
  line-height: 1.55;
}

.auth-step {
  color: var(--accent) !important;
  font-size: 0.68rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.01em;
}

.auth-form,
.stack-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.auth-submit {
  width: 100%;
  min-height: 46px !important;
  margin-top: 4px;
  font-size: 0.86rem !important;
}

.auth-secondary {
  width: 100%;
}

.auth-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.field > span:first-child {
  padding-left: 2px;
}

.field input,
.field select {
  width: 100%;
  min-height: 43px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.field input:hover,
.field select:hover {
  border-color: var(--line-strong);
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
  outline: none;
  background: var(--surface);
}

.field-help {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.5;
}

.form-error {
  margin: 0;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.45;
}

.app-shell {
  display: grid;
  grid-template-columns: 242px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 26px;
  height: 100vh;
  padding: 26px 18px 20px;
  border-right: 1px solid var(--line);
  background: var(--surface-glass);
  backdrop-filter: blur(22px);
}

.sidebar-brand {
  padding: 2px 6px;
}

.sidebar-brand .brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 14px;
}

.sidebar-brand .brand-name {
  font-size: 1.02rem;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 13px;
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 650;
  transition: background-color 140ms ease, color 140ms ease;
}

.side-link svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.side-link:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.side-link.is-active {
  background: var(--tab-active-bg);
  color: var(--tab-active-ink);
  box-shadow: var(--shadow-sm);
}

.side-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-soft);
}

.user-initial {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 750;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.user-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.user-copy strong {
  overflow: hidden;
  font-size: 0.76rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-logout {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 650;
  text-align: left;
}

.side-logout svg {
  width: 17px;
  height: 17px;
}

.side-logout:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.app-main {
  min-width: 0;
  padding: 0 var(--pad) 96px;
}

.view {
  width: min(var(--page), 100%);
  margin-inline: auto;
}

.view-panel {
  padding-top: 6px;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tabbar {
  display: none;
}

/* --------------------------------------------------------------- páginas */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 30px 0 18px;
}

.page-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.05em;
}

.page-subtitle {
  margin-top: 7px !important;
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 500;
}

.panel-card {
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-lg);
  background: var(--surface-glass);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px);
}

@media all {
  :root[data-theme="dark"] .panel-card {
    border-color: rgba(255, 255, 255, 0.07);
  }
}

.panel-card-head {
  margin-bottom: 16px;
}

.panel-card-head h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.panel-card-head p {
  margin-top: 4px !important;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.5;
}

.inline-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.empty-note {
  padding: 24px 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.empty-note.is-error {
  color: var(--danger);
}

.empty-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 34px 26px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
}

.empty-card h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.empty-card p {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.empty-card button {
  margin-top: 6px;
}

/* -------------------------------------------------------- programaciones */

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rule-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 19px 20px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-lg);
  background: var(--surface-glass);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
}

.rule-card.is-paused {
  opacity: 0.7;
}

.rule-card.is-watch {
  grid-template-columns: minmax(0, 1fr);
  border-style: dashed;
  border-color: rgba(250, 204, 21, 0.45);
}

.rule-card.is-watch .rule-waitlist-note {
  margin-bottom: 0;
}

@media all {
  :root[data-theme="dark"] .rule-card {
    border-color: rgba(255, 255, 255, 0.07);
  }
}

.rule-main {
  min-width: 0;
}

.rule-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.rule-title-row h2 {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.rule-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge.is-ok {
  border-color: var(--green-line);
  background: var(--green-soft);
  color: var(--green);
}

.badge.is-warn {
  border-color: rgba(155, 103, 0, 0.18);
  background: var(--warn-soft);
  color: var(--warn);
}

.badge.is-bad {
  border-color: var(--danger-line);
  background: var(--danger-soft);
  color: var(--danger);
}

.badge.is-muted {
  opacity: 0.68;
}

.badge.is-locked {
  border-color: var(--line-strong);
}

.rule-mode {
  margin-top: 3px !important;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 500;
}

.rule-next {
  margin-top: 9px !important;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.5;
}

.rule-next strong {
  font-weight: 700;
}

.rule-attempt {
  color: var(--muted);
}

.rule-waitlist-note {
  margin-top: 9px !important;
  padding: 9px 11px;
  border: 1px solid var(--waitlist-line);
  border-radius: 11px;
  background: var(--waitlist-soft);
  color: var(--waitlist);
  font-size: 0.68rem;
  font-weight: 650;
  line-height: 1.5;
}

.rule-message {
  margin-top: 4px !important;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.5;
}

.rule-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------------ cuenta */

.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.account-grid .panel-card:first-child {
  grid-column: 1 / -1;
}

.profile-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 14px;
}

.profile-list.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.profile-list dt {
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 700;
}

.profile-list dd {
  margin: 2px 0 0;
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 600;
  text-overflow: ellipsis;
}

.aim-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.aim-gym {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.inline-warning {
  margin: 10px 0 0 !important;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.5;
}

/* ------------------------------------------------------------------ admin */

.admin-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-users {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-user {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-lg);
  background: var(--surface-glass);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
}

@media all {
  :root[data-theme="dark"] .admin-user {
    border-color: rgba(255, 255, 255, 0.07);
  }
}

.admin-user-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-user-copy {
  min-width: 0;
  margin-right: auto;
}

.admin-user-copy h2 {
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-copy p {
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 600;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.admin-user-meta {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
}

.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.admin-user-actions button {
  min-height: 31px;
  padding: 5px 10px;
  font-size: 0.68rem;
}

.audit-card {
  margin-top: 2px;
}

.audit-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.audit-item {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 9px 2px;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
}

.audit-item:first-child {
  border-top: 0;
}

.audit-item strong {
  font-weight: 650;
}

.audit-detail {
  margin-left: 6px;
  color: var(--muted);
  font-weight: 500;
}

.audit-item time {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 600;
  white-space: nowrap;
}

.audit-dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.audit-dot.is-bad {
  background: var(--danger);
}

/* ------------------------------------------------------------- formularios */

.rule-sheet {
  width: min(560px, calc(100vw - 28px));
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field-wide {
  grid-column: 1 / -1;
}

.toggle-field {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  cursor: pointer;
}

.toggle-field input {
  width: 17px;
  min-height: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--accent);
}

.toggle-field span {
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 600;
}

.weekday-picker {
  display: flex;
  gap: 5px;
}

.weekday-picker label {
  position: relative;
  flex: 1;
  cursor: pointer;
}

.weekday-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.weekday-picker span {
  display: grid;
  min-height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.weekday-picker input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.weekday-picker input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.rule-sheet .rule-actions {
  justify-content: space-between;
  margin-top: 16px;
}

.secret-sheet {
  width: min(430px, calc(100vw - 28px));
}

.secret-code {
  display: block;
  padding: 14px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--ink);
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", monospace;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
  user-select: all;
}

.secret-sheet .rule-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

/* --------------------------------------------------------------- móvil ---- */

@media (max-width: 1000px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    display: none;
  }

  .app-main {
    padding: 0 var(--pad) calc(86px + env(safe-area-inset-bottom, 0px));
  }

  .tabbar {
    position: fixed;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    left: 10px;
    z-index: 40;
    display: flex;
    justify-content: space-around;
    gap: 2px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
    background: rgba(5, 12, 28, 0.92);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(20px);
  }

  .tab-link {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 7px 4px;
    border-radius: 15px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.58rem;
    font-weight: 650;
    white-space: nowrap;
  }

  .tab-link svg {
    width: 19px;
    height: 19px;
  }

  .tab-link.is-active {
    background: rgba(255, 255, 255, 0.11);
    color: #fff;
  }

  .savebar {
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  }

  .toast {
    bottom: calc(148px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 820px) {
  .account-grid,
  .admin-users {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rule-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .rule-actions {
    justify-content: flex-start;
  }

  .page-head {
    padding-top: 22px;
  }
}

@media (max-width: 560px) {
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .field-wide {
    grid-column: auto;
  }

  .rule-card {
    padding: 16px;
  }

  .rule-title-row h2 {
    font-size: 1.08rem;
  }

  .rule-actions button {
    min-height: 34px;
  }

  .admin-user-actions button {
    flex: 1 1 calc(50% - 4px);
  }

  .calendar-toolbar {
    margin-top: 8px;
  }

  .toolbar-actions {
    gap: 4px;
  }

  .auth-screen {
    justify-content: flex-start;
    padding-top: 40px;
  }
}

@media (min-width: 1001px) {
  .intro-side {
    margin-left: auto;
  }
}


/* ------------------------------------------------ azul oscuro / degradado */

.dashboard-greeting {
  margin: 0 0 10px !important;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.form-success {
  margin: 0;
  padding: 9px 12px;
  border: 1px solid var(--green-line);
  border-radius: 12px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.45;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1px 0;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 650;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

button.secondary.auth-submit {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  color: var(--ink);
}

button.secondary.auth-submit:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.account-grid .form-success {
  margin-bottom: 12px;
}

.brand-mark {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 10px 28px rgba(77, 141, 255, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 26px rgba(77, 141, 255, 0.36);
}

button.primary:hover {
  box-shadow: 0 13px 32px rgba(77, 141, 255, 0.46);
}

.side-link.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  box-shadow: 0 10px 26px rgba(77, 141, 255, 0.24);
}

.day-tab.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
}

.day-tab.is-active strong,
.day-tab.is-active .tab-weekday {
  color: var(--accent-ink);
}

.view-switch button.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

.auth-logo {
  width: 86px;
  height: 86px;
  object-fit: contain;
  filter: drop-shadow(0 12px 30px rgba(77, 141, 255, 0.35));
}

.brand-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(77, 141, 255, 0.28));
}

.profile-list {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

/* ------------------------------------------- entrenos, comparar y centros */

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.center-picker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
}

.center-picker select {
  min-height: 32px;
  max-width: 220px;
  padding: 5px 28px 5px 10px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--surface-soft);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
}

.day-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.day-actions button {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 0.66rem;
}

.day-wods {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-md);
  background: linear-gradient(
    140deg,
    var(--accent-soft),
    var(--surface-soft) 58%
  );
}

.day-wods-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 11px;
}

.day-wods-head h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.day-wods-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 600;
}

.day-wods-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}

.day-wod-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 52px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  transition: border-color 140ms ease, transform 140ms ease;
}

.day-wod-button:hover {
  border-color: var(--accent-line);
  transform: translateY(-1px);
}

.day-wod-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.day-wod-copy strong {
  font-size: 0.78rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.day-wod-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-wod-open {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 750;
}

@media (max-width: 560px) {
  .day-wods-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

.chip {
  align-items: flex-start;
  min-height: 42px;
}

.chip-indicator {
  margin-top: 7px;
}

.chip-name {
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: normal;
}

.chip-main {
  width: 100%;
}

.class-grid {
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
}

.sheet-head h2 {
  overflow-wrap: anywhere;
}

.chip.is-cancelled {
  border-style: dashed;
  border-color: var(--line-strong);
  background: transparent;
  color: var(--muted);
}

.chip.is-cancelled .chip-indicator {
  border-color: var(--muted);
  background: transparent;
}

.chip.is-cancelled .chip-meta {
  color: var(--muted);
}

.mini.is-cancelled {
  color: var(--muted);
  text-decoration: line-through;
}

.sheet-actions {
  flex-wrap: wrap;
}

.workout-sheet {
  width: min(660px, calc(100vw - 28px));
  max-height: min(92vh, 840px);
}

.workout-sheet .sheet-inner.workout-inner {
  display: flex;
  flex-direction: column;
  max-height: min(92vh, 840px);
  padding: 0;
  overflow: hidden;
}

.workout-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 0;
}

.workout-kicker {
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.workout-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.workout-close svg {
  width: 17px;
  height: 17px;
}

.workout-close:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.workout-head {
  padding: 4px 22px 18px;
  border-bottom: 1px solid var(--line);
}

.workout-head h2 {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.45rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

.workout-meta {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 550;
  line-height: 1.5;
}

.workout-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 22px 14px;
  overscroll-behavior: contain;
}

.workout-paper {
  max-width: 60ch;
}

.workout-material + .workout-material {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.workout-material-title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.workout-material-sub {
  margin: 0 0 12px !important;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 600;
}

.workout-block {
  padding-bottom: 20px;
}

.workout-block + .workout-block {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.workout-block:last-child {
  padding-bottom: 4px;
}

.workout-block-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 9px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.workout-block-title::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.workout-copy {
  display: grid;
  gap: 2px;
}

.workout-line {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 450;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.workout-break {
  height: 0.4rem;
}

.workout-videos {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 11px;
}

.workout-video {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.workout-video:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--ink);
}

.workout-video-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
}

.workout-video-play {
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid #fff;
}

.workout-video-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.workout-video-copy strong {
  overflow: hidden;
  font-size: 0.7rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workout-video-copy span {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 650;
}

.workout-video-arrow {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.8rem;
}

.workout-footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  padding: 13px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.workout-done {
  padding: 9px 20px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 650;
}

.workout-done:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

@media (max-width: 640px) {
  .workout-topbar {
    padding: 18px 18px 0;
  }

  .workout-head {
    padding: 2px 18px 16px;
  }

  .workout-body {
    padding: 18px 18px 10px;
  }

  .workout-footer {
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .workout-head h2 {
    font-size: 1.9rem;
  }
}

.workout-part {
  margin-top: 9px;
  padding: 10px 12px 10px 13px;
  border-left: 2px solid var(--accent-line);
  border-radius: 0 10px 10px 0;
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}

.workout-part h4 {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.workout-text {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.81rem;
  font-weight: 500;
  line-height: 1.62;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.compare-sheet {
  width: min(1180px, calc(100vw - 20px));
  max-height: 94vh;
}

.compare-sheet .sheet-inner {
  max-height: 94vh;
}

.compare-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.compare-count {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 650;
}

.compare-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 10px;
  max-height: 30vh;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.compare-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 5px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 600;
}

.compare-item:hover {
  background: var(--surface-soft);
}

.compare-item input {
  margin-top: 2px;
  accent-color: var(--accent);
}

.compare-item span {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 500;
}

.compare-picker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.compare-picker-label {
  margin-right: 2px;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 700;
}

.compare-type-chip {
  min-height: 30px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.66rem;
  font-weight: 650;
  transition: background-color 140ms ease, border-color 140ms ease,
    color 140ms ease;
}

.compare-type-chip:hover {
  border-color: var(--accent-line);
  color: var(--accent);
}

.compare-type-chip.is-selected {
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-ink);
}

.compare-picker-hint {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 600;
  white-space: nowrap;
}

.compare-grid {
  display: grid;
  gap: 12px;
  align-items: stretch;
  padding: 14px 2px 4px;
  min-height: 120px;
}

.compare-grid.compare-count-1 {
  grid-template-columns: minmax(0, 1fr);
}

.compare-grid.compare-count-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compare-grid.compare-count-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compare-empty {
  width: 100%;
  padding: 24px 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  text-align: center;
}

.compare-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  max-height: 52vh;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.compare-col-head {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.compare-col-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.compare-col-head p {
  margin-top: 4px !important;
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 600;
}

.compare-col-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

.compare-col-body .workout-text {
  max-width: 62ch;
}

.compare-col-body .workout-part:first-child {
  margin-top: 0;
}

.compare-times {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 12px;
}

.compare-time {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink);
  text-align: left;
}

.compare-time strong {
  font-size: 0.72rem;
  font-weight: 700;
}

.compare-time span {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 650;
}

.compare-time:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.compare-time.is-booked {
  border-color: var(--green-line);
  background: var(--green-soft);
  color: var(--green);
}

.compare-time.is-booked span {
  color: color-mix(in srgb, var(--green) 76%, var(--muted));
}

.compare-time.is-waitlisted {
  border-color: var(--waitlist-line);
  background: var(--waitlist-soft);
  color: var(--waitlist);
}

.compare-time.is-waitlisted span {
  color: color-mix(in srgb, var(--waitlist) 76%, var(--muted));
}

.compare-book {
  width: 100%;
  margin-top: 12px;
}

.confirm-sheet {
  width: min(430px, calc(100vw - 28px));
}

.confirm-sheet .rule-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

@media (max-width: 820px) {
  .compare-list {
    grid-template-columns: minmax(0, 1fr);
    max-height: 32vh;
  }

  .compare-grid.compare-count-2,
  .compare-grid.compare-count-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .compare-col {
    max-height: none;
  }

  .compare-picker-hint {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 560px) {
  .center-picker {
    width: 100%;
  }

  .center-picker select {
    flex: 1;
    max-width: none;
  }

  .compare-sheet {
    width: 100%;
    max-height: 94vh;
  }

  .compare-sheet .sheet-inner {
    max-height: 94vh;
  }

  .compare-grid {
    padding-top: 10px;
  }
}

/* ------------------------------------------------------------- propuestas */

.page-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.proposals-panel {
  margin-top: 14px;
  padding: 17px 18px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-lg);
  background: linear-gradient(
    145deg,
    var(--accent-soft),
    var(--surface-glass) 72%
  );
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
}

.proposals-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.proposals-head h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.proposals-head span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 600;
}

.proposal-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 4px;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  font-weight: 600;
}

.proposal-copy {
  flex: 1;
  min-width: 0;
}

.proposal-change {
  flex: 0 0 auto;
  margin-top: 1px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--surface);
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 700;
  white-space: nowrap;
}

.proposal-change:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.proposals-head-spaced {
  margin-top: 16px;
}

.proposal-counter {
  align-items: center;
  padding: 11px 10px;
  border: 1px solid var(--accent-line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}

.proposal-counter + .proposal-counter {
  margin-top: 6px;
}

.proposal-sent {
  padding: 9px 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  opacity: 0.82;
}

.proposal-sent + .proposal-sent {
  margin-top: 6px;
}

.proposal-mini-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.proposal-mini {
  min-height: 29px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.61rem;
  font-weight: 700;
}

.proposal-mini.primary {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}

.proposal-mini.danger {
  border-color: var(--danger-line);
  background: transparent;
  color: var(--danger);
}

.proposal-mini:hover {
  filter: brightness(1.05);
}

.proposal-item:first-of-type {
  border-top: 0;
}

.proposal-item input {
  margin-top: 2px;
  accent-color: var(--accent);
}

.proposal-item strong {
  font-weight: 700;
}

.proposal-item .proposal-meta {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 500;
}

.proposal-message {
  margin-top: 2px !important;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 500;
  font-style: italic;
}

.proposals-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.proposal-rules-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.proposal-rules {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 34vh;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.proposal-rule {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
}

.proposal-rule:hover {
  background: var(--surface-soft);
}

.proposal-rule input {
  margin-top: 2px;
  accent-color: var(--accent);
}

.proposal-rule span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 500;
}

/* ------------------------------- propuestas: destinatario por horario */

.proposal-bulk {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.proposal-bulk .field {
  flex: 1 1 200px;
  min-width: 0;
}

.proposal-bulk button {
  min-height: 43px;
}

.proposal-rule {
  align-items: center;
}

.proposal-rule-copy {
  min-width: 0;
  flex: 1 1 180px;
}

.proposal-recipient-list {
  display: flex;
  flex: 1 1 220px;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.recipient-chip {
  min-height: 29px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.63rem;
  font-weight: 650;
  transition: background-color 140ms ease, border-color 140ms ease,
    color 140ms ease;
}

.recipient-chip:hover {
  border-color: var(--accent-line);
  color: var(--accent);
}

.recipient-chip.is-selected {
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-ink);
}

.proposal-rule[data-rule-id] {
  align-items: flex-start;
  padding: 9px 7px;
}

@media (max-width: 560px) {
  .proposal-recipient-list {
    flex-basis: 100%;
    justify-content: flex-start;
  }
}

.proposal-rule select {
  flex: 1 1 150px;
  max-width: 220px;
  min-height: 34px;
  padding: 5px 26px 5px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
}

@media (max-width: 560px) {
  .proposal-rule {
    flex-wrap: wrap;
  }

  .proposal-rule select {
    flex-basis: 100%;
    max-width: none;
  }
}


/* ------------------------------------------------ contrapropuesta */

.counter-sheet {
  width: min(760px, calc(100vw - 28px));
}

.counter-body {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  margin-top: 16px;
}

.counter-calendar {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.counter-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.counter-month-nav strong {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.counter-weekdays,
.counter-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.counter-weekdays {
  margin-bottom: 4px;
}

.counter-weekdays span {
  color: var(--muted);
  font-size: 0.57rem;
  font-weight: 700;
  text-align: center;
}

.counter-day {
  display: flex;
  min-height: 40px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
}

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

.counter-day:disabled {
  opacity: 0.36;
  cursor: default;
}

.counter-day.is-outside {
  visibility: hidden;
}

.counter-day.is-today {
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

.counter-day.is-selected {
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-ink);
}

.counter-day-num {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.counter-day-count {
  color: var(--muted);
  font-size: 0.52rem;
  font-weight: 700;
  line-height: 1;
}

.counter-day.is-selected .counter-day-count {
  color: color-mix(in srgb, var(--accent-ink) 65%, transparent);
}

.counter-selection {
  margin-top: 0;
}

.counter-selection h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.counter-classes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 31vh;
  overflow: auto;
  padding: 2px;
}

.counter-class {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.counter-class:hover:not(:disabled) {
  border-color: var(--accent-line);
}

.counter-class strong {
  font-size: 0.73rem;
  font-weight: 700;
}

.counter-class span {
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 500;
}

.counter-class.is-selected {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

.counter-class.is-selected span {
  color: color-mix(in srgb, var(--accent) 72%, var(--muted));
}

.counter-class:disabled {
  opacity: 0.42;
  cursor: default;
}

.counter-sheet .field-wide {
  margin-top: 16px;
}

@media (max-width: 640px) {
  .counter-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .counter-classes {
    max-height: 24vh;
  }
}

/* --------------------------------------------------- vista de propuestas */

.nav-badge {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  margin-left: auto;
  padding: 0 5px;
  place-items: center;
  border-radius: var(--pill);
  background: #f43f5e;
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--surface) 80%, transparent);
}

.tab-link {
  position: relative;
}

.tab-badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 25px);
  display: grid;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  place-items: center;
  border-radius: var(--pill);
  background: #f43f5e;
  color: #fff;
  font-size: 0.52rem;
  font-weight: 800;
  line-height: 1;
}

.proposals-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 920px;
}

.proposal-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.proposal-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--surface-soft);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 650;
}

.proposal-tab:hover {
  border-color: var(--accent-line);
  color: var(--accent);
}

.proposal-tab.is-active {
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow-sm);
}

.proposal-tab-count {
  display: grid;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  place-items: center;
  border-radius: var(--pill);
  background: color-mix(in srgb, var(--ink) 10%, transparent);
  color: inherit;
  font-size: 0.58rem;
  font-weight: 800;
}

.proposal-tab-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-glass);
  box-shadow: var(--shadow-sm);
}

.proposal-subhead {
  margin: 18px 0 9px;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.proposal-subhead:first-child {
  margin-top: 0;
}

.proposal-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.proposal-stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-glass);
  box-shadow: var(--shadow-sm);
}

.proposal-stat strong {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.proposal-stat span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 650;
}

.proposal-stat.is-pending strong {
  color: var(--accent);
}

.proposal-stat.is-ok strong {
  color: var(--green);
}

.proposal-stat.is-bad strong {
  color: var(--danger);
}

.proposal-section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-glass);
  box-shadow: var(--shadow-sm);
}

.proposal-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.proposal-section-head h2 {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.proposal-section-head p {
  margin-top: 3px !important;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 500;
}

.proposal-section-count {
  display: grid;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  place-items: center;
  border-radius: var(--pill);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 750;
}

.proposal-card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.proposal-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

.proposal-card-pending {
  border-left: 3px solid var(--accent);
}

.proposal-card-accepted {
  border-left: 3px solid var(--green);
}

.proposal-card-rejected {
  border-left: 3px solid var(--danger);
}

.proposal-card-countered {
  border-left: 3px solid var(--waitlist);
}

.proposal-card input.proposal-select {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--accent);
}

.proposal-card-main {
  flex: 1;
  min-width: 0;
}

.proposal-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.proposal-card-title h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

.proposal-card-meta {
  margin-top: 3px !important;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 550;
  line-height: 1.45;
}

.proposal-card-message {
  margin-top: 4px !important;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  font-style: italic;
}

.proposal-card-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.proposal-bulk-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 4px;
}

@media (max-width: 700px) {
  .proposal-tabs {
    gap: 5px;
  }

  .proposal-tab {
    min-height: 35px;
    padding: 6px 10px;
    font-size: 0.67rem;
  }

  .proposal-tab-panel {
    padding: 14px;
  }

  .proposal-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .proposal-stat {
    padding: 11px 10px;
    flex-direction: column;
    gap: 1px;
  }

  .proposal-stat strong {
    font-size: 1.35rem;
  }

  .proposal-section {
    padding: 14px;
  }

  .proposal-card {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .proposal-card-actions {
    width: 100%;
    justify-content: flex-start;
    padding-left: 28px;
  }

  .proposal-card:not(:has(.proposal-select)) .proposal-card-actions {
    padding-left: 0;
  }

  .proposal-bulk-actions {
    justify-content: stretch;
  }

  .proposal-bulk-actions button {
    flex: 1;
  }
}

/* ------------------------------------------------ diálogo de propuestas */

.proposal-sheet {
  width: min(690px, calc(100vw - 28px));
}

.proposal-sheet .sheet-inner {
  padding: 30px 28px 24px;
}

.proposal-sheet .sheet-head {
  padding-bottom: 18px;
}

.proposal-sheet .sheet-date {
  margin-top: 8px;
  line-height: 1.6;
}

.proposal-bulk {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin: 18px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.proposal-bulk-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.proposal-bulk-copy strong {
  font-size: 0.72rem;
  font-weight: 700;
}

.proposal-bulk-copy span {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 500;
}

.proposal-bulk-controls {
  display: flex;
  align-items: center;
  gap: 7px;
}

.proposal-bulk-controls select {
  min-height: 40px;
  min-width: 190px;
  padding: 6px 28px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
}

.proposal-bulk-controls button {
  min-height: 40px;
}

.proposal-rules-head {
  margin: 22px 0 10px;
}

.proposal-selected-count {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: var(--pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.59rem;
  font-weight: 700;
  white-space: nowrap;
}

.proposal-rules {
  gap: 10px;
  max-height: 36vh;
  padding: 0;
  border: 0;
  background: transparent;
}

.proposal-rule[data-rule-id] {
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  cursor: default;
}

.proposal-rule[data-rule-id]:hover {
  border-color: var(--accent-line);
  background: var(--surface);
}

.proposal-rule-copy strong {
  font-size: 0.79rem;
  font-weight: 700;
}

.proposal-recipient-list {
  flex: 0 1 auto;
  justify-content: flex-end;
  gap: 7px;
}

.proposal-sheet .field-wide {
  margin-top: 18px;
}

.proposal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.proposal-footer .primary {
  min-width: 160px;
}

@media (max-width: 640px) {
  .proposal-sheet .sheet-inner {
    padding: 24px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  }

  .proposal-bulk {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    margin-top: 16px;
  }

  .proposal-bulk-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .proposal-bulk-controls select {
    width: 100%;
    min-width: 0;
  }

  .proposal-rule[data-rule-id] {
    flex-direction: column;
    align-items: stretch;
  }

  .proposal-rule[data-rule-id] .proposal-rule-copy {
    flex: 0 0 auto;
  }

  .proposal-recipient-list {
    flex-basis: auto;
    justify-content: flex-start;
  }

  .proposal-footer button {
    flex: 1;
  }
}

/* --------------------------------------------- temas, paletas y apariencia */

:root {
  --glow-1: rgba(56, 116, 255, 0.34);
  --glow-2: rgba(0, 210, 255, 0.16);
  --glow-3: rgba(104, 63, 255, 0.22);
}

body {
  background-image:
    radial-gradient(60% 52% at 8% 0%, var(--glow-1), transparent 68%),
    radial-gradient(46% 42% at 98% 6%, var(--glow-2), transparent 70%),
    radial-gradient(62% 55% at 76% 100%, var(--glow-3), transparent 72%),
    linear-gradient(155deg, #040914 0%, #071329 48%, #040a16 100%);
}

/* Paletas. El azul es la de por defecto. */
:root[data-palette="violet"] {
  --accent: #8b5cf6;
  --accent-2: #d8b4fe;
  --accent-ink: #1a0b35;
  --accent-soft: rgba(139, 92, 246, 0.16);
  --accent-line: rgba(139, 92, 246, 0.38);
  --glow-1: rgba(124, 58, 237, 0.32);
  --glow-2: rgba(216, 180, 254, 0.13);
  --glow-3: rgba(76, 29, 149, 0.25);
}

:root[data-palette="emerald"] {
  --accent: #34d399;
  --accent-2: #2dd4bf;
  --accent-ink: #052018;
  --accent-soft: rgba(52, 211, 153, 0.16);
  --accent-line: rgba(52, 211, 153, 0.36);
  --glow-1: rgba(16, 185, 129, 0.28);
  --glow-2: rgba(45, 212, 191, 0.14);
  --glow-3: rgba(6, 95, 70, 0.24);
}

:root[data-palette="coral"] {
  --accent: #ff7a59;
  --accent-2: #ffb26b;
  --accent-ink: #26100a;
  --accent-soft: rgba(255, 122, 89, 0.16);
  --accent-line: rgba(255, 122, 89, 0.38);
  --glow-1: rgba(255, 122, 89, 0.28);
  --glow-2: rgba(255, 178, 107, 0.14);
  --glow-3: rgba(159, 18, 57, 0.22);
}

/* Amarillo y negro, con un segundo tono verde ácido. */
:root[data-palette="radioactive"] {
  color-scheme: dark;

  --bg: #040500;
  --surface: #101204;
  --surface-soft: rgba(232, 255, 0, 0.07);
  --surface-glass: rgba(10, 12, 2, 0.8);
  --ink: #f4ffd6;
  --muted: #a6b276;
  --line: rgba(221, 255, 80, 0.14);
  --line-strong: rgba(221, 255, 80, 0.28);

  --accent: #e8ff00;
  --accent-2: #b4ff1f;
  --accent-ink: #0a0c00;
  --accent-soft: rgba(232, 255, 0, 0.13);
  --accent-line: rgba(232, 255, 0, 0.38);

  --waitlist: #ffb800;
  --waitlist-soft: rgba(255, 184, 0, 0.16);
  --waitlist-line: rgba(255, 184, 0, 0.46);

  --tab-active-bg: #dcff00;
  --tab-active-ink: #0a0c00;
  --switch-active-bg: #191d08;
  --sheet-bg: #0b0d03;

  --glow-1: rgba(232, 255, 0, 0.18);
  --glow-2: rgba(180, 255, 31, 0.1);
  --glow-3: rgba(90, 110, 0, 0.22);
}

:root[data-palette="radioactive"] body {
  background-image:
    radial-gradient(60% 52% at 8% 0%, var(--glow-1), transparent 68%),
    radial-gradient(46% 42% at 98% 6%, var(--glow-2), transparent 70%),
    radial-gradient(62% 55% at 76% 100%, var(--glow-3), transparent 72%),
    linear-gradient(155deg, #020300 0%, #0a0c02 48%, #020300 100%);
}

/* Modo claro: superficies claras con el mismo acento de la paleta. */
:root[data-theme="light"] {
  color-scheme: light;

  --bg: #eef4fd;
  --surface: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.62);
  --surface-glass: rgba(255, 255, 255, 0.8);
  --ink: #0c1930;
  --muted: #5e7191;
  --line: rgba(16, 42, 84, 0.12);
  --line-strong: rgba(16, 42, 84, 0.23);

  --accent: #2563eb;
  --accent-2: #0891b2;
  --accent-ink: #ffffff;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --accent-line: rgba(37, 99, 235, 0.26);

  --green: #0d8a61;
  --green-soft: #e3f6ee;
  --green-line: rgba(13, 138, 97, 0.22);

  --pending: #5e6f8b;
  --pending-soft: #e9eef7;
  --pending-line: rgba(94, 111, 139, 0.2);

  --danger: #c23d5b;
  --danger-soft: #fbe8ed;
  --danger-line: rgba(194, 61, 91, 0.22);

  --warn: #956000;
  --warn-soft: #fbf0d6;

  --waitlist: #8a6a00;
  --waitlist-soft: #fff4c2;
  --waitlist-line: rgba(138, 106, 0, 0.34);

  --shadow-lg: 0 30px 80px rgba(33, 55, 95, 0.16),
    0 2px 10px rgba(33, 55, 95, 0.06);
  --shadow-md: 0 14px 34px rgba(33, 55, 95, 0.12);
  --shadow-sm: 0 6px 18px rgba(33, 55, 95, 0.08);

  --tab-active-bg: #2563eb;
  --tab-active-ink: #ffffff;
  --switch-active-bg: #ffffff;
  --sheet-bg: #ffffff;

  --glow-1: rgba(37, 99, 235, 0.18);
  --glow-2: rgba(8, 145, 178, 0.12);
  --glow-3: rgba(124, 58, 237, 0.1);
}

:root[data-theme="light"] body {
  background-color: var(--bg);
  background-image:
    radial-gradient(60% 52% at 8% 0%, var(--glow-1), transparent 68%),
    radial-gradient(46% 42% at 98% 6%, var(--glow-2), transparent 70%),
    radial-gradient(62% 55% at 76% 100%, var(--glow-3), transparent 72%),
    linear-gradient(155deg, #fbfdff 0%, #edf3fc 48%, #f8fbff 100%);
}

:root[data-theme="light"][data-palette="violet"] {
  --accent: #7c3aed;
  --accent-2: #a855f7;
  --accent-ink: #ffffff;
  --accent-soft: rgba(124, 58, 237, 0.1);
  --accent-line: rgba(124, 58, 237, 0.26);
  --glow-1: rgba(124, 58, 237, 0.16);
  --glow-2: rgba(168, 85, 247, 0.1);
  --glow-3: rgba(76, 29, 149, 0.08);
  --tab-active-bg: #7c3aed;
}

:root[data-theme="light"][data-palette="emerald"] {
  --accent: #059669;
  --accent-2: #0d9488;
  --accent-ink: #ffffff;
  --accent-soft: rgba(5, 150, 105, 0.1);
  --accent-line: rgba(5, 150, 105, 0.26);
  --glow-1: rgba(5, 150, 105, 0.16);
  --glow-2: rgba(13, 148, 136, 0.1);
  --glow-3: rgba(6, 95, 70, 0.08);
  --tab-active-bg: #059669;
}

:root[data-theme="light"][data-palette="coral"] {
  --accent: #e2553d;
  --accent-2: #ea8c2f;
  --accent-ink: #ffffff;
  --accent-soft: rgba(226, 85, 61, 0.1);
  --accent-line: rgba(226, 85, 61, 0.26);
  --glow-1: rgba(226, 85, 61, 0.16);
  --glow-2: rgba(234, 140, 47, 0.1);
  --glow-3: rgba(159, 18, 57, 0.08);
  --tab-active-bg: #e2553d;
}

:root[data-theme="light"][data-palette="radioactive"] {
  --bg: #f9f8e8;
  --surface: #fffef2;
  --surface-soft: rgba(255, 255, 255, 0.62);
  --surface-glass: rgba(255, 254, 235, 0.82);
  --ink: #151600;
  --muted: #696b49;
  --line: rgba(52, 55, 0, 0.14);
  --line-strong: rgba(52, 55, 0, 0.27);

  --accent: #8f8900;
  --accent-2: #6f7b00;
  --accent-ink: #ffffff;
  --accent-soft: rgba(200, 205, 0, 0.14);
  --accent-line: rgba(143, 137, 0, 0.3);

  --waitlist: #8a6a00;
  --waitlist-soft: #fff4c2;
  --waitlist-line: rgba(138, 106, 0, 0.34);

  --tab-active-bg: #d4d000;
  --tab-active-ink: #151600;
  --switch-active-bg: #fffef2;
  --sheet-bg: #fffef2;

  --glow-1: rgba(220, 225, 0, 0.26);
  --glow-2: rgba(160, 180, 0, 0.14);
  --glow-3: rgba(120, 110, 0, 0.1);
}

:root[data-theme="light"][data-palette="radioactive"] body {
  background-color: var(--bg);
  background-image:
    radial-gradient(60% 52% at 8% 0%, var(--glow-1), transparent 68%),
    radial-gradient(46% 42% at 98% 6%, var(--glow-2), transparent 70%),
    radial-gradient(62% 55% at 76% 100%, var(--glow-3), transparent 72%),
    linear-gradient(155deg, #fffff4 0%, #f4f2d8 48%, #fbfae8 100%);
}

:root[data-theme="light"] .calendar-card,
:root[data-theme="light"] .panel-card,
:root[data-theme="light"] .auth-card,
:root[data-theme="light"] .rule-card,
:root[data-theme="light"] .admin-user {
  border-color: var(--line);
}

.auth-logo {
  filter: drop-shadow(0 12px 30px var(--accent-soft));
}

.brand-logo {
  filter: drop-shadow(0 8px 20px var(--accent-soft));
}

button.primary {
  box-shadow: 0 10px 26px var(--accent-line);
}

button.primary:hover {
  box-shadow: 0 13px 32px var(--accent-line);
}

.side-link.is-active {
  box-shadow: 0 10px 26px var(--accent-line);
}

/* Controles de apariencia en Cuenta. */
.appearance-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.appearance-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.appearance-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.theme-options,
.palette-options {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.theme-option,
.palette-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.73rem;
  font-weight: 650;
}

.theme-option::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
}

.theme-option[data-theme-option="light"]::before {
  background: #ffffff;
  border: 1px solid var(--line-strong);
}

.theme-option[data-theme-option="dark"]::before {
  background: #071329;
  border: 1px solid var(--line-strong);
}

.theme-option.is-active,
.palette-option.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

.palette-dot {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(135deg, var(--swatch-a), var(--swatch-b));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.palette-blue { --swatch-a: #4d8dff; --swatch-b: #5ad4ff; }
.palette-violet { --swatch-a: #8b5cf6; --swatch-b: #d8b4fe; }
.palette-emerald { --swatch-a: #34d399; --swatch-b: #2dd4bf; }
.palette-coral { --swatch-a: #ff7a59; --swatch-b: #ffb26b; }
.palette-radioactive { --swatch-a: #e8ff00; --swatch-b: #6f7b00; }

.appearance-note {
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 500;
}

.account-grid > .panel-card-wide {
  grid-column: 1 / -1;
}

.account-centers {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.center-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.center-row.is-current {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.center-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.center-copy strong {
  font-size: 0.78rem;
  font-weight: 700;
}

.center-copy span {
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 500;
}
