:root {
  /* Paleta TraeloExpress — tema claro */
  --te-primary: #fb9e20;
  --te-primary-hover: #c37b2b;
  --te-accent: #9d8156;
  --te-accent-dark: #7c703b;
  --te-ink: #2b2b2b;
  --te-bg: #ffffff;
  --te-bg-deep: #ffffff;
  --te-surface: #ffffff;
  --te-surface-raised: #f7f5f1;
  --te-border: #ddd5c8;
  --te-border-strong: #c9bfb0;
  --te-text: #2b2b2b;
  --te-text-secondary: #4a453c;
  --te-text-muted: #7c703b;
  --te-danger: #c62828;
  --te-primary-alpha: rgba(251, 158, 32, 0.14);
  --te-table-head: #f3efe8;
  --te-panel-bg: #faf8f5;
  --te-panel-bg-alt: #f5f0e8;
  --te-panel-border: #e5ddd0;
  --te-panel-accent-bg: #fff8ee;
  --te-input-bg: #ffffff;
  --te-shadow: rgba(43, 43, 43, 0.08);
  --te-shadow-md: rgba(43, 43, 43, 0.12);
  --te-gradient-panel: linear-gradient(
    165deg,
    var(--te-panel-bg-alt) 0%,
    var(--te-panel-bg) 55%,
    #ffffff 100%
  );
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--te-bg-deep);
  color: var(--te-text);
}

#app-root {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100vh;
  padding-bottom: 64px;
  background: var(--te-bg);
}

#view-outlet {
  flex: 1;
  overflow: auto;
  padding: 1rem;
}

#view-outlet:has(.mi-panel-view) {
  padding: 0;
}

.app-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0.55rem 1rem;
  background: var(--te-bg);
  border-bottom: 2px solid var(--te-primary);
  box-shadow: 0 1px 10px var(--te-shadow);
}

.app-header--hidden {
  display: none;
}

.app-header-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.app-header-brand:hover,
.app-header-brand:focus-visible {
  opacity: 0.92;
  outline: 2px solid var(--te-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.brand-logo {
  display: block;
  height: auto;
  max-width: 100%;
  object-fit: contain;
}

.brand-logo--header {
  width: min(220px, 52vw);
  max-height: 52px;
}

.brand-logo--login {
  width: min(320px, 88vw);
  max-height: 88px;
  margin: 0 auto;
}

.brand-logo--solicitud {
  width: min(280px, 80vw);
  max-height: 72px;
}

.login-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.solicitud-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--te-border);
}

.solicitud-editor {
  min-width: 0;
}

.solicitud-view .solicitud-editor {
  width: min(100%, 60rem);
  margin: 0 auto;
}

.solicitud-view .ship-user-picker-host,
.solicitud-view .ship-edit-root--page {
  margin-left: auto;
  margin-right: auto;
}

.solicitud-view .ship-edit-root--page {
  padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
}

.solicitud-view .ship-create-actions {
  bottom: calc(env(safe-area-inset-bottom, 0px));
  z-index: 90;
  padding-bottom: 0.75rem;
}

.envios-create-view .ship-user-picker-host,
.envios-create-view .ship-edit-root--page {
  margin-left: auto;
  margin-right: auto;
}

.envios-create-view .view-title,
.envios-create-view .ship-edit-link,
.envios-create-view .ship-user-picker-host,
.envios-create-view .ship-edit-root--page {
  width: min(100%, 60rem);
  margin-left: auto;
  margin-right: auto;
}

.envios-create-view .ship-edit-link {
  display: block !important;
}

.envios-create-view-active .app-header {
  justify-content: center;
}

.app-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.25rem calc(0.5rem + env(safe-area-inset-bottom));
  background: var(--te-surface);
  border-top: 1px solid var(--te-border);
  z-index: 100;
}

.app-nav button {
  flex: 1;
  max-width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.25rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--te-text-muted);
  font-size: 0.65rem;
  cursor: pointer;
}

.app-nav button:hover,
.app-nav button:focus-visible {
  background: var(--te-primary-alpha);
  color: var(--te-primary);
  outline: none;
}

.app-nav button.active {
  color: var(--te-primary);
}

.app-nav button svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-nav button.nav-exit {
  color: #f4212e;
}

.app-nav button.nav-exit:hover,
.app-nav button.nav-exit:focus-visible {
  color: #ff6b6b;
}

.view-title {
  margin: 0 0 1rem;
  font-size: 1.35rem;
  color: var(--te-text);
  font-weight: 700;
}

.view-actions {
  margin-bottom: 1rem;
}

.view-actions button {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--te-border);
  background: var(--te-surface);
  color: var(--te-text);
  cursor: pointer;
  font-size: 0.875rem;
}

.view-actions button:hover {
  border-color: var(--te-primary);
  color: var(--te-primary);
}

/* Window manager */
.win-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
}

.win-layer > * {
  pointer-events: auto;
}

.win-box {
  position: fixed;
  min-width: 240px;
  min-height: 120px;
  max-width: min(90vw, 480px);
  background: var(--te-surface);
  border: 1px solid var(--te-border-strong);
  border-radius: 10px;
  box-shadow: 0 8px 32px var(--te-shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.win-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  background: var(--te-surface-raised);
  border-bottom: 1px solid var(--te-border);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.win-titlebar:active {
  cursor: grabbing;
}

.win-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--te-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.win-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--te-text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.win-close:hover {
  background: #f4212e33;
  color: #f4212e;
}

.win-body {
  padding: 0.75rem 1rem;
  overflow: auto;
  flex: 1;
  font-size: 0.875rem;
  color: var(--te-text-secondary);
}

.win-box--ship-edit-page {
  left: 50%;
  top: max(1rem, env(safe-area-inset-top, 0px));
  width: min(60rem, calc(100vw - 2rem));
  max-width: 60rem;
  height: min(92dvh, calc(100dvh - 2rem));
  min-height: 0;
  transform: translateX(-50%);
}

.win-box--ship-edit-page .win-titlebar {
  cursor: default;
  flex-shrink: 0;
}

.win-box--ship-edit-page .win-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* Auth (login / signup) */
.auth-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem 3rem;
  background: var(--te-surface-raised);
}

.auth-page__inner {
  width: 100%;
  max-width: 48rem;
  animation: auth-fade-in 0.5s ease;
}

.auth-page__brand {
  display: flex;
  justify-content: center;
  margin-bottom: 1.75rem;
}

.auth-page__inner--narrow {
  max-width: 32rem;
}

.auth-notice {
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.auth-notice--info {
  background: #fff8ee;
  border: 1px solid #fde68a;
  color: #92400e;
  margin: 1.25rem;
}

.auth-notice--success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
}

.auth-activation {
  display: flex;
  flex-direction: column;
  min-height: 18rem;
  padding: 2rem 1.75rem 2.25rem;
  text-align: center;
}

.auth-activation__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.auth-activation__actions {
  margin-top: auto;
  padding-top: 1.75rem;
  flex-shrink: 0;
}

.auth-activation .auth-card__title {
  margin: 0;
}

.auth-activation .auth-card__desc {
  margin: 0;
  line-height: 1.55;
}

.auth-activation .auth-btn--block {
  margin: 0 auto;
  max-width: 18rem;
}

@keyframes auth-fade-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-tabs__list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding: 0.25rem;
  border-radius: 12px;
  background: var(--te-panel-bg);
  border: 1px solid var(--te-border);
}

.auth-tabs__trigger {
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--te-text-muted);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.auth-tabs__trigger--active {
  background: var(--te-surface);
  color: var(--te-text);
  box-shadow: 0 1px 6px var(--te-shadow);
}

.auth-tabs__panel--hidden {
  display: none;
}

.auth-card {
  background: var(--te-surface);
  border: 1px solid var(--te-border);
  border-radius: 16px;
  box-shadow: 0 8px 28px var(--te-shadow-md);
  overflow: hidden;
}

.auth-card--narrow {
  max-width: 36rem;
  margin: 0 auto;
}

.auth-card--activation {
  min-height: 14rem;
}

/* Recuperar contraseña (/recuperar) */
.auth-card--recover {
  padding: 2rem 2.25rem 2.5rem;
}

.auth-card--recover .auth-card__title {
  margin: 0 0 0.75rem;
}

.auth-card--recover .auth-card__desc {
  margin: 0 0 1.75rem;
  line-height: 1.55;
}

.auth-card--recover .auth-notice {
  margin-bottom: 1.5rem;
}

.auth-card--recover .auth-form {
  padding: 0;
  gap: 1.5rem;
}

.auth-card--recover .auth-field {
  gap: 0.5rem;
}

.auth-card--recover .auth-label {
  font-size: 0.9375rem;
}

.auth-card--recover .auth-input {
  padding: 0.85rem 1rem;
}

.auth-card--recover .auth-btn--block {
  margin-top: 0.25rem;
}

.auth-card--recover .auth-card__recover-login {
  margin-top: 1.75rem;
  padding: 0.9rem 1.25rem;
  text-align: center;
  text-decoration: none;
  display: block;
  box-sizing: border-box;
}

.auth-card__header {
  padding: 1.75rem 1.5rem 1.25rem;
}

.auth-card__header--center {
  text-align: center;
  padding-bottom: 2rem;
}

.auth-card__header--border {
  border-bottom: 1px solid var(--te-border);
}

.auth-card__icon-circle {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--te-primary-alpha);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--te-primary);
}

.auth-card__icon-circle .auth-icon {
  width: 2rem;
  height: 2rem;
}

.auth-card__title {
  margin: 2rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--te-text);
}

.auth-card__desc--email-gate {
  margin: 1.5rem !important;
  text-align: justify;
}

.auth-card__desc {
  margin: 0;
  font-size: 1rem;
  color: var(--te-text-muted);
}

.auth-card__footer {
  padding: 1.25rem 1.5rem 2rem;
  border-top: 1px solid var(--te-border);
  text-align: center;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 0 1.5rem 1.75rem;
}

.auth-form--centered {
  max-width: 28rem;
  margin: 0 auto;
}

.auth-form--signup {
  padding-top: 2rem;
  gap: 2rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.auth-field--narrow {
  max-width: 16rem;
}

.auth-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--te-text-secondary);
}

.auth-field__input-wrap {
  position: relative;
}

.auth-field__input-wrap > .auth-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  color: var(--te-text-muted);
  pointer-events: none;
}

.auth-input,
.auth-select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--te-border-strong);
  background: var(--te-input-bg);
  color: var(--te-text);
  font-size: 1rem;
  font-family: inherit;
}

.auth-input--icon {
  padding-left: 2.5rem;
}

.auth-input:focus,
.auth-select:focus {
  outline: none;
  border-color: var(--te-primary);
  box-shadow: 0 0 0 2px var(--te-primary-alpha);
}

.auth-btn {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.auth-btn--primary {
  background: var(--te-primary);
  color: var(--te-ink);
}

.auth-btn--primary:hover:not(:disabled) {
  background: var(--te-primary-hover);
  color: #fff;
}

.auth-btn--palette {
  background: linear-gradient(
    90deg,
    var(--te-primary) 0%,
    var(--te-primary-hover) 28%,
    var(--te-accent) 52%,
    var(--te-accent-dark) 76%,
    var(--te-ink) 100%
  );
  color: #fff;
  text-shadow: 0 1px 0 rgba(43, 43, 43, 0.25);
}

.auth-btn--palette:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow: 0 4px 16px var(--te-shadow-md);
}

.auth-submit-wrap--dual {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.auth-btn--outline {
  background: var(--te-surface);
  border: 1px solid var(--te-border-strong);
  color: var(--te-text);
}

.auth-btn--block {
  width: 100%;
}

.auth-btn--lg {
  padding: 1rem;
  font-size: 1.125rem;
  box-shadow: 0 4px 14px var(--te-shadow);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0 0.85rem;
  color: var(--te-text-muted);
  font-size: 0.75rem;
  text-transform: lowercase;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--te-border-strong);
}

.auth-google-host {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-bottom: 1rem;
}

.auth-google-btn-host {
  display: flex;
  justify-content: center;
  width: 100%;
}

.auth-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-link-btn {
  border: none;
  background: none;
  color: var(--te-primary-hover);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.auth-link-btn:hover {
  text-decoration: none;
}

.auth-form-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-form-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.auth-form-section-header .auth-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--te-primary);
}

