/* El resto de la app fija el alto y no deja bajar (body { overflow: hidden }). El portal
   lleva su propio scroll para que se llegue al calendario entero y al mapa del fondo. */
#portal { height: 100vh; height: 100dvh; overflow-y: auto; -webkit-overflow-scrolling: touch; background: #f4f6f2; color: #14211d; }
#portal header { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: #14211d; color: white; }
#portal header strong { letter-spacing: .08em; }
#portal header span { color: #c9d6ce; margin-right: auto; }
#portal header button { background: transparent; color: white; border: 1px solid #3d5248; }
#portal-root { max-width: 720px; margin: 0 auto; padding: 18px 16px 48px; }
#portal h1 { font: 700 28px/1.15 system-ui, sans-serif; margin: 8px 0 6px; }
#portal .help { color: #4d5c55; margin: 0 0 16px; }
#portal .banner { background: #e7f2ea; border: 1px solid #b7d7c4; border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; }
#portal label { font-size: 13px; }
#portal select, #portal input[type="date"] { font-size: 18px; padding: 14px; }
#portal .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#portal .primary { width: 100%; margin-top: 12px; font-size: 18px; padding: 16px; }
#portal .error { min-height: 1.2em; }
.month-nav { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 8px; }
.month-nav button { background: white; color: #14211d; border: 1px solid #dbe1d9; }
.weekdays, .month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.weekdays span { text-align: center; font-size: 12px; color: #68756f; }
.day { min-height: 46px; border: 1px solid #dbe1d9; border-radius: 8px; background: white; color: #14211d; font-weight: 650; }
.day.muted { color: transparent; border-color: transparent; background: transparent; }
.day.past { color: #b0b8b3; background: #eef1ee; }
.day.occupied { background: #155b43; color: white; border-color: #155b43; }
.day.mine { background: #f0c84b; border-color: #e0b52a; }
.day.in-range:not(.occupied):not(.mine) { background: #e5f3ec; }
.day.picked { outline: 3px solid #14211d; }
#portal .banner.ok { background: #e7f6c8; border-color: #c9ef4a; }
.block-list button.confirm { background: #8d322d; color: white; border-color: #8d322d; }
#portal button:focus-visible, #portal input:focus-visible, #portal select:focus-visible { outline: 3px solid #1f5962; outline-offset: 2px; }
.legend { display: flex; gap: 14px; font-size: 13px; margin: 10px 0 18px; color: #4d5c55; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.swatch.free { background: white; border: 1px solid #dbe1d9; }
.swatch.occupied { background: #155b43; }
.swatch.mine { background: #f0c84b; }
.block-list { list-style: none; padding: 0; margin: 8px 0 0; }
.block-list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; background: white; border: 1px solid #dbe1d9; border-radius: 8px; padding: 10px 12px; margin-top: 8px; }
.block-list button { background: white; color: #a33b35; border: 1px solid #e4c4c2; }
#portal-money { max-width: 1120px; margin: 0 auto; padding: 0 16px 28px; }
#portal-money h2 { font: 700 13px/1.2 system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #4d5c55; border-top: 1px solid #dbe1d9; padding-top: 22px; margin: 0 0 12px; }
.money-hero { background: #14211d; color: white; border-radius: 14px; padding: 22px 24px; display: grid; gap: 4px; }
.money-hero small { color: #c9d6ce; font-size: 14px; }
.money-hero strong { font: 800 clamp(38px, 9vw, 60px)/1.05 system-ui, sans-serif; letter-spacing: -.02em; color: #c9ef4a; font-variant-numeric: tabular-nums; }
.money-hero span { color: #c9d6ce; font-size: 13px; }
.money-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.money-card { display: grid; gap: 2px; text-align: left; background: white; color: #14211d; border: 1px solid #dbe1d9; border-radius: 12px; padding: 16px 18px; font-weight: 400; }
.money-card small { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #4d5c55; }
.money-card strong { font: 800 clamp(24px, 6vw, 32px)/1.1 system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.money-card span { font-size: 13px; color: #4d5c55; }
.money-card.pending strong { color: #9a5b00; }
.money-card.paid strong { color: #155b43; }
.money-card.on { border-color: #14211d; box-shadow: inset 0 0 0 2px #14211d; }
.money-head { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 8px; }
.money-head h3 { font: 700 18px/1.2 system-ui, sans-serif; margin: 0; }
.money-all { background: white; color: #14211d; border: 1px solid #dbe1d9; padding: 8px 12px; font-size: 13px; }
.money-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.money-list li { display: flex; justify-content: space-between; align-items: center; gap: 14px; background: white; border: 1px solid #dbe1d9; border-radius: 10px; padding: 12px 14px; }
.money-what, .money-amount { display: grid; gap: 3px; min-width: 0; }
.money-what small { color: #4d5c55; font-size: 13px; }
.money-amount { justify-items: end; flex: none; }
.money-amount strong { font-variant-numeric: tabular-nums; }
.money-chip { font-style: normal; font-size: 12px; font-weight: 650; border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.money-chip.pending { background: #fbf1d7; color: #7a4a00; }
.money-chip.paid { background: #e7f2ea; color: #155b43; }
#portal-gps { max-width: 1120px; margin: 0 auto; padding: 0 16px 56px; }
#portal-gps h2 { font: 700 13px/1.2 system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #4d5c55; border-top: 1px solid #dbe1d9; padding-top: 22px; margin: 0 0 10px; }
#portal-gps input { font-size: 16px; padding: 14px; }
#gps-map { height: min(68vh, 620px); min-height: 360px; border: 1px solid #dbe1d9; border-radius: 12px; background: #e9eee8; z-index: 0; }
#portal .banner.warn { background: #fbf1d7; border-color: #ecd491; }
.gps-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.gps-chip { justify-self: start; font-style: normal; font-size: 12px; font-weight: 650; border-radius: 999px; padding: 2px 10px; margin-top: 4px; background: #e7f2ea; color: #155b43; }
.gps-chip.rented { background: #155b43; color: white; }
.gps-list button { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; background: white; color: #14211d; border: 1px solid #dbe1d9; border-radius: 10px; padding: 12px 14px; }
.gps-list button:disabled { opacity: 1; color: #68756f; cursor: default; }
.gps-list span { display: grid; gap: 2px; min-width: 0; }
.gps-list small { color: #4d5c55; font-size: 13px; font-weight: 400; }
.gps-dot, .gps-pin { flex: none; display: inline-block; border-radius: 50%; background: #8b9690; }
.gps-dot { width: 12px; height: 12px; }
.gps-pin { width: 22px; height: 22px; border: 3px solid white; box-shadow: 0 1px 5px rgba(0, 0, 0, .45); }
.gps-dot.moving, .gps-pin.moving { background: #1f8a4c; }
.gps-dot.stopped, .gps-pin.stopped { background: #1f5962; }
.gps-dot.offline, .gps-pin.offline { background: #a9b1ac; }
@media (max-width: 640px) { #gps-map { height: 62vh; min-height: 320px; } }
.intake-fields { display: grid; gap: 8px; padding: 16px 20px 22px; }
.intake-fields button { justify-self: start; }
@media (max-width: 640px) {
  #portal .row { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  body { overflow: auto; }
  #app { display: block; height: auto; min-height: 100vh; overflow: visible; }
  #app aside { display: block; position: sticky; top: 0; z-index: 20; height: auto; padding: 8px 10px; }
  #app aside .brand, #app aside .aside-foot, #app aside .nav-label { display: none; }
  #app aside nav { display: flex; flex-direction: row; gap: 6px; overflow-x: auto; }
  #app aside nav button { white-space: nowrap; }
  #app main { height: auto; overflow: visible; padding: 0; }
  #app > main > header { position: static; margin: 0; padding: 16px 16px 12px; }
  #content { padding: 4px 16px 32px; }
  #app main.view-calendar, #app main.view-reservations { display: block; height: auto; overflow: visible; }
  #app main.view-calendar #content, #app main.view-reservations #content { display: block; height: auto; overflow: visible; padding: 4px 16px 32px; }
  .calendar-scroll { max-height: 62vh; }
  .calendar-panel .pick-bar { position: sticky; bottom: 0; }
  .reservations-panel { flex: none; min-height: 0; max-height: none; }
  .reservation-scroll { min-height: 0; max-height: none; overflow: visible; }
}

/* Lista de vehículos del suplidor: modelo, año, placa, color y cómo está hoy. */
.car-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.car-row { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 12px; align-items: center; text-align: left; background: white; color: #14211d; border: 1px solid #dbe1d9; border-radius: 12px; padding: 14px 16px; font-weight: 400; min-height: 64px; }
.car-row span { display: grid; gap: 2px; min-width: 0; }
.car-row small { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #68756f; }
.car-row b { font-size: 16px; font-weight: 650; overflow-wrap: anywhere; }
.car-row strong { font-size: 19px; line-height: 1.2; }
.car-row .car-model, .car-row .car-chip { grid-column: 1 / -1; }
.car-row.on { border-color: #14211d; box-shadow: inset 0 0 0 2px #14211d; }
.car-chip { justify-self: start; font-style: normal; font-size: 13px; font-weight: 650; border-radius: 999px; padding: 3px 12px; background: #e7f2ea; color: #155b43; }
.car-chip.rented { background: #155b43; color: white; }
.car-chip.blocked { background: #f0c84b; color: #4a3600; }
#portal-root h2 { font: 700 20px/1.2 system-ui, sans-serif; margin: 22px 0 8px; scroll-margin-top: 12px; }
#portal .install { width: 100%; background: white; color: #14211d; border: 1px solid #14211d; font-size: 16px; padding: 14px; margin-bottom: 6px; }
#portal .install-tip { font-size: 13px; margin: 0 0 6px; }
@media (min-width: 640px) {
  .car-row { grid-template-columns: 2fr .6fr 1fr 1fr 250px; }
  .car-row .car-model, .car-row .car-chip { grid-column: auto; }
  .car-row .car-chip { justify-self: end; }
}
/* En el teléfono las siete columnas del mes tienen que caber: sin esto el domingo se salía de la pantalla. */
.weekdays, .month { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month .day { padding: 0; min-width: 0; }
#portal a.install { display: block; text-align: center; text-decoration: none; border-radius: 8px; font-weight: 650; }
/* App del suplidor: pasos para guardarla en el teléfono y nota de cada bloqueo. */
.install-steps { background: white; border: 1px solid #dbe1d9; border-radius: 12px; padding: 0 16px; margin-bottom: 6px; }
.install-steps summary { cursor: pointer; font-weight: 650; padding: 14px 0; }
.install-steps ol { margin: 0; padding: 0 0 14px 22px; display: grid; gap: 8px; color: #33423b; }
#portal input[type="text"] { font-size: 18px; padding: 14px; }
#portal .note-help { font-size: 13px; margin: 6px 0 0; }
.block-list span { display: grid; gap: 2px; min-width: 0; }
.block-list small { color: #4d5c55; font-size: 13px; overflow-wrap: anywhere; }
/* El suplidor agrega un vehículo: botón, formulario y fila en revisión. */
#portal .add-car { width: 100%; background: #14211d; color: white; border: 0; font-size: 17px; padding: 15px; margin-bottom: 8px; }
.add-form { background: white; border: 1px solid #dbe1d9; border-radius: 12px; padding: 4px 16px 16px; margin-bottom: 10px; display: grid; gap: 10px; }
#portal .add-form h2 { margin: 14px 0 0; }
#portal .add-form .help { margin: 0; }
#portal .add-form input { font-size: 18px; padding: 14px; width: 100%; }
#portal .add-form .primary { margin-top: 4px; }
#portal .add-cancel { width: 100%; background: white; color: #14211d; border: 1px solid #dbe1d9; font-size: 16px; padding: 13px; }
#portal .add-form .error { margin: 0; }
.car-row:disabled { opacity: 1; cursor: default; background: #fafbf9; border-style: dashed; }
.car-chip.waiting { background: #fbf1d7; color: #7a4a00; }
.car-list li { display: grid; gap: 2px; }
#portal .car-remove { justify-self: end; background: transparent; color: #a33b35; border: 0; font-size: 14px; font-weight: 600; padding: 8px 6px; min-height: 40px; }
#portal .car-remove.confirm { background: #8d322d; color: white; border-radius: 8px; padding: 8px 12px; }
#portal #car-error { margin: 0 0 6px; min-height: 0; }
#portal #car-error:empty { display: none; }
