/* =========================================================
   ALANSA · EXPERIENCIA MÓVIL
   Capa final responsive. No modifica la vista de escritorio.
   ========================================================= */

.mobile-app-header,
.mobile-drawer-backdrop,
.mobile-drawer-close {
  display: none;
}

@media (max-width: 760px) {
  :root {
    --mobile-header-height: calc(58px + env(safe-area-inset-top));
  }

  html,
  body {
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
    overscroll-behavior-x: none;
  }

  body {
    background: #f5f7f4;
    -webkit-tap-highlight-color: transparent;
  }

  body.mobile-menu-open {
    overflow: hidden;
  }

  button,
  a,
  select,
  input,
  textarea {
    touch-action: manipulation;
  }

  /* -------------------------------------------------------
     Barra superior tipo app
     ------------------------------------------------------- */

  .mobile-app-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 80;
    height: var(--mobile-header-height);
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 38px;
    align-items: end;
    gap: 10px;
    padding: env(safe-area-inset-top) 14px 8px;
    border-bottom: 1px solid rgba(16, 42, 19, .08);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 3px 18px rgba(16, 42, 19, .06);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .mobile-menu-button,
  .mobile-drawer-close {
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--alansa-900);
  }

  .mobile-menu-button {
    display: flex;
  }

  .mobile-menu-button:active,
  .mobile-drawer-close:active {
    background: var(--alansa-100);
    transform: scale(.96);
  }

  .mobile-menu-button svg,
  .mobile-drawer-close svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
  }

  .mobile-app-title {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-bottom: 3px;
    line-height: 1.05;
  }

  .mobile-app-title strong {
    overflow: hidden;
    color: #17331f;
    font-size: .84rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-app-title span {
    margin-top: 3px;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 650;
  }

  .mobile-user-badge {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    align-self: center;
    margin-top: env(safe-area-inset-top);
    border-radius: 50%;
    background: var(--alansa-900);
    color: #fff;
    font-size: .75rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  /* -------------------------------------------------------
     Menú hamburguesa
     ------------------------------------------------------- */

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    width: min(84vw, 320px);
    height: 100dvh;
    display: flex;
    padding: calc(14px + env(safe-area-inset-top)) 12px calc(14px + env(safe-area-inset-bottom));
    transform: translateX(-104%);
    visibility: hidden;
    box-shadow: 18px 0 55px rgba(5, 24, 11, .25);
    transition: transform .24s ease, visibility .24s ease;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    visibility: visible;
  }

  .mobile-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: block;
    border: 0;
    opacity: 0;
    visibility: hidden;
    background: rgba(5, 20, 10, .48);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    transition: opacity .22s ease, visibility .22s ease;
  }

  .mobile-drawer-backdrop.visible {
    opacity: 1;
    visibility: visible;
  }

  .sidebar-brand {
    position: relative;
    min-height: 62px;
    padding-right: 48px;
  }

  .sidebar-brand-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
  }

  .mobile-drawer-close {
    position: absolute;
    top: 7px;
    right: 0;
    display: flex;
    color: rgba(255, 255, 255, .88);
  }

  .nav {
    gap: 5px;
    overflow-y: auto;
    padding: 6px 0 12px;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    min-height: 50px;
    gap: 13px;
    padding: 11px 13px;
    border-radius: 13px;
  }

  .nav-icon {
    width: 23px;
    height: 23px;
  }

  .nav-icon svg {
    width: 22px;
    height: 22px;
  }

  .nav-label {
    font-size: .91rem;
  }

  .sidebar-foot {
    padding-bottom: 2px;
  }

  /* -------------------------------------------------------
     Contenedor de módulos
     ------------------------------------------------------- */

  .main {
    width: 100%;
    min-height: 100dvh;
    margin-left: 0;
    padding: calc(var(--mobile-header-height) + 10px) 12px calc(28px + env(safe-area-inset-bottom));
  }

  .mobile-bar {
    display: none !important;
  }

  .module-sticky {
    position: relative;
    top: auto;
    z-index: 20;
    padding: 8px 0 10px;
    background: #f5f7f4;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .module-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
  }

  .module-head > div:first-child {
    min-width: 0;
    flex: 1;
  }

  .module-head h1 {
    margin: 0;
    font-size: 1.38rem;
    line-height: 1.15;
    letter-spacing: -.025em;
  }

  .module-head p {
    display: block;
    margin: 5px 0 0;
    font-size: .75rem;
    line-height: 1.35;
  }

  .module-head .btn,
  .module-head button {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 9px 12px;
    border-radius: 11px;
    font-size: .76rem;
    white-space: nowrap;
  }

  .content,
  .dashboard-v2-content,
  .collections-content {
    gap: 12px;
  }

  .card,
  .panel,
  .dashboard-v2-section,
  .collections-panel {
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(16, 42, 19, .045);
  }

  /* -------------------------------------------------------
     Formularios y filtros: dedos, no cursor
     ------------------------------------------------------- */

  .filters,
  .dashboard-v2-filter-grid,
  .shipments-v2-filters,
  .collections-filters,
  .form-grid,
  .shipment-form-grid,
  .collections-form-grid {
    grid-template-columns: 1fr !important;
  }

  .input,
  select.input,
  textarea.input,
  .collections-filter-field select,
  .collections-filter-field input {
    min-height: 48px;
    font-size: 16px;
    border-radius: 11px;
  }

  textarea.input {
    min-height: 96px;
  }

  .field label,
  .collections-filter-field label {
    margin-bottom: 6px;
    font-size: .72rem;
  }

  .btn,
  .icon-btn {
    min-height: 44px;
  }

  /* -------------------------------------------------------
     KPIs compactos y legibles
     ------------------------------------------------------- */

  .kpi-grid,
  .dashboard-v2-kpis,
  .collections-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px;
  }

  .kpi,
  .dashboard-v2-kpi,
  .collections-kpi {
    min-width: 0;
    min-height: 96px;
    padding: 12px !important;
    border-radius: 13px;
  }

  .collections-kpi-count:last-child:nth-child(odd),
  .dashboard-v2-kpi:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  /* -------------------------------------------------------
     Tablas: scroll táctil estable
     ------------------------------------------------------- */

  .table-wrap,
  .desktop-table,
  .shipments-v2-scroll,
  .dashboard-v2-table-scroll,
  .dashboard-v2-due-scroll,
  .dashboard-excel-table-scroll,
  .collections-table-scroll,
  .collections-history-scroll,
  .shipment-lines-scroll,
  .planting-projection-table {
    max-width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }

  .shipments-v2-table,
  .collections-table,
  .dashboard-excel-table,
  .dashboard-due-excel-table {
    font-size: .75rem;
  }

  .shipments-v2-table th,
  .shipments-v2-table td,
  .collections-table th,
  .collections-table td {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .collections-table-scroll,
  .shipments-v2-scroll {
    max-height: 64dvh;
  }

  /* Los filtros flotantes nunca pueden salir de pantalla. */
  .shipment-filter-menu-portal,
  .dashboard-excel-filter-menu-portal,
  .collections-filter-menu-portal {
    width: min(310px, calc(100vw - 24px)) !important;
    max-width: calc(100vw - 24px) !important;
    max-height: min(70dvh, 480px) !important;
    overflow: auto;
    border-radius: 14px;
  }

  /* -------------------------------------------------------
     Cabeceras de tablas / acciones
     ------------------------------------------------------- */

  .shipments-v2-head,
  .collections-panel-head,
  .dashboard-v2-section-head,
  .shipment-lines-head,
  .collections-history-head {
    align-items: stretch !important;
    flex-direction: column !important;
    gap: 10px !important;
  }

  .shipment-header-actions,
  .collections-actions,
  .dashboard-v2-filter-actions {
    width: 100%;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .shipment-header-actions .btn,
  .collections-actions .btn,
  .dashboard-v2-filter-actions .btn {
    width: 100%;
    min-height: 44px;
  }

  /* -------------------------------------------------------
     Modales como hojas de app
     ------------------------------------------------------- */

  .modal-backdrop,
  .shipment-modal-backdrop,
  .collections-modal-backdrop {
    align-items: end !important;
    padding: 0 !important;
    background: rgba(5, 20, 10, .52);
  }

  .modal,
  .shipment-modal,
  .collections-payment-modal,
  .collections-detail-modal {
    width: 100vw !important;
    max-width: none !important;
    max-height: 94dvh !important;
    min-height: 0 !important;
    margin: 0 !important;
    border-radius: 20px 20px 0 0 !important;
    overflow: auto;
    box-shadow: 0 -18px 55px rgba(0, 0, 0, .18);
  }

  .modal-head,
  .shipment-modal-head {
    padding: 14px 15px;
  }

  .modal-body,
  #shipmentForm {
    padding: 15px !important;
  }

  .modal-actions,
  .shipment-modal-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 18px -15px -15px !important;
    padding: 12px 15px calc(12px + env(safe-area-inset-bottom)) !important;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  .modal-actions .btn,
  .shipment-modal-actions .btn {
    width: 100%;
    min-height: 48px;
  }

  .shipment-form-bottom,
  .collections-payment-summary,
  .collections-detail-grid {
    grid-template-columns: 1fr !important;
  }

  /* -------------------------------------------------------
     Login móvil
     ------------------------------------------------------- */

  .login-premium {
    min-height: 100dvh;
  }

  .login-visual {
    min-height: 100dvh;
    background-position: 42% center;
  }

  .login-brand {
    top: calc(26px + env(safe-area-inset-top));
    right: 20px;
    left: 20px;
  }

  .login-brand h1 {
    max-width: 280px;
    font-size: clamp(1.5rem, 7vw, 2rem);
  }

  .login-access {
    min-height: 100dvh;
    padding: 150px 12px calc(12px + env(safe-area-inset-bottom));
  }

  .login-access-card {
    max-width: 480px;
    margin: 0 auto;
    padding: 24px 18px 20px;
    border-radius: 22px;
  }

  .login-user-button {
    min-height: 70px;
  }
}

