/* Phone layer (< 768px) for the logged-in app and its dialogs: login, Tin nhắn (list, Thêm Mới / Chỉnh sửa dialogs),
   Danh bạ (list, customer dialog), Doanh thu, Doanh thu phân loại. Loaded after every other style sheet; layout and
   functions stay those of the desktop pages, only what a finger and iPhone Safari need changes:
   - every text field at 16px (iOS Safari zooms the page into a field whose text is smaller);
   - buttons, tabs, check boxes and row icons at least 40px high (the tap area; icons keep their size);
   - the Doanh thu date buttons wrap instead of hiding past the right edge;
   - dialog footers (Lưu / Kiểm tra / Đóng) stay at the bottom of the screen while a long dialog scrolls;
   - wide tables scroll inside their own box, never the page. */
@media (max-width: 767.98px) {
  body.has-shell input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
  body.has-shell select, body.has-shell textarea,
  .modal input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
  .modal select, .modal textarea, .select2-search__field,
  .auth-screen .form-control {
    font-size: 16px !important;
  }
  /* the red marks under a message in the Chỉnh sửa dialog follow its box's 16px text (they were drawn at 12px: v1.6.83) */
  .modal .hl-text { font-size: 16px; }
  /* v1.6.100: the entry card's box keeps the size picked under it (16px at least), the layer behind it the same */
  body.has-shell .msg-entry textarea.hl-input { font-size: max(16px, var(--msg-fs, 16px)) !important; }
  .select2-container .select2-selection--single { min-height: 40px; }
  .select2-container .select2-selection--single .select2-selection__rendered { font-size: 16px; line-height: 38px; }
  .select2-container .select2-selection--single .select2-selection__arrow { height: 38px; }
  .select2-results__option { min-height: 40px; padding-top: 10px; padding-bottom: 10px; }

  /* buttons and tabs */
  body.has-shell #view .btn, .modal .btn, .auth-screen .btn { min-height: 40px; }
  body.has-shell #view .btn.btnborder, body.has-shell #view .btn-icon-split { display: inline-flex; align-items: center; justify-content: center; }
  body.has-shell #view .nav-tabs .nav-link, body.has-shell #view .nav-link { min-height: 40px; }
  .modal .close { min-width: 40px; min-height: 40px; }
  /* full login screen */
  .auth-eye { width: 40px; height: 40px; }
  .auth-links a { min-height: 40px; }
  .auth-switch { min-height: 40px; }
  .rev-btn-group { flex-wrap: wrap; row-gap: 4px; }
  .rev-btns { overflow-x: visible; }

  /* check boxes / switches: an 11px band above and below the 18px label, 40px in all (the box moves with it; 8px gave
     34-35px, sua-96 check 15/10/2026) */
  body.has-shell #view .custom-control-label, .modal .custom-control-label { padding-top: 11px; padding-bottom: 11px; }
  body.has-shell #view .custom-control-label::before, body.has-shell #view .custom-control-label::after,
  .modal .custom-control-label::before, .modal .custom-control-label::after { margin-top: 11px; }
  .modal .form-check-input, .modal input[type="checkbox"]:not(.custom-control-input),
  .modal input[type="radio"]:not(.custom-control-input) { width: 20px; height: 20px; vertical-align: middle; }
  .modal .form-check-label, .modal .form-check { min-height: 40px; display: inline-flex; align-items: center; gap: 6px; }
  .modal .form-check { padding-left: 0; }
  .modal .form-check-input { position: static; margin: 0; flex: none; }

  /* row icons of Tin nhắn (Sửa, Xoá, Lịch sử) and Danh bạ (Sửa, Xóa, Nhân bản): 40px high, 32px wide side by side
     (the THAO TÁC column stays pinned on the right; wider would hide NỘI DUNG on a 360px phone) */
  .msg-ic, .contact-act { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 40px; }
  .msg-ic + .msg-ic, .contact-act + .contact-act { margin-left: 0; }
  .contact-price-input { min-height: 40px; }
  /* text links in table rows and the breadcrumb: a taller tap band, the line keeps its height */
  .msg-link, .rev-win, .breadcrumb-tts .breadcrumb-item a { display: inline-block; padding: 12px 0; margin: -12px 0; }
  body.has-shell .tts-brand { display: inline-flex; align-items: center; min-height: 40px; }

  /* dialogs: the buttons stay in reach while the body scrolls */
  .modal .modal-footer { position: sticky; bottom: 0; z-index: 2; background: var(--dialog-foot); box-shadow: 0 -1px 0 var(--td-line); }

  /* tables: horizontal scrolling inside the table box only */
  body.has-shell #view .table-responsive, body.has-shell #view .rev-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  body.has-shell #content-wrapper { overflow-x: clip; }
}
/* a phone turned sideways 768px wide or more (iPhone 844x390, Android 863x360: the tablet layout, a touch screen at most
   500px high; v1.6.96): the text fields at 16px too, or iOS Safari zooms into the box and the page moves while typing;
   the red marks under Tin sửa and the dialog's box follow their box's size */
@media (hover: none) and (max-height: 500px) and (min-width: 768px) {
  body.has-shell input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
  body.has-shell select, body.has-shell textarea,
  .modal input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
  .modal select, .modal textarea, .select2-search__field {
    font-size: 16px !important;
  }
  .modal .hl-text { font-size: 16px; }
  body.has-shell .msg-entry .hl-text { font-size: max(16px, var(--msg-fs, 16px)); }
  body.has-shell .msg-entry textarea.hl-input { font-size: max(16px, var(--msg-fs, 16px)) !important; }
}
