:root {
  /* Tokens oficiales del manual de marca Agenda Nuez */
  --color-brown: #3d2b1f;
  --color-olive: #7a8b5a;
  --color-orange: #e76f3d;
  --color-cream: #f6efe6;

  --color-soft-green: #a8b89a;
  --color-peach: #ffc9a6;
  --color-sand: #f2dfc5;
  --color-light-brown: #d7bfa6;
  --color-espresso: #1f160f;

  --color-surface: #fffcf8;
  --color-border: rgba(61, 43, 31, 0.14);
  --color-text: #3d2b1f;
  --color-text-muted: #7d6d62;

  --font-display: "Baloo 2", "Nunito", "Segoe UI", system-ui, sans-serif;
  --font-body: "Nunito", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;

  /* Aliases internos (mapean los nombres históricos a los tokens del manual) */
  --bg: var(--color-cream);
  --surface: var(--color-surface);
  --surface-glass: rgba(255, 252, 248, 0.94);
  --surface-soft: #f5ecdc;
  --ink: var(--color-brown);
  --text: var(--color-text);
  --muted: var(--color-text-muted);
  --line: var(--color-border);
  --primary: var(--color-brown);
  --primary-dark: var(--color-espresso);
  --primary-soft: #efe5d4;
  --green: var(--color-olive);
  --green-dark: #62714a;
  --green-soft: #e9edda;
  --accent: var(--color-orange);
  --accent-soft: #fce4d3;
  --teal: var(--green);
  --amber: var(--accent);
  --danger: #b03a26;
  --shadow: 0 10px 32px -16px rgba(61, 43, 31, 0.2);
  --radius: 14px;
  --sidebar: var(--color-cream);
  --blur: 0px;
  --font-serif: var(--font-display);
  --font-sans: var(--font-body);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 400;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 1000;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--primary-dark);
  padding: 10px 12px;
}

.skip-link:focus {
  top: 16px;
}

.auth-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(100%, 440px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-glass);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow);
  padding: 32px;
}

.auth-brand {
  margin-bottom: 28px;
}

.auth-brand .brand-logo {
  width: 150px;
}

.auth-heading {
  margin-bottom: 22px;
}

.auth-heading h1 {
  margin-bottom: 10px;
}

.auth-heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 4px;
}

.auth-mode-button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 750;
}

.auth-mode-button.active {
  background: var(--surface);
  color: var(--primary-dark);
  box-shadow: 0 1px 5px rgba(61, 43, 31, 0.1);
}

.auth-form label,
.password-field {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-weight: 650;
}

.auth-signup-field.collapsed {
  display: none;
}

.password-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.password-control .ghost-button {
  min-width: 92px;
}

.password-field small {
  color: var(--muted);
  font-weight: 500;
}

.auth-message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.45;
}

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

.auth-message.success {
  color: var(--teal);
}

.auth-submit {
  width: 100%;
  min-height: 46px;
}

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

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green-dark);
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  background: var(--sidebar);
  color: var(--text);
  border-right: 1px solid var(--line);
  padding: 28px 18px;
}

.brand {
  display: flex;
  min-width: 0;
  padding: 4px 0;
}

/* Logo oficial del manual: SVG como asset, una sola vez por pantalla,
   sin fondo ni contenedor, con aire alrededor (§4 del manual). */
.brand-logo {
  display: block;
  width: 160px;
  height: auto;
  max-width: 100%;
  object-fit: contain;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0 14px;
  text-align: left;
  font-weight: 500;
}

.nav-item:hover {
  background: rgba(255, 252, 248, 0.7);
  color: var(--ink);
}

.nav-item.active {
  position: relative;
  border-color: transparent;
  background: var(--color-sand);
  color: var(--ink);
  font-weight: 700;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: var(--accent);
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: var(--muted);
  flex: 0 0 auto;
}

.nav-icon svg {
  width: 20px;
  height: 20px;
}

.nav-item.active .nav-icon {
  color: var(--ink);
}

.connection-stack {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.connection-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 14px;
}

.connection-box small {
  display: block;
  color: var(--muted);
  line-height: 1.45;
  margin-top: 10px;
}

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