.auth-form-section-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.auth-form-section-header--with-action h3 {
  flex: 1;
}

.auth-warehouse-load-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 0.35rem;
  border: 1px solid var(--te-border);
  border-radius: 8px;
  background: var(--te-panel-bg);
  color: var(--te-primary);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.auth-warehouse-load-btn:hover {
  background: #fff;
  border-color: var(--te-primary);
}

.auth-warehouse-load-btn .auth-icon {
  width: 1.125rem;
  height: 1.125rem;
}

.auth-principal-address-note {
  margin: 0 0 0.75rem;
}

.auth-principal-address-link {
  color: var(--te-primary);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.auth-principal-address-link:hover {
  color: var(--te-primary-dark, #0d6efd);
}

.auth-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .auth-form-grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.auth-field-hint {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--te-text-muted);
}

.auth-strength {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.5rem;
  height: 0.375rem;
  border-radius: 999px;
  overflow: hidden;
  background: var(--te-panel-bg);
}

.auth-strength-bar {
  flex: 1;
  height: 100%;
  background: transparent;
  transition: background 0.3s;
}

.auth-strength-bar--weak {
  background: var(--te-danger);
}

.auth-strength-bar--fair {
  background: #f97316;
}

.auth-strength-bar--good {
  background: #eab308;
}

.auth-strength-bar--strong {
  background: #22c55e;
}

.auth-opciones-grid {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.auth-opciones-grid--2 {
  grid-template-columns: 1fr;
}

.auth-opciones-grid--3 {
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .auth-opciones-grid--2 {
    grid-template-columns: 1fr 1fr;
  }
  .auth-opciones-grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.auth-opcion-card {
  position: relative;
  text-align: left;
  padding: 1rem;
  border-radius: 12px;
  border: 2px solid var(--te-border);
  background: var(--te-surface);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.auth-opcion-card:hover {
  border-color: rgba(251, 158, 32, 0.45);
  background: var(--te-panel-bg);
}

.auth-opcion-card--selected {
  border-color: var(--te-primary);
  background: var(--te-primary-alpha);
  box-shadow: 0 2px 8px var(--te-shadow);
}

.auth-opcion-card__check {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 1rem;
  height: 1rem;
  color: var(--te-primary);
}

.auth-opcion-card__icon {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  background: var(--te-panel-bg);
  color: var(--te-text-muted);
}

.auth-opcion-card__icon .auth-icon {
  width: 1rem;
  height: 1rem;
}

.auth-opcion-card__icon--selected {
  background: var(--te-primary);
  color: #fff;
}

.auth-opcion-card__title {
  margin: 0 0 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--te-text);
}

.auth-opcion-card--selected .auth-opcion-card__title {
  color: var(--te-primary-hover);
}

.auth-opcion-card__desc {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--te-text-muted);
}

.auth-opcion-card-wrap {
  display: block;
  min-width: 0;
}

.auth-opcion-card-wrap--disabled {
  cursor: not-allowed;
}

.auth-opcion-card-wrap--disabled .auth-opcion-card {
  width: 100%;
}

.auth-opcion-card--disabled,
.auth-opcion-card--disabled:hover {
  cursor: not-allowed;
  opacity: 0.55;
  border-color: var(--te-border);
  background: var(--te-panel-bg);
  box-shadow: none;
}

.auth-dynamic-panel {
  animation: auth-panel-in 0.2s ease;
}

@keyframes auth-panel-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-address-summary,
.auth-warehouse-block {
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--te-border);
  background: var(--te-panel-bg);
}

.auth-warehouse-block {
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.auth-address-summary__head,
.auth-warehouse-block__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.auth-address-summary__head .auth-icon,
.auth-warehouse-block__head .auth-icon {
  width: 1rem;
  height: 1rem;
  color: var(--te-primary);
}

.auth-warehouse-block__head {
  color: #047857;
  font-weight: 600;
  font-size: 0.875rem;
}

.auth-address-summary__head-title {
  font-weight: 600;
  font-size: 0.875rem;
}

.auth-address-summary__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
}

.auth-address-summary__label {
  font-weight: 600;
  color: var(--te-text-secondary);
}

.auth-address-summary__value--empty {
  font-style: italic;
  color: var(--te-text-muted);
  opacity: 0.65;
}

.auth-address-summary__warn {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.75rem;
  font-size: 0.75rem;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
}

.auth-warehouse-block__note {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.75rem;
  font-size: 0.75rem;
  color: #047857;
  background: #d1fae5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
}

.auth-conflict-wrap {
  display: none;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.auth-conflict-wrap--visible {
  display: block;
  animation: auth-panel-in 0.2s ease;
}

.auth-conflict {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid #fcd34d;
  background: #fffbeb;
  font-size: 0.875rem;
}

.auth-conflict .auth-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  color: #d97706;
  margin-top: 0.125rem;
}

.auth-conflict__title {
  margin: 0 0 0.25rem;
  font-weight: 600;
  color: #92400e;
}

.auth-conflict__body {
  margin: 0;
  color: #b45309;
  line-height: 1.4;
}

.auth-conflict-hint {
  text-align: center;
  font-size: 0.875rem;
  color: #b45309;
  margin: 0 0 0.75rem;
}

.auth-conflict-hint--hidden {
  display: none;
}

.auth-submit-wrap {
  margin-top: 0.5rem;
}

.auth-form-error {
  background: #7f1d1d;
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.45;
}

.auth-form-error--hidden {
  display: none;
}

.auth-dialog {
  border: none;
  border-radius: 14px;
  padding: 0;
  max-width: 28rem;
  width: calc(100% - 2rem);
  box-shadow: 0 16px 40px var(--te-shadow-md);
}

.auth-dialog::backdrop {
  background: rgba(43, 43, 43, 0.45);
}

.auth-dialog__form {
  padding: 1.5rem;
}

.auth-dialog__title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}

.auth-dialog__desc {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--te-text-muted);
}

.auth-dialog__fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-dialog__fields--hidden {
  display: none;
}

.auth-dialog__success {
  text-align: center;
  padding: 1rem 0;
}

.auth-dialog__success--hidden {
  display: none;
}

.auth-dialog__success-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-toast {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  z-index: 9999;
  max-width: min(24rem, calc(100vw - 2rem));
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  box-shadow: 0 8px 24px var(--te-shadow-md);
}

.auth-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.auth-toast--success {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.auth-toast--error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.auth-icon {
  display: block;
  flex-shrink: 0;
}

.auth-field--city {
  position: relative;
}

.auth-geo-ac-list {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  margin: 0.25rem 0 0;
  padding: 0.25rem 0;
  list-style: none;
  max-height: 11rem;
  overflow: auto;
  background: var(--te-surface);
  border: 1px solid var(--te-border-strong);
  border-radius: 8px;
  box-shadow: 0 6px 18px var(--te-shadow-md);
}

.auth-geo-ac-item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 0.875rem;
  color: var(--te-text);
  cursor: pointer;
}

.auth-geo-ac-item:hover {
  background: var(--te-primary-alpha);
}

.ship-controls {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.ship-search,
.ship-per-page {
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--te-border);
  background: var(--te-input-bg);
  color: var(--te-text);
}

.ship-search {
  min-width: 320px;
  flex: 1;
}

.ship-status {
  margin-bottom: 0.75rem;
  color: var(--te-text-secondary);
  font-size: 0.875rem;
}

.ship-table-wrap {
  overflow: auto;
  border: 1px solid var(--te-border);
  border-radius: 8px;
}

.ship-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1200px;
}

.ship-table th,
.ship-table td {
  border-bottom: 1px solid var(--te-border);
  padding: 0.5rem 0.6rem;
  text-align: left;
  font-size: 0.8125rem;
  white-space: nowrap;
  color: var(--te-text);
}

.ship-table th.ship-table-check-col,
.ship-table td.ship-table-check-col {
  width: 2.25rem;
  min-width: 2.25rem;
  max-width: 2.25rem;
  text-align: center;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
}

.ship-table-check-col input[type='checkbox'] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
  accent-color: var(--te-primary);
}

.ship-bulk-track-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--te-border);
  border-radius: 8px;
  background: var(--te-panel-bg, var(--te-input-bg));
}

.ship-bulk-track-count {
  font-size: 0.8125rem;
  color: var(--te-text-secondary);
  min-width: 7rem;
}

.ship-bulk-track-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  color: var(--te-text);
}

.ship-bulk-track-select {
  min-width: 16rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--te-border);
  background: var(--te-input-bg);
  color: var(--te-text);
  font-size: 0.8125rem;
}

.ship-bulk-track-apply {
  border: 1px solid var(--te-primary);
  color: #fff;
  background: var(--te-primary);
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  font-size: 0.8125rem;
  cursor: pointer;
}

.ship-bulk-track-apply:hover:not(:disabled) {
  filter: brightness(1.05);
}

.ship-bulk-track-apply:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ship-table th {
  background: var(--te-table-head);
  color: var(--te-text-secondary);
  font-weight: 600;
  position: sticky;
  top: 0;
}

.ship-view-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.ship-view-heading .view-title {
  margin: 0;
}

.ship-create-btn {
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--te-border);
  background: var(--te-surface);
  color: var(--te-primary);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
}

.ship-create-btn:hover {
  border-color: var(--te-primary);
  background: var(--te-panel-accent-bg);
}

.ship-edit-link {
  color: var(--te-primary);
  text-decoration: underline;
  cursor: pointer;
  white-space: nowrap;
}

button.ship-edit-link {
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
  text-align: left;
}

.ship-edit-link:hover {
  color: var(--te-primary-hover);
}

.ship-user-picker-host {
  max-width: 60rem;
  margin-bottom: 1.25rem;
}

.ship-user-picker {
  padding: 1rem 1.15rem;
  border: 1px solid var(--te-panel-border);
  border-radius: 10px;
  background: var(--te-gradient-panel);
  box-shadow: 0 2px 12px var(--te-shadow);
}

.ship-user-picker-title {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--te-text);
}

.ship-user-picker-search-wrap {
  position: relative;
  margin-bottom: 0.75rem;
}

.ship-user-picker-search {
  width: 100%;
  max-width: 28rem;
  box-sizing: border-box;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--te-border-strong);
  border-radius: 8px;
  background: var(--te-input-bg);
  color: var(--te-text);
  font-size: 0.95rem;
}

.ship-user-picker-search:focus {
  outline: none;
  border-color: var(--te-primary);
  box-shadow: 0 0 0 2px var(--te-primary-alpha);
}

.ship-user-picker-results {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  max-width: 28rem;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--te-border-strong);
  border-radius: 8px;
  background: var(--te-surface);
  box-shadow: 0 8px 24px var(--te-shadow-md);
}

.ship-user-picker-result {
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--te-text);
  border-bottom: 1px solid var(--te-border);
}

.ship-user-picker-result:last-child {
  border-bottom: none;
}

.ship-user-picker-result:hover {
  background: var(--te-panel-accent-bg);
  color: var(--te-text);
}

.ship-user-picker-result--empty {
  cursor: default;
  color: var(--te-text-muted);
}

.ship-user-picker-result--empty:hover {
  background: transparent;
}

.ship-user-picker-selected {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: var(--te-primary-alpha);
  border: 1px solid rgba(251, 158, 32, 0.45);
}

.ship-user-picker-selected-label {
  font-size: 0.92rem;
  color: var(--te-accent-dark);
  font-weight: 500;
}

.ship-user-picker-clear {
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--te-border-strong);
  border-radius: 6px;
  background: transparent;
  color: var(--te-text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
}

.ship-user-picker-clear:hover {
  border-color: var(--te-primary);
  color: var(--te-primary);
}

.ship-user-picker-addr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
  margin-bottom: 0.5rem;
}

@media (max-width: 720px) {
  .ship-user-picker-addr-grid {
    grid-template-columns: 1fr;
  }
}

.ship-user-picker-addr-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ship-user-picker-addr-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--te-text-muted);
  letter-spacing: 0.02em;
}

.ship-user-picker-select {
  width: 100%;
  min-height: 2.35rem;
}

.ship-user-picker-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--te-text-muted);
}

