/* Vidrio de la app de conductores. Misma lectura que la tienda: foto, blur y módulos. */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,560;9..144,680&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #f6f1e7;
  --ink-soft: rgba(246, 241, 231, 0.78);
  --line: rgba(255, 255, 255, 0.28);
  --glass: rgba(255, 255, 255, 0.14);
  --glass-strong: rgba(16, 33, 27, 0.72);
  --coral: #e36a4f;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

html, body {
  font-family: Outfit, "Segoe UI", sans-serif;
  color: var(--ink);
  background-color: #10211b;
  background-image:
    linear-gradient(180deg, rgba(7, 16, 14, 0.38), rgba(7, 16, 14, 0.78)),
    url('fotos/fondo.jpg');
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

#homeScreen,
#loginScreen,
.screen,
#route-details-screen,
.checklist-screen,
.pallets-screen,
#ocupacionDarsenaScreen,
#documentacion-unidad-screen,
#documentacion-conductor-screen {
  background: transparent !important;
  color: var(--ink);
}

button {
  margin-top: 0;
  border-radius: 16px;
  font-family: inherit;
}

button::before {
  display: none;
}

button:hover {
  transform: none;
}

/* ——— Login ——— */
#loginScreen {
  min-height: 100dvh;
  justify-content: flex-start;
}

.login-container {
  width: min(440px, calc(100% - 28px));
  max-width: none;
  margin: 28px auto 120px;
  padding: 22px 18px 18px;
  border-radius: 28px;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
}

.login-container > img {
  height: 84px !important;
  width: 84px;
  object-fit: contain;
  margin: 0 auto 10px !important;
  display: block;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 22px;
  padding: 8px;
  filter: none !important;
}

.logo {
  font-family: Fraunces, Georgia, serif;
  font-weight: 680;
  color: var(--ink);
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.subtitle,
.recaptcha-notice,
.recaptcha-notice a,
.login-options {
  color: var(--ink-soft);
}

.register-link,
.forgot-password-btn {
  color: var(--ink) !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  min-height: 44px;
  font-weight: 700;
  text-decoration: none;
}

#loginBtn,
#sendPasswordReset,
.load-btn,
.save-btn,
.confirm-btn,
.submit-delivery-btn,
.confirm-comment-btn,
#btnNuevaOcupacion {
  background: var(--coral) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 16px !important;
  min-height: 52px !important;
  font-weight: 800 !important;
  font-size: 17px !important;
  width: 100%;
  box-shadow: none !important;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]),
textarea,
select,
.form-control,
.date-input,
.comment-select,
.custom-comment {
  background: rgba(8, 18, 16, 0.45) !important;
  color: var(--ink) !important;
  -webkit-text-fill-color: var(--ink);
  border: 1px solid var(--line) !important;
  border-radius: 16px !important;
  min-height: 48px;
  font-size: 16px !important;
  font-family: Outfit, "Segoe UI", sans-serif !important;
  box-shadow: none !important;
  transform: none !important;
}

textarea {
  min-height: 96px;
  padding: 12px 14px !important;
}

input::placeholder,
textarea::placeholder {
  color: rgba(246, 241, 231, 0.62) !important;
  -webkit-text-fill-color: rgba(246, 241, 231, 0.62);
}

option {
  color: #14241c;
  background: #fff;
}

label,
.form-group label,
.date-section label,
.profile-form label,
.profile-form small,
.system-info-header h3,
.info-label,
.info-value,
.section-title,
.form-section h3,
.document-header h4,
.stops-list h4,
.routes-header h3,
.profile-header h3,
.delivery-header h3,
.recepcion-header h3,
.comment-modal-header h3,
.modal-header h3,
.checklist-header h2,
.route-header h2,
.screen-header h2,
.pallets-header h2,
.date-selection h4,
.routes-list h4 {
  color: var(--ink) !important;
}