.connection-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.connection-title strong {
  color: var(--ink);
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
}

.brand-badge {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px -4px rgba(90, 60, 30, 0.3);
}

.brand-badge svg {
  width: 21px;
  height: 21px;
  display: block;
}

.brand-badge.brand-mp {
  color: #009ee3;
}

.brand-badge.brand-mp svg {
  width: 26px;
  height: 26px;
}

.panel-title-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-title-brand .brand-badge {
  width: 42px;
  height: 42px;
}

.panel-title-brand .brand-badge svg {
  width: 24px;
  height: 24px;
}

.panel-title-brand .brand-badge.brand-mp svg {
  width: 29px;
  height: 29px;
}

.status-line {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.status-line--spaced {
  margin-top: 12px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
}

.status-dot.connected {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(122, 139, 90, 0.22);
}

.status-dot.disconnected {
  background: #9b8a76;
  box-shadow: 0 0 0 4px rgba(155, 138, 118, 0.16);
}

.status-dot.error {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(231, 111, 61, 0.18);
}

.main-panel {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.topbar-actions,
.toolbar-actions,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.user-chip {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 260px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
}

.user-chip strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
}

h2,
h3 {
  margin-bottom: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 600;
  touch-action: manipulation;
}

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.primary-button {
  background: var(--primary);
  color: var(--color-cream);
  font-weight: 700;
}

.primary-button:hover {
  background: var(--primary-dark);
}

.secondary-button {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

.secondary-button:hover {
  background: var(--surface-soft);
}

.ghost-button {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-color: transparent;
}

.ghost-button:hover {
  background: var(--color-sand);
}

.text-button {
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-button:hover {
  color: var(--accent);
}

.small-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.square-button {
  width: 44px;
  padding: 0;
}

.section {
  display: none;
}

.section.active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric {
  min-height: 126px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-glass);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow);
  padding: 20px;
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
}

.metric strong {
  display: block;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 29px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  margin: 12px 0 8px;
}

.agenda-layout,
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

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

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-glass);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow);
  padding: 24px;
}

.compact-panel {
  padding: 20px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-header.tight {
  margin-bottom: 12px;
}

.appointment-list {
  display: grid;
  gap: 10px;
}

.appointment {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border-left: 5px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0 14px 14px;
}

.appointment:last-child {
  border-bottom: 0;
}

.appointment.confirmed {
  border-left-color: var(--teal);
}

.appointment.pending {
  border-left-color: var(--amber);
}

.appointment time,
.appointment strong {
  color: var(--ink);
  font-weight: 800;
}

.appointment span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.appointment b {
  color: var(--text);
}

.empty-hint {
  color: var(--muted);
  font-size: 13px;
  padding: 6px 0;
}

.window-edit {
  display: flex;
  align-items: center;
  gap: 6px;
}

.window-edit input[type="time"] {
  min-height: 34px;
}

.side-stack {
  display: grid;
  gap: 14px;
}

.public-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.public-link.collapsed {
  display: none;
}

.public-link code {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 11px 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-menu {
  position: relative;
}

/* .panel usa backdrop-filter, que crea su propio stacking context: sin
   esto, el panel siguiente (pintado despues en el DOM) tapa el menu
   aunque tenga z-index mayor, porque ese z-index queda atrapado dentro
   del stacking context del propio panel. */
.panel.menu-open {
  position: relative;
  z-index: 30;
}

.link-menu-toggle {
  width: 100%;
}

.link-menu-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  padding: 6px;
}

.link-menu-item {
  display: grid;
  gap: 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  padding: 8px 10px;
}

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

.link-menu-item strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.link-menu-item span {
  font-size: 12px;
  color: var(--muted);
}

.action-list {
  display: grid;
  gap: 8px;
}

.action-list button,
.rules-list button,
.row-actions button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  padding: 0 10px;
  text-align: left;
}

.action-list button:hover,
.rules-list button:hover,
.row-actions button:hover {
  background: var(--surface-soft);
}

