/* Suwasetha mobile billing v80: airy, thumb-friendly cards. Display-only change. */
@media screen and (max-width:850px){
  #unified-new-bill, .payment-simple { min-width:0; max-width:100%; }
  #unified-new-bill .panel.pad, #unified-payment-section .panel.pad, .payment-simple.panel.pad {
    border-radius:18px; padding:18px 14px; box-shadow:0 3px 15px rgba(27,46,62,.045);
  }
  #unified-new-bill .heading-row, #unified-payment-section .heading-row {
    align-items:flex-start; gap:10px; flex-wrap:wrap;
  }
  #unified-new-bill .bill-create-item-grid, #unified-new-bill .bill-create-people {
    grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px;
  }
  #unified-new-bill .pos-add-search {grid-column:1/-1;}
  #unified-new-bill .control, .payment-simple .control {min-height:46px;font-size:16px;border-radius:11px;max-width:100%;}
  #unified-new-bill .table-wrap:has(.bill-cart-table) {overflow-x:visible;min-width:0;}
  #unified-new-bill .bill-cart-table tbody tr {
    display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    padding:15px; margin:12px 0; gap:13px 12px;
    border-radius:16px; border:1px solid #e1e8ed; background:#f8fafc;
    box-shadow:0 1px 3px rgba(27,46,62,.03);
  }
  #unified-new-bill .bill-cart-table tbody td:first-child {grid-column:1/-1; font-weight:700;}
  #unified-new-bill .bill-cart-table tbody td:first-child input {
    font-weight:700; background:#fff; font-size:16px;
  }
  #unified-new-bill .bill-cart-table tbody td:nth-child(4) output {
    display:block; font-weight:750; font-size:18px; padding:10px 0;
  }
  #unified-new-bill .bill-cart-table tbody td:nth-child(5) {grid-column:1/-1;display:flex;justify-content:flex-end;align-items:center;}
  #unified-new-bill .bill-cart-table tbody td:nth-child(5) button {
    min-height:44px; min-width:100px; border-radius:10px;
  }
  #unified-new-bill .bill-cart-table tbody td:before {
    text-transform:none; font-size:12px; letter-spacing:0; color:#637386; margin-bottom:5px;
  }
  #unified-new-bill .invoice-summary {
    padding:18px 16px; border-radius:18px; background:#fff;
    border:1px solid #dae5ed; box-shadow:0 3px 14px rgba(27,46,62,.06);
  }
  #unified-new-bill .invoice-summary .money-row {
    display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:42px;
  }
  #unified-new-bill .invoice-summary .total-row {
    border-top:1px solid #e4eaf0; margin-top:12px; padding-top:15px;
    display:flex; justify-content:space-between;align-items:center;gap:12px; font-size:19px;
  }
  #unified-new-bill .invoice-summary .total-row strong {font-size:23px;white-space:nowrap;}
  #unified-new-bill .bill-final-actions {display:grid;gap:10px;margin-top:15px;}
  #unified-new-bill .bill-final-actions .btn,
  #unified-payment-section #confirm-payment-allocation,
  .payment-simple #confirm-payment-allocation {
    width:100%; min-height:54px; border-radius:13px; font-size:17px;
    font-weight:750; white-space:normal; text-align:center;
  }
  #unified-new-bill .bill-final-actions [data-next="payment"] {order:-1;}
  #unified-new-bill .bill-final-actions .bill-cancel-danger-v59 {margin-top:7px;}
  .payment-simple .payment-total-banner {border-radius:15px;padding:18px 15px;}
  .payment-simple .payment-total-banner strong {font-size:clamp(22px,6vw,30px);}
  .payment-simple .payment-quick-buttons {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
  .payment-simple .payment-quick-buttons .btn {min-height:48px;border-radius:12px;}
  .payment-simple .payment-mode-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
  .payment-simple .payment-remaining {font-size:17px;font-weight:700;border-radius:12px;padding:12px;}
  .payment-simple .table-wrap {max-width:100%;overflow-x:auto;}
}
@media screen and (max-width:420px){
  #unified-new-bill .bill-create-item-grid {grid-template-columns:1fr 1fr;}
  #unified-new-bill .bill-cart-table tbody tr {padding:12px;gap:10px;}
  .payment-simple .payment-mode-grid {grid-template-columns:1fr;}
}
@media print{
  #unified-new-bill .bill-cart-table tbody tr {display:table-row!important;}
}

/* Prescription stock safety applies to desktop and mobile bill lines. */
#bill-new-cart tr.prescription-stock-shortage{background:#fff0f0!important;border:2px solid #c53030!important;color:#921e25!important}
#bill-new-cart .prescription-stock-message{display:block;color:#a51f2c;font-size:13px;font-weight:700;margin-top:7px}

/* Compact patient financial history nested under the demographic column. */
.patient-bill-mini{min-width:0}
.patient-bill-mini .section-header{display:block}
.patient-bill-mini .section-header h2{margin-bottom:4px}
.patient-bill-scroll{max-height:270px;overflow-y:auto;overscroll-behavior:contain;border:1px solid #e3e9ed;border-radius:10px}
.patient-bill-mini .line-item{padding:9px 10px;gap:7px;align-items:center}
.patient-bill-mini .line-item b{font-size:13px}
.patient-bill-mini .line-item small{font-size:11px}
.patient-bill-mini .line-item .btn{font-size:11px;padding:5px 8px}
@media(max-width:600px){.patient-bill-mini .line-item{flex-wrap:wrap}}

/* Zero-stock items are selectable; red indicates an insufficient-stock warning, not a disabled item. */
.bill-create-item-grid .pos-patient-option.shortage-allowed{color:#a82a2a;cursor:pointer;border-left:3px solid #d04b4b}