.ship-new-address-panels {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ship-edit-section--new-addr[hidden] {
  display: none;
}

.ship-edit-section--new-addr {
  margin-bottom: 0;
}

.ship-edit-section--new-addr .ship-new-address-status {
  margin-top: 0.65rem;
}

.ship-edit-section--new-addr .ship-new-address-actions {
  margin-top: 0.5rem;
}

.ship-new-address-status {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: #f87171;
  min-height: 1.2em;
}

.ship-new-address-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.ship-new-addr-cancel {
  background: transparent;
  border-color: var(--te-border-strong);
  color: var(--te-text-secondary);
}

.ship-flag-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.ship-table td.ship-table-flags-cell {
  text-align: center;
  vertical-align: middle;
}

.ship-table th.ship-table-flags-head {
  text-align: center;
}

.ship-flag-dot {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  border: 1px solid transparent;
}

.ship-flag-dot--ok {
  background: #1c9b49;
  border-color: #23c15b;
}

.ship-flag-dot--pending {
  background: #b21c28;
  border-color: #df3b48;
}

.ship-flag-dot--warning {
  background: #b98a00;
  border-color: #f3c623;
}

.ship-edit-root {
  flex-direction: column;
  align-items: stretch;
  max-height: min(70vh, 560px);
  overflow: auto;
}

.ship-edit-root--page {
  max-height: none;
  overflow: visible;
  max-width: 60rem;
}

.ship-edit-top-tools {
  display: block;
  position: relative;
  overflow: visible;
  margin-bottom: 0.6rem;
}

.ship-edit-top-tools::after {
  content: '';
  display: table;
  clear: both;
}

.ship-edit-menu {
  position: relative;
  float: right;
  margin-right: 1rem;
}

.ship-edit-menu summary::-webkit-details-marker {
  display: none;
}

.ship-edit-menu summary::marker {
  display: none;
  content: '';
}

.ship-edit-menu-trigger {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 8px;
  border: 1px solid var(--te-border-strong);
  background: var(--te-surface-raised);
  color: var(--te-text);
  cursor: pointer;
  font-size: 1.5rem;
  font-weight: 700;
  user-select: none;
  line-height: 1;
}

.ship-edit-menu-trigger-icon {
  display: inline-block;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
}

.ship-edit-menu[open] .ship-edit-menu-trigger,
.ship-edit-menu-trigger:hover {
  border-color: var(--te-primary);
  color: var(--te-primary-hover);
  background: var(--te-panel-accent-bg);
}

.ship-edit-menu-panel {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.35rem;
  min-width: 10.5rem;
  z-index: 1200;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.45rem;
  border-radius: 10px;
  border: 1px solid var(--te-panel-border);
  background: var(--te-surface);
  box-shadow: 0 8px 24px var(--te-shadow-md);
}

.ship-edit-menu[open] .ship-edit-menu-panel {
  display: flex;
}

.ship-edit-menu-item {
  border: 1px solid var(--te-border);
  background: var(--te-surface-raised);
  color: var(--te-text);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  text-align: left;
  font-size: 0.8rem;
  cursor: pointer;
}

.ship-edit-menu-item:hover:not(:disabled) {
  border-color: var(--te-primary);
  color: var(--te-primary-hover);
  background: var(--te-panel-accent-bg);
}

.ship-edit-menu-item:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ship-create-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.4rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--te-panel-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, #ffffff 42%);
}

.ship-create-errors-panel {
  flex: 1 1 100%;
  margin: 0 0 0.35rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #ef9a9a;
  border-radius: 8px;
  background: #ffebee;
}

.ship-create-error-title {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #b71c1c;
}

.ship-create-error-list {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #c62828;
}

.ship-create-error-list li + li {
  margin-top: 0.2rem;
}

.ship-create-status {
  min-height: 1rem;
  font-size: 0.78rem;
  color: var(--te-text-secondary);
}

.ship-create-status--error {
  color: #c62828;
  font-weight: 600;
}

.ship-field--error,
input.ship-field--error,
select.ship-field--error,
textarea.ship-field--error {
  border-color: #c62828 !important;
  box-shadow: 0 0 0 1px #c62828;
}

/* Encabezado envío (creador, correo, fecha, estado) — alineado arriba-izquierda */
.ship-edit-header-wrap {
  align-self: flex-start;
  max-width: min(100%, 22rem);
  margin-bottom: 1rem;
  padding: 0.95rem 1.05rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--te-panel-border);
  background: var(--te-gradient-panel);
  box-shadow: 0 2px 10px var(--te-shadow);
}

.ship-edit-header-title {
  margin: 0 0 0.7rem;
  font-size: 1.28rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--te-text);
  letter-spacing: 0.01em;
}

.ship-edit-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.45rem;
  margin-bottom: 0.4rem;
  font-size: 0.875rem;
  line-height: 1.4;
}

.ship-edit-header-row:last-child {
  margin-bottom: 0;
}

.ship-edit-header-row--stack {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
}

.ship-edit-header-label {
  font-weight: 600;
  color: var(--te-text-muted);
}

.ship-edit-header-value {
  color: var(--te-text);
  font-weight: 400;
}

.ship-edit-header-datebox {
  display: inline-block;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  background: var(--te-surface-raised);
  border: 1px solid var(--te-border-strong);
  color: var(--te-text);
  font-size: 0.875rem;
  font-weight: 400;
}

/* Resumen remitente / destinatario (ventana de envío) */
.ship-edit-banner {
  margin-bottom: 1.1rem;
  padding: 0.9rem 1rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--te-panel-border);
  background: var(--te-gradient-panel);
  box-shadow: 0 2px 12px var(--te-shadow);
}

.ship-edit-banner-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.5rem;
  align-items: start;
}

@media (max-width: 640px) {
  .ship-edit-banner-inner {
    grid-template-columns: 1fr;
  }
}

.ship-edit-banner-col {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.ship-edit-banner-row {
  display: grid;
  grid-template-columns: minmax(7.5rem, 40%) 1fr;
  gap: 0.35rem 0.65rem;
  align-items: baseline;
  font-size: 0.8125rem;
  line-height: 1.35;
}

.ship-edit-banner-label {
  font-weight: 600;
  color: var(--te-accent-dark);
  word-break: break-word;
}

.ship-edit-banner-value {
  color: var(--te-text);
  word-break: break-word;
  white-space: pre-wrap;
}

.ship-edit-loading,
.ship-edit-empty {
  margin: 0;
  color: var(--te-text-muted);
  font-size: 0.8125rem;
}

.ship-edit-section {
  margin-bottom: 1.1rem;
}

.ship-edit-section:last-child {
  margin-bottom: 0;
}

.ship-edit-section h3 {
  margin: 0 0 0.45rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--te-text);
}

.ship-edit-sub {
  margin: 0.5rem 0 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--te-text-secondary);
}

.ship-edit-dl {
  display: grid;
  grid-template-columns: minmax(7rem, 32%) 1fr;
  gap: 0.2rem 0.65rem;
  font-size: 0.8125rem;
  margin: 0;
}

.ship-edit-dl dt {
  margin: 0;
  color: var(--te-text-muted);
  word-break: break-word;
}

.ship-edit-dl dd {
  margin: 0;
  color: var(--te-text-secondary);
  word-break: break-word;
  white-space: pre-wrap;
}

/* Factura (ventana envío): barra lateral naranja, fondo lavanda oscuro */
.ship-edit-section--invoice {
  margin-bottom: 1.1rem;
}

.ship-inv-shell {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  border: 1px solid var(--te-panel-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--te-gradient-panel);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.ship-inv-rail {
  flex: 0 0 2.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.15rem;
  background: linear-gradient(180deg, var(--te-primary) 0%, var(--te-primary-hover) 100%);
  color: #1a0f0a;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-transform: uppercase;
  user-select: none;
}

.ship-inv-body {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 0.85rem 0.9rem;
}

.ship-inv-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.55rem;
}

.ship-inv-headline {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--te-text);
  text-align: right;
}

.ship-inv-headline--muted {
  color: var(--te-text-muted);
  font-weight: 500;
}

.ship-inv-btn {
  border: none;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.4rem 0.75rem;
}

.ship-inv-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ship-inv-btn--add {
  margin-bottom: 0.55rem;
  background: #2f855a;
  color: #fff;
}

.ship-inv-btn--add:hover:not(:disabled) {
  background: #276749;
}

.ship-inv-btn--action {
  background: #2f855a;
  color: #fff;
  padding: 0.38rem 0.55rem;
  font-size: 0.75rem;
}

.ship-inv-btn--action:hover:not(:disabled) {
  background: #276749;
}

.ship-inv-warning {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  color: #fbbf24;
}

.ship-inv-rows {
  margin-bottom: 0.65rem;
}

.ship-inv-line {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.45rem 0.6rem;
  margin-bottom: 0.55rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--te-panel-border);
}

.ship-inv-line:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.ship-inv-remove {
  flex: 0 0 auto;
  width: 1.75rem;
  height: 1.75rem;
  margin-bottom: 0.1rem;
  border: 1px solid #5c3d3d;
  border-radius: 6px;
  background: transparent;
  color: #f87171;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  align-self: center;
}

.ship-inv-remove:hover:not(:disabled) {
  background: #f8717122;
}

.ship-inv-remove:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.ship-inv-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.ship-inv-field-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--te-text-muted);
}

.ship-inv-field--item {
  flex: 1 1 11rem;
  min-width: 8rem;
}

.ship-inv-field--qty {
  flex: 0 0 4.25rem;
}

.ship-inv-field--unit {
  flex: 0 0 5.25rem;
}

.ship-inv-field--sub {
  flex: 0 0 4.75rem;
}

.ship-inv-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--te-border-strong);
  background: var(--te-input-bg);
  color: var(--te-text);
  font-size: 0.8125rem;
}

.ship-inv-input:focus {
  outline: none;
  border-color: var(--te-primary);
}

.ship-inv-input--readonly {
  background: var(--te-surface-raised);
  color: var(--te-text-secondary);
}

select.ship-inv-input {
  cursor: pointer;
}

.ship-inv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.ship-inv-total-row {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
}

.ship-inv-total-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--te-text-muted);
}

.ship-inv-total-input {
  width: 100%;
  max-width: 12rem;
  text-align: right;
  font-weight: 600;
}

/* Vista previa del correo de factura (ventana flotante) */
.ship-inv-preview-root {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 280px;
  max-height: min(72vh, 640px);
}

.win-box--ship-edit-page .ship-inv-preview-root {
  flex: 1;
  min-height: 0;
  max-height: none;
  height: 100%;
}

.ship-inv-preview-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.35rem 0.4rem;
  border-radius: 8px;
  background: var(--te-panel-bg-alt);
  border: 1px solid var(--te-panel-border);
}

.ship-inv-preview-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
  font-size: 0.8125rem;
}

.ship-inv-preview-meta-label {
  color: var(--te-text-muted);
  font-weight: 600;
  min-width: 9rem;
}

.ship-inv-preview-meta-value {
  color: var(--te-text);
  word-break: break-all;
  flex: 1;
  min-width: 0;
}

.ship-inv-preview-meta-value--muted {
  font-weight: 500;
  color: var(--te-text-secondary);
}

.ship-inv-preview-frame {
  flex: 1;
  width: 100%;
  min-height: 240px;
  height: min(48vh, 420px);
  border: 1px solid var(--te-panel-border);
  border-radius: 8px;
  background: #ffffff;
}

.win-box--ship-edit-page .ship-inv-preview-frame {
  flex: 1;
  min-height: 0;
  height: auto;
  max-height: none;
}

.ship-inv-preview-error {
  margin: 0;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  border: 1px solid #991b1b;
  background: #fef2f2;
  color: #7f1d1d;
  font-size: 0.8125rem;
  line-height: 1.35;
}

.ship-inv-preview-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  padding-top: 0.25rem;
}

.win-box--ship-edit-page .ship-inv-preview-meta,
.win-box--ship-edit-page .ship-inv-preview-error,
.win-box--ship-edit-page .ship-inv-preview-footer {
  flex-shrink: 0;
}

.win-box--ship-edit-page .ship-inv-preview-footer {
  justify-content: stretch;
  gap: 0.65rem;
  padding-top: 0.5rem;
}

.win-box--ship-edit-page .ship-inv-preview-footer .ship-inv-btn {
  flex: 1;
  min-width: 0;
  min-height: 2.75rem;
}

