@import url("https://fonts.googleapis.com/css2?family=Raleway:wght@300;400;500;600;700&display=swap");

/* ================================================================
   DENSIDAD COMPACTA GLOBAL (LUMO COMPACT THEME)
   Reduce la altura de campos, combos, datepickers, botones y espacio vertical.
================================================================ */
:root {
  /* Alto de inputs, combos, botones y datepickers (por defecto es 36px-40px) */
  --lumo-size-m: 28px;
  --lumo-size-s: 24px;
  --lumo-size-l: 34px;

  /* Tamaños de tipografía en campos e interfaz */
  --lumo-font-size-m: 13px;
  --lumo-font-size-s: 11px;
  --lumo-font-size-xs: 10px;

  /* Espaciado interno de contenedores y layouts */
  --lumo-space-m: 8px;
  --lumo-space-s: 4px;
  --lumo-space-xs: 2px;
}

/* Reducir espacio vertical entre filas dentro de vaadin-form-layout */
vaadin-form-layout {
  --vaadin-form-item-row-spacing: 4px;
}

/* Compactar las etiquetas (labels) de todos los tipos de campo */
vaadin-text-field::part(label),
vaadin-combo-box::part(label),
vaadin-date-picker::part(label),
vaadin-number-field::part(label),
vaadin-integer-field::part(label),
vaadin-password-field::part(label),
vaadin-text-area::part(label),
vaadin-select::part(label) {
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 1px;
  padding-bottom: 0;
}

/* =========================
   BASE GLOBAL
========================= */
html, body, vaadin-app-layout {
  font-family: 'Raleway', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--app-bg);
  color: var(--app-text);
  margin: 0;
  font-variant-numeric: lining-nums;
}

/* =========================
   PALETA
========================= */
:root {
  --app-bg:               #f3f4f6;
  --app-surface:          #ffffff;
  --app-primary:          #16a34a;
  --app-primary-hover:    #15803d;
  --app-primary-dark:     #14532d;
  --app-sidebar-bg:       #3b656f;
  --app-sidebar-text:    rgba(255, 255, 255, 0.93);
  --app-sidebar-muted:   rgba(255, 255, 255, 0.45);
  --app-sidebar-hover:   rgba(255, 255, 255, 0.12);
  --app-secondary:        #64748b;
  --app-border:           #e5e7eb;
  --app-text:             #111827;
  --app-text-muted:       #6b7280;
  --app-text-light:       #9ca3af;
  --app-danger:           #dc2626;
  --app-danger-bg:        #fee2e2;
  --app-success:          #16a34a;
  --app-success-bg:       #dcfce7;
  --app-badge-open-bg:    #dcfce7;
  --app-badge-open-txt:   #16a34a;
  --app-badge-close-bg:   #f3f4f6;
  --app-badge-close-txt:  #6b7280;
  --app-shadow-sm:        0 1px 3px rgba(0, 0, 0, 0.06);
  --app-shadow-md:        0 4px 12px rgba(0, 0, 0, 0.08);
}

/* =========================
   APP LAYOUT
========================= */
vaadin-app-layout::part(navbar) {
  background:    #ffffff !important;
  border-bottom: 1px solid #e5e7eb !important;
  box-shadow:    var(--app-shadow-sm) !important;
  padding:       0 !important;
}

vaadin-app-layout::part(drawer) {
  background:   #3b656f !important;
  border-right: none !important;
}