.agenda-panel {
  min-width: 0;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.status-strip span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 0 12px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.calendar-scroll {
  max-height: 620px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  position: relative;
}

.calendar-scroll.is-loading .calendar-grid {
  opacity: 0.45;
  pointer-events: none;
}

.calendar-loading {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 650;
  color: var(--primary-dark);
}

/* 48 filas de media hora (30px cada una = 60px por hora, como antes). */
.calendar-grid {
  display: grid;
  grid-template-columns: 54px repeat(7, minmax(104px, 1fr));
  grid-template-rows: 58px repeat(48, 30px);
  min-width: 830px;
}

.calendar-corner,
.day-head {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.calendar-corner {
  left: 0;
  z-index: 3;
}

.day-head {
  display: grid;
  place-items: center;
  color: var(--muted);
  padding: 8px 0 6px;
}

.day-head small {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.day-head strong {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.day-head.today strong {
  background: var(--primary);
  color: var(--color-cream);
}

.time-rail {
  position: sticky;
  left: 0;
  z-index: 1;
  grid-row: 2 / span 48;
  display: grid;
  grid-template-rows: repeat(24, 60px);
  background: var(--surface);
}

.time-rail time {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 8px 10px 0 0;
}

.day-column {
  position: relative;
  min-width: 0;
  grid-row: 2 / span 48;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: repeat(48, 30px);
}

.hour-slot {
  grid-row: calc(var(--start) + 1) / span var(--span);
  grid-column: 1;
  min-width: 0;
  margin: 2px 5px;
  border: 1px solid rgba(61, 43, 31, 0.08);
  border-radius: 9px;
  padding: 0;
  background: var(--surface-soft);
}

.hour-slot-unavailable {
  background: repeating-linear-gradient(-45deg, rgba(61, 43, 31, 0.05), rgba(61, 43, 31, 0.05) 6px, rgba(61, 43, 31, 0.1) 6px, rgba(61, 43, 31, 0.1) 12px);
  border-color: rgba(61, 43, 31, 0.06);
  cursor: default;
}

.hour-slot-available {
  position: relative;
  background: var(--green-soft);
  border-color: rgba(122, 139, 90, 0.35);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.slot-cta {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.12s ease;
  pointer-events: none;
}

.slot-cta i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--green-dark);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-style: normal;
}

.slot-cta i svg {
  width: 10px;
  height: 10px;
  display: block;
}

.slot-cta strong {
  font-size: 11px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.hour-slot-available:hover,
.hour-slot-available:focus-visible {
  background: var(--surface);
  border: 1.5px dashed var(--green-dark);
  box-shadow: 0 6px 16px -8px rgba(98, 113, 74, 0.55);
  z-index: 3;
}

.hour-slot-available:hover .slot-cta,
.hour-slot-available:focus-visible .slot-cta {
  opacity: 1;
}

.event {
  grid-row: calc(var(--start) + 1) / span var(--span);
  grid-column: 1;
  z-index: 1;
  min-width: 0;
  min-height: 26px;
  border: 1px solid transparent;
  border-radius: 9px;
  margin: 2px 5px;
  padding: 6px 9px;
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  touch-action: manipulation;
  transition: box-shadow 0.15s ease, transform 0.1s ease;
}

.event:hover,
.event:focus-visible {
  box-shadow: 0 2px 8px rgba(74, 51, 43, 0.18);
}

.event:active {
  transform: scale(0.97);
}

.event strong,
.event span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event strong {
  font-size: 12px;
}

.event span {
  margin-top: 3px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.event span em {
  font-style: normal;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event span svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.event.confirmed {
  background: var(--green);
  border-color: var(--green-dark);
  color: #fffcf8;
}

.event.pending {
  background: var(--accent-soft);
  border-color: #f0c49e;
  color: #9c4a16;
}

.agenda-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
}

.agenda-hint svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 50%;
  margin-right: 6px;
}

.confirmed-dot {
  background: var(--teal);
}

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

.available-dot {
  background: var(--green);
  opacity: 0.85;
}

.unavailable-dot {
  background: var(--muted);
  opacity: 0.45;
}

.form-stack,
.rules-list,
.privacy-list {
  display: grid;
  gap: 10px;
}

.panel-hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.toggle-field {
  white-space: nowrap;
}

.channel-checks {
  display: flex;
  gap: 14px;
  margin-top: 4px;
  font-weight: 500;
  color: var(--ink);
}

.channel-checks span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.form-stack label,
.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
}

textarea {
  padding: 10px 12px;
}

.privacy-list article {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.5fr);
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.rules-list article {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: 16px;
  row-gap: 6px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.rules-list article:last-child,
.privacy-list article:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.rules-list strong,
.privacy-list strong {
  color: var(--ink);
}

.rules-list strong {
  flex: 1 1 170px;
}

.rules-list span,
.privacy-list span {
  color: var(--muted);
  font-size: 13px;
}

.rules-list span {
  flex: 1 1 120px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.rules-list article button {
  flex: 0 0 auto;
}

.patient-form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 16px;
  margin-bottom: 18px;
}

.patient-form.collapsed {
  display: none;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(58, 42, 31, 0.32);
}

.drawer-form {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  width: min(400px, 92vw);
  height: 100vh;
  margin-bottom: 0;
  border-radius: 0;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: -18px 0 40px -20px rgba(58, 42, 31, 0.35);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  transform: translateX(0);
  transition: transform 0.25s ease;
}

.drawer-form.collapsed {
  display: flex;
  transform: translateX(110%);
  visibility: hidden;
  pointer-events: none;
}

/* Ficha de paciente: ventana grande centrada en lugar del drawer lateral. */
.drawer-form.drawer-wide {
  left: 50%;
  right: auto;
  top: 3vh;
  height: 94vh;
  width: min(980px, 94vw);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 40px 80px -40px rgba(58, 42, 31, 0.5);
  transform: translateX(-50%);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.drawer-form.drawer-wide.collapsed {
  transform: translateX(-50%) translateY(24px);
  opacity: 0;
}

.ficha-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.ficha-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.ficha-tab {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 650;
  padding: 0 14px;
}

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

.ficha-tab.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.ficha-body {
  flex: 1;
}

.ficha-summary {
  margin: 0 0 12px;
  color: var(--muted);
  font-weight: 600;
}

.history-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.history-filters label {
  flex: 0 1 180px;
}

.fee-summary {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 12px 14px;
}

.fee-summary p {
  margin: 0;
  color: var(--text);
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
}

.form-subsection {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: grid;
  gap: 10px;
}

.ficha-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 0;
}

@media (max-width: 720px) {
  .drawer-form.drawer-wide {
    top: 0;
    height: 100vh;
    width: 100vw;
    border-radius: 0;
    border: 0;
  }
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.drawer-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.drawer-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  flex: 0 0 auto;
}

.drawer-icon svg {
  width: 22px;
  height: 22px;
}

.drawer-title h3 {
  font-size: 19px;
}

.drawer-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

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

.drawer-body {
  display: grid;
  gap: 16px;
}

.drawer-body label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.field-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.duration-group {
  display: grid;
  gap: 8px;
}

.duration-pills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.duration-pill {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
}

.duration-pill:hover {
  background: var(--surface-soft);
}

.duration-pill.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.hidden-select {
  display: none;
}

.drawer-actions {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.drawer-submit {
  width: 100%;
}

.drawer-actions .text-button {
  justify-self: center;
}

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

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

.form-grid label.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  grid-column: 1 / -1;
}

.checkbox-field input[type="checkbox"] {
  width: auto;
  min-height: auto;
  flex: 0 0 auto;
}

.form-error {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--danger);
  font-weight: 650;
}

.form-actions {
  margin-top: 14px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: var(--surface);
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

tbody tr:hover {
  background: var(--surface-soft);
}

.table-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 750;
}

.table-status.active,
.table-status.paid {
  background: var(--green-soft);
  color: #55663d;
}

.table-status.pending {
  background: var(--accent-soft);
  color: #9c4a16;
}

.table-status.archived {
  background: #ece5da;
  color: #6d5f4d;
}

.table-status.rejected {
  background: #f6e0da;
  color: #8f2f1c;
}

.table-status.auto {
  background: var(--green-soft);
  color: #55663d;
}

.table-status.manual {
  background: #ece5da;
  color: #6d5f4d;
}

.cell-sub {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.table-status.status-toggle {
  border: none;
  cursor: pointer;
}

.table-status.status-toggle:hover {
  filter: brightness(0.96);
}

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

.row-actions .danger-link {
  border-color: #dcb3a8;
  color: var(--danger);
}

.fee-line {
  margin: 0 0 16px;
  color: var(--ink);
}

.slot-list {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.slot-day strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
}

.slot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.slot-button.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  max-width: min(360px, calc(100vw - 40px));
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--color-cream);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  padding: 12px 14px;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .agenda-layout,
  .settings-grid {
    grid-template-columns: 1fr;
  }

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

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

  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
  }

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

  .nav-item {
    justify-content: center;
    padding: 0;
  }

  .nav-item span:last-child {
    display: none;
  }

  .connection-stack {
    display: none;
  }

  .main-panel {
    padding: 18px;
  }

  .topbar,
  .panel-header,
  .agenda-toolbar,
  .topbar-actions,
  .toolbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions button,
  .toolbar-actions button {
    width: 100%;
  }

  .user-chip {
    width: 100%;
    max-width: none;
  }

  .metric-grid,
  .side-stack,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .calendar-scroll {
    max-height: 480px;
  }

  .calendar-grid {
    grid-template-columns: 42px repeat(7, minmax(84px, 1fr));
    grid-template-rows: 52px repeat(48, 27px);
    min-width: 630px;
  }

  .time-rail {
    grid-template-rows: repeat(24, 54px);
  }

  .day-column {
    grid-template-rows: repeat(48, 27px);
  }

  .event {
    margin: 3px;
    padding: 6px;
  }

  .event span {
    display: none;
  }

  .rules-list article {
    justify-content: flex-start;
  }

  .rules-list span {
    flex: 1 1 100%;
    order: 3;
    text-align: left;
  }

  .privacy-list article {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 26px;
  }

  .brand-logo,
  .auth-brand .brand-logo {
    width: 128px;
  }

  .metric {
    min-height: 110px;
  }

  .metric strong {
    font-size: 25px;
  }

  .appointment {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .appointment b {
    grid-column: 2;
  }

  .public-link {
    grid-template-columns: 1fr;
  }

  .auth-screen {
    align-items: stretch;
    padding: 16px;
  }

  .auth-card {
    align-self: center;
    padding: 20px;
  }

  .password-control {
    grid-template-columns: 1fr;
  }

  .password-control .ghost-button {
    width: 100%;
  }
}

/* ============================================================
   Selector de horarios del drawer "Nuevo turno" (agenda interna)
   ============================================================ */

.turno-time-group {
  display: grid;
  gap: 6px;
}

.time-chip-scroll {
  max-height: 190px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 10px 12px;
  display: grid;
  gap: 10px;
}

.time-chip-group {
  display: grid;
  gap: 6px;
}

.time-chip-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.time-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.time-chip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 5px 9px;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.time-chip:hover:not(:disabled) {
  border-color: var(--primary);
}

.time-chip.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.time-chip:disabled {
  opacity: 0.35;
  cursor: default;
  text-decoration: line-through;
}

/* ==============================
   Panel de servicios (agenda)
   ============================== */

.service-form {
  margin-top: 14px;
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}

.rules-list article.service-inactive strong,
.rules-list article.service-inactive span {
  opacity: 0.55;
}

/* ============================================================
   Wizard público de reserva (reservar.html)
   ============================================================ */

.booking-shell {
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  padding: 24px;
}

.booking-card {
  width: min(100%, 720px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-glass);
  box-shadow: var(--shadow);
  padding: 32px;
  align-self: flex-start;
}

.booking-step-title {
  font-family: var(--font-display);
  color: var(--ink);
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 18px;
}

.booking-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  color: var(--primary-dark);
  font-weight: 650;
  cursor: pointer;
  padding: 0;
  margin-bottom: 14px;
}

.booking-back:hover {
  text-decoration: underline;
}

/* Paso 1: tipo de servicio */

.modality-chips {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.modality-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1.5px solid var(--primary-dark);
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 650;
  padding: 8px 14px;
  cursor: pointer;
}

.modality-chip[aria-pressed="false"] {
  border-color: var(--line);
  background: var(--surface);
  color: var(--muted);
}

.modality-chip svg {
  width: 17px;
  height: 17px;
}

.service-cards {
  display: grid;
  gap: 14px;
}

.service-card {
  position: relative;
  text-align: left;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 20px 64px 20px 22px;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.service-card:hover,
.service-card:focus-visible {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.service-card.selected {
  border-color: var(--primary-dark);
}

.service-card h2 {
  font-family: var(--font-display);
  color: var(--primary-dark);
  font-size: 22px;
  margin: 0 0 6px;
}

.service-card p {
  margin: 0 0 12px;
  color: var(--muted);
}

.service-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--ink);
  font-weight: 700;
}

.service-card-meta i {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-style: normal;
}

.service-card-meta i svg {
  width: 20px;
  height: 20px;
}

.service-card .service-check {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-dark);
  color: #ffffff;
  display: none;
  place-items: center;
}

