/* ==========================================================================
   CRM Servicios · Villa Manglar — Hoja de estilos base
   Paleta negro y grises. Tokens de diseño compartidos por todas las páginas rediseñadas.
   ========================================================================== */

:root {
  /* Colores */
  --vm-ink:        #111111;
  --vm-ink-soft:   #3d3d3d;
  --vm-muted:      #6e6e6e;
  --vm-line:       #dddddd;
  --vm-bg:         #f3f3f3;
  --vm-surface:    #ffffff;
  --vm-accent:     #111111;   /* negro */
  --vm-accent-ink: #ffffff;
  --vm-accent-hov: #3a3a3a;
  --vm-gray-200:   #e6e6e6;
  --vm-danger:     #b3261e;
  --vm-danger-bg:  #fdecea;
  --vm-ok:         #2b2b2b;
  --vm-ok-bg:      #ececec;
  --vm-focus:      #555555;

  /* Tipografía */
  --vm-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --vm-font-mono: ui-monospace, "Courier New", monospace;

  /* Forma */
  --vm-radius:    12px;
  --vm-radius-sm: 8px;
  --vm-shadow:    0 1px 2px rgba(0,0,0,.06), 0 12px 32px -12px rgba(0,0,0,.18);
  --vm-tap:       48px;   /* altura mínima táctil */
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--vm-font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--vm-ink);
  background: var(--vm-bg);
}

a { color: var(--vm-accent); }
a:hover { color: var(--vm-accent-hov); }

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

.vm-sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

/* ---------- Formularios ---------- */

.vm-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }

.vm-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--vm-ink-soft);
}

.vm-input {
  width: 100%;
  min-height: var(--vm-tap);
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;            /* evita zoom automático en iOS */
  color: var(--vm-ink);
  background: var(--vm-surface);
  border: 1px solid var(--vm-line);
  border-radius: var(--vm-radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.vm-input::placeholder { color: #a3a3a3; }
.vm-input:hover { border-color: #c4c4c4; }
.vm-input:focus {
  outline: none;
  border-color: var(--vm-focus);
  box-shadow: 0 0 0 3px rgba(0,0,0,.12);
}

.vm-input-wrap { position: relative; }
.vm-input-wrap .vm-input { padding-right: 84px; }
.vm-input-addon {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  min-height: 36px; padding: 0 12px;
  font: inherit; font-size: 14px; font-weight: 600;
  color: var(--vm-accent);
  background: transparent; border: 0; border-radius: 6px;
  cursor: pointer;
}
.vm-input-addon:hover { background: rgba(0,0,0,.06); }

.vm-check {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px;
  font-size: 15px; color: var(--vm-ink-soft);
  cursor: pointer; user-select: none;
}
.vm-check input {
  width: 20px; height: 20px; margin: 0;
  accent-color: var(--vm-accent);
  cursor: pointer;
}

/* ---------- Botones ---------- */

.vm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--vm-tap);
  padding: 12px 20px;
  font: inherit; font-size: 16px; font-weight: 600; letter-spacing: .02em;
  text-decoration: none;
  color: var(--vm-accent-ink);
  background: var(--vm-accent);
  border: 1px solid transparent;
  border-radius: var(--vm-radius-sm);
  cursor: pointer;
  transition: background-color .15s, transform .05s;
}
.vm-btn:hover { background: var(--vm-accent-hov); color: var(--vm-accent-ink); }
.vm-btn:active { transform: translateY(1px); }
.vm-btn[disabled] { opacity: .6; cursor: progress; }
.vm-btn--block { width: 100%; }

/* ---------- Avisos ---------- */

.vm-alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px;
  margin-bottom: 20px;
  font-size: 15px;
  border-radius: var(--vm-radius-sm);
  border: 1px solid transparent;
}
.vm-alert--error { color: var(--vm-danger); background: var(--vm-danger-bg); border-color: #f5c6c2; }
.vm-alert--ok    { color: var(--vm-ok);     background: var(--vm-ok-bg);     border-color: #d6d6d6; }

/* ==========================================================================
   Página de acceso
   ========================================================================== */

.vm-auth {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(0,0,0,.05), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(0,0,0,.04), transparent 60%),
    var(--vm-bg);
}

.vm-auth__card {
  width: 100%;
  max-width: 420px;
  padding: 36px 32px 28px;
  background: var(--vm-surface);
  border: 1px solid var(--vm-line);
  border-radius: var(--vm-radius);
  box-shadow: var(--vm-shadow);
}

.vm-auth__logo {
  display: block;
  width: 180px; max-width: 70%; height: auto;
  margin: 0 auto 24px;
}

.vm-auth__title {
  margin: 0 0 4px;
  font-size: 24px; font-weight: 700; line-height: 1.25;
  text-align: center;
}

.vm-auth__subtitle {
  margin: 0 0 28px;
  font-size: 15px;
  color: var(--vm-muted);
  text-align: center;
}

.vm-auth__row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 4px 16px;
  margin: -4px 0 20px;
}
.vm-auth__row a { font-size: 15px; padding: 10px 0; }

.vm-auth__back {
  margin: 16px 0 0;
  text-align: center;
  font-size: 15px;
}
.vm-auth__back a { display: inline-block; padding: 10px 0; }

.vm-auth__footer {
  margin: 24px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--vm-line);
  font-size: 13px;
  color: var(--vm-muted);
  text-align: center;
}