/* Overlay de carga (ventanas flotantes, FedEx, etc.) */
.te-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(2px);
}

.te-loading-overlay-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.15rem 1.4rem;
  border-radius: 10px;
  background: var(--te-surface);
  border: 1px solid var(--te-border-strong);
  box-shadow: 0 6px 28px var(--te-shadow-md);
}

.te-loading-spinner {
  width: 2.25rem;
  height: 2.25rem;
  border: 3px solid var(--te-border-strong);
  border-top-color: var(--te-accent);
  border-radius: 50%;
  animation: te-loading-spin 0.75s linear infinite;
}

@keyframes te-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.te-loading-overlay-msg {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--te-text);
  text-align: center;
}

.ship-inv-preview-btn-exit {
  background: var(--te-surface-raised) !important;
  color: var(--te-text) !important;
  border: 1px solid var(--te-border-strong) !important;
}

.ship-inv-preview-btn-exit:hover:not(:disabled) {
  background: var(--te-border) !important;
}

/* Resumen FedEx Ship Request (ventana flotante) */
.ship-fedex-preview-root {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 280px;
  max-height: min(72vh, 640px);
}

.win-box--ship-edit-page .ship-fedex-preview-root {
  flex: 1;
  min-height: 0;
  max-height: none;
  height: 100%;
}

.win-box--ship-edit-page .ship-fedex-preview-intro {
  flex-shrink: 0;
}

.ship-fedex-preview-intro {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--te-text-muted);
  line-height: 1.4;
}

.ship-fedex-preview-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.ship-fedex-preview-section {
  margin-bottom: 1rem;
}

.ship-fedex-preview-section:last-child {
  margin-bottom: 0.25rem;
}

.ship-fedex-preview-section-title {
  margin: 0 0 0.4rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #e8b84a;
  letter-spacing: 0.02em;
}

.ship-fedex-preview-dl {
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  background: var(--te-panel-bg-alt);
  border: 1px solid var(--te-panel-border);
}

.ship-fedex-preview-note {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  color: var(--te-text-secondary);
}

.ship-fedex-preview-pkg-wrap {
  overflow-x: auto;
}

.ship-fedex-preview-pkg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.ship-fedex-preview-pkg-table th,
.ship-fedex-preview-pkg-table td {
  padding: 0.35rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--te-panel-border);
}

.ship-fedex-preview-pkg-table th {
  color: var(--te-text-muted);
  font-weight: 600;
}

.ship-fedex-preview-pkg-table td {
  color: var(--te-text);
}

.ship-fedex-preview-btn-request {
  background: #4f46e5 !important;
  color: #fff !important;
}

.ship-fedex-preview-btn-request:hover:not(:disabled) {
  background: #6366f1 !important;
}

.ship-fedex-preview-btn-force {
  background: #b45309 !important;
  color: #fff !important;
}

.ship-fedex-preview-btn-force:hover:not(:disabled) {
  background: #d97706 !important;
}

.ship-fedex-preview-footer {
  align-items: flex-start;
  justify-content: space-between;
}

.win-box--ship-edit-page .ship-fedex-preview-footer {
  flex-shrink: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}

.win-box--ship-edit-page .ship-fedex-preview-footer-actions {
  justify-content: stretch;
  width: 100%;
  gap: 0.65rem;
}

.win-box--ship-edit-page .ship-fedex-preview-footer-actions .ship-inv-btn {
  flex: 1;
  min-width: 0;
  min-height: 2.75rem;
}

.win-box--ship-edit-page .ship-fedex-preview-footer-prior {
  max-width: 100%;
  width: 100%;
}

.ship-fedex-preview-footer-msg {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  margin: 0;
}

.ship-fedex-preview-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  align-items: center;
}

.ship-fedex-preview-footer-prior {
  margin: 0;
  max-width: min(100%, 22rem);
  padding: 0.4rem 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: #fcd34d;
  border-radius: 8px;
  border: 1px solid #b45309;
  background: rgba(180, 83, 9, 0.18);
}

@media (min-width: 480px) {
  .ship-fedex-preview-footer-msg {
    max-width: calc(100% - 15rem);
  }
}

.fedex-page-intro {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: var(--te-text-muted);
  line-height: 1.4;
}

.fedex-courier-table .fedex-row-actions-cell {
  min-width: 28rem;
  vertical-align: middle;
}

.fedex-row-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.fedex-row-action {
  padding: 0.25rem 0.45rem;
  font-size: 0.75rem;
  line-height: 1.25;
  border-radius: 6px;
  border: 1px solid var(--te-primary);
  background: var(--te-panel-accent-bg);
  color: var(--te-primary-hover);
  cursor: pointer;
  white-space: nowrap;
}

.fedex-row-action:hover:not(:disabled) {
  background: var(--te-primary-alpha);
  color: var(--te-ink);
}

.fedex-row-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Origen (ventana envío): misma idea que factura, rejilla 3 columnas */
.ship-edit-section--service-type {
  margin-bottom: 1.1rem;
}

.ship-edit-section--service-type .ship-origin-body {
  max-width: 22rem;
}

.ship-edit-section--origin {
  margin-bottom: 1.1rem;
}

.ship-origin-shell {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  border: 1px solid var(--te-panel-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--te-gradient-panel);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.ship-origin-rail {
  flex: 0 0 2.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.15rem;
  background: linear-gradient(180deg, var(--te-primary) 0%, var(--te-primary-hover) 100%);
  color: #1a0f0a;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-transform: none;
  user-select: none;
}

.ship-origin-body {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 0.85rem 0.9rem;
}

.ship-origin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.55rem 1rem;
  align-items: start;
}

@media (max-width: 720px) {
  .ship-origin-grid {
    grid-template-columns: 1fr;
  }
}

/* Destino: misma rejilla 3×4, celdas planas (sin subcolumnas) */
.ship-dest-form-grid {
  grid-template-columns: 1fr 1fr 1fr;
}

.ship-dest-form-grid .ship-origin-field--wide .ship-origin-input {
  width: 100%;
}

.ship-edit-section--dest {
  margin-bottom: 1.1rem;
}

/* Paquetes (ventana envío) */
.ship-edit-section--pkg {
  margin-bottom: 1.1rem;
}

/* Recolección (pickup) */
.ship-edit-section--pickup {
  margin-bottom: 1.1rem;
}

.ship-pickup-shell {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  border: 1px solid var(--te-panel-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--te-gradient-panel);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.ship-pickup-rail {
  flex: 0 0 2.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.15rem;
  background: linear-gradient(180deg, var(--te-primary) 0%, var(--te-primary-hover) 100%);
  color: #1a0f0a;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-transform: none;
  user-select: none;
}

.ship-pickup-body {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 0.85rem 0.9rem;
}

.ship-pickup-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
}

.ship-pickup-toggle input[type='checkbox'] {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--te-primary);
  cursor: pointer;
}

.ship-pickup-toggle-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--te-text);
  cursor: pointer;
  user-select: none;
}

.ship-pickup-detail-fields {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ship-pickup-detail-fields--disabled {
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
}

.ship-pickup-detail-fields--disabled .ship-pickup-field-label {
  color: var(--te-text-muted);
  opacity: 0.65;
}

.ship-pickup-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ship-pickup-field-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--te-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ship-pickup-input {
  max-width: 16rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--te-border-strong);
  border-radius: 6px;
  background: var(--te-input-bg);
  color: var(--te-text);
  font-size: 0.875rem;
}

.ship-pickup-input:disabled {
  cursor: not-allowed;
  background: var(--te-surface-raised);
  color: var(--te-text-muted);
}

.ship-pickup-time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
  max-width: 28rem;
}

@media (max-width: 520px) {
  .ship-pickup-time-grid {
    grid-template-columns: 1fr;
  }
}

.ship-pickup-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--te-text-muted);
  line-height: 1.4;
}

.ship-pkg-shell {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  border: 1px solid var(--te-panel-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--te-gradient-panel);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.ship-pkg-rail {
  flex: 0 0 2.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.15rem;
  background: linear-gradient(180deg, var(--te-primary) 0%, var(--te-primary-hover) 100%);
  color: #1a0f0a;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-transform: none;
  user-select: none;
}

.ship-pkg-body {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.85rem 0.85rem;
}

.ship-pkg-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.45rem;
}

.ship-pkg-toolbar-left {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.ship-pkg-toolbar-right {
  margin-left: auto;
}

.ship-pkg-rate-note {
  font-size: 0.8125rem;
  color: var(--te-text-secondary);
  align-self: center;
}

.ship-pkg-muted {
  color: var(--te-text-muted);
}

.ship-pkg-fedex-api {
  font-size: 0.8125rem;
  color: var(--te-text-secondary);
  margin-bottom: 0.5rem;
}

.ship-pkg-btn {
  border: none;
  border-radius: 6px;
  padding: 0.38rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  background: #2f855a;
  color: #fff;
}

.ship-pkg-btn:hover:not(:disabled) {
  background: #276749;
}

.ship-pkg-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ship-pkg-block-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--te-text-muted);
  margin: 0.35rem 0 0.2rem;
}

.ship-pkg-input,
.ship-pkg-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--te-border-strong);
  background: var(--te-input-bg);
  color: var(--te-text);
  font-size: 0.8125rem;
  margin-bottom: 0.35rem;
}

.ship-pkg-input--wide {
  max-width: 100%;
}

.ship-pkg-input--readonly {
  background: var(--te-surface-raised);
  color: var(--te-text-muted);
}

.ship-pkg-input:focus,
.ship-pkg-textarea:focus {
  outline: none;
  border-color: var(--te-primary);
}

.ship-pkg-identical {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.25rem 0 0.45rem;
  font-size: 0.8125rem;
  color: var(--te-text-secondary);
}

.ship-pkg-table-wrap {
  overflow: auto;
  border: 1px solid var(--te-panel-border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.ship-pkg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  min-width: 720px;
}

.ship-pkg-table th,
.ship-pkg-table td {
  border-bottom: 1px solid var(--te-panel-border);
  padding: 0.35rem 0.4rem;
  text-align: left;
  vertical-align: middle;
}

.ship-pkg-table th {
  background: var(--te-table-head);
  color: var(--te-text-muted);
  font-weight: 600;
}

.ship-pkg-cell-input {
  width: 100%;
  min-width: 3.25rem;
  box-sizing: border-box;
  padding: 0.28rem 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--te-border-strong);
  background: var(--te-input-bg);
  color: var(--te-text);
  font-size: 0.75rem;
}

.ship-pkg-cell-input--disabled {
  background: var(--te-surface-raised);
  color: var(--te-text-secondary);
}

.ship-pkg-borrar {
  border: none;
  background: none;
  color: var(--te-primary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0.15rem;
}

.ship-pkg-borrar:hover:not(:disabled) {
  color: #f97316;
}

.ship-pkg-borrar:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  text-decoration: none;
}

.ship-pkg-summary {
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--te-border-strong);
  border-radius: 6px;
  background: var(--te-panel-bg);
  font-size: 0.78rem;
  color: var(--te-text);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.ship-origin-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.ship-origin-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.ship-origin-field--wide .ship-origin-input {
  width: 100%;
}

.ship-origin-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--te-text-muted);
}

.ship-origin-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--te-border-strong);
  background: var(--te-input-bg);
  color: var(--te-text);
  font-size: 0.8125rem;
}

.ship-origin-input:focus {
  outline: none;
  border-color: var(--te-primary);
}

select.ship-origin-input {
  cursor: pointer;
}

.ship-origin-city-wrap {
  position: relative;
}