.service-card.selected .service-check {
  display: grid;
}

.service-check svg {
  width: 16px;
  height: 16px;
}

/* Skeleton del paso 1 mientras llega la info del link: mismo layout que
   el wizard real (eyebrow + titulo + cards) para que no haya salto ni
   texto generico de "Cargando...". */
@keyframes skeleton-shimmer {
  0% {
    background-position: -160% 0;
  }
  100% {
    background-position: 160% 0;
  }
}

.skeleton-line {
  border-radius: 8px;
  background: linear-gradient(90deg, var(--line) 25%, var(--surface) 50%, var(--line) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

.skeleton-eyebrow {
  width: 150px;
  height: 14px;
  margin-bottom: 10px;
}

.skeleton-step {
  width: 90px;
  height: 12px;
  margin-bottom: 10px;
}

.skeleton-title {
  width: 70%;
  height: 30px;
  margin-bottom: 20px;
}

.skeleton-card {
  cursor: default;
}

.skeleton-card-title {
  width: 55%;
  height: 20px;
  margin-bottom: 10px;
}

.skeleton-card-meta {
  width: 40%;
  height: 14px;
}

/* Skeleton de Agenda mientras cargan metricas, turnos de hoy, link
   publico y solicitudes de reagendo (mismo criterio que arriba: mostrar
   la forma final en vez de "Cargando..."). */
.skeleton-metric-value {
  width: 70px;
  height: 29px;
  margin: 12px 0 8px;
}

.skeleton-metric-detail {
  width: 65%;
  height: 13px;
}

.skeleton-link-value {
  width: 100%;
  max-width: 240px;
  height: 16px;
}

/* .public-link code ya trae su propio background (mas especifico que
   .skeleton-line); esta regla lo pisa para que el shimmer se vea. */
.public-link code.skeleton-link-value {
  background: linear-gradient(90deg, var(--line) 25%, var(--surface) 50%, var(--line) 75%);
  background-size: 200% 100%;
  color: transparent;
}

.skeleton-appt-time {
  width: 40px;
  height: 14px;
}

.skeleton-appt-name {
  width: 70%;
  height: 15px;
  margin-bottom: 6px;
}

.skeleton-appt-status {
  width: 45%;
  height: 11px;
}

.skeleton-appt-fee {
  width: 50px;
  height: 15px;
  justify-self: end;
}

.appointment.skeleton-appt {
  border-left-color: var(--line);
}

.skeleton-row {
  display: grid;
  gap: 8px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.skeleton-row:last-child {
  border-bottom: 0;
}

.skeleton-row-title {
  width: 60%;
  height: 16px;
}

.skeleton-row-subtitle {
  width: 40%;
  height: 12px;
}

/* Paso 2: día y hora */

.date-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 6px;
  margin-bottom: 18px;
}

.date-tab {
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--muted);
  font-weight: 700;
  padding: 12px 8px;
  cursor: pointer;
  display: grid;
  gap: 2px;
  justify-items: center;
}

.date-tab small {
  font-weight: 500;
  font-size: 12px;
}

.date-tab.active {
  background: var(--primary-dark);
  color: #ffffff;
}

.date-tab:disabled {
  opacity: 0.45;
  cursor: default;
}

.month-cal {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 18px;
  margin-bottom: 18px;
}

.month-cal-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}