@media (max-width: 430px) {
  .main {
    padding-right: 10px;
    padding-left: 10px;
  }

  .module-head {
    flex-wrap: wrap;
  }

  .module-head > .btn,
  .module-head > button {
    width: 100%;
  }

  .kpi-grid,
  .dashboard-v2-kpis,
  .collections-kpis {
    grid-template-columns: 1fr 1fr !important;
  }

  .shipment-header-actions,
  .collections-actions,
  .dashboard-v2-filter-actions {
    grid-template-columns: 1fr;
  }

  .login-access {
    padding-right: 9px;
    padding-left: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .mobile-drawer-backdrop {
    transition: none;
  }
}

/* =========================================================
   ALANSA · MODO MÓVIL REAL
   En teléfono las tablas operativas se convierten en tarjetas.
   Escritorio conserva las tablas originales.
   ========================================================= */
@media (max-width: 760px) {
  /* Dashboard: la proyección deja de ser una matriz comprimida. */
  .dashboard-v2-table-wrap {
    overflow: visible !important;
  }

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

  .projection-dashboard-table thead {
    display: none;
  }

  .projection-dashboard-table {
    min-width: 0 !important;
    border: 0 !important;
    background: transparent;
  }

  .projection-dashboard-table tbody {
    display: grid;
    gap: 10px;
  }

  .projection-dashboard-table tbody tr {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #fff;
  }

  .projection-dashboard-table tbody td {
    min-width: 0 !important;
    padding: 10px 12px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--border) !important;
    text-align: right !important;
  }

  .projection-dashboard-table tbody td:first-child {
    background: #f7faf7;
    text-align: left !important;
  }

  .projection-dashboard-table tbody td:last-child {
    border-bottom: 0 !important;
  }

  .projection-dashboard-table tbody td:nth-child(2)::before { content: 'Por ha · MXN'; }
  .projection-dashboard-table tbody td:nth-child(3)::before { content: 'Por ha · USD'; }
  .projection-dashboard-table tbody td:nth-child(4)::before { content: 'Siembra · MXN'; }
  .projection-dashboard-table tbody td:nth-child(5)::before { content: 'Siembra · USD'; }

  .projection-dashboard-table tbody td:not(:first-child)::before {
    float: left;
    margin-right: 12px;
    color: var(--muted);
    font-size: .69rem;
    font-weight: 750;
    text-transform: uppercase;
  }

  /* Dashboard: Remisiones y vencimientos como tarjetas. */
  .dashboard-excel-table-scroll,
  .dashboard-v2-due-scroll {
    overflow: visible !important;
    max-height: none !important;
  }

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

  .dashboard-excel-table {
    min-width: 0 !important;
    border: 0 !important;
    background: transparent;
  }

  .dashboard-excel-table thead {
    display: none;
  }

  .dashboard-excel-table tbody {
    display: grid;
    gap: 10px;
  }

  .dashboard-excel-table tbody tr {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #fff;
  }

  .dashboard-excel-table tbody td {
    min-width: 0 !important;
    display: grid;
    grid-template-columns: minmax(100px, .8fr) minmax(0, 1.2fr);
    gap: 12px;
    align-items: center;
    padding: 9px 12px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--border) !important;
    text-align: right !important;
    overflow-wrap: anywhere;
  }

  .dashboard-excel-table tbody td:last-child {
    border-bottom: 0 !important;
  }

  .dashboard-excel-table tbody td::before {
    color: var(--muted);
    font-size: .68rem;
    font-weight: 750;
    text-align: left;
    text-transform: uppercase;
  }

  .dashboard-excel-table:not(.dashboard-due-excel-table) tbody td:nth-child(1)::before { content: 'Remisión'; }
  .dashboard-excel-table:not(.dashboard-due-excel-table) tbody td:nth-child(2)::before { content: 'Fecha'; }
  .dashboard-excel-table:not(.dashboard-due-excel-table) tbody td:nth-child(3)::before { content: 'Cliente'; }
  .dashboard-excel-table:not(.dashboard-due-excel-table) tbody td:nth-child(4)::before { content: 'Monto MXN'; }
  .dashboard-excel-table:not(.dashboard-due-excel-table) tbody td:nth-child(5)::before { content: 'Monto USD'; }
  .dashboard-excel-table:not(.dashboard-due-excel-table) tbody td:nth-child(6)::before { content: 'Estatus'; }

  .dashboard-due-excel-table tbody td:nth-child(1)::before { content: 'Remisión'; }
  .dashboard-due-excel-table tbody td:nth-child(2)::before { content: 'Fecha'; }
  .dashboard-due-excel-table tbody td:nth-child(3)::before { content: 'Vencimiento'; }
  .dashboard-due-excel-table tbody td:nth-child(4)::before { content: 'Cliente'; }
  .dashboard-due-excel-table tbody td:nth-child(5)::before { content: 'Monto MXN'; }
  .dashboard-due-excel-table tbody td:nth-child(6)::before { content: 'Monto USD'; }
  .dashboard-due-excel-table tbody td:nth-child(7)::before { content: 'Días'; }

  .dashboard-excel-table tfoot {
    display: block;
    margin-top: 10px;
  }

  .dashboard-excel-table tfoot tr {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #f7faf7;
  }

  .dashboard-excel-table tfoot td {
    display: block;
    width: 100%;
    padding: 0 !important;
    border: 0 !important;
    text-align: left !important;
  }

  /* Remisiones: una remisión = una tarjeta completa. */
  .shipments-v2-scroll {
    overflow: visible !important;
    max-height: none !important;
  }

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

  .shipments-v2-table {
    min-width: 0 !important;
    border: 0 !important;
    background: transparent;
  }

  .shipments-v2-table thead {
    display: none;
  }

  .shipments-v2-table tbody {
    display: grid;
    gap: 12px;
  }

  .shipments-v2-table tbody tr {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(16, 42, 19, .04);
  }

  .shipments-v2-table tbody td {
    min-width: 0 !important;
    max-width: none !important;
    display: grid;
    grid-template-columns: minmax(105px, .8fr) minmax(0, 1.2fr);
    gap: 12px;
    align-items: center;
    padding: 9px 12px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--border) !important;
    text-align: right !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  .shipments-v2-table tbody td:last-child {
    border-bottom: 0 !important;
  }

  .shipments-v2-table tbody td::before {
    color: var(--muted);
    font-size: .68rem;
    font-weight: 750;
    text-align: left;
    text-transform: uppercase;
  }

  .shipments-v2-table tbody td:nth-child(1)::before { content: 'Folio'; }
  .shipments-v2-table tbody td:nth-child(2)::before { content: 'Fecha'; }
  .shipments-v2-table tbody td:nth-child(3)::before { content: 'Contrato'; }
  .shipments-v2-table tbody td:nth-child(4)::before { content: 'Cliente'; }
  .shipments-v2-table tbody td:nth-child(5)::before { content: 'Producto'; }
  .shipments-v2-table tbody td:nth-child(6)::before { content: 'Cajas'; }
  .shipments-v2-table tbody td:nth-child(7)::before { content: 'Libras'; }
  .shipments-v2-table tbody td:nth-child(8)::before { content: 'Total MXN'; }
  .shipments-v2-table tbody td:nth-child(9)::before { content: 'Total USD'; }
  .shipments-v2-table tbody td:nth-child(10)::before { content: 'Vencimiento'; }
  .shipments-v2-table tbody td:nth-child(11)::before { content: 'Estado'; }
  .shipments-v2-table tbody td:nth-child(12)::before { content: 'Acciones'; }

  .shipments-v2-table .shipment-cell-folio {
    font-weight: 800;
    color: var(--alansa-900);
  }

  .shipments-v2-table tbody td:nth-child(12) > * {
    justify-self: end;
  }

  .shipments-v2-table tfoot {
    display: none;
  }

  /* Cobranza: cartera en tarjetas, sin perder ningún dato. */
  .collections-table-scroll {
    overflow: visible !important;
    max-height: none !important;
  }

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

  .collections-table {
    min-width: 0 !important;
    border: 0 !important;
    background: transparent;
  }

  .collections-table thead {
    display: none;
  }

  .collections-table tbody {
    display: grid;
    gap: 12px;
  }

  .collections-table tbody tr {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(16, 42, 19, .04);
  }

  .collections-table tbody td {
    min-width: 0 !important;
    max-width: none !important;
    display: grid;
    grid-template-columns: minmax(110px, .82fr) minmax(0, 1.18fr);
    gap: 12px;
    align-items: center;
    padding: 9px 12px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--border) !important;
    text-align: right !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  .collections-table tbody td:last-child {
    border-bottom: 0 !important;
  }

  .collections-table tbody td::before {
    color: var(--muted);
    font-size: .68rem;
    font-weight: 750;
    text-align: left;
    text-transform: uppercase;
  }

  .collections-table tbody td:nth-child(1)::before { content: 'Folio'; }
  .collections-table tbody td:nth-child(2)::before { content: 'Fecha'; }
  .collections-table tbody td:nth-child(3)::before { content: 'Vencimiento'; }
  .collections-table tbody td:nth-child(4)::before { content: 'Contrato'; }
  .collections-table tbody td:nth-child(5)::before { content: 'Cliente'; }
  .collections-table tbody td:nth-child(6)::before { content: 'Total MXN'; }
  .collections-table tbody td:nth-child(7)::before { content: 'Total USD'; }
  .collections-table tbody td:nth-child(8)::before { content: 'Cobrado MXN'; }
  .collections-table tbody td:nth-child(9)::before { content: 'Cobrado USD'; }
  .collections-table tbody td:nth-child(10)::before { content: 'Saldo MXN'; }
  .collections-table tbody td:nth-child(11)::before { content: 'Saldo USD'; }
  .collections-table tbody td:nth-child(12)::before { content: 'Días'; }
  .collections-table tbody td:nth-child(13)::before { content: 'Estatus'; }
  .collections-table tbody td:nth-child(14)::before { content: 'Acciones'; }

  .collections-row-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  .collections-row-actions .btn,
  .collections-row-actions .icon-btn {
    width: 100%;
    min-height: 44px;
  }

  .collections-table tfoot {
    display: none;
  }

  /* Siembras y Gastos: tablas generales a tarjetas. */
  .content > .table-card .table-scroll:not(.shipments-v2-scroll),
  .desktop-table {
    overflow: visible !important;
  }

  .content > .table-card .table-scroll:not(.shipments-v2-scroll) > table,
  .content > .table-card .table-scroll:not(.shipments-v2-scroll) > table tbody,
  .content > .table-card .table-scroll:not(.shipments-v2-scroll) > table tr,
  .content > .table-card .table-scroll:not(.shipments-v2-scroll) > table td,
  .desktop-table > table,
  .desktop-table > table tbody,
  .desktop-table > table tr,
  .desktop-table > table td {
    display: block;
    width: 100%;
  }

  .content > .table-card .table-scroll:not(.shipments-v2-scroll) > table,
  .desktop-table > table {
    min-width: 0 !important;
    border: 0 !important;
    background: transparent;
  }

  .content > .table-card .table-scroll:not(.shipments-v2-scroll) > table thead,
  .desktop-table > table thead {
    display: none;
  }

  .content > .table-card .table-scroll:not(.shipments-v2-scroll) > table tbody,
  .desktop-table > table tbody {
    display: grid;
    gap: 12px;
  }

  .content > .table-card .table-scroll:not(.shipments-v2-scroll) > table tbody tr,
  .desktop-table > table tbody tr {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: #fff;
  }

  .content > .table-card .table-scroll:not(.shipments-v2-scroll) > table tbody td,
  .desktop-table > table tbody td {
    min-width: 0 !important;
    display: grid;
    grid-template-columns: minmax(110px, .85fr) minmax(0, 1.15fr);
    gap: 12px;
    align-items: center;
    padding: 9px 12px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--border) !important;
    text-align: right !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  .content > .table-card .table-scroll:not(.shipments-v2-scroll) > table tbody td:last-child,
  .desktop-table > table tbody td:last-child {
    border-bottom: 0 !important;
  }

  .content > .table-card .table-scroll:not(.shipments-v2-scroll) > table tbody td::before,
  .desktop-table > table tbody td::before {
    color: var(--muted);
    font-size: .68rem;
    font-weight: 750;
    text-align: left;
    text-transform: uppercase;
  }

  /* Siembras */
  .content > .table-card .table-scroll:not(.shipments-v2-scroll) > table tbody td:nth-child(1)::before { content: 'Contrato'; }
  .content > .table-card .table-scroll:not(.shipments-v2-scroll) > table tbody td:nth-child(2)::before { content: 'Cliente'; }
  .content > .table-card .table-scroll:not(.shipments-v2-scroll) > table tbody td:nth-child(3)::before { content: 'Producto'; }
  .content > .table-card .table-scroll:not(.shipments-v2-scroll) > table tbody td:nth-child(4)::before { content: 'Hectáreas'; }
  .content > .table-card .table-scroll:not(.shipments-v2-scroll) > table tbody td:nth-child(5)::before { content: 'Rendimiento / ha'; }
  .content > .table-card .table-scroll:not(.shipments-v2-scroll) > table tbody td:nth-child(6)::before { content: 'Cajas proyectadas'; }
  .content > .table-card .table-scroll:not(.shipments-v2-scroll) > table tbody td:nth-child(7)::before { content: 'Ingreso proyectado'; }
  .content > .table-card .table-scroll:not(.shipments-v2-scroll) > table tbody td:nth-child(8)::before { content: 'Costos proyectados'; }
  .content > .table-card .table-scroll:not(.shipments-v2-scroll) > table tbody td:nth-child(9)::before { content: 'Estado'; }
  .content > .table-card .table-scroll:not(.shipments-v2-scroll) > table tbody td:nth-child(10)::before { content: 'Acciones'; }

  /* Gastos */
  .desktop-table > table tbody td:nth-child(1)::before { content: 'Fecha'; }
  .desktop-table > table tbody td:nth-child(2)::before { content: 'Siembra'; }
  .desktop-table > table tbody td:nth-child(3)::before { content: 'Categoría'; }
  .desktop-table > table tbody td:nth-child(4)::before { content: 'Proveedor'; }
  .desktop-table > table tbody td:nth-child(5)::before { content: 'Concepto'; }
  .desktop-table > table tbody td:nth-child(6)::before { content: 'Importe'; }
  .desktop-table > table tbody td:nth-child(7)::before { content: 'Tipo de cambio'; }
  .desktop-table > table tbody td:nth-child(8)::before { content: 'Equivalente MXN'; }
  .desktop-table > table tbody td:nth-child(9)::before { content: 'Método de pago'; }
  .desktop-table > table tbody td:nth-child(10)::before { content: 'Acciones'; }

  /* En móvil las tarjetas ocupan el ancho útil completo. */
  .table-card,
  .shipments-table-card,
  .collections-panel,
  .dashboard-v2-section {
    overflow: visible !important;
  }
}