.ship-origin-ac-list {
  position: absolute;
  z-index: 50;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  max-height: 11rem;
  overflow: auto;
  margin: 0;
  padding: 0.2rem 0;
  list-style: none;
  border-radius: 6px;
  border: 1px solid var(--te-border-strong);
  background: var(--te-input-bg);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.ship-origin-ac-item {
  padding: 0.35rem 0.55rem;
  font-size: 0.8125rem;
  color: var(--te-text);
  cursor: pointer;
}

.ship-origin-ac-item:hover {
  background: var(--te-panel-accent-bg);
}

.ship-delete {
  border: 1px solid #f4212e66;
  color: #f4212e;
  background: transparent;
  border-radius: 6px;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
}

.ship-pager {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.8rem;
}

.ship-pager button {
  border: 1px solid var(--te-border);
  color: var(--te-text);
  background: transparent;
  border-radius: 6px;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
}

.release-edit-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.release-edit-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.release-edit-field:last-child {
  grid-column: 1 / -1;
}

.release-edit-root--page {
  width: min(100%, 60rem);
  margin-left: auto;
  margin-right: auto;
}

.release-create-view .view-title,
.release-create-view .ship-edit-link,
.release-create-view .release-edit-root--page {
  width: min(100%, 60rem);
  margin-left: auto;
  margin-right: auto;
}

.release-create-view .ship-edit-link {
  display: block !important;
}

.release-create-view-active .app-header {
  justify-content: center;
}

.release-scanner-title {
  margin-bottom: 0.6rem;
}

.release-scanner-top {
  display: grid;
  grid-template-columns: minmax(12rem, 24rem) 1fr;
  gap: 0.6rem 0.75rem;
  align-items: end;
  margin-bottom: 0.5rem;
}

.release-scanner-code-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.release-scanner-right {
  justify-self: end;
  align-self: start;
  color: var(--te-text-secondary);
  font-size: 1.1rem;
  font-weight: 700;
}

.release-scanner-totals {
  margin: 0.4rem 0 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--te-panel-border);
  background: var(--te-panel-bg);
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--te-text);
}

.release-scanner-table td input.ship-pkg-cell-input {
  min-width: 9rem;
}

a.ship-create-btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.user-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.65rem;
}

.user-form-field label {
  font-size: 0.78rem;
  color: var(--te-text-secondary);
  font-weight: 600;
}

.user-form-inline {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.user-address-card {
  border: 1px solid var(--te-border);
  border-radius: 10px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  background: var(--te-surface);
}

.user-address-card-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.35rem;
}

.user-address-remove {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 6px;
  border: 1px solid #536471;
  background: transparent;
  color: #f4212e;
  cursor: pointer;
}

.user-address-remove:hover {
  border-color: #f4212e;
}

.user-city-suggest {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0;
  max-height: 10rem;
  overflow: auto;
  border: 1px solid var(--te-border-strong);
  border-radius: 8px;
  background: var(--te-surface);
  box-shadow: 0 4px 16px var(--te-shadow);
}

.user-city-suggest li {
  padding: 0.35rem 0.5rem;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--te-text);
}

.user-city-suggest li:hover {
  background: var(--te-panel-accent-bg);
  color: var(--te-primary-hover);
}

.user-edit-form {
  max-width: 40rem;
}

.user-edit-root {
  max-height: min(70vh, 640px);
  overflow: auto;
  padding-right: 0.25rem;
}

.user-edit-embedded {
  max-height: min(65vh, 600px);
  overflow: auto;
}

.user-signup-window {
  max-height: min(85vh, 820px);
  overflow-y: auto;
  padding: 0 0.25rem 0.5rem;
}

.user-signup-window .auth-card {
  box-shadow: none;
  border: none;
  max-width: none;
  margin: 0;
}

.user-signup-window__status {
  margin-bottom: 0.75rem;
}

.user-signup-window-modal .win-body {
  overflow: hidden;
}

/* ── Dashboard administrativo (DashboardAdminWindow.js) ── */
.dash-admin {
  --da-orange: #f97316;
  --da-orange-dark: #ea580c;
  --da-green: #22c55e;
  --da-blue: #3b82f6;
  --da-purple: #a855f7;
  --da-red: #ef4444;
  --da-amber: #f59e0b;
  --da-teal: #14b8a6;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.dash-admin[data-theme='light'] {
  --da-bg: #f4f5f7;
  --da-surface: #ffffff;
  --da-surface2: #f0f1f3;
  --da-border: #e2e4e9;
  --da-text: #111114;
  --da-muted: #6b7280;
  --da-muted2: #9ca3af;
}

.dash-admin[data-theme='dark'] {
  --da-bg: #0d0d0f;
  --da-surface: #161618;
  --da-surface2: #1e1e21;
  --da-border: #2a2a2f;
  --da-text: #f0f0f2;
  --da-muted: #7c7c8a;
  --da-muted2: #4a4a55;
}

.dash-admin-window-root {
  max-height: min(85vh, 820px);
  overflow: auto;
  padding: 0.25rem 0.35rem 0.5rem;
}

.dash-admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.85rem;
  background: var(--da-surface);
  border: 1px solid var(--da-border);
  border-radius: 12px;
}

.dash-admin-toolbar__left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.dash-admin-toolbar__period-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--da-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dash-admin-toolbar__sep {
  width: 1px;
  height: 1.25rem;
  background: var(--da-border);
}

.dash-admin-filter-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.dash-admin-filter-btn {
  padding: 0.3rem 0.7rem;
  border-radius: 7px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--da-border);
  background: transparent;
  color: var(--da-muted);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.dash-admin-filter-btn:hover {
  color: var(--da-text);
  border-color: var(--da-muted2);
}

.dash-admin-filter-btn--active {
  border-color: transparent;
  background: var(--da-orange);
  color: #fff;
}

.dash-admin-range {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.dash-admin-range__input {
  padding: 0.3rem 0.55rem;
  border-radius: 7px;
  border: 1px solid var(--da-border);
  background: var(--da-surface2);
  color: var(--da-text);
  font-size: 0.75rem;
}

.dash-admin-range__arrow {
  font-size: 0.68rem;
  color: var(--da-muted);
}

.dash-admin-range__apply {
  padding: 0.3rem 0.7rem;
  border-radius: 7px;
  border: none;
  background: var(--da-orange);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.dash-admin-theme-toggle {
  display: flex;
  align-items: center;
  background: var(--da-surface2);
  border: 1px solid var(--da-border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
}

.dash-admin-theme-toggle__btn {
  width: 30px;
  height: 28px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  background: transparent;
  color: var(--da-muted);
  transition: background 0.2s, color 0.2s;
}

.dash-admin-theme-toggle__btn--active {
  background: var(--da-orange);
  color: #fff;
}

.dash-admin-period-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.7rem;
  margin-bottom: 0.85rem;
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--da-orange);
}

.dash-admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.dash-admin-stat-card {
  position: relative;
  overflow: hidden;
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid var(--da-border);
  background: var(--da-surface);
  transition: transform 0.15s, border-color 0.2s;
}

.dash-admin-stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--da-muted2);
}

.dash-admin-stat-card__glow {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  opacity: 0.07;
}

.dash-admin-stat-card--orange .dash-admin-stat-card__glow {
  background: var(--da-orange);
}

.dash-admin-stat-card--orange .dash-admin-stat-card__icon {
  color: var(--da-orange);
  background: color-mix(in srgb, var(--da-orange) 15%, transparent);
}

.dash-admin-stat-card--green .dash-admin-stat-card__glow {
  background: var(--da-green);
}

.dash-admin-stat-card--green .dash-admin-stat-card__icon {
  color: var(--da-green);
  background: color-mix(in srgb, var(--da-green) 15%, transparent);
}

.dash-admin-stat-card--blue .dash-admin-stat-card__glow {
  background: var(--da-blue);
}

.dash-admin-stat-card--blue .dash-admin-stat-card__icon {
  color: var(--da-blue);
  background: color-mix(in srgb, var(--da-blue) 15%, transparent);
}

.dash-admin-stat-card--purple .dash-admin-stat-card__glow {
  background: var(--da-purple);
}

.dash-admin-stat-card--purple .dash-admin-stat-card__icon {
  color: var(--da-purple);
  background: color-mix(in srgb, var(--da-purple) 15%, transparent);
}

.dash-admin-stat-card--amber .dash-admin-stat-card__glow {
  background: var(--da-amber);
}

.dash-admin-stat-card--amber .dash-admin-stat-card__icon {
  color: var(--da-amber);
  background: color-mix(in srgb, var(--da-amber) 15%, transparent);
}

.dash-admin-stat-card--teal .dash-admin-stat-card__glow {
  background: var(--da-teal);
}

.dash-admin-stat-card--teal .dash-admin-stat-card__icon {
  color: var(--da-teal);
  background: color-mix(in srgb, var(--da-teal) 15%, transparent);
}

.dash-admin-stat-card--red .dash-admin-stat-card__glow {
  background: var(--da-red);
}

.dash-admin-stat-card--red .dash-admin-stat-card__icon {
  color: var(--da-red);
  background: color-mix(in srgb, var(--da-red) 15%, transparent);
}

.dash-admin-stat-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.dash-admin-stat-card__icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dash-admin-stat-card__trend {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
}

.dash-admin-stat-card__trend--up {
  background: rgba(34, 197, 94, 0.12);
  color: var(--da-green);
}

.dash-admin-stat-card__trend--down {
  background: rgba(239, 68, 68, 0.12);
  color: var(--da-red);
}

.dash-admin-stat-card__trend--flat {
  background: rgba(124, 124, 138, 0.12);
  color: var(--da-muted);
}

.dash-admin-stat-card__num {
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--da-text);
}

.dash-admin-stat-card__label {
  font-size: 0.68rem;
  color: var(--da-muted);
  margin-top: 0.25rem;
}

.dash-admin-stat-card__sub {
  font-size: 0.62rem;
  color: var(--da-muted2);
  margin-top: 0.12rem;
}

.dash-admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.dash-admin-section-title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--da-text);
}

.dash-admin-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: none;
  background: var(--da-orange);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.dash-admin-btn-primary:hover {
  background: var(--da-orange-dark);
}

.dash-admin-table-wrap {
  overflow: auto;
  margin-bottom: 1rem;
  border: 1px solid var(--da-border);
  border-radius: 14px;
  background: var(--da-surface);
}

.dash-admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.dash-admin-table th {
  padding: 0.65rem 0.85rem;
  text-align: left;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--da-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--da-surface);
  border-bottom: 1px solid var(--da-border);
}

.dash-admin-table td {
  padding: 0.65rem 0.85rem;
  font-size: 0.78rem;
  color: var(--da-text);
  border-bottom: 1px solid var(--da-border);
}

.dash-admin-table tbody tr:hover td {
  background: var(--da-surface2);
}

.dash-admin-table__cell--bold {
  font-weight: 600;
}

.dash-admin-table__fact-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.dash-admin-table__price {
  font-weight: 600;
  font-size: 0.85rem;
}

.dash-admin-table__empty,
.dash-admin-panel__empty {
  color: var(--dash-muted, #6b7280);
  font-size: 0.9rem;
  padding: 8px 0;
}

.dash-admin-table__cell--mono {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.75rem;
}

.dash-admin-table__cell--green {
  color: var(--da-green);
  font-weight: 600;
}

.dash-admin-table__cell--amber {
  color: var(--da-amber);
  font-weight: 600;
}

.dash-admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 0.66rem;
  font-weight: 600;
}

.dash-admin-badge__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
}

.dash-admin-badge--entregado {
  background: rgba(34, 197, 94, 0.12);
  color: var(--da-green);
}

.dash-admin-badge--transito {
  background: rgba(59, 130, 246, 0.12);
  color: var(--da-blue);
}

.dash-admin-badge--pendiente {
  background: rgba(245, 158, 11, 0.12);
  color: var(--da-amber);
}

.dash-admin-badge--cancelado {
  background: rgba(239, 68, 68, 0.12);
  color: var(--da-red);
}

.dash-admin-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

@media (max-width: 768px) {
  .dash-admin-bottom-grid {
    grid-template-columns: 1fr;
  }
}

.dash-admin-panel {
  padding: 1rem;
  border: 1px solid var(--da-border);
  border-radius: 14px;
  background: var(--da-surface);
}

.dash-admin-panel__title {
  margin: 0 0 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--da-text);
}

.dash-admin-activity-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.5rem 0;
}

.dash-admin-activity-item--border {
  border-bottom: 1px solid var(--da-border);
}

.dash-admin-activity-item__icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dash-admin-activity-item__icon--green {
  background: rgba(34, 197, 94, 0.15);
  color: var(--da-green);
}

.dash-admin-activity-item__icon--blue {
  background: rgba(59, 130, 246, 0.15);
  color: var(--da-blue);
}