.month-cal-head strong {
  font-family: var(--font-sans);
  font-size: 18px;
  color: var(--ink);
  text-transform: capitalize;
}

.month-cal-nav {
  border: 0;
  background: none;
  color: var(--primary-dark);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 8px;
}

.month-cal-nav:hover:not(:disabled) {
  background: var(--primary-soft);
}

.month-cal-nav:disabled {
  opacity: 0.3;
  cursor: default;
}

.month-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  justify-items: center;
}

.month-cal-grid .dow {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  padding: 6px 0;
}

.month-cal-day {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.month-cal-day:hover:not(:disabled) {
  background: var(--primary-soft);
}

.month-cal-day:disabled {
  color: var(--muted);
  opacity: 0.45;
  cursor: default;
  font-weight: 450;
}

.month-cal-day.selected {
  background: var(--primary-dark);
  color: #ffffff;
}

.booking-day-group {
  margin-bottom: 18px;
}

.booking-day-group > strong {
  display: block;
  color: var(--ink);
  margin-bottom: 10px;
}

.franja {
  margin-bottom: 16px;
}

.franja-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 750;
  color: var(--ink);
  margin-bottom: 10px;
}

.franja-head svg {
  width: 20px;
  height: 20px;
  color: var(--amber);
}

.slot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.slot-chip {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--ink);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.slot-chip:hover,
.slot-chip:focus-visible {
  border-color: var(--primary-dark);
}