/* ——— Inicio ——— */
.driver-marco {
  width: min(760px, calc(100% - 28px));
  margin: 0 auto;
  padding: 14px 0 110px;
}

.driver-bar.header {
  position: sticky;
  top: 10px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 10px 8px 18px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
}

.driver-bar.header::after {
  display: none;
}

.driver-bar__marca {
  font-family: Fraunces, Georgia, serif;
  font-weight: 560;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.logout-btn {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.16) !important;
  color: var(--ink) !important;
  border: 1px solid var(--line) !important;
  border-radius: 999px !important;
  min-height: 44px;
  padding: 10px 16px !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}

.driver-hero {
  margin-top: 16px;
  min-height: 210px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(8, 18, 16, 0.08), rgba(8, 18, 16, 0.72)),
    url('fotos/hero.jpg') center / cover no-repeat;
  display: flex;
  align-items: flex-end;
  padding: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.driver-marca {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.driver-kicker {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.86;
  margin: 0 0 6px;
}

.driver-hero h2 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 680;
  font-size: clamp(22px, 5.2vw, 34px);
  line-height: 1.05;
  overflow-wrap: anywhere;
  letter-spacing: -0.03em;
  margin: 0;
  text-align: left;
  color: var(--ink);
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.driver-lead {
  margin: 8px 0 0;
  max-width: 36ch;
  text-align: left;
  color: rgba(246, 241, 231, 0.9);
  font-size: 16px;
  line-height: 1.4;
}

.driver-marca img {
  width: 84px;
  height: 84px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 22px;
  padding: 8px;
  flex: none;
}

.system-info {
  margin: 16px 0 0;
  padding: 16px;
  border-radius: 24px;
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
}

.system-info-icon,
.info-icon {
  background: rgba(255, 255, 255, 0.16);
  color: var(--ink);
  box-shadow: none;
}

.info-icon.status-online {
  background: rgba(82, 196, 26, 0.28);
  color: #bbf7d0;
}

.info-item {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  min-height: 52px;
}

.info-label {
  color: var(--ink-soft) !important;
}

.info-value.status-connected {
  color: #bbf7d0;
}

.menu-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
  padding: 0;
}

.menu-item {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 112px;
  padding: 14px 14px 14px 18px;
  border-radius: 24px;
  text-align: left;
  overflow: visible;
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  transform: none;
}

.menu-item::before,
.menu-icon-wrap {
  display: none;
}

.menu-item:hover,
.menu-item:active {
  transform: scale(0.985);
  box-shadow: var(--shadow);
  border-color: rgba(255, 255, 255, 0.45);
}

.menu-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.menu-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--ink);
  text-align: left;
}

.menu-subtitle {
  display: block;
  font-size: 15px;
  line-height: 1.35;
  color: var(--ink-soft);
  opacity: 1;
  text-align: left;
}

.menu-foto {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 20px;
  flex: none;
}

.driver-pie {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  opacity: 0.9;
}

.driver-pie img {
  height: 36px;
  width: auto;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 10px;
  padding: 4px;
}

.driver-pie p {
  margin: 0;
  text-align: right;
  color: var(--ink-soft);
  font-size: 12px;
}

/* ——— Paneles y pantallas ——— */
.routes-content,
.profile-content,
.delivery-content,
.comment-modal-content,
.recepcion-content,
.modal-content,
.checklist-content,
.unit-content,
.route-card,
.stop-card,
.document-section,
.form-section,
.pallets-summary-card,
.pallets-detail-section,
.pallets-legend,
.route-progress,
.unit-card,
.info-card,
.recepcion-item-card,
.recepcion-oc-group {
  background: var(--glass) !important;
  color: var(--ink) !important;
  border: 1px solid var(--line) !important;
  border-radius: 24px !important;
  box-shadow: var(--shadow) !important;
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
}