.dash-admin-activity-item__icon--purple {
  background: rgba(168, 85, 247, 0.15);
  color: var(--da-purple);
}

.dash-admin-activity-item__icon--amber {
  background: rgba(245, 158, 11, 0.15);
  color: var(--da-amber);
}

.dash-admin-activity-item__title {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--da-text);
}

.dash-admin-activity-item__time {
  font-size: 0.68rem;
  color: var(--da-muted);
}

.dash-admin-dest-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.dash-admin-dest-row__label {
  font-size: 0.75rem;
  color: var(--da-muted);
  width: 100px;
  flex-shrink: 0;
}

.dash-admin-dest-row__track {
  flex: 1;
  height: 5px;
  background: var(--da-surface2);
  border-radius: 99px;
  overflow: hidden;
}

.dash-admin-dest-row__fill {
  height: 100%;
  border-radius: 99px;
}

.dash-admin-dest-row__fill--orange {
  background: var(--da-orange);
}

.dash-admin-dest-row__fill--blue {
  background: var(--da-blue);
}

.dash-admin-dest-row__fill--purple {
  background: var(--da-purple);
}

.dash-admin-dest-row__fill--green {
  background: var(--da-green);
}

.dash-admin-dest-row__fill--teal {
  background: var(--da-teal);
}

.dash-admin-dest-row__pct {
  font-size: 0.68rem;
  font-weight: 700;
  width: 32px;
  text-align: right;
  flex-shrink: 0;
  color: var(--da-text);
}

/* Admin Datos hub + CRUD */
.datos-intro {
  margin: 0 0 1rem;
  color: var(--te-text-secondary);
  font-size: 0.95rem;
}

.datos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 0.85rem;
}

.datos-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.1rem 0.85rem;
  border: 1px solid var(--te-border);
  border-radius: 12px;
  background: var(--te-surface);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.datos-card:hover {
  border-color: var(--te-primary);
  box-shadow: 0 4px 14px var(--te-shadow);
  transform: translateY(-1px);
}

.datos-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--te-primary-alpha);
  color: var(--te-primary);
  flex-shrink: 0;
}

.datos-card-icon svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.datos-card:hover .datos-card-icon {
  background: var(--te-primary);
  color: #fff;
}

.datos-card-title {
  font-weight: 600;
  color: var(--te-text);
  font-size: 0.88rem;
  line-height: 1.25;
}

.datos-card-desc {
  font-size: 0.8rem;
  color: var(--te-text-muted);
}

.datos-lugares-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 900px) {
  .datos-lugares-layout {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.datos-lugares-panel {
  min-width: 0;
  border: 1px solid var(--te-border);
  border-radius: 10px;
  padding: 0.75rem;
  background: var(--te-panel-bg);
}

.datos-lugares-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.admin-crud-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(43, 43, 43, 0.45);
  padding: 1rem;
}

.admin-crud-modal[hidden] {
  display: none;
}

.admin-crud-modal-box {
  width: min(480px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--te-surface);
  border: 1px solid var(--te-border);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 8px 32px var(--te-shadow-md);
}

.admin-crud-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0 0;
}

.admin-crud-form .ship-create-actions {
  margin-top: 0.25rem;
}

.admin-crud-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.88rem;
}

.admin-crud-field span {
  font-weight: 600;
  color: var(--te-text-secondary);
}

.admin-crud-field input,
.admin-crud-field select,
.admin-crud-field textarea {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--te-border);
  border-radius: 6px;
  background: var(--te-input-bg);
  font: inherit;
}

/* Mi panel (standard user hub) */
.mi-panel-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--te-gradient-panel);
}

.mi-panel-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 1rem 1rem 0.5rem;
  gap: 0.5rem;
}

.mi-panel-topbar--public {
  grid-template-columns: 1fr;
  justify-items: center;
}

.mi-panel-topbar--public .mi-panel-brand {
  grid-column: 1;
  justify-self: center;
  width: 100%;
}

.mi-panel-brand {
  grid-column: 2;
  display: flex;
  justify-content: center;
}

.mi-panel-exit-btn {
  grid-column: 3;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--te-border);
  border-radius: 10px;
  background: var(--te-surface);
  color: #f4212e;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.mi-panel-exit-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mi-panel-exit-btn:hover,
.mi-panel-exit-btn:focus-visible {
  border-color: #f4212e;
  color: #ff6b6b;
  outline: none;
}

.mi-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 1rem 2rem;
  gap: 1.5rem;
}

.mi-panel-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--te-text);
  text-align: center;
}

.mi-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 150px));
  gap: 1rem;
  width: 100%;
  max-width: 360px;
  justify-content: center;
}

.mi-panel-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 120px;
  padding: 1rem 0.75rem;
  border: 1px solid var(--te-border);
  border-radius: 14px;
  background: var(--te-surface);
  color: var(--te-text);
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.mi-panel-tile:hover,
.mi-panel-tile:focus-visible {
  border-color: var(--te-primary);
  box-shadow: 0 4px 16px var(--te-primary-alpha);
  outline: none;
}

.mi-panel-tile-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--te-primary-alpha);
  color: var(--te-primary);
}

.mi-panel-tile-icon svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mi-panel-tile-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.25;
}

/* Mi panel — dashboard fusionado */
.mi-panel--dashboard {
  align-items: stretch;
  justify-content: flex-start;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
  padding: 1.25rem 1rem 2.5rem;
  gap: 1.75rem;
}

.mi-panel-hero {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.mi-panel-avatar {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--te-primary), var(--te-primary-hover));
  box-shadow: 0 8px 24px rgba(251, 158, 32, 0.28);
}

.mi-panel-hero-text {
  min-width: 0;
}

.mi-panel-title--hero {
  text-align: left;
  font-size: clamp(1.15rem, 3vw, 1.65rem);
  line-height: 1.25;
  margin: 0;
}

.mi-panel-subtitle {
  margin: 0.4rem 0 0;
  font-size: 0.875rem;
  color: var(--te-text-muted);
}

.mi-panel-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--te-text-muted);
}

.mi-panel-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}

.mi-panel-actions-grid--pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mi-panel-action-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  min-height: 8.5rem;
  padding: 1rem 1rem 0.9rem;
  border-radius: 1rem;
  border: 1px solid var(--te-panel-border);
  background: var(--te-surface);
  color: var(--te-text);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.mi-panel-action-card:hover,
.mi-panel-action-card:focus-visible {
  outline: none;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px var(--te-shadow-md);
}

.mi-panel-action-card--primary {
  border-color: rgba(251, 158, 32, 0.35);
  background: linear-gradient(165deg, #fff8ee 0%, #ffffff 100%);
}

.mi-panel-action-card--primary:hover,
.mi-panel-action-card--primary:focus-visible {
  border-color: var(--te-primary);
  box-shadow: 0 12px 32px rgba(251, 158, 32, 0.18);
}

.mi-panel-action-card--ochre {
  border-color: rgba(195, 123, 43, 0.28);
  background: linear-gradient(165deg, #faf4ea 0%, #ffffff 100%);
}

.mi-panel-action-card--ochre:hover,
.mi-panel-action-card--ochre:focus-visible {
  border-color: var(--te-primary-hover);
}

.mi-panel-action-card--tan {
  border-color: rgba(157, 129, 86, 0.28);
  background: linear-gradient(165deg, #f7f3ec 0%, #ffffff 100%);
}

.mi-panel-action-card--tan:hover,
.mi-panel-action-card--tan:focus-visible {
  border-color: var(--te-accent);
}

.mi-panel-dash-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: var(--te-primary-alpha);
  color: var(--te-primary);
}

.mi-panel-action-card--ochre .mi-panel-dash-icon {
  background: rgba(195, 123, 43, 0.12);
  color: var(--te-primary-hover);
}

.mi-panel-action-card--tan .mi-panel-dash-icon {
  background: rgba(157, 129, 86, 0.12);
  color: var(--te-accent);
}

.mi-panel-dash-icon svg {
  width: 1.35rem;
  height: 1.35rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mi-panel-action-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--te-ink);
}

.mi-panel-action-desc {
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--te-text-muted);
}

.mi-panel-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.mi-panel-dash-panel {
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--te-panel-border);
  background: var(--te-surface);
  box-shadow: 0 2px 10px var(--te-shadow);
}

.mi-panel-dash-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--te-panel-border);
  background: var(--te-panel-bg);
}

.mi-panel-dash-panel-title {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--te-ink);
}

.mi-panel-dash-panel-title .mi-panel-dash-icon {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.55rem;
}

.mi-panel-dash-panel-title .mi-panel-dash-icon svg {
  width: 0.95rem;
  height: 0.95rem;
}

.mi-panel-dash-panel-action {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--te-primary);
  cursor: pointer;
}

.mi-panel-dash-panel-action:hover,
.mi-panel-dash-panel-action:focus-visible {
  color: var(--te-primary-hover);
  outline: none;
}

.mi-panel-dash-panel-body {
  min-height: 7rem;
}

.mi-panel-dash-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid var(--te-panel-border);
}

.mi-panel-dash-row:last-child {
  border-bottom: none;
}

.mi-panel-dash-row-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--te-ink);
}

.mi-panel-dash-row-meta {
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: var(--te-text-muted);
}

.mi-panel-dash-row-side {
  font-size: 0.72rem;
  color: var(--te-accent-dark);
  white-space: nowrap;
}

.mi-panel-dash-empty {
  padding: 1.75rem 1.1rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--te-text-muted);
}

.mi-panel-invoice-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.mi-panel-invoice-badge--pagada {
  background: rgba(124, 112, 59, 0.14);
  color: var(--te-accent-dark);
}

.mi-panel-invoice-badge--por-cobrar {
  background: rgba(251, 158, 32, 0.14);
  color: var(--te-primary-hover);
}

.mi-panel-invoice-badge--en-revision {
  background: rgba(195, 123, 43, 0.14);
  color: var(--te-primary-hover);
}

.mi-panel-invoice-badge--sin-monto {
  background: rgba(43, 43, 43, 0.08);
  color: var(--te-text-secondary);
}

.mi-panel-link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--te-primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mi-panel-link-btn:hover {
  color: var(--te-primary-hover);
}

.mi-panel-table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.mi-panel-dash-row--clickable {
  cursor: pointer;
}

.mi-panel-dash-row--clickable:hover {
  background: rgba(249, 115, 22, 0.06);
}

.mi-panel-invoice-detail {
  max-width: 880px;
}

.mi-panel-invoice-detail-content {
  width: 100%;
}

/* Mi panel — subpáginas (mis-envios, mis-facturas) */
.mi-panel--subpage {
  align-items: stretch;
  justify-content: flex-start;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
  padding: 1rem 1rem 2.5rem;
  gap: 1.25rem;
}

.mi-panel-page-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
}

.mi-panel-back-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--te-primary);
  cursor: pointer;
}

.mi-panel-back-btn:hover,
.mi-panel-back-btn:focus-visible {
  color: var(--te-primary-hover);
  outline: none;
}

.mi-panel-page-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.mi-panel-page-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.85rem;
  flex-shrink: 0;
}

.mi-panel-page-icon svg {
  width: 1.35rem;
  height: 1.35rem;
}

.mi-panel-title--page {
  margin: 0;
  text-align: left;
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  line-height: 1.2;
}

.mi-panel-subpage-content {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.mi-panel-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.mi-panel-select {
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--te-panel-border);
  border-radius: 0.6rem;
  background: var(--te-surface);
  color: var(--te-text);
  font: inherit;
  font-size: 0.85rem;
}

.mi-panel-select:focus-visible {
  outline: 2px solid var(--te-primary-alpha);
  border-color: var(--te-primary);
}

.mi-panel-status {
  font-size: 0.82rem;
  color: var(--te-text-muted);
}

.mi-panel-list-panel {
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--te-panel-border);
  background: var(--te-surface);
  box-shadow: 0 2px 10px var(--te-shadow);
}

.mi-panel-table-wrap {
  overflow-x: auto;
}

.mi-panel-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.mi-panel-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--te-text-muted);
  background: var(--te-panel-bg);
  border-bottom: 1px solid var(--te-panel-border);
  white-space: nowrap;
}

.mi-panel-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--te-panel-border);
  color: var(--te-text);
  vertical-align: middle;
}

.mi-panel-table tbody tr:last-child td {
  border-bottom: none;
}

