/* css/visitas_registros.css */

html,
body {
  min-height: 100%;
  overflow-y: auto;
}

.vr-page {
  display: block;
}

.vr-top {
  flex: 0 0 auto;
}

.vr-bottom {
  display: block;
}

.vr-table-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}

.vr-table-scroll {
  padding: 0 12px 12px 12px;
}

.vr-table-scroll thead th,
.vr-tabla thead th {
  position: static;
}

.vr-titulo {
  color: #eb8c22;
  margin-bottom: 12px;
}

.vr-marco {
  background: #908075;
  border: 1px solid #d9e1ec;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
}

.vr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 14px;
}

.vr-bloque {
  background: #ffffff;
  border: 1px solid #ffffff;
  border-radius: 10px;
  padding: 12px;
  min-height: 140px;
}

.vr-bloque label {
  display: block;
  font-size: 13px;
  color: #333;
  margin-bottom: 6px;
}

.vr-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.vr-select,
.vr-input {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #cdd6e1;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  box-sizing: border-box;
}

.vr-input {
  margin-bottom: 12px;
}

.vr-btn-mini {
  padding: 8px 10px;
  background: #6384b1;
  border: 1px solid #cdd6e1;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

.vr-btn-mini:hover { background: #e4ecf7; }

.vr-btn-guardar {
  width: 100%;
  height: 100%;
  min-height: 140px;
  background: #2f6fed;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.vr-btn-guardar:hover { background: #2456b7; }

.vr-bloque-d { display: flex; align-items: center; }

.vr-estacionamientos-card {
  background: #444445;
  border: 1px solid #d9e1ec;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 16px;
}

.vr-est-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.vr-est-grid {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.vr-est {
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid #d0d7e5;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.estacionamiento-box,
.estacionamiento-box span,
.estacionamiento-box .label,
.vr-est,
.vr-est span,
.vr-est .reserva,
.vr-est .empresa {
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  white-space: normal;
}

.estacionamiento-box,
.vr-est {
  max-width: 100%;
  overflow: hidden;
  text-align: center;
}

.estacionamiento-box .label,
.vr-est .label {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  line-height: 1.1em;
  max-height: 2.2em;
}

.vr-est .num { display: block; font-size: 14px; }
.vr-est .area { display: block; font-size: 11px; margin-top: 2px; opacity: 0.9; }
.vr-est .reserva { display: block; font-size: 11px; margin-top: 4px; }
.vr-est .empresa { display: block; font-size: 11px; margin-top: 4px; color: inherit; }

.vr-est.libre { background: #27ae60; }
.vr-est.ocupado { background: #e74c3c; }
.vr-est.reservado { background: #f1c40f; color: #2c3e50; }

.vr-tabla-card {
  background: #444445;
  border: 1px solid #d9e1ec;
  border-radius: 10px;
  padding: 12px;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.vr-tabla-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.vr-tabla-head h3 { margin: 0; }

.vr-tabla-head input {
  padding: 8px 10px;
  border: 1px solid #cdd6e1;
  border-radius: 6px;
  width: 240px;
}

.table-container,
.vr-table-scroll {
  padding-bottom: 20px;
  box-sizing: border-box;
  display: block;
}

.table-container table {
  width: 100%;
  table-layout: fixed;
}

.footer {
  background-color: #333;
  color: #fff;
  text-align: center;
  padding: 10px;
}

.vr-tabla-wrapper {
  display: block;
}

.vr-tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
}

.vr-tabla th,
.vr-tabla td {
  border: 1px solid #d9e1ec;
  padding: 4px 6px;
  background: #fff;
}

.vr-tabla th {
  background: #99bdf8;
  color: #333;
}

.vr-tabla td { color: #444; }
.vr-tabla th:last-child,
.vr-tabla td:last-child {
  width: 250px;
}

/* Compactar columnas de valores cortos */
.vr-tabla th:nth-child(7),
.vr-tabla td:nth-child(7) { /* Patente */
  width: 90px;
  white-space: nowrap;
}
.vr-tabla th:nth-child(8),
.vr-tabla td:nth-child(8) { /* Tiempo */
  width: 70px;
  white-space: nowrap;
}
.vr-tabla th:nth-child(4),
.vr-tabla td:nth-child(4) { /* Piso */
  width: 70px;
  white-space: nowrap;
}

.vr-tabla .vr-tiempo {
  color: #0059f3;
  font-weight: 600;
}

.vr-btn {
  padding: 9px 12px;
  border: none;
  border-radius: 8px;
  background: #2f6fed;
  color: #fff;
  cursor: pointer;
}

.vr-btn.ghost {
  background: #eef2fb;
  color: #2f6fed;
  border: 1px solid #d0daf1;
}

.btn-ver {
  background: #27ae60;
  color: #fff;
  border: none;
}

.btn-ver:hover {
  background: #1f8c4d;
}

.vr-modal-detalle {
  max-width: 620px;
  width: 92vw;
  padding: 20px;
}
#vr_modal_ver .vr-modal-content.vr-modal-detalle {
  max-width: 1100px;
  width: 90vw;
}

.vr-detalle-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  background: #19386e;
}

.vr-detalle-title {
  margin: 2px 0 0;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.vr-detalle-subtitle {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  color: #99bdf8;
}

.vr-detalle-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.vr-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 24px;
  border: 1px solid #3a404a;
  background: #30353e;
  color: #ffffff;
  letter-spacing: 0.2px;
}

.vr-chip-tiempo::before { content: '⏱'; }

.vr-chip-patente {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  letter-spacing: 0.5px;
}

.vr-detalle-body {
  padding-right: 6px;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
  gap: 14px 18px;
  align-items: start;
}
#vr_modal_ver .vr-detalle-body {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
}

.vr-detalle-section {
  border-top: 1px solid #d4dce9;
  padding-top: 12px;
  margin-top: 12px;
  grid-column: 1;
}

.vr-section-head h4 {
  margin: 0 0 8px;
  color: #cdd6e1;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.vr-detalle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px 16px;
}

.vr-detalle-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  background: #dcdee2;
  border: 1px solid #111111;
  border-radius: 10px;
}

.vr-detalle-label {
  color: #000000;
  font-size: 12px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.vr-detalle-value {
  color: #000000;
  font-size: 18px;
  font-weight: 600;
  word-break: break-word;
}

.vr-detalle-note {
  padding: 12px;
  background: #323741;
  border: 1px dashed #4b5361;
  border-radius: 10px;
  color: #e8edf7;
  line-height: 1.5;
}

#vr_detalle_info_wrap {
  grid-column: 2;
  grid-row: 1 / span 4;
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}
#vr_modal_ver #vr_detalle_info_wrap {
  grid-row: 1 / -1;
}
.vr-detalle-note strong {
  display: block;
  margin-bottom: 6px;
  color: #fff;
  letter-spacing: 0.3px;
}

.vr-detalle-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  color: #9aa3b5;
  border: 1px solid transparent;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border 0.15s ease;
}

.vr-detalle-close:hover {
  background: #3a404a;
  color: #fff;
  border-color: #4a5260;
}

.vr-detalle-actions {
  margin-top: 14px;
}

.vr-btn.danger { background: #e74c3c; }
.vr-btn.action { padding: 7px 10px; font-size: 12px; }

.vr-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.vr-modal.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.vr-modal-content {
  background: #19386e;
  border: 1px solid #a9b8d1;
  border-radius: 14px;
  padding: 18px;
  min-width: 320px;
  max-width: 460px;
  box-shadow: 0 16px 50px rgba(183, 144, 144, 0.4);
  transform: translateY(8px);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.vr-modal.show .vr-modal-content {
  transform: translateY(0);
  opacity: 1;
}

.vr-modal-content.mini { min-width: 280px; }

.vr-modal-content h3 { margin-top: 0; margin-bottom: 10px; color: #fff; }

.vr-modal-content label {
  display: block;
  margin-top: 8px;
  font-size: 13px;
}

.vr-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.vr-textarea {
  width: 100%;
  border: 1px solid #cdd6e1;
  border-radius: 8px;
  padding: 10px;
  resize: vertical;
  box-sizing: border-box;
}

.vr-small { font-size: 12px; color: #fc9c3c; margin: 0 0 8px 0; }

.oculto { display: none !important; }

.opt-disabled,
option:disabled {
  color: #7a7a7a;
}

.vr-toggle{
  width: 100%;
  text-align: center;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.15);
  background: #908075;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 10px;
}

/* Panel animado */
.vr-panel{
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-8px);
  transition: max-height .35s ease, opacity .25s ease, transform .25s ease;
  will-change: max-height, opacity, transform;
}

/* Expandido */
.vr-panel.is-expanded{
  max-height: 2000px; /* suficientemente grande para el formulario */
  opacity: 1;
  transform: translateY(0);
}

/* Colapsado */
.vr-panel.is-collapsed{
  max-height: 0;
  opacity: 0;
  transform: translateY(-8px);
}

/* Ajustes TomSelect: resaltar selección con gris claro y texto negro */
.ts-dropdown .option.active,
.ts-dropdown .option.selected {
  background: #f2f2f2 !important;
  color: #111 !important;
}

.ts-control .item,
.ts-item-visible {
  background: #f2f2f2 !important;
  color: #111 !important;
}

@media (max-width: 720px) {
  .vr-grid { grid-template-columns: 1fr; }
  .vr-est-grid { flex-wrap: wrap; }
  .vr-detalle-body { display: block; }
  #vr_detalle_info_wrap {
    grid-column: auto;
    grid-row: auto;
    border-top: 1px solid #d4dce9;
    padding-top: 12px;
    margin-top: 12px;
  }
}