/* Toggle hamburguesa */
vaadin-drawer-toggle { color: #16a34a !important; }

/* =========================
   GRID
========================= */
vaadin-grid                           { background: var(--app-surface); border-radius: 0 0 10px 10px; border: none; }
vaadin-grid::part(header-cell)        { background: #f9fafb; font-weight: 600; font-size: 13px; color: var(--app-text-muted); border-bottom: 1px solid var(--app-border); }
vaadin-grid::part(cell)               { font-size: 14px; color: var(--app-text); }
vaadin-grid::part(row):hover          { background: #f0fdf4; }
vaadin-grid::part(selected-row),
vaadin-grid::part(selected-row):hover { background: #dcfce7; }

/* =========================
   LOGIN
========================= */
.login-title { font-weight: 700; letter-spacing: -0.4px; color: var(--app-text); }
.login-card  { background: white; border-radius: 16px; padding: 40px; box-shadow: 0 15px 40px rgba(0,0,0,0.08); }
.login-field::part(input-field) { background-color: #f9fafb; border-radius: 10px; border: 1px solid var(--app-border); }
.login-field::part(label)       { color: var(--app-text-light); }
.login-button       { margin-top: 20px; background-color: var(--app-primary); color: white; border-radius: 10px; font-weight: 600; }
.login-button:hover { background-color: var(--app-primary-hover); }

/* =========================
   FORMULARIOS
========================= */
.period-header { width: 100%; background: var(--app-surface); border: 1px solid var(--app-border); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.period-header vaadin-form-item::part(label) { color: var(--app-text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
.period-header-field::part(input-field)      { background: #f9fafb; border: 1px solid var(--app-border); border-radius: 8px; }
.period-header-field::part(value)            { color: var(--app-text); font-weight: 600; }

/* =========================
   TARJETAS Y UTILIDADES
========================= */
.card        { background: var(--app-surface); border-radius: 12px; border: 1px solid var(--app-border); padding: 16px; box-shadow: var(--app-shadow-sm); }
.text-muted  { color: var(--app-text-muted); }
.text-success{ color: var(--app-success); }
.text-danger { color: var(--app-danger); }
.badge-open   { background: var(--app-badge-open-bg);  color: var(--app-badge-open-txt);  padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; }
.badge-closed { background: var(--app-badge-close-bg); color: var(--app-badge-close-txt); padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; }
.hover-icono       { transition: transform 0.3s ease, color 0.3s ease; cursor: pointer; }
.hover-icono:hover { transform: scale(1.15); color: var(--app-primary); }

/* =========================
   SCROLLBAR
========================= */
::-webkit-scrollbar             { width: 6px; }
::-webkit-scrollbar-track      { background: transparent; }
::-webkit-scrollbar-thumb      { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover{ background: #94a3b8; }

/* =========================
   BUSCADOR SIDEBAR
========================= */
.sidebar-search-input::placeholder {
  color: rgba(255, 255, 255, 0.55) !important;
  opacity: 1;
}

/* ================================================================
   BUS LAYOUT — CSS FINAL LIMPIO
================================================================ */

/* ── SCALER ─────────────────────────────────────────────────── */
.bus-scaler {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 0;
}

.bus-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  transform-origin: top center;
  flex-shrink: 0;
}

/* ── SHELL ─────────────────────────────────────────────────── */
.bus-shell {
  position: relative;
  overflow: visible;
  display: inline-block;
}

/* techo oculto */
.bus-roof { display: none; }

/* ── CARROCERÍA — faros integrados ─────────────────────────── */
.bus-body {
  border-radius: 22px 22px 16px 16px;
  padding: 4px;
  background: #2a3a50;
  border: 2px solid #1a2838;
  box-shadow:
          0 2px 0 #0d1520,
          0 5px 4px rgba(0,0,0,.18),
          0 18px 44px rgba(0,0,0,.38),
          inset 0 1px 0 rgba(255,255,255,.06);
  position: relative;
  z-index: 2;
}

/* faro izquierdo */
.bus-body::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 26px;
  width: 13px;
  height: 4px;
  border-radius: 29%;
  background: radial-gradient(circle at 38% 33%, #fff7aa, #f5d800 55%, #c89000);
  border: 1.5px solid #a07800;
  box-shadow: 0 0 7px 3px rgba(245,216,0,.65);
  z-index: 6;
  pointer-events: none;
}

/* faro derecho */
.bus-body::after {
  content: '';
  position: absolute;
  top: -2px;
  right: 26px;
  width: 13px;
  height: 4px;
  border-radius: 29%;
  background: radial-gradient(circle at 38% 33%, #fff7aa, #f5d800 55%, #c89000);
  border: 1.5px solid #a07800;
  box-shadow: 0 0 7px 3px rgba(245,216,0,.65);
  z-index: 6;
  pointer-events: none;
}

/* ── PISO INTERIOR — blanco ─────────────────────────────────── */
.bus {
  --seat-size: 28px;
  --slot-gap:  4px;
  position: relative;
  background: #ffffff;
  padding: 7px 8px 10px;
  border-radius: 18px 18px 12px 12px;
  width: fit-content;
  margin: auto;
}

/* ventana trasera */
.bus::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 10px; right: 10px;
  height: 5px;
  background: rgba(140,190,230,.35);
  border-radius: 0 0 8px 8px;
}

/* parabrisas oculto */
.bus-front-row { display: none; }

/* ── VOLANTE ────────────────────────────────────────────────── */
.steering-wheel-visual {
  width:  calc(var(--seat-size) - 6px);
  height: calc(var(--seat-size) - 6px);
  position: relative;
  flex-shrink: 0;
  background: #1e2c3a;
  border-radius: 50%;
  border: 2px solid #3a5268;
  box-shadow: 0 0 0 1px rgba(255,255,255,.15), inset 0 0 0 1px rgba(255,255,255,.08);
}
.steering-wheel-visual::before,
.steering-wheel-visual::after { display: none; }

.sw-spoke-v {
  position: absolute;
  left: 50%; top: 2px; bottom: 2px;
  width: 2px;
  transform: translateX(-50%);
  background: #3a5268;
  border-radius: 2px;
}
.sw-spoke-h {
  position: absolute;
  top: 50%; left: 2px; right: 2px;
  height: 2px;
  transform: translateY(-50%);
  background: #3a5268;
  border-radius: 2px;
}
.sw-horn {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4a6a84;
  border: 1px solid #3a5268;
}

/* ── ZONA DE ASIENTOS ───────────────────────────────────────── */
.bus-seat-zone { position: relative; }

.seat-row {
  display: grid;
  grid-template-columns: repeat(5, var(--seat-size));
  column-gap: var(--slot-gap);
  justify-content: center;
  margin-bottom: 8px;
}

/* ================================================================
   ASIENTO — respaldo abajo (border-bottom grueso)
================================================================ */
.bus-seat {
  width:  var(--seat-size);
  height: var(--seat-size);
  position: relative;
  cursor: pointer;
  user-select: none;
  z-index: 2;
  background: #c8d4c0;
  border-radius: 8px 8px 4px 4px;
  border-top:    2px solid #9aaa90;
  border-left:   2px solid #9aaa90;
  border-right:  2px solid #9aaa90;
  border-bottom: 10px solid #7a9070;
  box-shadow: inset 4px 0 0 rgba(0,0,0,.09), inset -4px 0 0 rgba(0,0,0,.09);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3a5030;
  transition: transform .12s, filter .12s, box-shadow .12s;
}

/* acolchado */
.bus-seat::before {
  content: '';
  position: absolute;
  top: 4px; left: 5px; right: 5px;
  height: 7px;
  background: rgba(255,255,255,.35);
  border-radius: 3px;
}

/* número via data-seat */
.bus-seat::after {
  content: attr(data-seat);
  position: absolute;
  top: 50%; left: 0; right: 0;
  transform: translateY(-30%);
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  color: inherit;
}
.bus-seat:hover:not(.occupied):not(.block):not(.reserved)  {
  filter: brightness(1.08);
  transform: scale(1.08) translateY(-1px);
  z-index: 6;
  box-shadow: inset 4px 0 0 rgba(0,0,0,.09), inset -4px 0 0 rgba(0,0,0,.09), 0 4px 12px rgba(0,0,0,.2);
}

/* SELECCIONADA */
.bus-seat.selected {
  background: #6aaee0;
  border-color: #2e72b8;
  border-bottom-color: #1a5090;
  color: #fff;
  box-shadow: inset 4px 0 0 rgba(0,0,0,.12), inset -4px 0 0 rgba(0,0,0,.12), 0 0 0 2px rgba(59,130,196,.5);
}
.bus-seat.selected::before { background: rgba(255,255,255,.3); }
.bus-seat.selected:hover { filter: brightness(1.08); transform: scale(1.08) translateY(-1px); }

/* OCUPADA */
.bus-seat.occupied {
  background: #e06060;
  border-color: #b03030;
  border-bottom-color: #882020;
  color: rgba(255,255,255,.85);
  cursor: not-allowed;
  box-shadow: inset 4px 0 0 rgba(0,0,0,.14), inset -4px 0 0 rgba(0,0,0,.14);
}
.bus-seat.occupied::before { background: rgba(255,255,255,.18); }
.bus-seat.occupied:hover { transform: none; filter: none; }

/* BLOQUEADA */
.bus-seat.block {
  background: #dfa050;
  border-color: #a86820;
  border-bottom-color: #7a4a10;
  color: rgba(255,255,255,.7);
  cursor: not-allowed;
  box-shadow: inset 4px 0 0 rgba(0,0,0,.12), inset -4px 0 0 rgba(0,0,0,.12);
}
.bus-seat.block::before { background: rgba(255,255,255,.2); }
.bus-seat.block:hover { transform: none; filter: none; }

/* ── SLOTS ESPECIALES ───────────────────────────────────────── */
.aisle {
  width:  var(--seat-size);
  height: var(--seat-size);
}
.missing-seat-block {
  width:  var(--seat-size);
  height: var(--seat-size);
  border-radius: 6px;
  border: 1px dashed rgba(0,0,0,.12);
  background: rgba(0,0,0,.04);
}
.hidden-slot {
  width:  var(--seat-size);
  height: var(--seat-size);
  visibility: hidden;
  pointer-events: none;
}
.configured-hidden-seat {
  width:  var(--seat-size);
  height: var(--seat-size);
  border-radius: 6px;
  border: 1.5px dashed rgba(0,0,0,.15);
  background: rgba(0,0,0,.05);
  color: rgba(0,0,0,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  user-select: none;
}

/* ── RUEDAS ─────────────────────────────────────────────────── */
.wheel {
  position: absolute;
  width: 10px;
  height: 38px;
  background: #1a2030;
  border: 1.5px solid #0d1520;
  border-radius: 4px;
  z-index: 1;
  overflow: hidden;
}
.wheel::before {
  content: '';
  position: absolute;
  top: 4px; left: 3px; right: 3px; bottom: 4px;
  background: #2e3e52;
  border-radius: 2px;
  border: 1px solid #3a5070;
}
.wheel::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #5a7898;
  border: 1px solid #3a5070;
}
.wheel-l1, .wheel-l2 { left:  -9px; border-radius: 5px 0 0 5px; }
.wheel-r1, .wheel-r2 { right: -9px; border-radius: 0 5px 5px 0; }
.wheel-l1, .wheel-r1 { top: 24%; transform: translateY(-50%); }
.wheel-l2, .wheel-r2 { top: 74%; transform: translateY(-50%); }

/* ================================================================
   SELECTOR DE PISO — botones a la DERECHA del bus
================================================================ */
.deck-selector-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
  padding: 30px 0 0 15px;
}

.deck-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1.5px solid #c0c8d4;
  background: #e8ecf0;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .12s, box-shadow .15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 5px;
  user-select: none;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 1px 0 rgba(255,255,255,.8) inset;
}
.deck-btn img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: block;
  pointer-events: none;
}
.deck-btn span {
  font-size: 8px;
  font-weight: 700;
  color: #5a6a7a;
  text-transform: uppercase;
  letter-spacing: .4px;
  line-height: 1;
}
.deck-btn:hover {
  background: #d8dfe8;
  border-color: #a0b0c0;
  transform: scale(1.05);
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.deck-btn:hover span { color: #2a3a4a; }
.deck-btn-active {
  background: #ccd8e8 !important;
  border-color: #7a9ab8 !important;
  box-shadow: 0 0 0 2px rgba(100,150,200,.3), inset 0 2px 4px rgba(0,0,0,.08) !important;
}
.deck-btn-active span { color: #1e3a5a !important; font-weight: 900 !important; }

/* ── LEYENDA ────────────────────────────────────────────────── */
.bus-legend {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  background: #fff;
  border: 1px solid #dce3ee;
  border-radius: 10px;
}
.bus-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: #364253;
}
.bus-legend-swatch {
  width: 22px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 4px 4px 0 0;
  border-bottom-width: 6px;
  border-bottom-style: solid;
}
.bus-legend-swatch.free     { background: #c8d4c0; border-bottom-color: #7a9070; }
.bus-legend-swatch.selected { background: #6aaee0; border-bottom-color: #1a5090; }
.bus-legend-swatch.occupied { background: #e06060; border-bottom-color: #882020; }
.bus-legend-swatch.block    { background: #dfa050; border-bottom-color: #7a4a10; }

/* ── PANEL HOST ─────────────────────────────────────────────── */
.bus-panel-host {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 6px;
  overflow: hidden;
  height: 100%;
  box-sizing: border-box;
}
.gridrods-bus-panel-host {
  min-width: 320px;
  max-width: 480px;
  flex: 0 0 420px;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.bus-panel {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}
.bus-panel > .bus-scaler {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* ── GRID CENTER ────────────────────────────────────────────── */
.gridrods-center {
  min-height: 0;
  gap: 10px;
  height: 100%;
  align-items: stretch;
}
.gridrods-tickets-panel { min-width: 0; min-height: 0; flex: 1 1 auto; }
.gridrods-grid {
  min-height: 0;
  height: 100%;
  --vaadin-grid-cell-padding: 0.22rem 0.38rem;
}
.gridrods-grid::part(header-cell) {
  background: #edf1f7;
  font-size: 12px;
  font-weight: 600;
  color: #1e2a38;
}
.gridrods-grid::part(body-cell) { font-size: 13px; }

/* ── BOTÓN RESERVAR ─────────────────────────────────────────── */
.sell-ticket-button {
  flex-shrink: 0 !important;
  width: calc(100% - 12px) !important;
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  margin: 6px 6px 4px !important;
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .2px;
  box-shadow: 0 2px 6px rgba(30,80,144,.22);
  transition: background .15s, transform .12s;
  cursor: pointer;
}
.sell-ticket-button:hover { background: #15803d; transform: translateY(-1px); }

/* ── BOTONES DE ACCIÓN ──────────────────────────────────────── */
.sale-action-button,
.add-passenger-button,
.dian-passenger-button,
.dian-buyer-button {
  color: #fff;
  background: #2563a8;
  border: none;
  border-radius: 5px;
  font-weight: 700;
  transition: background .12s, transform .10s;
}
.sale-action-button:hover,
.add-passenger-button:hover,
.dian-passenger-button:hover,
.dian-buyer-button:hover { background: #1e5090; transform: translateY(-1px); }
.remove-passenger-button { background: #a83535; color: #fff; border: none; border-radius: 5px; font-weight: 700; }
.remove-passenger-button:hover { background: #8a2a2a; }

.sell-form-section {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  white-space: nowrap;
  font-weight: 700;
  color: #1e5090;
  background: #ddeaf7;
  border: 1px solid #b8d4ee;
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 11px;
  letter-spacing: .3px;
  text-transform: uppercase;
}
.sell-form-actions {
  width: 100%;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #dce3ee;
}

.bus-seat.reserved {
  background: #8B5E3C;
  border-color: #6B3F1F;
  border-bottom-color: #4a2a0f;
  color: rgba(255,255,255,.85);
  cursor: not-allowed;
  box-shadow: inset 4px 0 0 rgba(0,0,0,.14), inset -4px 0 0 rgba(0,0,0,.14);
}
.bus-seat.reserved::before { background: rgba(255,255,255,.18); }
.bus-seat.reserved:hover { transform: none; filter: none; }

/* ── ICONOS TOP BAR ─────────────────────────────────────────── */
.hover-icono { color: #475569 !important; cursor: pointer; transition: color .12s, transform .12s; }
.hover-icono:hover { color: #2563a8 !important; transform: scale(1.12); }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .gridrods-center { flex-direction: column; }
  .gridrods-bus-panel-host { min-width: 100%; max-width: 100%; flex-basis: auto; }
}
.gridrods-center.selling-mode .gridrods-bus-panel-host { min-width: 0; max-width: 100%; flex: 1 1 100%; }
.gridrods-center.selling-mode .sell-form-left-panel { flex: 0 0 40%; max-width: 40%; width: 40%; }

/* ── Grid Rodamientos ── */
.gridrods-grid::part(header-cell) {
  background: #f1f5f9;
  color: #374151;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 10px;
  border-bottom: 2px solid #e2e8f0;
}

.gridrods-grid::part(cell) {
  padding: 6px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: #374151;
}

.gridrods-grid::part(row):hover {
  background: #eff6ff;
  cursor: pointer;
}

.gridrods-grid::part(row selected) {
  background: #dbeafe;
}

.titulo-normal [part="title"] {
  text-transform: none !important;
}

/* ================================================================
   RESPONSIVE GLOBAL v2 — QUIRÚRGICO
================================================================ */

/* ── 0. Anti-desborde base ─────────────────────────────────────── */
html, body { max-width: 100%; overflow-x: hidden; }
vaadin-app-layout::part(content) { max-width: 100%; }

/* ── 1. DIÁLOGOS acotados al viewport ───────────────────────────── */
vaadin-dialog-overlay::part(overlay) {
  max-width: 96vw !important;
  max-height: 92vh !important;
  box-sizing: border-box;
}
vaadin-dialog-overlay::part(content) {
  max-width: 100% !important;
  overflow: auto;
}

/* ── 2. GRIDS: scroll horizontal propio ─────────────────────────── */
vaadin-grid { width: 100% !important; max-width: 100%; min-width: 0; }

/* ================================================================
   FOOTER
================================================================ */
.app-footer { flex-wrap: wrap !important; row-gap: 6px; }

.app-footer-card vaadin-icon,
.app-footer-card .v-icon { width: 15px; height: 15px; }

@media (max-width: 1024px) {
  .app-footer-card {
    flex: 1 1 calc(50% - 8px) !important;
    min-width: calc(50% - 8px) !important;
    height: 40px !important;
  }
}
@media (max-width: 600px) {
  .app-footer { padding: 6px 10px !important; }
  .app-footer-card {
    flex: 1 1 100% !important;
    min-width: 100% !important;
    height: 38px !important;
  }
}

/* ================================================================
   GRIDRODS — bus + grid + botón comprar
================================================================ */
@media (max-width: 1100px) {
  .gridrods-center {
    flex-direction: column !important;
    overflow-y: auto;
  }
  .gridrods-center > div:first-child {
    width: 100% !important;
    flex: none !important;
    height: 50vh !important;
    min-height: 320px;
  }
  .gridrods-bus-panel-host {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    height: auto !important;
    min-height: 460px;
    border-left: none !important;
    border-top: 1px solid #e2e8f0;
  }
  .sell-ticket-button { width: calc(100% - 12px) !important; }
  .gridrods-bus-panel-host .bus-scaler {
    min-height: 380px;
  }
}

/* ================================================================
   RECAUDOS / FORMULARIOS LARGOS
================================================================ */
@media (max-width: 1024px) {
  vaadin-app-layout::part(content) { overflow-y: auto; }
}

/* ================================================================
   TARJETAS DE PERIODO
================================================================ */
@media (max-width: 1024px) {
  .period-header { padding: 10px; }
}
@media (max-width: 768px) {
  .period-header { padding: 8px; border-radius: 10px; }
  .card { padding: 12px; }
}

/* ================================================================
   AJUSTES FINOS POR DISPOSITIVO
================================================================ */
@media (max-width: 1024px) {
  vaadin-grid::part(header-cell) { font-size: 12px; }
  vaadin-grid::part(cell)         { font-size: 12.5px; }
}
@media (max-width: 480px) {
  vaadin-grid::part(header-cell) { font-size: 11px; padding: 5px 6px; }
  vaadin-grid::part(cell)         { font-size: 11.5px; padding: 5px 6px; }
}

@media (pointer: coarse) {
  vaadin-button { min-height: 36px; }
}

/* ================================================================
   RECAUDOS — vista con cabecera + grid
================================================================ */
@media (max-width: 1024px) {
  .recaudos-main {
    height: auto !important;
    min-height: 100%;
    overflow-y: auto;
  }
  .recaudos-main .recaudos-grid-panel {
    flex: none !important;
    height: 55vh !important;
    min-height: 360px;
  }
}
@media (max-width: 768px) {
  .recaudos-main { padding: 12px !important; gap: 10px !important; }
  .recaudos-main .recaudos-grid-panel {
    height: 60vh !important;
    min-height: 320px;
  }
}

/* ================================================================
   MÓVIL UNIVERSAL — TODAS LAS VISTAS (≤600px)
================================================================ */
@media (max-width: 600px) {

  vaadin-app-layout::part(content) {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  vaadin-app-layout::part(content) > * {
    height: auto !important;
    min-height: 100% !important;
    box-sizing: border-box;
  }

  .recaudos-main,
  .gridrods-center {
    height: auto !important;
    min-height: 0 !important;
  }

  vaadin-grid:not(.gridrods-grid) {
    height: 60vh !important;
    min-height: 280px !important;
    max-height: 70vh;
  }

  .app-paginator,
  .app-footer {
    position: static !important;
    flex-shrink: 0;
  }

  vaadin-app-layout::part(content) [style*="width: 420px"],
  vaadin-app-layout::part(content) [style*="width:420px"],
  vaadin-app-layout::part(content) [style*="width: 480px"],
  vaadin-app-layout::part(content) [style*="width:480px"],
  vaadin-app-layout::part(content) [style*="width: 400px"],
  vaadin-app-layout::part(content) [style*="width:400px"],
  .card,
  .login-card {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box;
  }

  vaadin-app-layout::part(content) > * {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* ================================================================
   VISTAS DE ESTADO
================================================================ */
@media (max-width: 480px) {
  .login-card {
    padding: 24px 18px !important;
    border-radius: 14px !important;
  }
  vaadin-app-layout::part(content) vaadin-vertical-layout[style*="width"] {
    max-width: 92vw !important;
  }
}

/* ================================================================
   TABLET VERTICAL (≤834px)
================================================================ */
@media (max-width: 834px) and (orientation: portrait) {
  vaadin-app-layout::part(content) {
    overflow-y: auto !important;
  }
  vaadin-app-layout::part(content) > * {
    height: auto !important;
    min-height: 100% !important;
  }
  .recaudos-main,
  .gridrods-center {
    height: auto !important;
    min-height: 0 !important;
  }
  vaadin-grid:not(.gridrods-grid) {
    height: 60vh !important;
    min-height: 320px !important;
  }
  .app-paginator,
  .app-footer { position: static !important; }
}

/* ================================================================
   NAVBAR RESPONSIVO
================================================================ */
@media (max-width: 900px) {
  .nav-header { padding: 6px 10px !important; }
  .nav-header .nav-right { gap: 4px !important; }

  .nav-breadcrumb {
    max-width: 38vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 600px) {
  .nav-btn-text {
    font-size: 0 !important;
    min-width: 36px !important;
    width: 36px !important;
    padding: 0 !important;
  }
  .nav-btn-text vaadin-icon,
  .nav-btn-text .v-icon {
    margin: 0 !important;
    font-size: 16px !important;
  }

  .nav-username { display: none !important; }
  .nav-breadcrumb { max-width: 32vw; font-size: 13px; }
  .nav-header { padding: 6px 8px !important; }
}

/* ================================================================
   TOOLBARS DE GRID
================================================================ */
@media (max-width: 768px) {
  .grid-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  .grid-toolbar-left,
  .grid-toolbar-right {
    width: 100% !important;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .grid-toolbar-right {
    justify-content: flex-end;
  }
  .grid-toolbar vaadin-button {
    flex: 0 1 auto;
  }
}

@media (max-width: 480px) {
  .grid-toolbar-right {
    justify-content: stretch;
  }
  .grid-toolbar-right vaadin-button {
    flex: 1 1 auto;
  }
}

/* ================================================================
   GRIDRODS — BARRAS Y PESTAÑAS
================================================================ */
@media (max-width: 900px) {
  .gridrods-topbar,
  .gridrods-actionbar {
    flex-wrap: wrap !important;
    height: auto !important;
    overflow: visible !important;
    row-gap: 8px;
  }
  .gridrods-actionbar > vaadin-horizontal-layout {
    flex-wrap: wrap;
  }
}

/* Pestaña seleccionada del TabSheet en Verde Primario (#16a34a) */
vaadin-tabsheet vaadin-tab[selected] {
  background-color: var(--app-primary, #16a34a) !important;
  color: #ffffff !important;
  border-color: var(--app-primary, #16a34a) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12) !important;
}

/* Color del texto e icono dentro de la pestaña seleccionada */
vaadin-tabsheet vaadin-tab[selected] span,
vaadin-tabsheet vaadin-tab[selected] vaadin-icon {
  color: #ffffff !important;
}

/* Botón de cierre en pestaña seleccionada */
vaadin-tabsheet vaadin-tab[selected] vaadin-button {
  color: rgba(255, 255, 255, 0.8) !important;
}