/* iPad workspace: retain the desktop cash workflow and tables contained within the viewport. */
@media screen and (min-width:769px) and (max-width:1180px) and (pointer:coarse) {
  .ecocrm-cash, .eco-cash-shell, .eco-cash-content { min-width:0; min-height:0; }
  .eco-cash-head { min-height:68px; gap:12px; padding:12px 14px; }
  .eco-cash-head h1 { font-size:23px; }
  .eco-cash-head small { font-size:11px; }
  .eco-cash-head-actions { flex-wrap:wrap; justify-content:flex-end; gap:6px; }
  .eco-cash-head button, .eco-cash-tabs button { min-height:40px; padding-inline:11px; }
  .eco-cash-tabs { flex:none; padding:0 14px; gap:2px; flex-wrap:wrap; }
  .eco-cash-tabs button { flex:none; white-space:nowrap; }
  .eco-cash-content { padding:12px 14px 18px; overscroll-behavior:contain; }
  .eco-cash-order-tools { gap:8px; margin-bottom:10px; }
  .eco-cash-order-search input { min-height:40px; padding:9px 38px 9px 10px; }
  .eco-cash-order-search>button { width:38px; height:40px; }
  .eco-cash-date-actions { gap:6px; flex:none; }
  .eco-cash-date-actions button { min-height:40px!important; height:40px!important; padding:0 10px!important; font-size:12px; }
  .eco-cash-metrics { padding:10px 0; }
  .eco-cash-metrics article { padding-inline:12px; gap:5px 8px; }
  .eco-cash-metrics strong { font-size:19px; }
  .eco-cash-metrics span, .eco-cash-scope { font-size:12px; }
  .eco-cash-card-head { min-height:56px; gap:10px; padding:10px 12px; flex-wrap:wrap; }
  .eco-cash-card-head>div { min-width:0; }
  .eco-cash-card-head>div:last-child { flex-wrap:wrap; }
  .eco-cash-table-wrap { min-width:0; max-width:100%; overflow:visible; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; }
  .eco-cash-table-wrap table { min-width:0; width:100%; table-layout:fixed; }
  .eco-cash-orders-table table { min-width:0; width:100%; table-layout:fixed; }
  .eco-cash-counterparties-table table { min-width:0; width:100%; table-layout:fixed; }
  .eco-cash-table-wrap :is(th,td) { min-width:0; white-space:normal!important; overflow-wrap:anywhere; }
  .eco-cash-table-wrap :is(button,input,.eco-cash-inline-name) { min-width:0!important; max-width:100%; white-space:normal; }
  .eco-cash-table-wrap :is(input,.eco-cash-inline-name) { width:100%; }
  .eco-cash-table-wrap th { height:40px; padding:8px 10px; font-size:11px; }
  .eco-cash-table-wrap td { padding:10px; font-size:12px; }
  .eco-cash-table-wrap td strong { font-size:13px; }
  .eco-cash-table-wrap td small { font-size:11px; }
  .eco-cash-table-wrap :is(button,.eco-cash-order-number), .eco-cash-counterparty-actions button { min-height:36px; }
  .eco-cash-order-actions { display:grid; grid-template-columns:minmax(0,1fr); white-space:normal; gap:5px; }
  .eco-cash-orders-table :is(th,td) { padding:8px 6px; }
  .eco-cash-orders-table :is(th,td):nth-child(1) { width:15%; }
  .eco-cash-orders-table :is(th,td):nth-child(2) { width:23%; }
  .eco-cash-orders-table :is(th,td):nth-child(3) { width:18%; }
  .eco-cash-orders-table :is(th,td):nth-child(4) { width:13%; }
  .eco-cash-orders-table :is(th,td):nth-child(5) { width:14%; }
  .eco-cash-orders-table :is(th,td):nth-child(6) { width:17%; }
  .eco-cash-orders-table .eco-cash-status-switch { display:grid; grid-template-columns:minmax(0,1fr); width:100%; }
  .eco-cash-orders-table .eco-cash-sort { flex-wrap:wrap; white-space:normal; }
  .eco-cash-counterparties-table :is(th,td):nth-child(1) { width:36%; }
  .eco-cash-counterparties-table :is(th,td):nth-child(2) { width:36%; }
  .eco-cash-counterparties-table :is(th,td):nth-child(3) { width:28%; }
  .eco-cash-counterparties-table .eco-cash-counterparty-actions { display:grid; grid-template-columns:minmax(0,1fr); }
  .eco-cash-table-wrap .eco-cash-counterparty-link { white-space:normal; overflow-wrap:anywhere; }
  .eco-cash-orders-table .eco-cash-order-actions button { min-height:36px; padding-inline:8px; }
  .eco-cash-status-switch button { min-height:36px!important; padding-inline:8px; }
  .eco-cash-search { padding:10px 12px; gap:8px; }
  .eco-cash-search input { min-width:0; }
  .eco-cash-search span { font-size:11px; }
  .ecocrm-cash :is(input:not([type=checkbox]):not([type=radio]),select,textarea),
  .eco-cash-global-modal-host :is(input:not([type=checkbox]):not([type=radio]),select,textarea) { font-size:16px!important; }

  .eco-cash-modal-backdrop, .eco-cash-picker-backdrop { padding:12px; }
  .eco-cash-modal { box-sizing:border-box; max-width:calc(100vw - 24px); max-height:calc(100dvh - 24px); max-height:min(calc(100dvh - 24px),calc(var(--crm-viewport-height,100dvh) - 24px)); overscroll-behavior:contain; }
  .eco-cash-point-modal { width:calc(100vw - 24px); }
  .eco-cash-point-modal .eco-cash-modal-head { min-height:60px; padding:10px 14px; }
  .eco-cash-point-modal .eco-cash-modal-head h2 { font-size:20px; }
  .eco-cash-modal-head>button, .eco-cash-point-modal .eco-cash-modal-head>button { width:40px; height:40px; flex:none; }
  .eco-cash-point-modal .eco-cash-order-grid { grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr); }
  .eco-cash-point-modal .eco-cash-order-grid>section { min-width:0; padding:14px; }
  .eco-cash-point-modal .eco-cash-order-grid>section+section { border-top:0; border-left:1px solid rgba(255,255,255,.07); }
  .eco-cash-point-modal .eco-cash-item-row { grid-template-columns:minmax(0,1fr) 94px 78px 36px; gap:8px; }
  .eco-cash-point-modal .eco-cash-item-row label { min-width:0; }
  .eco-cash-point-modal .eco-cash-item-row :is(input,select) { height:40px; padding-inline:8px; }
  .eco-cash-point-modal .eco-cash-item-row>button { width:36px; min-height:40px; }
  .eco-cash-point-modal .eco-cash-combo { grid-template-columns:minmax(0,1fr) 40px; }
  .eco-cash-point-modal .eco-cash-new-customer { min-width:40px; min-height:40px; }
  .eco-cash-point-modal .eco-cash-saved-addresses button { white-space:normal; overflow-wrap:anywhere; text-overflow:clip; }
  .eco-cash-point-modal .eco-cash-item-row label small { overflow-wrap:anywhere; height:auto; }
  .eco-cash-point-modal .eco-cash-item-row label { grid-template-rows:auto 40px minmax(12px,auto); }
  .eco-cash-point-modal .eco-cash-field { margin-bottom:12px; }
  .eco-cash-point-modal .eco-cash-field input { min-width:0; min-height:40px; }
  .eco-cash-point-modal .eco-cash-items-head { flex-wrap:wrap; gap:4px; }
  .eco-cash-point-modal .eco-cash-items-head small { font-size:10px; }
  .eco-cash-point-modal .eco-cash-add-item { min-height:40px; }
  .eco-cash-point-modal .eco-cash-form-bottom { grid-template-columns:minmax(160px,.7fr) minmax(0,1fr); padding:14px; gap:12px; }
  .eco-cash-point-modal .eco-cash-form-bottom :is(input,textarea) { min-width:0; }
  .eco-cash-point-modal .eco-cash-manual-total { width:min(250px,100%); margin-top:12px; }
  .eco-cash-point-modal .eco-cash-modal-actions { position:sticky; bottom:0; z-index:3; padding:12px 14px; gap:8px; background:#151416; border-top:1px solid rgba(255,255,255,.07); }
  .eco-cash-point-modal .eco-cash-modal-actions button { min-height:40px; min-width:120px!important; }
  .eco-cash-simple-fields { min-width:0; }
  .eco-cash-counterparty-actions { gap:6px; }
  .eco-cash-counterparty-modal .eco-cash-simple-fields input { min-height:40px; }
  .eco-cash-history-summary { gap:10px; padding:12px 14px; }
  .eco-cash-history-summary>button { min-height:40px; }
  .eco-cash-history-modal .eco-cash-table-wrap { overflow-y:auto; }
  .eco-cash-history-modal .eco-cash-table-wrap table { min-width:0; width:100%; table-layout:fixed; }
  .eco-cash-modal-actions :is(button,a) { min-height:40px; }

  @media (max-width:900px) {
    .eco-cash-head-actions { max-width:340px; }
    .eco-cash-point-modal .eco-cash-order-grid { grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr); }
    .eco-cash-point-modal .eco-cash-item-row { grid-template-columns:minmax(0,1fr) minmax(0,.85fr) 36px; gap:5px 8px; }
    .eco-cash-point-modal .eco-cash-item-row>label:first-child { grid-column:1/-1; }
    .eco-cash-point-modal .eco-cash-item-row>button { grid-column:3; grid-row:2; }
    .eco-cash-point-modal .eco-cash-items-head small { max-width:230px; text-align:right; }
  }
}