@media (max-width: 480px) {
  .vm-auth { place-items: start center; padding-top: 32px; }
  .vm-auth__card { padding: 28px 20px 20px; }
  .vm-auth__title { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ==========================================================================
   Páginas internas: plantilla (cabecera, menú, contenido)
   Escritorio primero; en pantallas estrechas el menú se pliega
   y las tablas .vm-table--cards se convierten en tarjetas.
   ========================================================================== */

.vm-app { background: var(--vm-bg); }

/* ---------- Botones extra ---------- */

.vm-btn--ghost {
  color: var(--vm-ink); background: var(--vm-surface); border-color: var(--vm-line);
}
.vm-btn--ghost:hover { color: var(--vm-ink); background: var(--vm-gray-200); }
.vm-btn--sm { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.vm-btn--icon { min-width: 44px; padding: 8px 12px; font-size: 22px; line-height: 1; }
.vm-btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* ---------- Contenido ---------- */

.vm-main { max-width: 1280px; margin: 0 auto; padding: 28px 24px 48px; }

.vm-page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 16px 24px; margin-bottom: 20px;
}
.vm-page-title { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 700; }
.vm-page-sub { margin: 4px 0 0; color: var(--vm-muted); font-size: 15px; }

.vm-datebar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vm-input--date { width: auto; min-width: 170px; min-height: 44px; padding: 8px 12px; }

.vm-alert--flash { margin-bottom: 20px; }

.vm-section { transition: opacity .15s; }
.vm-section.is-loading { opacity: .45; pointer-events: none; }

.vm-muted { color: var(--vm-muted); }
.vm-num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Cifras de resumen ---------- */

.vm-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
  margin-bottom: 20px;
}
.vm-stat {
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px 16px;
  background: var(--vm-surface); border: 1px solid var(--vm-line); border-radius: var(--vm-radius-sm);
}
.vm-stat__value { font-size: 24px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.vm-stat__label { font-size: 13px; color: var(--vm-muted); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Tabla ---------- */

.vm-table-wrap {
  background: var(--vm-surface);
  border: 1px solid var(--vm-line); border-radius: var(--vm-radius);
  overflow-x: auto;
}
.vm-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.vm-table th, .vm-table td { padding: 12px 16px; text-align: left; vertical-align: middle; }
.vm-table thead th {
  font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--vm-muted); background: #fafafa;
  border-bottom: 1px solid var(--vm-line);
  white-space: nowrap;
}
.vm-table tbody tr + tr > * { border-top: 1px solid #ececec; }
.vm-table tbody tr:hover > * { background: #fafafa; }
.vm-table tbody th { font-weight: 600; }
.vm-table tr.is-open > * { background: #f7f7f7; }

.vm-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; font-size: 13px; font-weight: 600;
  border-radius: 999px; white-space: nowrap;
}
.vm-badge--live { color: #fff; background: var(--vm-ink); }
.vm-badge--live::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff;
  animation: vm-pulse 1.6s ease-in-out infinite;
}
@keyframes vm-pulse { 50% { opacity: .3; } }

/* ---------- Estado vacío ---------- */

.vm-empty {
  padding: 48px 24px; text-align: center;
  background: var(--vm-surface);
  border: 1px dashed #cfcfcf; border-radius: var(--vm-radius);
}
.vm-empty__title { margin: 0 0 4px; font-size: 18px; font-weight: 700; }
.vm-empty__text { margin: 0; color: var(--vm-muted); }

/* ---------- Tarjetas y rejilla de 2 columnas ---------- */

.vm-grid-2 {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px; align-items: start;
}
.vm-card {
  padding: 24px;
  background: var(--vm-surface);
  border: 1px solid var(--vm-line); border-radius: var(--vm-radius);
}
.vm-card__title { margin: 0 0 4px; font-size: 18px; font-weight: 700; }
.vm-card__sub { margin: 0 0 20px; font-size: 14px; color: var(--vm-muted); }
.vm-card__note { margin: 16px 0 0; font-size: 13px; color: var(--vm-muted); }
.vm-card .vm-btn { margin-top: 4px; }

/* ---------- Ficha de usuario ---------- */

.vm-profile { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.vm-avatar {
  flex: none; display: grid; place-items: center;
  width: 64px; height: 64px; border-radius: 50%;
  font-size: 22px; font-weight: 700; letter-spacing: .02em;
  color: #fff; background: var(--vm-ink);
}
.vm-profile__name { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.vm-profile__mail { margin: 2px 0 0; font-size: 15px; color: var(--vm-muted); overflow-wrap: anywhere; }

.vm-dl { margin: 0; border-top: 1px solid var(--vm-line); }
.vm-dl__row {
  display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 4px 16px;
  padding: 12px 0; border-bottom: 1px solid #ececec;
}
.vm-dl dt { font-size: 13px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--vm-muted); }
.vm-dl dd { margin: 0; font-size: 15px; overflow-wrap: anywhere; }

.vm-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.vm-tag {
  display: inline-block; padding: 2px 10px;
  font-size: 13px; font-weight: 600;
  color: var(--vm-ink); background: var(--vm-gray-200); border-radius: 999px;
}

@media (max-width: 860px) {
  .vm-grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .vm-card { padding: 18px 16px; }
  .vm-dl__row { grid-template-columns: minmax(0, 1fr); }
  .vm-avatar { width: 52px; height: 52px; font-size: 18px; }
}

/* ---------- Móvil: tarjetas ---------- */

@media (max-width: 719px) {
  .vm-main { padding: 20px 16px 40px; }
  .vm-page-head { flex-direction: column; align-items: stretch; }
  .vm-page-title { font-size: 22px; }
  .vm-datebar { display: grid; grid-template-columns: auto 1fr auto auto; }
  .vm-input--date { min-width: 0; width: 100%; }

  .vm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .vm-stat { padding: 12px; }
  .vm-stat__value { font-size: 20px; }

  .vm-table-wrap { background: transparent; border: 0; border-radius: 0; overflow: visible; }
  .vm-table--cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .vm-table--cards, .vm-table--cards tbody, .vm-table--cards tr,
  .vm-table--cards th, .vm-table--cards td { display: block; width: 100%; }
  .vm-table--cards tbody { display: flex; flex-direction: column; gap: 10px; }
  .vm-table--cards tr {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px;
    padding: 14px 16px;
    background: var(--vm-surface);
    border: 1px solid var(--vm-line); border-radius: var(--vm-radius);
  }
  .vm-table--cards tbody tr + tr > * { border-top: 0; }
  .vm-table--cards tr > * { padding: 0; background: transparent !important; }
  .vm-table--cards tr.is-open { border-color: var(--vm-ink); }
  .vm-table--cards tbody th { grid-column: 1 / -1; font-size: 17px; }
  .vm-hide-sm { display: none !important; }
  .vm-table--cards td::before {
    content: attr(data-label);
    display: block; font-size: 12px; font-weight: 600; letter-spacing: .04em;
    text-transform: uppercase; color: var(--vm-muted);
  }
}

@media print {
  .vm-datebar { display: none !important; }
  .vm-main { padding: 0; max-width: none; }
  .vm-table-wrap { border: 0; }
}

/* ==========================================================================
   Informes: barra de acciones, filtros, tabla ordenable
   ========================================================================== */

[hidden] { display: none !important; }

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

.vm-select {
  width: auto; min-height: 44px; padding: 8px 36px 8px 12px;
  appearance: none; -webkit-appearance: none;
  background: var(--vm-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23555' stroke-width='1.8'/%3E%3C/svg%3E") no-repeat right 12px center;
  cursor: pointer;
}

.vm-filters {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(0, 1fr)) auto;
  align-items: end; gap: 12px;
  padding: 16px;
  margin-bottom: 12px;
  background: var(--vm-surface);
  border: 1px solid var(--vm-line); border-radius: var(--vm-radius);
}
.vm-filters__search { position: relative; }
.vm-filters__search .vm-input { min-height: 44px; padding: 8px 12px 8px 38px; }
.vm-filters__icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--vm-muted); pointer-events: none; }
.vm-filters__field { display: flex; flex-direction: column; gap: 4px; margin: 0; min-width: 0; }
.vm-filters__field > span {
  font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--vm-muted);
}
.vm-filters__field .vm-select { width: 100%; }
.vm-filters__reset { min-height: 44px; }

.vm-results { margin: 0 0 10px; font-size: 14px; color: var(--vm-muted); }

.vm-r { text-align: right !important; }
.vm-sub { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--vm-muted); word-break: break-word; }

/* Cabeceras ordenables */
.vm-table--sort thead th { padding: 0; }
.vm-sort {
  display: inline-flex; align-items: center; gap: 6px;
  width: 100%; padding: 12px 16px;
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit;
  background: none; border: 0; cursor: pointer; text-align: inherit;
}
.vm-r .vm-sort { justify-content: flex-end; }
.vm-sort:hover { color: var(--vm-ink); }
.vm-sort__ic { width: 10px; height: 12px; opacity: .35;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='12' viewBox='0 0 10 12'%3E%3Cpath d='M1 4.5 5 1l4 3.5M1 7.5 5 11l4-3.5' fill='none' stroke='%23111' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat center; }
th[aria-sort] .vm-sort { color: var(--vm-ink); }
th[aria-sort] .vm-sort__ic { opacity: 1; }
th[aria-sort="ascending"] .vm-sort__ic {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='12' viewBox='0 0 10 12'%3E%3Cpath d='M1 7.5 5 4l4 3.5' fill='none' stroke='%23111' stroke-width='1.8'/%3E%3C/svg%3E"); }
th[aria-sort="descending"] .vm-sort__ic {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='12' viewBox='0 0 10 12'%3E%3Cpath d='M1 4.5 5 8l4-3.5' fill='none' stroke='%23111' stroke-width='1.8'/%3E%3C/svg%3E"); }

/* Estados de reserva (solo grises) */
.vm-badge--est0 { color: var(--vm-ink); background: var(--vm-surface); border: 1px solid #9a9a9a; }
.vm-badge--est1 { color: #fff; background: var(--vm-ink); }
.vm-badge--est2 { color: var(--vm-muted); background: var(--vm-gray-200); text-decoration: line-through; }
.vm-table tr.is-cancelled > * { color: var(--vm-muted); }

@media (max-width: 1080px) {
  .vm-filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .vm-filters__search { grid-column: 1 / -2; }
  .vm-filters__reset { grid-column: -2 / -1; }
}

@media (max-width: 719px) {
  .vm-actions { display: grid; grid-template-columns: 1fr auto; }
  .vm-actions .vm-select { width: 100%; }
  .vm-filters { grid-template-columns: 1fr 1fr; padding: 12px; gap: 10px; }
  .vm-filters__search { grid-column: 1 / -1; }
  .vm-filters__reset { grid-column: 1 / -1; }
  .vm-table--cards .vm-r { text-align: left !important; }
}

@media print {
  .vm-actions, .vm-filters, .vm-header, .vm-footer { display: none !important; }
  .vm-sort__ic { display: none; }
}

/* Filas que abren un detalle */
.vm-row-link { cursor: pointer; }
.vm-rowlink { color: inherit; text-decoration: none; }
.vm-rowlink:hover, .vm-row-link:hover .vm-rowlink { text-decoration: underline; text-underline-offset: 3px; }

/* ==========================================================================
   Formulario de nueva reserva (reserva.php / reserva_colaborador.php)
   ========================================================================== */

.vm-req { color: var(--vm-danger); font-weight: 700; }
.vm-help { margin: 2px 0 0; font-size: 13px; color: var(--vm-muted); }

.vm-form-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 16px;
}
.vm-reserva .vm-field { margin-bottom: 16px; }
.vm-reserva .vm-select { width: 100%; }
.vm-textarea { min-height: 110px; resize: vertical; line-height: 1.45; }

/* Errores en el propio campo */
.vm-field.is-invalid .vm-input { border-color: var(--vm-danger); box-shadow: 0 0 0 3px rgba(179,38,30,.12); }
.vm-field__error { margin: 2px 0 0; font-size: 13px; font-weight: 600; color: var(--vm-danger); }

/* Acompañantes */
.vm-section-title { margin: 28px 0 12px; font-size: 18px; font-weight: 700; }
.vm-acomp__list {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px; align-items: start;
}
.vm-acomp__item .vm-card__title { margin-bottom: 16px; }

/* Barra de confirmación: fija abajo mientras se rellena */
.vm-submitbar {
  position: sticky; bottom: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 24px; padding: 14px 20px;
  background: var(--vm-surface);
  border: 1px solid var(--vm-line); border-radius: var(--vm-radius);
  box-shadow: 0 -8px 24px -16px rgba(0,0,0,.25);
}
.vm-submitbar__resumen { margin: 0; font-size: 15px; font-weight: 600; color: var(--vm-ink-soft); }
.vm-submitbar .vm-btn { min-width: 220px; }

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

/* ---------- Pasos y disponibilidad ---------- */
.vm-paso1 { margin-bottom: 20px; }
.vm-paso__head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.vm-paso__head .vm-card__sub { margin-bottom: 0; }
.vm-paso__num {
  flex: none; display: grid; place-items: center;
  width: 30px; height: 30px; margin-top: -2px;
  font-size: 15px; font-weight: 700; color: #fff; background: var(--vm-ink); border-radius: 50%;
}
.vm-fechas {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 0 16px; align-items: end;
}
.vm-disp {
  display: flex; align-items: center; gap: 10px;
  min-height: 48px; margin-bottom: 16px; padding: 10px 14px;
  font-size: 15px; font-weight: 600;
  border: 1px solid var(--vm-line); border-radius: var(--vm-radius-sm);
  background: #fafafa; color: var(--vm-muted);
}
.vm-disp__icon { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 800; line-height: 1; }
.vm-disp[data-estado="vacio"] .vm-disp__icon { border: 2px dashed #bdbdbd; }
.vm-disp[data-estado="comprobando"] .vm-disp__icon { border: 2px solid #d0d0d0; border-top-color: var(--vm-ink); animation: vm-giro .8s linear infinite; }
.vm-disp[data-estado="libre"] { color: var(--vm-ink); background: var(--vm-surface); border-color: var(--vm-ink); }
.vm-disp[data-estado="libre"] .vm-disp__icon { color: #fff; background: var(--vm-ink); }
.vm-disp[data-estado="libre"] .vm-disp__icon::before { content: "✓"; }
.vm-disp[data-estado="ocupado"], .vm-disp[data-estado="error"] { color: var(--vm-danger); background: var(--vm-danger-bg); border-color: #f5c6c2; }
.vm-disp[data-estado="ocupado"] .vm-disp__icon, .vm-disp[data-estado="error"] .vm-disp__icon { color: #fff; background: var(--vm-danger); }
.vm-disp[data-estado="ocupado"] .vm-disp__icon::before, .vm-disp[data-estado="error"] .vm-disp__icon::before { content: "!"; }
.vm-disp__extra { margin: -4px 0 0; font-size: 14px; color: var(--vm-ink-soft); }
@keyframes vm-giro { to { transform: rotate(360deg); } }

@media (max-width: 860px) {
  .vm-fechas { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .vm-disp { grid-column: 1 / -1; }
}
@media (max-width: 400px) {
  .vm-fechas { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Calendario dentro del paso 1 ---------- */
.vm-paso__headtxt { flex: 1; min-width: 0; }
.vm-cal-toggle { flex: none; }
.vm-linkbtn {
  padding: 0; font: inherit; font-weight: 600; color: var(--vm-ink);
  background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.vm-calpanel {
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--vm-line);
}
.vm-calpanel__bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px 16px; margin-bottom: 12px;
}
.vm-calpanel__hint { margin: 0; font-size: 15px; color: var(--vm-ink-soft); }
.vm-calpanel__tools { display: flex; align-items: center; gap: 8px; }
.vm-calpanel__year { min-height: 36px; padding-top: 4px; padding-bottom: 4px; font-size: 15px; }
.vm-calpanel__body { max-height: 70vh; overflow: auto; transition: opacity .15s; }
.vm-calpanel__body.is-loading { opacity: .45; pointer-events: none; }
@media (max-width: 560px) {
  .vm-paso__head { flex-wrap: wrap; }
  .vm-cal-toggle { width: 100%; }
  .vm-calpanel__body { max-height: none; overflow: visible; }
}

/* ---------- Diálogo modal ---------- */
.vm-dialog {
  width: min(440px, calc(100vw - 32px));
  margin: auto; padding: 0;
  color: var(--vm-ink); background: var(--vm-surface);
  border: 1px solid var(--vm-line); border-radius: var(--vm-radius);
  box-shadow: 0 24px 64px -16px rgba(0,0,0,.35);
}
.vm-dialog::backdrop { background: rgba(17,17,17,.45); }
.vm-dialog__body { margin: 0; padding: 28px 24px 22px; text-align: center; }
.vm-dialog__icon {
  display: grid; place-items: center;
  width: 52px; height: 52px; margin: 0 auto 14px;
  font-size: 26px; font-weight: 800; line-height: 1;
  color: #fff; background: var(--vm-ink); border-radius: 50%;
}
.vm-dialog__title { margin: 0 0 8px; font-size: 20px; font-weight: 700; }
.vm-dialog__text { margin: 0 0 22px; font-size: 15px; line-height: 1.5; color: var(--vm-ink-soft); }
.vm-dialog__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.vm-dialog__dl { margin: 0 0 20px; text-align: left; border-top: 1px solid var(--vm-line); }
.vm-dialog__dl > div {
  display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px;
  padding: 9px 0; border-bottom: 1px solid #ececec;
}
.vm-dialog__dl dt { font-size: 13px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--vm-muted); }
.vm-dialog__dl dd { margin: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.vm-dialog__warn {
  margin: -6px 0 18px; padding: 10px 12px; text-align: left;
  font-size: 14px; font-weight: 600; color: var(--vm-danger);
  background: var(--vm-danger-bg); border: 1px solid #f5c6c2; border-radius: var(--vm-radius-sm);
}
.vm-dialog__actions .vm-btn { min-width: 150px; }
@media (max-width: 480px) {
  .vm-dialog__actions { flex-direction: column-reverse; }
  .vm-dialog__actions .vm-btn { width: 100%; }
}
@media (prefers-reduced-motion: no-preference) {
  .vm-dialog[open] { animation: vm-dlg-in .16s ease-out; }
  @keyframes vm-dlg-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
}
@media (max-width: 560px) {
  .vm-form-grid { grid-template-columns: minmax(0, 1fr); }
  .vm-submitbar { flex-direction: column; align-items: stretch; padding: 12px; gap: 10px;
                  border-radius: var(--vm-radius) var(--vm-radius) 0 0; margin-left: -16px; margin-right: -16px; }
  .vm-submitbar .vm-btn { min-width: 0; width: 100%; }
  .vm-submitbar__resumen { text-align: center; font-size: 14px; }
}