.routes-modal,
.profile-modal,
.delivery-modal,
.comment-modal,
.recepcion-modal,
.modal,
.checklist-modal,
.unit-modal {
  background: rgba(7, 16, 14, 0.55) !important;
  align-items: flex-end;
  padding: 0;
}

.routes-content,
.profile-content,
.delivery-content,
.comment-modal-content,
.recepcion-content,
.modal-content,
.checklist-content,
.unit-content {
  width: 100% !important;
  max-width: 720px !important;
  max-height: 94dvh !important;
  margin: 0 auto;
  border-radius: 28px 28px 0 0 !important;
  background: var(--glass-strong) !important;
  padding-bottom: 108px !important;
}

.routes-header,
.profile-header,
.delivery-header,
.recepcion-header,
.comment-modal-header,
.modal-header,
.route-header,
.screen-header,
.checklist-header,
.pallets-header {
  background: transparent !important;
  color: var(--ink) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 0 !important;
}

.route-header,
.screen-header,
.checklist-header,
.pallets-header {
  position: sticky;
  top: 0;
  z-index: 4;
  padding: 12px 14px !important;
  background: rgba(16, 33, 27, 0.55) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  gap: 10px;
  flex-wrap: wrap;
}

.route-header h2,
.screen-header h2,
.checklist-header h2,
.pallets-header h2 {
  flex: 1;
  min-width: 0;
  font-size: 18px !important;
  line-height: 1.25 !important;
  text-align: left;
}

.back-btn,
.close-btn,
.close-delivery-btn,
.close-comment-btn {
  background: rgba(255, 255, 255, 0.16) !important;
  color: var(--ink) !important;
  border: 1px solid var(--line) !important;
  border-radius: 999px !important;
  min-height: 44px !important;
  min-width: 44px;
  margin: 0 !important;
  box-shadow: none !important;
  font-weight: 700;
}

.route-content,
.routes-body,
.screen-content,
.checklist-form,
.pallets-screen,
.profile-body,
.delivery-body,
.recepcion-body {
  color: var(--ink);
}

.route-card,
.stop-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px !important;
  margin-bottom: 12px;
}

