:root {
  --vp-dark: #0d0d27;
  --vp-dark-2: #171735;
  --vp-brand: #28b5e5;
  --vp-brand-hover: #169fd0;
  --vp-brand-soft: #dff6ff;
  --vp-page: #f4f7fa;
  --vp-text: #202334;
  --vp-muted: #6c7280;
  --vp-border: #dce2e8;
  color: var(--vp-text);
  background: var(--vp-page);
}

[hidden] { display: none !important; }

body { background: var(--vp-page); color: var(--vp-text); }
.page { max-width: 1180px; padding-top: 22px; }
.page > header {
  position: relative;
  overflow: hidden;
  min-height: 94px;
  margin-bottom: 20px;
  padding: 18px 22px;
  color: #fff;
  background: linear-gradient(135deg, var(--vp-dark), var(--vp-dark-2));
  border-bottom: 4px solid var(--vp-brand);
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(13, 13, 39, .16);
}
.page > header::after {
  content: "";
  position: absolute;
  right: 120px;
  top: -75px;
  width: 210px;
  height: 210px;
  border: 45px solid rgba(40, 181, 229, .08);
  border-radius: 50%;
  pointer-events: none;
}
.page > header h1 { font-size: 30px; letter-spacing: .7px; color: #fff; }
.page > header .eyebrow { color: var(--vp-brand); }
.card { border-color: var(--vp-border); box-shadow: 0 8px 28px rgba(13, 13, 39, .08); }
label { color: #555b6c; }
input, select { border-color: #cfd6de; color: var(--vp-text); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { outline: none; border-color: var(--vp-brand); box-shadow: 0 0 0 3px rgba(40, 181, 229, .14); }
input:disabled, select:disabled { background: #eef1f4; color: #737886; cursor: not-allowed; opacity: 1; }
.header-lock { align-self: center; max-width: 150px; color: #087da6; font-size: 11px; font-weight: 700; line-height: 1.3; }
.budget-header { flex: 0 0 165px; }
.selected-product-row { display: flex; align-items: center; gap: 18px; margin-top: 10px; }
.selected-product-row .product-info { flex: 1; min-width: 0; }
.selected-product-row .quantity-row { flex: 0 0 auto; align-items: center; }
.product-info.selected { display: grid; grid-template-columns: minmax(210px,1fr) auto; gap: 0; margin: 0; padding: 0; color: var(--vp-dark); background: transparent; border-radius: 7px; box-shadow: 0 5px 16px rgba(40,181,229,.18); overflow: hidden; }
.product-info.selected strong { display: flex; align-items: center; padding: 10px 12px; color: var(--vp-dark); background: var(--vp-brand); font-size: 15px; letter-spacing: .01em; }
.product-info.selected span { display: flex; align-items: center; justify-content: center; padding: 8px 10px; color: var(--vp-dark); background: var(--vp-brand-soft); border-bottom: 3px solid var(--vp-brand); font-size: 15px; font-weight: 700; text-align: center; white-space: nowrap; }
.visit-panel { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-left: 4px solid var(--vp-brand); }
.visit-panel strong, .visit-panel small { display: block; margin-top: 5px; }
.visit-panel small { color: var(--vp-muted); }
.visit-actions { display: flex; gap: 9px; }
.session-actions { display: flex; gap: 9px; }
.client-location-tools { display: grid; grid-template-columns: minmax(280px,1fr) minmax(300px,1fr); gap: 16px; align-items: end; margin: 16px 0; }
.location-coordinates { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.location-coordinates span { color: var(--vp-muted); font-size: 13px; }
.client-locations-map { cursor: crosshair; }
.line-actions { display: flex; justify-content: flex-end; gap: 7px; }
.line-actions button { min-width: 42px; padding: 8px 10px; font-size: 17px; line-height: 1; }
.mobile-label { display: none; }
.edit-line-dialog label { margin-bottom: 14px; }
.edit-line-price { display: flex; justify-content: space-between; align-items: center; margin: 3px 0 20px; padding: 12px; border-radius: 9px; background: var(--vp-brand-soft); }
.multiple-product-results { max-height: 480px; margin-top: 12px; overflow-y: auto; border: 1px solid var(--vp-border); border-radius: 10px; }
.multiple-product-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--vp-border); transition: background .15s; }
.multiple-product-row:last-child { border-bottom: 0; }
.multiple-product-row.is-selected { background: #dff6ff; box-shadow: inset 4px 0 0 var(--vp-brand); }
.multiple-product-info { min-width: 0; }
.multiple-product-info strong { display: block; overflow-wrap: anywhere; }
.multiple-product-info span { display: block; margin-top: 4px; color: var(--vp-muted); font-weight: 700; }
.multiple-quantity { display: flex; align-items: center; gap: 5px; }
.multiple-quantity input { width: 64px; min-height: 42px; text-align: center; font-weight: 800; border-radius: 8px; appearance: textfield; }
.multiple-quantity input::-webkit-inner-spin-button, .multiple-quantity input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.multiple-quantity > button { min-width: 38px; height: 42px; padding: 0; border-radius: 8px; font-size: 22px; line-height: 1; box-shadow: none; }
.multi-stepper { display: grid; grid-template-rows: 1fr 1fr; height: 46px; }
.multi-stepper button { min-width: 30px; height: 23px; padding: 0; border-radius: 0; font-size: 10px; line-height: 1; box-shadow: none; }
.multi-stepper button:first-child { border-radius: 0 8px 0 0; }
.multi-stepper button:last-child { border-radius: 0 0 8px 0; }
.multiple-load-footer { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 12px; background: #fff; border-top: 2px solid var(--vp-brand); }
.finish-visit { background: #0d0d27; color: #fff; box-shadow: none; }
.finish-visit:hover { background: #25254b; }
.order-actions { display: grid; grid-template-columns: auto minmax(190px,1fr); gap: 10px; }
.cancel-order { background: #ef233c; color: #fff; box-shadow: none; }
.cancel-order:hover { background: #d71932; }
.delete-order { background: #ef233c; color: #fff; box-shadow: none; }
.delete-order:hover { background: #d71932; }
.tracking-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.tracking-kpis div { padding: 15px; background: var(--vp-brand-soft); border-radius: 11px; }
.tracking-kpis span { display: block; color: var(--vp-muted); font-size: 12px; font-weight: 700; }
.tracking-kpis strong { display: block; margin-top: 5px; font-size: 23px; }
.tracking-live { color: #2e7d32; font-weight: 800; }
.tracking-map { height: 430px; margin: 16px 0; border: 1px solid var(--vp-border); border-radius: 12px; overflow: hidden; background: #e8eef2; }
.client-map-marker { background: var(--vp-brand); border: 3px solid #fff; border-radius: 50%; box-shadow: 0 2px 8px rgba(13,13,39,.35); }
.seller-map-marker { display: flex; align-items: center; gap: 6px; width: 150px !important; background: transparent; border: 0; }
.seller-map-marker span { width: 20px; height: 20px; flex: 0 0 20px; background: #2e7d32; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 2px 8px rgba(13,13,39,.45); }
.seller-map-marker strong { padding: 4px 7px; overflow: hidden; color: #fff; background: #0d0d27; border-radius: 6px; box-shadow: 0 2px 8px rgba(13,13,39,.35); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
button { background: var(--vp-brand); color: var(--vp-dark); box-shadow: 0 4px 12px rgba(40, 181, 229, .20); transition: background .15s, transform .08s, box-shadow .15s; }
button:hover { filter: none; background: var(--vp-brand-hover); transform: translateY(-1px); }
.secondary { background: #eef1f4; color: var(--vp-text); border-color: #d5dce3; box-shadow: none; }
.secondary:hover { background: #e3e7eb; }
.page > header .secondary { position: relative; z-index: 1; background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.page > header .secondary:hover { background: rgba(255, 255, 255, .09); }
.pill { background: var(--vp-brand-soft); color: #087da6; }
.total-card { background: var(--vp-brand-soft); border-color: #b9e8f8; }
.toast { background: var(--vp-dark); border-left: 4px solid var(--vp-brand); box-shadow: 0 8px 28px rgba(13, 13, 39, .24); }

.admin-menu-button {
  background: #fff;
  color: var(--vp-text);
  border-color: var(--vp-border);
  box-shadow: 0 8px 24px rgba(13, 13, 39, .07);
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.admin-menu-button:hover { background: #fff; border-color: var(--vp-brand); box-shadow: 0 10px 28px rgba(13, 13, 39, .13); transform: translateY(-3px); }
.admin-menu-button span { color: var(--vp-brand); }
.dashboard-tabs .is-active { background: var(--vp-dark); color: #fff; border-color: var(--vp-dark); }
.dashboard-kpis > div {
  background: linear-gradient(145deg, #fff, #f6fbfd);
  border-color: var(--vp-border);
  border-top: 3px solid var(--vp-brand);
  box-shadow: 0 5px 18px rgba(13, 13, 39, .05);
}
.bar-fill { background: linear-gradient(90deg, var(--vp-brand), var(--vp-brand-hover)); }
.trend-line { stroke: var(--vp-brand); }
.trend-area { fill: rgba(40, 181, 229, .13); }

/* Mantiene las acciones de Usuarios visibles aun en tablas anchas. */
#adminUsers th:last-child,
#adminUsers td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  min-width: 225px;
  background: #fff;
  text-align: right;
  box-shadow: -10px 0 14px -14px rgba(13, 13, 39, .55);
}
#adminUsers th:last-child::after { content: "Acciones"; }
#adminUsers .user-toggle,
#adminUsers .user-password { padding: 9px 11px; white-space: nowrap; }
#adminUsers .user-password { background: var(--vp-dark); color: #fff; border-color: var(--vp-dark); }
#adminUsers .user-password:hover { background: var(--vp-dark-2); }

@media (max-width: 760px) {
  .page > header { min-height: 82px; padding: 15px 16px; border-radius: 12px; }
  .page > header h1 { font-size: 25px; }
  .page > header::after { display: none; }
  .header-lock { max-width: none; text-align: center; }
  .budget-header { flex-basis: auto; }
  .selected-product-row { align-items: stretch; flex-direction: column; }
  .product-info.selected { grid-template-columns: 1fr; }
  .selected-product-row .quantity-row { justify-content: flex-end; }
  .order-actions { grid-template-columns: 1fr; }
  .visit-panel, .visit-actions { align-items: stretch; flex-direction: column; }
  .session-actions, .location-coordinates { align-items: stretch; flex-direction: column; }
  .client-location-tools { grid-template-columns: 1fr; }
  #lines { display: block; }
  .cart-table thead { display: none; }
  #lines .cart-line { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 8px 10px; padding: 12px 0; border-bottom: 1px solid var(--vp-border); }
  #lines .cart-line td { display: flex; align-items: center; padding: 0; border: 0; text-align: left; }
  #lines .cart-description { grid-column: 1 / -1; width: 100%; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
  #lines .cart-quantity, #lines .cart-price { gap: 5px; min-width: 0; white-space: nowrap; font-size: 14px; }
  #lines .cart-price { justify-content: flex-start; }
  #lines .cart-actions { justify-content: flex-end; }
  #lines .cart-line .cart-amount { display: none; }
  #lines .mobile-label { display: inline; color: var(--vp-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
  #lines .line-actions { gap: 5px; }
  #lines .line-actions button { min-width: 38px; padding: 8px; }
  #sellerOrder .card { padding: 13px; border-radius: 12px; margin-bottom: 10px; }
  #sellerOrder label { gap: 5px; font-size: 12px; }
  #sellerOrder input, #sellerOrder select { min-height: 39px; padding: 7px 9px; font-size: 14px; }
  #orderHeader .client-search-block { margin-bottom: 10px; }
  #orderHeader .order-header-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; align-items: center; }
  #orderHeader .budget-header { grid-column: 1 / -1; }
  #orderHeader .switch { min-height: 36px; padding: 5px 4px; font-size: 13px; }
  #orderHeader .switch input { width: 19px; min-height: 19px; }
  #orderHeader .order-header-meta > div { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; font-size: 12px; }
  #orderHeader .header-lock { grid-column: 1 / -1; padding-top: 3px; font-size: 10px; }
  .product-panel { padding-top: 11px !important; }
  #multipleLoadPanel > label { gap: 5px; font-size: 12px; }
  #multipleProductSearch { min-height: 39px; padding: 7px 9px; font-size: 14px; }
  .multiple-product-results { max-height: 56vh; margin-top: 8px; border-radius: 8px; }
  .multiple-product-row { grid-template-columns: minmax(0,1fr) auto; gap: 8px; padding: 7px 8px; min-height: 54px; }
  .multiple-product-info { display: block; min-width: 0; font-size: 13px; line-height: 1.2; }
  .multiple-product-info strong { display: inline; font-size: 13px; font-weight: 700; }
  .multiple-product-info span { display: inline; margin: 0 0 0 5px; font-size: 12px; white-space: nowrap; }
  .multiple-quantity { justify-content: flex-end; gap: 4px; }
  .multiple-quantity input { width: 52px; min-height: 38px; height: 38px; padding: 5px; font-size: 14px; }
  .multiple-quantity > button { min-width: 34px; width: 34px; height: 38px; font-size: 20px; }
  .multi-stepper { height: 38px; }
  .multi-stepper button { min-width: 25px; height: 19px; font-size: 8px; }
  .multiple-load-footer { align-items: center; flex-direction: row; gap: 8px; margin-top: 8px; padding: 8px 4px 2px; }
  .multiple-load-footer strong { font-size: 12px; }
  .multiple-load-footer button { padding: 10px 12px; font-size: 12px; white-space: nowrap; }
  .tracking-kpis { grid-template-columns: 1fr; }
  .tracking-map { height: 330px; }
  #adminUsers th:last-child,
  #adminUsers td:last-child { min-width: 150px; }
  #adminUsers .user-toggle,
  #adminUsers .user-password { display: block; width: 100%; margin: 4px 0; }
}