.mi-panel-table tbody tr:hover td {
  background: var(--te-panel-bg);
}

.mi-panel-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding-top: 0.25rem;
}

.mi-panel-pager-info {
  font-size: 0.82rem;
  color: var(--te-text-muted);
}

.mi-panel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--te-panel-border);
  border-radius: 0.6rem;
  background: var(--te-surface);
  color: var(--te-text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.mi-panel-btn:hover:not(:disabled),
.mi-panel-btn:focus-visible:not(:disabled) {
  border-color: var(--te-primary);
  color: var(--te-primary);
  outline: none;
}

.mi-panel-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.mi-panel-btn--primary {
  border-color: rgba(251, 158, 32, 0.45);
  background: var(--te-primary);
  color: #fff;
}

.mi-panel-btn--primary:hover:not(:disabled),
.mi-panel-btn--primary:focus-visible:not(:disabled) {
  border-color: var(--te-primary-hover);
  background: var(--te-primary-hover);
  color: #fff;
}

.mi-panel-btn--danger {
  border-color: rgba(198, 40, 40, 0.35);
  color: var(--te-danger);
}

.mi-panel-btn--danger:hover:not(:disabled),
.mi-panel-btn--danger:focus-visible:not(:disabled) {
  border-color: var(--te-danger);
  background: rgba(198, 40, 40, 0.08);
  color: var(--te-danger);
}

.mi-panel-btn--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--te-primary);
}

.mi-panel-btn--ghost:hover:not(:disabled),
.mi-panel-btn--ghost:focus-visible:not(:disabled) {
  background: var(--te-primary-alpha);
  border-color: transparent;
  color: var(--te-primary-hover);
}

.mi-panel-btn--small {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
}

.mi-panel-input {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0.35rem 0;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--te-panel-border);
  border-radius: 0.6rem;
  background: var(--te-surface);
  color: var(--te-text);
  font: inherit;
  font-size: 0.85rem;
}

.mi-panel-input:focus-visible {
  outline: 2px solid var(--te-primary-alpha);
  border-color: var(--te-primary);
}

.mi-panel-select--grow {
  flex: 1;
  min-width: 200px;
}

.mi-panel-session-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.mi-panel-form-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mi-panel-form-section .mi-panel-input,
.mi-panel-form-section .mi-panel-select {
  max-width: 480px;
}

.mi-panel-section-title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--te-ink);
}

.mi-panel-hint {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  color: var(--te-text-muted);
}

.mi-panel-message {
  margin-top: 0.25rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.6rem;
  font-size: 0.85rem;
}

.mi-panel-message--ok {
  background: rgba(124, 112, 59, 0.12);
  color: var(--te-accent-dark);
}

.mi-panel-message--error {
  background: rgba(198, 40, 40, 0.1);
  color: var(--te-danger);
}

.mi-panel-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mi-panel-tab {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--te-panel-border);
  border-radius: 0.6rem;
  background: var(--te-surface);
  color: var(--te-text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.mi-panel-tab:hover,
.mi-panel-tab:focus-visible {
  border-color: var(--te-primary);
  outline: none;
}

.mi-panel-tab--active {
  border-color: var(--te-primary);
  background: var(--te-primary-alpha);
  color: var(--te-primary-hover);
}

.mi-panel-card {
  padding: 0.95rem 1.1rem;
  border-bottom: 1px solid var(--te-panel-border);
}

.mi-panel-card:last-child {
  border-bottom: none;
}

.mi-panel-card-head {
  margin-bottom: 0.35rem;
}

.mi-panel-card-head strong {
  font-size: 0.88rem;
  color: var(--te-ink);
}

.mi-panel-card-meta {
  margin: 0.25rem 0;
  font-size: 0.8rem;
  color: var(--te-text-muted);
}

.mi-panel-card-items {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--te-panel-border);
  font-size: 0.8rem;
}

.mi-panel-item-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0;
}

.mi-panel-view .locker-status-badge--esperando {
  background: rgba(251, 158, 32, 0.14);
  color: var(--te-primary-hover);
}

.mi-panel-view .locker-status-badge--recibido {
  background: rgba(124, 112, 59, 0.14);
  color: var(--te-accent-dark);
}

.mi-panel-view .locker-dest-form-host .ship-edit-section--dest {
  margin-top: 0.75rem;
}

.mi-panel-view .ship-user-picker-title,
.mi-panel-view .ship-origin-rail {
  color: var(--te-primary-hover);
}

.mi-panel-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mi-panel-field-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--te-accent-dark);
}

.mi-panel-form-section .mi-panel-field .mi-panel-input,
.mi-panel-form-section .mi-panel-field .mi-panel-select,
.mi-panel-form-section .mi-panel-field .mi-panel-file {
  margin: 0;
  max-width: 480px;
}

.mi-panel-input[type='date'],
.mi-panel-input[type='number'] {
  max-width: 280px;
}

textarea.mi-panel-input {
  min-height: 5.5rem;
  resize: vertical;
}

.mi-panel-file {
  display: block;
  width: 100%;
  max-width: 480px;
  padding: 0.45rem 0;
  font: inherit;
  font-size: 0.82rem;
  color: var(--te-text-secondary);
}

.pay-invoice-summary-body {
  padding: 0.85rem 1.1rem 1.1rem;
}

.pay-invoice-amounts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.pay-invoice-amount {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 0.9rem;
  border-radius: 0.75rem;
  border: 1px solid var(--te-panel-border);
  background: var(--te-panel-bg);
}

.pay-invoice-amount--due {
  border-color: rgba(251, 158, 32, 0.45);
  background: var(--te-panel-accent-bg);
}

.pay-invoice-amount--paid {
  border-color: rgba(124, 112, 59, 0.35);
  background: rgba(124, 112, 59, 0.08);
}

.pay-invoice-amount-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--te-text-muted);
}

.pay-invoice-amount-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--te-ink);
  line-height: 1.2;
}

.pay-invoice-amount--due .pay-invoice-amount-value {
  color: var(--te-primary-hover);
}

.pay-invoice-amount--paid .pay-invoice-amount-value {
  color: var(--te-accent-dark);
}

.pay-invoice-form {
  margin: 2em;
}

.pay-invoice-form-panel {
  margin-top: 0.15rem;
}

.pay-invoice-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.35rem;
}

.pay-invoice-feedback {
  margin-top: 0.15rem;
}

.pay-invoice-cc-card-container {
  min-height: 3.25rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--te-border);
  border-radius: 8px;
  background: #fff;
}

.pay-invoice-cc-fee-breakdown {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.35rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--te-border);
  border-radius: 8px;
  background: #f8fafc;
}

.pay-invoice-cc-fee-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.pay-invoice-cc-fee-row--charge {
  padding-top: 0.35rem;
  border-top: 1px solid var(--te-border);
  font-weight: 600;
}

.pay-invoice-cc-fee-label {
  font-size: 0.92rem;
  color: var(--te-text-muted, #64748b);
}

.pay-invoice-cc-fee-row--charge .pay-invoice-cc-fee-label,
.pay-invoice-cc-fee-row--charge .pay-invoice-cc-fee-value {
  color: var(--te-primary-hover, #0f4c81);
}

.pay-invoice-cc-fee-value {
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .mi-panel-summary-grid {
    grid-template-columns: 1fr;
  }

  .mi-panel-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .mi-panel-title--hero {
    font-size: 1.15rem;
  }

  .pay-invoice-amounts {
    grid-template-columns: 1fr;
  }
}

/* Locker module */
.locker-input {
  display: block;
  width: 100%;
  max-width: 480px;
  margin: 0.5rem 0;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--te-border);
  border-radius: 8px;
  background: var(--te-input-bg);
  font: inherit;
}

.locker-session-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

.locker-session-select {
  flex: 1;
  min-width: 200px;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--te-border);
  border-radius: 8px;
  background: var(--te-input-bg);
}

.locker-item-form,
.locker-process {
  margin: 1.25rem 0;
  padding: 1rem;
  border: 1px solid var(--te-border);
  border-radius: 10px;
  background: var(--te-surface);
}

.locker-process-hint {
  margin: 0 0 0.75rem;
  color: var(--te-text-muted);
  font-size: 0.875rem;
}

.locker-process-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.locker-message {
  margin-top: 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.875rem;
}

.locker-message--ok {
  background: rgba(0, 186, 124, 0.12);
  color: #0a7a52;
}

.locker-message--error {
  background: rgba(244, 33, 46, 0.1);
  color: #c62828;
}

.ship-locker-purchase-meta {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: var(--te-text-muted, #64748b);
}

.locker-status-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.locker-status-badge--esperando {
  background: rgba(255, 173, 31, 0.2);
  color: #9a6700;
}

.locker-status-badge--recibido {
  background: rgba(0, 186, 124, 0.18);
  color: #0a7a52;
}

.locker-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.locker-tab {
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--te-border);
  border-radius: 8px;
  background: var(--te-surface);
  cursor: pointer;
  font: inherit;
}

.locker-tab--active {
  border-color: var(--te-primary);
  color: var(--te-primary);
}

.locker-card {
  margin-bottom: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--te-border);
  border-radius: 10px;
  background: var(--te-surface);
}

.locker-card-meta {
  margin: 0.35rem 0;
  font-size: 0.85rem;
  color: var(--te-text-muted);
}

.locker-card-toggle {
  margin-top: 0.5rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--te-border);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 0.8rem;
}

.locker-card-items {
  margin-top: 0.65rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--te-border);
}

.locker-item-row {
  padding: 0.25rem 0;
  font-size: 0.85rem;
}

.locker-admin-receive-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

.locker-admin-receive-bar .locker-input {
  flex: 1;
  min-width: 220px;
  margin: 0;
}

.locker-admin-empty {
  margin: 0.5rem 0 1rem;
  padding: 1rem;
  text-align: center;
  color: var(--te-text-muted, #64748b);
  font-size: 0.95rem;
  border: 1px dashed var(--te-border);
  border-radius: 10px;
  background: var(--te-surface);
}

.locker-delete-req {
  color: #c62828;
}

/* Locker client pages (standard user) — paleta TraeloExpress */
.locker-client-view {
  --locker-accent: #fb9e20;
  --locker-accent-hover: #c37b2b;
  --locker-earth: #9d8156;
  --locker-olive: #7c703b;
  --locker-text: #2b2b2b;
}

.locker-client-brand {
  display: flex;
  justify-content: center;
  padding: 1rem 0 0.5rem;
}

.locker-client-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  margin-bottom: 1rem;
  padding: 0 0.25rem;
}

.locker-client-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--locker-text);
}

.locker-client-content {
  padding-bottom: 1.5rem;
}

.locker-client-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  background: var(--locker-accent);
  color: #fff;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.locker-client-btn:hover,
.locker-client-btn:focus-visible {
  background: var(--locker-accent-hover);
  outline: none;
}

.locker-client-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.locker-client-btn--ghost {
  background: transparent;
  color: var(--locker-accent-hover);
  border: 1px solid var(--locker-earth);
  padding: 0.4rem 0.75rem;
}

.locker-client-btn--ghost:hover,
.locker-client-btn--ghost:focus-visible {
  background: rgba(251, 158, 32, 0.12);
  color: var(--locker-accent-hover);
}

.locker-client-btn--danger {
  background: #c62828;
}

.locker-client-btn--danger:hover,
.locker-client-btn--danger:focus-visible {
  background: #a32020;
}

.locker-client-btn--small {
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem;
}

.locker-client-view .locker-tab {
  border-color: var(--locker-earth);
  color: var(--locker-text);
}

.locker-client-view .locker-tab--active {
  border-color: var(--locker-accent);
  background: rgba(251, 158, 32, 0.14);
  color: var(--locker-accent-hover);
}

.locker-client-view .locker-card {
  border-color: rgba(157, 129, 86, 0.45);
}

.locker-client-view .locker-card-head strong {
  color: var(--locker-text);
}

.locker-client-view .locker-item-form,
.locker-client-view .locker-process {
  border-color: rgba(157, 129, 86, 0.35);
}

.locker-client-view .ship-user-picker-title,
.locker-client-view .ship-origin-rail {
  color: var(--locker-accent-hover);
}

.locker-client-view .locker-dest-form-host .ship-edit-section--dest {
  margin-top: 0.75rem;
}

