/* Accesos y salidas: one row per car, entry and exit together. */
#live-visits { position: relative; margin: 0 0 18px; overflow: hidden; border: 1px solid rgba(16, 32, 26, 0.06); border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(16, 32, 26, 0.03), 0 8px 24px rgba(16, 32, 26, 0.04); }
/* Loading: a thin bar along the card's top edge, over whatever is shown. */
#live-visits::before { content: ""; position: absolute; z-index: 1; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, #143d2b, transparent) no-repeat; background-size: 40% 100%; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
#live-visits.is-loading::before { opacity: 1; animation: visits-bar 1.1s ease-in-out infinite; }
@keyframes visits-bar { from { background-position: -60% 0; } to { background-position: 160% 0; } }
.visit-row.is-skeleton:hover { background: none; }
.visit-row.is-skeleton > .visit-bone { display: block; width: 70%; height: 12px; padding: 0; border: 0; border-radius: 6px; background: linear-gradient(90deg, #f0f1ee, #f7f7f4, #f0f1ee); background-size: 200% 100%; animation: visits-shimmer 1.2s linear infinite; }
.visit-row.is-skeleton > .visit-plate { width: 72px; height: 22px; }
.visit-row.is-skeleton > .visit-state { width: 96px; height: 20px; }
.visit-row.is-skeleton > :is(.visit-amount, .visit-discount, .visit-total) { justify-self: end; width: 44px; }
@keyframes visits-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  #live-visits.is-loading::before { animation: none; background: #143d2b; opacity: 0.35; }
  .visit-row.is-skeleton > .visit-bone { animation: none; }
}
#live-visits .activity-list-heading { gap: 12px 16px; flex-wrap: wrap; }

.visits-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.visits-filters { display: contents; }
.visits-title { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title add" "sub add"; align-items: center; column-gap: 16px; width: 100%; }
.visits-title h2 { grid-area: title; }
.visits-title #visits-sub { grid-area: sub; margin: 0; }
.visits-title #visits-sub:has(> span) { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.visits-title #visits-sub > span { padding: 3px 8px; border-radius: 999px; background: #f3f4f1; color: #3d4a44; font-size: 12px; font-weight: 550; line-height: 1.35; }
.visits-actions { grid-area: add; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.visits-exit { display: inline-flex; align-items: center; justify-content: center; height: 34px; padding: 0 12px; border: 1px solid #9a3b2f; border-radius: 9px; background: #9a3b2f; color: #fff; font: inherit; font-size: 13px; font-weight: 550; white-space: nowrap; cursor: pointer; }
.visits-exit:hover:not(:disabled) { background: #842f25; }
.visits-exit:focus-visible { outline: 2px solid rgba(154, 59, 47, 0.45); outline-offset: 2px; }
.visits-exit:disabled { border-color: transparent; background: #e6e8e4; color: rgba(16, 32, 26, 0.38); cursor: default; }
.dash.is-signed-in .cta.visits-exit { width: 100%; height: 48px; border-color: #9a3b2f; background: #9a3b2f; color: #fff; font-size: 15px; font-weight: 600; }
.dash.is-signed-in .cta.visits-exit:hover:not(:disabled):not(.is-loading) { background: #842f25; }
.exit-free-panel > .lede { margin: 0; padding: 0 20px 16px; color: #5f6b64; font-size: 14px; line-height: 1.45; }
.exit-free-panel .form-error { margin: 0 20px 12px; }
.exit-free-panel .sheet-actions { display: grid; gap: 10px; padding: 0 20px 20px; }
.visits-add { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 12px 0 10px; border: 1px solid #143d2b; border-radius: 9px; background: #143d2b; color: #fff; font: inherit; font-size: 13px; font-weight: 550; white-space: nowrap; cursor: pointer; }
.visits-add:hover { background: #1c4f39; }
.visits-add:focus-visible { outline: 2px solid rgba(20, 61, 43, 0.35); outline-offset: 2px; }
.visits-add svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* Salidas por confirmar: exit photos the model matched, for a person. */
.photo-reviews { margin: 0 16px 16px; padding: 14px; border: 1px solid rgba(181, 120, 20, 0.22); border-radius: 14px; background: #fdf8ec; }
.photo-reviews-title { margin: 0; color: #10201a; font-size: 15px; font-weight: 650; }
.photo-reviews .photo-pair { max-width: 520px; }
.photo-reviews .form-error { margin: 8px 0 0; }

/* Agregar entrada */
.dash .entry-panel > .lede { margin: 0; padding: 0 20px 16px; color: #5f6b64; font-size: 14px; line-height: 1.45; }
.entry-form { display: grid; gap: 14px; padding: 0 20px; }
.entry-mode { display: flex; padding: 3px; border-radius: 12px; background: #eff0ec; }
.entry-mode button { flex: 1; height: 40px; border: 0; border-radius: 9px; background: transparent; color: #5f6b64; font: inherit; font-size: 14px; font-weight: 550; cursor: pointer; }
.entry-mode button:hover { color: #10201a; }
.entry-mode button[aria-pressed="true"] { background: #fff; color: #10201a; box-shadow: 0 1px 2px rgba(16, 32, 26, 0.08); }
.entry-mode button:focus-visible { outline: 2px solid rgba(20, 61, 43, 0.35); outline-offset: 2px; }
.entry-done { display: grid; gap: 12px; padding: 0 20px 20px; }
.entry-done[hidden] { display: none; }
.entry-done .dash-label { margin: 0; }
.entry-folio { margin: 0; padding: 16px 8px; border-radius: 12px; background: #f3f4f1; color: #10201a; font-family: var(--font-mono); font-size: 28px; font-weight: 600; letter-spacing: 0.14em; text-align: center; }
.entry-folio-note { margin: 0; color: #5f6b64; font-size: 14px; line-height: 1.45; }
.entry-done .sheet-actions { display: grid; gap: 10px; padding: 0; }
.entry-form .field { display: grid; gap: 6px; margin: 0; }
.entry-form .dash-label { margin: 0; }
.entry-form .control { width: 100%; box-sizing: border-box; }
.entry-time { font-variant-numeric: tabular-nums; }
.entry-plate { font-family: var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; }
.entry-plate::placeholder { font-family: var(--font-mono); letter-spacing: 0.06em; }
.entry-form .form-error { margin: 0; }
.entry-form .sheet-actions { padding: 6px 0 0; gap: 10px; }
.dash.is-signed-in .entry-form .sheet-actions .cta,
.dash.is-signed-in .entry-form .sheet-actions .cta-line,
.dash.is-signed-in .entry-done .sheet-actions .cta,
.dash.is-signed-in .entry-done .sheet-actions .cta-line { width: 100%; height: 48px; margin: 0; border-radius: 12px; font-size: 15px; font-weight: 600; }
.visits-find { display: inline-flex; align-items: center; gap: 8px; width: 220px; height: 34px; padding: 0 12px; border: 1px solid rgba(16, 32, 26, 0.1); border-radius: 9px; background: #fff; color: #9aa39d; }
.visits-find:focus-within { border-color: rgba(20, 61, 43, 0.35); box-shadow: 0 0 0 4px rgba(20, 61, 43, 0.08); }
.visits-find svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
#visits-find { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: none; color: #10201a; font: inherit; font-size: 13px; }
#visits-find::placeholder { color: #9aa39d; }
.visits-type { position: relative; display: inline-flex; }
.visits-type::after { content: ""; position: absolute; top: 50%; right: 12px; width: 0; height: 0; margin-top: -2px; border-inline: 4px solid transparent; border-top: 5px solid #8b958f; pointer-events: none; }
.visits-type select { height: 34px; padding: 0 30px 0 12px; border: 1px solid rgba(16, 32, 26, 0.1); border-radius: 9px; outline: 0; background: #fff; color: #10201a; font: inherit; font-size: 13px; appearance: none; cursor: pointer; }
.visits-type select:focus-visible { border-color: rgba(20, 61, 43, 0.35); box-shadow: 0 0 0 4px rgba(20, 61, 43, 0.08); }
/* Desktop sorts from the column headers; the list is the phone's. */
.visits-sort { display: none; }
#live-visits .form-error { margin: 0 20px 14px; }

.visits-head,
.visit-row {
  display: grid;
  grid-template-columns: minmax(104px, 1fr) minmax(110px, 1fr) minmax(90px, 0.9fr) minmax(90px, 0.9fr) minmax(70px, 0.7fr) 72px 80px 72px 128px;
  align-items: center;
  gap: 14px;
}
.visits-head {
  padding: 10px 20px;
  border-block: 1px solid #f0f1ee;
  background: #fbfbf9;
  color: #8b958f;
  font-size: 12px;
  font-weight: 500;
}
.visits-head button { display: inline-flex; align-items: center; gap: 4px; min-width: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; white-space: nowrap; }
.visits-head button:hover,
.visits-head button.is-sorted { color: #10201a; }
.visits-head button:focus-visible { outline: 2px solid rgba(20, 61, 43, 0.35); outline-offset: 3px; border-radius: 4px; }
.visits-head button.is-sorted::after { content: ""; width: 0; height: 0; border-inline: 4px solid transparent; border-top: 5px solid currentColor; }
.visits-head button[data-dir="asc"]::after { border-top: 0; border-bottom: 5px solid currentColor; }
.visits-head button { justify-self: start; }
.visits-head .is-num { justify-self: end; }
.visit-amount { text-align: right; }
.visits-rows { margin: 0; padding: 0; list-style: none; }
.visit-row { min-height: 48px; padding: 9px 20px; border-bottom: 1px solid #f3f4f1; box-sizing: border-box; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.visit-row:last-child { border-bottom: 0; }
.visit-row:hover { background: #fbfbf9; }
.visit-plate { justify-self: start; padding: 3px 8px; border: 1px solid rgba(16, 32, 26, 0.08); border-radius: 7px; background: #f3f4f1; color: #10201a; font-family: var(--font-mono); font-size: 12.5px; font-weight: 550; letter-spacing: 0.04em; white-space: nowrap; }
.visit-when,
.visit-duration { color: #10201a; white-space: nowrap; }
.visit-duration { color: #5f6b64; }
.visit-amount { color: #5f6b64; }
.visit-total { color: #10201a; font-weight: 550; }
.visits-rows .is-empty { color: #b3bab5; }

.visit-type { justify-self: start; color: #7b867f; white-space: nowrap; }
.visit-type[data-state="permit"] { color: #3f6c9a; }
.visit-type[data-state="customer"] { color: #2f7a52; }
.visit-state { justify-self: start; padding: 2px 8px; border-radius: 6px; background: #f3f4f1; color: #5f6b64; font-size: 12px; font-weight: 500; white-space: nowrap; }
.visit-state.is-empty { padding: 0; background: none; }
.visit-state:is([data-state="paid"], [data-state="cash"]) { background: #e6efe8; color: #2f7a52; }
.visit-state[data-state="unpaid"] { background: #f6efdf; color: #8a5a1c; }
.visit-state[data-state="permit"] { background: #e9eff6; color: #3f6c9a; }
.visits-empty { margin: 0; padding: 40px 20px; color: #8b958f; text-align: center; }
#visits-more { margin: 16px auto; }

@media (max-width: 1100px) {
  .visits-head,
  .visit-row { grid-template-columns: minmax(96px, 1fr) 100px 70px 70px 64px 60px 60px 64px 120px; gap: 10px; }
  .visits-head,
  .visit-row { padding-inline: 16px; }
}
@media (max-width: 760px) {
  .dash.is-signed-in [data-view=live] .dash-lot-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "title cal refresh" "days days days"; align-items: start; column-gap: 8px; }
  .dash.is-signed-in [data-view=live] .dash-lot-head > div { grid-area: title; }
  .dash.is-signed-in [data-view=live] .dash-head-actions { display: contents; }
  .dash.is-signed-in [data-view=live] .live-calendar { grid-area: cal; margin-top: 28px; }
  .dash.is-signed-in [data-view=live] #live-refresh { grid-area: refresh; margin-top: 28px; }
  .dash.is-signed-in [data-view=live] #live-days { grid-area: days; display: flex; min-width: 0; margin-top: 4px; overflow-x: auto; }
  .dash.is-signed-in [data-view=live] #live-days button { flex: none; }
  #live-visits .activity-list-heading { align-items: stretch; padding: 14px 16px 12px; }
  .visits-title { grid-template-areas: "title title" "add add" "sub sub"; row-gap: 10px; }
  .visits-actions { flex-direction: row; flex-wrap: nowrap; justify-content: flex-start; gap: 8px; }
  .visits-add { order: -1; flex: 1 1 0; height: 44px; border-radius: 12px; font-size: 14px; }
  .visits-exit { flex: 1.15 1 0; height: 44px; padding: 0 8px; border-color: rgba(154, 59, 47, 0.4); border-radius: 12px; background: #fff; color: #9a3b2f; font-size: 12.5px; }
  .visits-exit:hover:not(:disabled) { background: #fdf6f4; }
  .visits-title #visits-sub { margin-top: 0; }
  .dash.is-signed-in .entry-form .sheet-actions .cta,
  .dash.is-signed-in .entry-form .sheet-actions .cta-line { height: 52px; font-size: 16px; }
  .entry-form .control { height: 48px; font-size: 16px; }
  .visits-toolbar { display: flex; flex-direction: column; align-items: stretch; width: 100%; gap: 10px; }
  .visits-find { order: 2; flex: none; width: 100%; height: 44px; }
  #visits-view { order: 1; display: flex; width: 100%; }
  #visits-view button { flex: 1; height: 40px; font-size: 14px; font-weight: 600; }
  .visits-filters { order: 3; display: flex; gap: 8px; }
  .visits-filters .visits-type:not(.visits-sort) { flex: 1.4 1 0; }
  .visits-type { min-width: 0; }
  .visits-sort { display: inline-flex; flex: 0.85 1 0; }
  .visits-type select { width: 100%; height: 44px; font-size: 16px; text-overflow: ellipsis; }
  .visits-head { display: none; }
  .visit-row {
    grid-template-columns: auto auto minmax(0, 1fr);
    grid-template-areas:
      "plate plate state"
      "entered left amount"
      "type type duration";
    gap: 6px 8px;
    padding: 12px 16px;
  }
  .visit-row:has(> .visit-discount:not(.is-empty)) {
    grid-template-areas:
      "plate plate state"
      "entered left amount"
      "type type duration"
      "list list discount";
  }
  .visit-plate { grid-area: plate; }
  .visit-state { grid-area: state; justify-self: end; }
  .visit-type { grid-area: type; font-size: 12.5px; }
  .visit-row > .visit-amount:not(.visit-total) { display: none; }
  .visit-row:has(> .visit-discount:not(.is-empty)) > :is(.visit-list, .visit-discount) { display: block; font-size: 12.5px; }
  .visit-list { grid-area: list; justify-self: start; }
  .visit-discount { grid-area: discount; justify-self: end; }
  .visit-row > :is(.visit-list, .visit-discount)::before { content: attr(data-label) " "; color: #9aa39d; }
  .visit-total { grid-area: amount; justify-self: end; font-size: 14px; }
  .visit-entered { grid-area: entered; }
  .visit-left { grid-area: left; }
  .visit-left::before { content: "→ "; color: #9aa39d; }
  .visit-duration { grid-area: duration; justify-self: end; font-size: 12.5px; color: #8b958f; }
  .visit-row .is-empty { display: none; }
  .visit-row.is-skeleton > :is(.visit-discount, .visit-amount:not(.visit-total)) { display: none; }
  .visit-row.is-skeleton > .visit-left::before { content: none; }
  .visit-row.is-skeleton > .visit-bone { width: 56px; }
  .visit-row.is-skeleton > .visit-plate { width: 72px; }
  .visit-row.is-skeleton > .visit-state { width: 96px; }
}

.visit-state[data-state="refunded"] { background: #fbeae4; color: #b9603f; }