.route-card.completed { box-shadow: inset 6px 0 0 #52c41a, var(--shadow) !important; }
.route-card.in_progress { box-shadow: inset 6px 0 0 #1890ff, var(--shadow) !important; }
.route-card.pending { box-shadow: inset 6px 0 0 #fa8c16, var(--shadow) !important; }
.stop-card.loading-place { box-shadow: inset 6px 0 0 #1890ff, var(--shadow) !important; }

.route-info,
.stop-info {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.route-name,
.route-details,
.loading-info,
.stop-name,
.stop-address,
.stop-time span,
.no-routes,
.no-stops,
.loading-routes,
.pallets-summary-label,
.pallets-summary-sub,
.pallets-summary-value,
.pallets-stat-label,
.pallets-stat-value,
.pallets-detail-header h3,
.pallets-count,
.pallets-legend,
.pallets-legend p,
.recepcion-item-sku,
.recepcion-item-desc,
.recepcion-oc-title,
.recepcion-empty,
.recepcion-loading {
  color: var(--ink) !important;
}

.route-name,
.stop-name {
  font-size: 18px !important;
  font-weight: 700 !important;
  line-height: 1.25;
}

.route-details,
.loading-info,
.stop-address,
.stop-time span {
  display: block;
  font-size: 15px !important;
  line-height: 1.4;
  word-break: break-word;
}

.stop-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.stop-number {
  width: 32px;
  height: 32px;
  font-size: 14px;
}

.stop-details {
  margin: 0 !important;
  display: grid;
  gap: 8px;
  font-size: 15px !important;
}

.stop-time {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
}

.stop-mas {
  margin-top: 4px;
}

.stop-mas summary {
  list-style: none;
  cursor: pointer;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--line);
  font-weight: 800;
  font-size: 15px;
  color: var(--ink);
}

.stop-mas summary::-webkit-details-marker {
  display: none;
}

.stop-mas summary::after {
  content: '▾';
}

.stop-mas:not([open]) summary::after {
  content: '▸';
}

.stop-mas .stop-details {
  padding-top: 10px;
}

.stop-actions,
.action-buttons,
.action-buttons-completed,
.form-actions,
.modal-buttons,
.comment-modal-actions,
.delivery-photo-actions,
.date-selection {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 8px !important;
  width: 100%;
}

.select-route-btn,
.arrival-btn,
.departure-btn,
.arrival-btn-large,
.departure-btn-large,
.navigation-btn,
.recepcion-btn,
.reset-btn,
.reset-btn-red,
.edit-delivery-photos-btn,
.cancel-btn,
.cancel-delivery-btn,
.cancel-comment-btn,
.pallets-load-more,
.upload-btn,
.delivery-pick-photos-btn {
  width: 100% !important;
  min-height: 52px !important;
  margin: 0 !important;
  border-radius: 16px !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  flex: none !important;
  box-shadow: none !important;
}

.arrival-btn,
.arrival-btn-large,
.navigation-btn,
.select-route-btn {
  background: #1890ff !important;
  color: #fff !important;
}

.departure-btn,
.departure-btn-large {
  background: #52c41a !important;
  color: #fff !important;
}

.recepcion-btn {
  background: #722ed1 !important;
  color: #fff !important;
}

.reset-btn,
.reset-btn-red,
.btn-danger {
  background: #ff4d4f !important;
  color: #fff !important;
}

.cancel-btn,
.cancel-delivery-btn,
.cancel-comment-btn,
.modal-buttons .btn-secondary,
.pallets-load-more,
.upload-btn,
.delivery-pick-photos-btn,
.edit-delivery-photos-btn {
  background: rgba(255, 255, 255, 0.16) !important;
  color: var(--ink) !important;
  border: 1px solid var(--line) !important;
}

.modal-buttons .btn-secondary,
#exit-button {
  width: 100% !important;
  min-height: 52px !important;
}

.ocupacion-card .btn-secondary,
.ocupacion-card .btn-danger {
  width: auto !important;
  flex: 1 !important;
}

.ocupacion-card .btn-secondary {
  background: #1f2937 !important;
  color: #fff !important;
  border: none !important;
}

.completed-text {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: #bbf7d0 !important;
  font-size: 16px !important;
  font-weight: 800 !important;
}

.progress-bar {
  height: 12px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.progress-fill {
  background: #52c41a;
}

.route-status,
.stop-status,
.loading-badge,
.limpieza-badge,
.bromatological-badge,
.status-badge {
  font-size: 12px !important;
  padding: 6px 10px !important;
  border-radius: 999px !important;
  font-weight: 800 !important;
}

/* Pallets: cada movimiento es una tarjeta con rótulo */
.pallets-table-wrap {
  max-height: none;
  overflow: visible;
  padding: 0 12px 12px;
}

.pallets-table thead {
  display: none;
}

.pallets-table,
.pallets-table tbody,
.pallets-table tr,
.pallets-table td {
  display: block;
  width: 100%;
}

.pallets-table {
  border-collapse: separate;
  border-spacing: 0 10px;
}

.pallets-table tr {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  padding: 8px 12px;
}

.pallets-table td {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: none !important;
  text-align: right !important;
  padding: 7px 0 !important;
  color: var(--ink) !important;
  max-width: none;
}

.pallets-table td::before {
  content: attr(data-label);
  font-weight: 700;
  color: var(--ink-soft);
  text-align: left;
}

.pallets-empty {
  display: block;
  text-align: center !important;
}

.pallets-empty::before {
  content: none;
}

.saldo-pos { color: #86efac !important; }
.saldo-neg { color: #fecaca !important; }
.saldo-cero { color: var(--ink-soft) !important; }

.pallets-summary-card.deuda-negativa {
  box-shadow: inset 6px 0 0 var(--coral), var(--shadow) !important;
}
.pallets-summary-card.deuda-positiva {
  box-shadow: inset 6px 0 0 #52c41a, var(--shadow) !important;
}

.recepcion-qty-btn {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  background: rgba(255, 255, 255, 0.18) !important;
  color: var(--ink) !important;
  border: 1px solid var(--line) !important;
}

.unit-item {
  background: rgba(255, 255, 255, 0.12) !important;
  color: var(--ink) !important;
  border: 1px solid var(--line) !important;
  border-radius: 18px !important;
  min-height: 56px;
  padding: 16px !important;
  font-size: 16px;
}

.unit-item.selected {
  border-color: var(--coral) !important;
  background: rgba(227, 106, 79, 0.28) !important;
}

#unit-selection-modal h3,
#unit-selection-modal h4,
#selected-unit-box,
#selected-unit-display,
#unit-selection-modal .modal-body {
  color: var(--ink) !important;
}

#selected-unit-box {
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid var(--line) !important;
  border-radius: 20px !important;
}

#ocupacionDarsenaScreen .screen-content label,
#emptyState,
#emptyState p {
  color: var(--ink) !important;
}

.ocupacion-card {
  border-radius: 22px !important;
  color: #14241c;
}

.ocupacion-card button {
  min-height: 48px !important;
  border-radius: 14px !important;
  font-size: 16px !important;
  font-weight: 800 !important;
}

.error-message {
  background: rgba(255, 77, 79, 0.18);
  color: #fecaca;
  border: 1px solid rgba(255, 77, 79, 0.45);
  border-left: 4px solid #ff4d4f;
}

.change-photo-btn {
  width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  min-width: 44px !important;
  border-radius: 50% !important;
  background: var(--coral) !important;
  color: #fff !important;
  font-size: 18px !important;
  margin: 0 !important;
  padding: 0 !important;
}

#profile-photo {
  border-color: rgba(255, 255, 255, 0.7) !important;
}

.sos-button {
  border-radius: 50% !important;
  width: 64px;
  height: 64px;
  font-size: 16px;
}

#install-button {
  left: 16px !important;
  right: auto !important;
  bottom: 20px !important;
  border-radius: 999px !important;
  min-height: 44px;
  background: var(--coral) !important;
}

/* El botón de fotos comparte la fila con ATRÁS y quedaba al 46%. */
.action-buttons-completed .edit-delivery-photos-btn {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  flex: 1 1 100% !important;
  align-self: stretch !important;
  box-sizing: border-box !important;
  font-size: 16px !important;
  min-height: 52px !important;
  padding: 12px 16px !important;
}

/* Chips claros: el texto crema no se lee. */
.arrival-comment,
.delivery-comment,
.delivery-status,
.bromatological-badge,
.stop-delivery-photos-label,
.delivery-recepcion-hint {
  color: #14241c !important;
  background: rgba(255, 255, 255, 0.94) !important;
}

.delivery-content,
.recepcion-content,
.comment-modal-content,
.document-section,
.vehicle-info,
.driver-info,
.route-header,
.screen-header,
.checklist-header,
.pallets-header {
  background: rgba(8, 18, 16, 0.92) !important;
}

.document-header h4,
.vehicle-info h3,
.driver-info h3,
.vehicle-info p,
.driver-info p,
.document-content,
.document-content label,
.date-section label,
.photo-section label,
.screen-header h2,
.delivery-header h3,
.delivery-header .stop-name,
.delivery-body,
.delivery-body label,
.delivery-body p,
.delivery-body small,
.edit-photos-hint,
.comment-modal-header h3,
.comment-modal-body,
.comment-modal-body label,
.recepcion-header h3,
.recepcion-body,
.recepcion-item-sku,
.recepcion-item-desc,
.recepcion-oc-title,
.recepcion-items-title,
.recepcion-meta {
  color: #fff !important;
}