.locker-client-pager {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.locker-client-table th {
  background: rgba(251, 158, 32, 0.1);
  color: var(--locker-text);
}

/* Casillero — usuario standard (/casillero) */
.casillero-page {
  max-width: 62.5rem;
}

.casillero-welcome {
  padding: 0.7rem 1rem;
  border-radius: 0.65rem;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  font-size: 0.82rem;
  color: #92400e;
  line-height: 1.65;
}

.casillero-success-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  border-radius: 0.75rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  font-size: 0.85rem;
  color: #166534;
}

.casillero-success-icon {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
  background: #dcfce7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
}

.casillero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (min-width: 900px) {
  .casillero-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.casillero-stat {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 0.875rem;
  border: 1px solid #e5e7eb;
  background: #fff;
}

.casillero-stat--amber { border-color: #fde68a; }
.casillero-stat--blue { border-color: #bfdbfe; }
.casillero-stat--violet { border-color: #ddd6fe; }
.casillero-stat--green { border-color: #bbf7d0; }

.casillero-stat-icon {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.casillero-stat--amber .casillero-stat-icon { background: #fffbeb; }
.casillero-stat--blue .casillero-stat-icon { background: #eff6ff; }
.casillero-stat--violet .casillero-stat-icon { background: #f5f3ff; }
.casillero-stat--green .casillero-stat-icon { background: #f0fdf4; }

.casillero-stat-value {
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1;
}

.casillero-stat--amber .casillero-stat-value { color: #d97706; }
.casillero-stat--blue .casillero-stat-value { color: #1d4ed8; }
.casillero-stat--violet .casillero-stat-value { color: #6d28d9; }
.casillero-stat--green .casillero-stat-value { color: #166534; }

.casillero-stat-label {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: #9ca3af;
}

.casillero-card {
  border-radius: 0.875rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  overflow: hidden;
}

.casillero-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid #f3f4f6;
}

.casillero-card-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #111827;
}

.casillero-card-sub {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: #9ca3af;
}

.casillero-active-pill {
  font-size: 0.75rem;
  font-weight: 700;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  padding: 0.15rem 0.75rem;
  border-radius: 999px;
}

.casillero-fields-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem 1.75rem;
  padding: 1.1rem 1.25rem;
}

@media (min-width: 640px) {
  .casillero-fields-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.casillero-field-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.2rem;
}

.casillero-field-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
}

.casillero-warn {
  margin: 0 1.25rem 1rem;
  padding: 0.65rem 0.9rem;
  border-radius: 0.65rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  font-size: 0.82rem;
  color: #92400e;
  line-height: 1.65;
}

.casillero-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 1.25rem 1.1rem;
}

.casillero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1.1rem;
  border-radius: 0.65rem;
  border: none;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.casillero-btn--primary {
  background: #f97316;
  color: #fff;
}

.casillero-btn--primary:hover,
.casillero-btn--primary:focus-visible {
  background: #ea580c;
}

.casillero-btn--primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #9ca3af;
}

.casillero-btn--ghost {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #6b7280;
  font-weight: 600;
}

.casillero-btn--ghost:hover,
.casillero-btn--ghost:focus-visible {
  background: #e5e7eb;
}

.casillero-btn--lg {
  padding: 0.7rem 1.5rem;
  border-radius: 0.75rem;
}

.casillero-btn--success {
  background: #16a34a;
  color: #fff;
}

.casillero-btn--danger-sm {
  color: #dc2626;
  border-color: #fecaca;
  background: #fff1f2;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.casillero-collapse-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.casillero-collapse-body {
  border-top: 1px solid #f3f4f6;
  padding: 1.1rem 1.25rem;
}

.casillero-steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .casillero-steps-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .casillero-steps-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.casillero-step-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.casillero-step-num {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 0.5rem;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 900;
  color: #f97316;
}

.casillero-step-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #111827;
}

.casillero-step-desc {
  margin: 0;
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1.65;
}

.casillero-tabs {
  display: flex;
  gap: 0.25rem;
}

.casillero-tab {
  padding: 0.5rem 1.1rem;
  border-radius: 0.65rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #6b7280;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
}

.casillero-tab--active {
  background: #f97316;
  border-color: #f97316;
  color: #fff;
}

.casillero-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.casillero-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.1rem 1.25rem;
}

.casillero-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .casillero-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.casillero-field--full {
  grid-column: 1 / -1;
}

.casillero-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 0.55rem;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #111827;
  font: inherit;
  font-size: 0.875rem;
  box-sizing: border-box;
}

.casillero-req {
  color: #ef4444;
  font-weight: 900;
}

.casillero-opt {
  font-size: 0.75rem;
  color: #9ca3af;
  text-transform: none;
  font-weight: 400;
  letter-spacing: 0;
}

.casillero-form-feedback {
  padding: 0.65rem 0.9rem;
  border-radius: 0.65rem;
  font-size: 0.82rem;
}

.casillero-form-feedback--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.casillero-form-feedback--ok {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.casillero-process-cta {
  border-radius: 0.875rem;
  border: 1px solid #e5e7eb;
  background: #fafafa;
}

.casillero-process-cta--ready {
  background: #fff7ed;
  border-color: #fed7aa;
}

.casillero-process-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
}

.casillero-process-text {
  font-size: 0.82rem;
  color: #6b7280;
  line-height: 1.5;
}

.casillero-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid #f3f4f6;
}

.casillero-table-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #111827;
}

.casillero-count-pill {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.75rem;
  background: #fff7ed;
  color: #f97316;
  border: 1px solid #fed7aa;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
}

.casillero-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.casillero-filter {
  padding: 0.3rem 0.7rem;
  border-radius: 0.55rem;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  color: #6b7280;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.casillero-filter--active {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #f97316;
  font-weight: 700;
}

.casillero-table-hint {
  padding: 0.5rem 1.25rem;
  background: #eff6ff;
  border-bottom: 1px solid #dbeafe;
  font-size: 0.75rem;
  color: #1d4ed8;
}

.casillero-table-wrap {
  overflow-x: auto;
}

.casillero-table {
  width: 100%;
  border-collapse: collapse;
}

.casillero-table th,
.casillero-table td {
  padding: 0.65rem 1rem;
  text-align: left;
  font-size: 0.82rem;
}

.casillero-table th {
  background: #fafafa;
  font-size: 0.68rem;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.casillero-table tbody tr {
  border-bottom: 1px solid #f3f4f6;
}

.casillero-row--selected {
  background: #fff7ed;
}

.casillero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.casillero-badge-dot {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.casillero-badge--reportado {
  background: #fef9ec;
  color: #92400e;
  border: 1px solid #fde68a;
}

.casillero-badge--reportado .casillero-badge-dot {
  background: #f59e0b;
}

.casillero-badge--recibido {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.casillero-badge--recibido .casillero-badge-dot {
  background: #3b82f6;
}

.casillero-badge--default {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.casillero-badge--default .casillero-badge-dot {
  background: #22c55e;
}

.casillero-mono {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-weight: 700;
  word-break: break-all;
}

.casillero-muted {
  font-size: 0.75rem;
  color: #9ca3af;
}

.casillero-accent {
  color: #f97316;
}

.casillero-actions {
  text-align: right;
}

.casillero-empty {
  padding: 2.25rem 1.25rem;
  text-align: center;
  color: #9ca3af;
  font-size: 0.875rem;
}

.casillero-dest-body {
  padding: 1rem 1.25rem 1.25rem;
}

.casillero-dest-body .casillero-process-cta {
  margin-top: 1rem;
}

.casillero-message {
  padding: 0.65rem 0.9rem;
  border-radius: 0.65rem;
  font-size: 0.82rem;
}

.casillero-message--ok {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.casillero-message--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.casillero-modal[hidden] {
  display: none !important;
}

.casillero-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  padding: 1rem;
}

.casillero-modal-box {
  width: 100%;
  max-width: 32.5rem;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1.25rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  padding: 1.25rem 1.5rem 1.5rem;
}

.casillero-modal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.casillero-modal-title {
  font-size: 1rem;
  font-weight: 900;
  color: #111827;
}

.casillero-modal-close {
  border: none;
  background: #f3f4f6;
  border-radius: 0.5rem;
  padding: 0.35rem 0.5rem;
  cursor: pointer;
  color: #6b7280;
}

.casillero-modal-list {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  overflow: hidden;
  margin-bottom: 1rem;
}

.casillero-modal-list-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #f3f4f6;
}

.casillero-modal-list-row:last-child {
  border-bottom: none;
}

.casillero-carrier-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 0.35rem;
  background: #fef9ec;
  color: #92400e;
  flex-shrink: 0;
}

.casillero-modal-actions {
  display: flex;
  gap: 0.65rem;
  margin-top: 1rem;
}

.casillero-modal-actions .casillero-btn {
  flex: 1;
}

.casillero-modal-actions .casillero-btn--primary,
.casillero-modal-actions .casillero-btn--success {
  flex: 2;
}

.casillero-ship-opt {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  border: 2px solid #e5e7eb;
  background: #fafafa;
  cursor: pointer;
  margin-bottom: 0.65rem;
  font-size: 0.82rem;
  line-height: 1.5;
}

.casillero-ship-opt--active {
  border-color: #f97316;
  background: #fff7ed;
}

.casillero-tag {
  font-size: 0.68rem;
  font-weight: 700;
  background: #fed7aa;
  color: #92400e;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}

.casillero-modal-summary {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-radius: 0.875rem;
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  font-size: 0.82rem;
  margin-bottom: 0.85rem;
}

.casillero-info {
  padding: 0.7rem 0.9rem;
  border-radius: 0.65rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  font-size: 0.82rem;
  color: #1d4ed8;
  line-height: 1.65;
}

@media (max-width: 640px) {
  .casillero-hide-sm {
    display: none;
  }
}

@media (max-width: 768px) {
  .casillero-hide-md {
    display: none;
  }
}

/* --- Campañas de correo (admin) --- */
.ship-campaign-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 60rem;
}

.ship-campaign-jodit-mount {
  width: 100%;
  max-width: 60rem;
}

.ship-campaign-jodit-mount .jodit-container {
  border-radius: 0.5rem;
  border-color: #d1d5db;
}

.ship-campaign-editor-hint {
  margin: 0;
  font-size: 0.82rem;
  color: #6b7280;
  line-height: 1.5;
}

.ship-campaign-editor-error {
  color: #b91c1c;
}


.ship-campaign-subject {
  width: 100%;
  max-width: 40rem;
}

.ship-campaign-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ship-campaign-tab {
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 0.5rem;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  font-size: 0.85rem;
}

.ship-campaign-tab--active {
  background: #1e3a5f;
  color: #fff;
  border-color: #1e3a5f;
}

.ship-campaign-editor-wrap {
  display: flex;
  flex-direction: column;
  min-height: 18rem;
}

.ship-campaign-html {
  width: 100%;
  min-height: 18rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  resize: vertical;
}

.ship-campaign-preview-frame {
  min-height: 18rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background: #fff;
}

.ship-campaign-section-title {
  font-size: 1rem;
  margin: 0.5rem 0 0;
}

.ship-campaign-images {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.ship-campaign-images-empty {
  color: #6b7280;
  font-size: 0.85rem;
  margin: 0;
}

.ship-campaign-image-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 10rem;
  padding: 0.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #f9fafb;
}

.ship-campaign-image-thumb {
  width: 100%;
  height: 5rem;
  object-fit: cover;
  border-radius: 0.35rem;
  background: #fff;
}

.ship-campaign-image-name {
  font-size: 0.72rem;
  color: #374151;
  word-break: break-all;
}

.ship-campaign-upload-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.ship-campaign-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e5e7eb;
}

.ship-campaign-result-panel {
  max-width: 40rem;
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ship-campaign-result-subject {
  font-weight: 600;
  margin: 0;
}

.ship-campaign-result-stat {
  font-size: 0.95rem;
}

.ship-campaign-result-label {
  color: #374151;
}

.ship-campaign-failed-list {
  max-height: 16rem;
  overflow: auto;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
}
.user-batch-import-root {
.user-batch-import-intro {
.user-batch-import-sample {
.user-batch-import-errors {
.user-batch-import-errors-title {
.user-batch-import-errors-list {