.slot-chip.selected {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #ffffff;
}

.booking-empty {
  color: var(--muted);
  margin: 8px 0 18px;
}

.booking-context {
  color: var(--muted);
  margin: -8px 0 14px;
}

.step-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 4px;
}

.field-hint {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

/* Paso 3: confirmación */

.booking-summary {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 16px 18px;
  margin-bottom: 18px;
  display: grid;
  gap: 4px;
}

.booking-summary strong {
  color: var(--primary-dark);
  font-family: var(--font-sans);
  font-size: 18px;
}

.booking-summary span {
  color: var(--text);
}

.booking-summary .payment-note {
  color: var(--muted);
  font-size: 14px;
  margin-top: 6px;
}

a.secondary-button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

@media (max-width: 520px) {
  .booking-shell {
    padding: 14px;
  }

  .booking-card {
    padding: 20px;
  }

  .service-card {
    padding-right: 56px;
  }
}

/* ============================================================
   Marca Agenda Nuez: mascota (la ardilla) y frases por sección
   ============================================================ */

.mascot-card {
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-glass);
  box-shadow: var(--shadow);
  padding: 16px 20px;
}

.mascot-card img {
  width: 116px;
  height: auto;
  flex: 0 0 auto;
  object-fit: contain;
}

.mascot-card strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.mascot-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.mascot-card.mascot-inline {
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
  margin-top: 20px;
}

.mascot-card.mascot-inline img {
  width: 100px;
}

/* Fase 10: recorrido de reserva completo. */

/* Botón de acción destructiva fuera de .row-actions (drawer de turno). */
.danger-link {
  color: #a4553f;
}

.danger-link:hover {
  color: #7f3c2a;
}

/* Bloque de reagendo en gestionar.html. */
.reschedule-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  text-align: left;
}

.reschedule-block label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.reschedule-block textarea {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 400;
  resize: vertical;
  background: var(--surface);
  color: var(--ink);
}

/* Lista de solicitudes: que el texto no empuje los botones. */
#reschedule-requests-list article strong,
#patient-recurrence-list article strong {
  flex: 1 1 100%;
}

#reschedule-requests-list article span,
#patient-recurrence-list article span {
  flex: 1 1 auto;
  text-align: left;
}
