/* ClinicFlow v3.2.77 - Mobile responsive layer
   IMPORTANT: all layout changes are media-query scoped so desktop stays unchanged. */

@media (max-width: 900px) {
  html, body { max-width:100%; overflow-x:hidden !important; }
  #clinicflow-app, .cf-app, .cf-main, .cf-content { max-width:100%; min-width:0; }
  .cf-main { margin-left:0 !important; width:100% !important; }
  .cf-content { padding:14px !important; }

  /* Off-canvas sidebar */
  .cf-sidebar {
    width:min(300px,88vw) !important;
    max-width:88vw !important;
    transform:translateX(-105%) !important;
    transition:transform .22s ease !important;
    z-index:1502 !important;
    box-shadow:none;
  }
  .cf-sidebar.open { transform:translateX(0) !important; box-shadow:8px 0 28px rgba(0,0,0,.28); }
  body.cf-mobile-menu-open::after {
    content:""; position:fixed; inset:0; background:rgba(14,28,38,.42); z-index:1501;
  }
  .cf-menu { display:inline-flex !important; align-items:center; justify-content:center; width:40px; height:40px; flex:0 0 40px; }
  .cf-close { display:block !important; }
  .cf-sidebar nav { overflow-y:auto; overscroll-behavior:contain; }

  /* Top area and filters */
  .cf-topbar { min-height:58px !important; padding:9px 12px !important; gap:10px; align-items:flex-start !important; flex-wrap:wrap !important; }
  #cf-top-actions, .cf-top-actions { width:calc(100% - 50px) !important; flex:1 1 calc(100% - 50px) !important; min-width:0 !important; gap:8px !important; flex-wrap:wrap !important; }
  .cf-filter-shell, .ph-filter-shell, .cf-filter-stack, .cf-filter-row { width:100% !important; min-width:0 !important; }
  .cf-filter-singleline { flex-wrap:wrap !important; gap:8px !important; }
  .cf-list-search, .ph-top-search { flex:1 1 100% !important; width:100% !important; min-width:0 !important; max-width:none !important; }
  .cf-filter-extra { width:100% !important; min-width:0 !important; flex-wrap:wrap !important; gap:8px !important; }
  .cf-filter-singleline .cf-list-filter,
  .cf-filter-singleline .ph-top-filter,
  .cf-filter-singleline .cf-filter-date,
  body.cf-pharmacy-page #cf-top-actions .ph-top-filter { flex:1 1 180px !important; min-width:140px !important; max-width:100% !important; }
  .cf-filter-date { min-width:0 !important; }
  .cf-filter-date input { min-width:0 !important; width:100% !important; }
  .cf-add-wrap { margin-left:0 !important; width:100% !important; display:flex !important; justify-content:flex-end !important; }
  .cf-add-wrap .cf-btn { min-height:40px; }

  /* Panels/tables never force body wider */
  .cf-panel, .cf-table-wrap, .cf-view-items, .ph-detail-panel, .ph-detail-scroll { max-width:100% !important; min-width:0 !important; box-sizing:border-box; }
  .cf-table-wrap, .ph-detail-scroll { overflow-x:auto !important; -webkit-overflow-scrolling:touch; }
  .cf-panel { padding:12px !important; }

  /* Modal shell */
  .cf-modal { padding:7px !important; align-items:flex-start !important; overflow:hidden !important; }
  .cf-modal-card,
  .cf-form-modal .cf-modal-card,
  .cf-record-view-modal .cf-modal-card,
  body.cf-pharmacy-page .ph-form-modal .cf-modal-card {
    width:calc(100vw - 14px) !important;
    max-width:none !important;
    max-height:calc(100dvh - 14px) !important;
    margin:0 !important;
    display:flex !important;
    flex-direction:column !important;
    overflow:hidden !important;
    border-radius:6px !important;
  }
  .cf-modal-head { position:sticky; top:0; z-index:8; flex:0 0 auto; padding:13px 14px !important; background:#fff; }
  #cf-form { min-height:0; overflow-y:auto !important; overflow-x:hidden !important; }
  .cf-form-actions, .ph-form-footer { position:sticky !important; bottom:0 !important; z-index:8 !important; background:#fff !important; border-top:1px solid #d6e0e5; }

  /* Forms */
  .cf-grid, .cf-two, .cf-form-grid, body.cf-pharmacy-page .ph-form-grid { grid-template-columns:1fr !important; min-width:0 !important; }
  .cf-field, .cf-field.full, .ph-form-group, .ph-form-group.full { grid-column:auto !important; min-width:0 !important; }
  .cf-field input, .cf-field select, .cf-field textarea,
  .ph-form-group input, .ph-form-group select, .ph-form-group textarea { max-width:100% !important; min-width:0 !important; }

  /* Quotation/service item rows: mobile-safe stacking; desktop untouched */
  .cf-form-modal-quotations .cf-items-head { display:none !important; }
  .cf-form-modal-quotations .cf-items-list,
  .cf-form-modal-quotations .cf-line-items { overflow:visible !important; }
  .cf-form-modal-quotations .cf-item-row {
    display:grid !important;
    grid-template-columns:1fr 1fr !important;
    min-width:0 !important;
    width:100% !important;
    gap:9px !important;
    padding:11px !important;
    border:1px solid #ccd7dc !important;
    border-radius:5px !important;
    background:#f8fafb !important;
  }
  .cf-form-modal-quotations .cf-item-row > * { min-width:0 !important; max-width:100% !important; }
  .cf-form-modal-quotations .cf-item-row > :first-child { grid-column:1/-1 !important; }

  /* Pharmacy forms */
  body.cf-pharmacy-page .ph-form-purchases .cf-modal-card,
  body.cf-pharmacy-page .ph-form-issues .cf-modal-card,
  body.cf-pharmacy-page .ph-form-returns .cf-modal-card,
  body.cf-pharmacy-page .ph-form-stock-adjustments .cf-modal-card { width:calc(100vw - 14px) !important; max-width:none !important; }
  body.cf-pharmacy-page .ph-items-field { max-width:100% !important; overflow:visible !important; padding:10px !important; }
  body.cf-pharmacy-page #ph-items { overflow:visible !important; max-width:100% !important; min-width:0 !important; }
  body.cf-pharmacy-page #ph-items > .ph-line,
  body.cf-pharmacy-page .ph-form-purchases #ph-items > .ph-line,
  body.cf-pharmacy-page .ph-form-issues #ph-items > .ph-line,
  body.cf-pharmacy-page .ph-form-returns #ph-items > .ph-line,
  body.cf-pharmacy-page .ph-form-stock-adjustments #ph-items > .ph-line {
    min-width:0 !important; width:100% !important; max-width:100% !important;
    grid-template-columns:1fr 1fr !important; gap:9px !important; padding:10px !important;
  }
  body.cf-pharmacy-page .ph-line-field { min-width:0 !important; }
  body.cf-pharmacy-page .ph-line-field:first-child { grid-column:1/-1 !important; }
  body.cf-pharmacy-page .ph-item-select-inline, body.cf-pharmacy-page .ph-lookup-inline { min-width:0 !important; width:100% !important; }
  body.cf-pharmacy-page .ph-remove { grid-column:1/-1 !important; width:100% !important; min-width:0 !important; }
  body.cf-pharmacy-page .ph-remove::after { content:"Remove"; font-size:12px; font-weight:700; margin-left:4px; }
  body.cf-pharmacy-page .ph-quick-card { width:calc(100vw - 18px) !important; max-width:560px !important; }
  body.cf-pharmacy-page .ph-quick-body { grid-template-columns:1fr !important; }
  body.cf-pharmacy-page .ph-quick-body > label:first-child { grid-column:auto !important; }

  /* Pagination */
  .cf-pagination { display:flex !important; flex-wrap:wrap !important; gap:10px !important; align-items:center !important; }
  .cf-page-info { flex:1 1 100% !important; width:100% !important; }
  .cf-page-controls { flex:1 1 100% !important; width:100% !important; display:flex !important; align-items:center !important; gap:6px !important; flex-wrap:wrap !important; justify-content:flex-start !important; }
  .cf-page-size-label { margin-right:auto !important; }
  .cf-page-btn { min-width:36px !important; height:36px !important; padding:0 8px !important; }

  /* Action controls */
  .cf-row-actions { min-width:0 !important; gap:5px !important; flex-wrap:nowrap !important; }
  .cf-row-actions .cf-btn.small, .cf-icon-action { width:34px !important; min-width:34px !important; height:34px !important; padding:0 6px !important; display:inline-flex !important; align-items:center !important; justify-content:center !important; }
}

@media (max-width: 700px) {
  .cf-content { padding:10px !important; }
  .cf-topbar { padding:8px 10px !important; }
  #cf-top-actions, .cf-top-actions { width:100% !important; flex-basis:100% !important; }
  .cf-menu { position:absolute; left:8px; top:8px; z-index:3; }
  .cf-topbar { padding-left:58px !important; }
  .cf-add-wrap { justify-content:stretch !important; }
  .cf-add-wrap .cf-btn { width:100% !important; }

  /* Dashboard cards */
  .cf-cards { grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:8px !important; }
  .cf-card { min-width:0 !important; padding:10px !important; }
  .cf-card b, .cf-card strong { overflow-wrap:anywhere; }

  /* Generic list tables become labelled mobile rows. JS supplies data-label safely. */
  .cf-table.cf-mobile-card-table { display:block !important; width:100% !important; min-width:0 !important; border:0 !important; }
  .cf-table.cf-mobile-card-table thead { display:none !important; }
  .cf-table.cf-mobile-card-table tbody { display:block !important; width:100% !important; }
  .cf-table.cf-mobile-card-table tbody > tr:not(.ph-detail-row) {
    display:block !important; width:100% !important; min-width:0 !important;
    border:1px solid #cbd6dc !important; margin:0 0 10px !important; background:#fff !important;
  }
  .cf-table.cf-mobile-card-table tbody > tr:not(.ph-detail-row) > td {
    display:grid !important; grid-template-columns:minmax(104px,36%) minmax(0,1fr) !important;
    align-items:start !important; gap:8px !important; width:100% !important; min-width:0 !important;
    min-height:38px !important; padding:9px 10px !important; border:0 !important; border-bottom:1px solid #e1e7ea !important;
    position:relative !important; overflow-wrap:anywhere !important;
  }
  .cf-table.cf-mobile-card-table tbody > tr:not(.ph-detail-row) > td:last-child { border-bottom:0 !important; }
  .cf-table.cf-mobile-card-table tbody > tr:not(.ph-detail-row) > td::before {
    content:attr(data-label) !important; position:static !important; width:auto !important;
    font-weight:700 !important; color:#40535e !important; font-size:11px !important;
  }
  .cf-table.cf-mobile-card-table tbody > tr:not(.ph-detail-row) > td.cf-empty { display:block !important; padding:14px !important; }
  .cf-table.cf-mobile-card-table tbody > tr:not(.ph-detail-row) > td.cf-empty::before { content:none !important; }
  .cf-table.cf-mobile-card-table .cf-row-actions, .cf-table.cf-mobile-card-table .ph-actions { justify-content:flex-start !important; white-space:normal !important; }

  /* Pharmacy expanded detail row under a mobile card */
  .cf-table.cf-mobile-card-table .ph-detail-row { display:block !important; width:100% !important; margin:-10px 0 10px !important; }
  .cf-table.cf-mobile-card-table .ph-detail-row > td { display:block !important; width:100% !important; padding:8px !important; border:1px solid #b9d7d4 !important; border-top:0 !important; background:#f5fbfa !important; }
  .cf-table.cf-mobile-card-table .ph-detail-row > td::before { content:none !important; }

  /* Expanded item-detail tables also become labelled rows */
  .ph-detail-table.cf-mobile-card-table { display:block !important; width:100% !important; min-width:0 !important; }
  .ph-detail-table.cf-mobile-card-table thead { display:none !important; }
  .ph-detail-table.cf-mobile-card-table tbody, .ph-detail-table.cf-mobile-card-table tr { display:block !important; width:100% !important; }
  .ph-detail-table.cf-mobile-card-table tr { border:1px solid #d5e0e4 !important; background:#fff !important; margin-bottom:8px !important; }
  .ph-detail-table.cf-mobile-card-table td { display:grid !important; grid-template-columns:42% 58% !important; gap:8px; padding:7px 9px !important; border:0 !important; border-bottom:1px solid #e5ebee !important; overflow-wrap:anywhere; }
  .ph-detail-table.cf-mobile-card-table td::before { content:attr(data-label); font-weight:700; color:#40535e; font-size:11px; }

  /* Forms and footer buttons */
  .cf-form-actions, body.cf-pharmacy-page .ph-form-footer { display:flex !important; gap:8px !important; padding:10px !important; }
  .cf-form-actions > button, body.cf-pharmacy-page .ph-form-footer > button { flex:1 1 0 !important; min-width:0 !important; }
  textarea { max-width:100% !important; }

  /* Pharmacy receipt dropdowns */
  body.cf-pharmacy-page .ph-form-pharmacy-receipts .ph-form-grid { grid-template-columns:1fr !important; }
  .ph-form-pharmacy-receipts select, .ph-form-pharmacy-receipts option { max-width:100% !important; white-space:normal !important; overflow-wrap:anywhere !important; }

  /* Narrower title/panel spacing */
  .cf-list-title-bar h1, .cf-page-heading h1 { font-size:21px !important; }
  .cf-panel { padding:9px !important; }
}

@media (max-width: 420px) {
  .cf-content { padding:8px !important; }
  .cf-cards { grid-template-columns:1fr 1fr !important; }
  .cf-card { padding:8px !important; min-height:76px !important; }
  .cf-card span { font-size:9px !important; }
  .cf-card b, .cf-card strong { font-size:17px !important; }
  .cf-filter-singleline .cf-list-filter,
  .cf-filter-singleline .ph-top-filter,
  .cf-filter-singleline .cf-filter-date { flex:1 1 100% !important; min-width:0 !important; }
  .cf-page-controls .cf-page-btn[data-page="first"],
  .cf-page-controls .cf-page-btn[data-page="last"] { display:none !important; }
  body.cf-pharmacy-page #ph-items > .ph-line,
  body.cf-pharmacy-page .ph-form-purchases #ph-items > .ph-line,
  body.cf-pharmacy-page .ph-form-issues #ph-items > .ph-line,
  body.cf-pharmacy-page .ph-form-returns #ph-items > .ph-line,
  body.cf-pharmacy-page .ph-form-stock-adjustments #ph-items > .ph-line,
  .cf-form-modal-quotations .cf-item-row { grid-template-columns:1fr !important; }
  body.cf-pharmacy-page .ph-line-field:first-child { grid-column:auto !important; }
}

/* ClinicFlow v3.2.96 - Dashboard mobile-only refinement. Desktop remains unchanged. */
@media (max-width: 700px) {
  /* Dashboard panels */
  .cf-pending-tasks-panel,
  .cf-content > .cf-panel {
    max-width:100% !important;
    overflow:hidden !important;
  }

  .cf-pending-tasks-panel .cf-panel-head,
  .cf-content > .cf-panel .cf-panel-head {
    display:flex !important;
    align-items:center !important;
    gap:8px !important;
    flex-wrap:wrap !important;
    padding:4px 0 10px !important;
  }

  .cf-pending-tasks-panel .cf-panel-head h2,
  .cf-content > .cf-panel .cf-panel-head h2 {
    margin:0 !important;
    font-size:20px !important;
    line-height:1.2 !important;
  }

  /* Pending Tasks: one clean card per task, no squeezed desktop table. */
  .cf-pending-tasks-panel .cf-table-wrap {
    overflow:visible !important;
    margin:0 !important;
  }
  .cf-pending-tasks-table.cf-mobile-card-table,
  .cf-pending-tasks-table.cf-mobile-card-table tbody {
    display:block !important;
    width:100% !important;
  }
  .cf-pending-tasks-table.cf-mobile-card-table thead { display:none !important; }
  .cf-pending-tasks-table.cf-mobile-card-table tbody > tr {
    display:grid !important;
    grid-template-columns:minmax(0,1fr) 82px !important;
    gap:0 !important;
    width:100% !important;
    margin:0 0 10px !important;
    padding:0 !important;
    border:1px solid #ccd9dd !important;
    border-radius:7px !important;
    overflow:hidden !important;
    background:#fff !important;
    box-shadow:0 1px 2px rgba(0,0,0,.03) !important;
  }
  .cf-pending-tasks-table.cf-mobile-card-table tbody > tr > td {
    display:block !important;
    width:auto !important;
    min-width:0 !important;
    padding:10px 12px !important;
    border:0 !important;
    line-height:1.3 !important;
    overflow-wrap:anywhere !important;
  }
  .cf-pending-tasks-table.cf-mobile-card-table tbody > tr > td::before {
    display:block !important;
    width:auto !important;
    margin:0 0 4px !important;
    font-size:10px !important;
    line-height:1.1 !important;
    font-weight:700 !important;
    color:#6d7f87 !important;
    text-transform:uppercase !important;
    letter-spacing:.03em !important;
  }
  .cf-pending-tasks-table.cf-mobile-card-table tbody > tr > td:nth-child(1) {
    grid-column:1 / -1 !important;
    font-size:14px !important;
    font-weight:600 !important;
    color:#162a3a !important;
    border-bottom:1px solid #e4ebee !important;
  }
  .cf-pending-tasks-table.cf-mobile-card-table tbody > tr > td:nth-child(2) {
    grid-column:1 !important;
    font-size:18px !important;
    font-weight:700 !important;
    color:#10283a !important;
    display:flex !important;
    flex-direction:column !important;
    justify-content:center !important;
  }
  .cf-pending-tasks-table.cf-mobile-card-table tbody > tr > td:nth-child(3) {
    grid-column:2 !important;
    display:flex !important;
    align-items:center !important;
    justify-content:flex-end !important;
    padding:8px !important;
  }
  .cf-pending-tasks-table.cf-mobile-card-table tbody > tr > td:nth-child(3)::before { display:none !important; }
  .cf-pending-tasks-table .cf-dashboard-task-action {
    width:100% !important;
    min-width:0 !important;
    height:38px !important;
    padding:0 10px !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    white-space:nowrap !important;
    font-size:12px !important;
    border-radius:5px !important;
  }

  /* Upcoming Appointments: compact header + readable appointment cards. */
  .cf-upcoming-note {
    order:3 !important;
    flex:1 1 100% !important;
    font-size:11px !important;
    line-height:1.3 !important;
    color:#6c7d85 !important;
  }
  .cf-dashboard-go {
    margin-left:auto !important;
    min-width:0 !important;
    width:auto !important;
    max-width:145px !important;
    padding:7px 10px !important;
    font-size:11px !important;
    line-height:1.2 !important;
  }
  .cf-upcoming-appointments.cf-mobile-card-table tbody > tr {
    border-radius:7px !important;
    overflow:hidden !important;
  }
  .cf-upcoming-appointments.cf-mobile-card-table tbody > tr > td {
    grid-template-columns:minmax(86px,32%) minmax(0,1fr) !important;
    padding:8px 10px !important;
  }
  .cf-upcoming-appointments .cf-upcoming-service,
  .cf-upcoming-appointments .cf-upcoming-time {
    display:block !important;
    margin-top:2px !important;
    font-size:10px !important;
    color:#65767e !important;
  }

  /* Export buttons on mobile: compact and contained inside panel. */
  .cf-panel .cf-export-actions,
  .cf-panel .cf-table-export-actions,
  .cf-panel .cf-export-buttons {
    display:flex !important;
    gap:7px !important;
    flex-wrap:wrap !important;
    width:100% !important;
  }
  .cf-panel .cf-export-actions .cf-btn,
  .cf-panel .cf-table-export-actions .cf-btn,
  .cf-panel .cf-export-buttons .cf-btn {
    flex:1 1 calc(50% - 4px) !important;
    min-width:0 !important;
    padding:8px 9px !important;
    font-size:11px !important;
    white-space:nowrap !important;
  }
}


/* ClinicFlow v3.2.97 - Mobile parity mode.
   Goal: retain the same tables, columns, actions and controls as desktop.
   Mobile only gets smooth scrolling and compact spacing; nothing is removed. */
@media (max-width: 700px) {
  html, body { max-width:100%; overflow-x:hidden; }
  .cf-content { overflow:visible !important; }
  .cf-panel,
  .cf-pending-tasks-panel,
  .cf-content > .cf-panel { overflow:visible !important; max-width:100% !important; }

  /* Keep desktop table structure intact on mobile. */
  .cf-table-wrap,
  .ph-table-wrap,
  .cf-panel .cf-table-wrap,
  body.cf-pharmacy-page .cf-table-wrap,
  body.cf-pharmacy-page .ph-table-wrap {
    display:block !important;
    width:100% !important;
    max-width:100% !important;
    overflow-x:auto !important;
    overflow-y:hidden !important;
    -webkit-overflow-scrolling:touch !important;
    overscroll-behavior-x:contain !important;
    scrollbar-width:thin !important;
    touch-action:pan-x pan-y !important;
  }

  .cf-table.cf-mobile-card-table,
  .cf-table,
  .ph-detail-table.cf-mobile-card-table,
  .ph-detail-table,
  .cf-pending-tasks-table.cf-mobile-card-table,
  .cf-upcoming-appointments.cf-mobile-card-table {
    display:table !important;
    width:max-content !important;
    min-width:100% !important;
    table-layout:auto !important;
    border-collapse:collapse !important;
  }
  .cf-table.cf-mobile-card-table thead,
  .cf-table thead,
  .ph-detail-table.cf-mobile-card-table thead,
  .ph-detail-table thead,
  .cf-pending-tasks-table.cf-mobile-card-table thead,
  .cf-upcoming-appointments.cf-mobile-card-table thead {
    display:table-header-group !important;
  }
  .cf-table.cf-mobile-card-table tbody,
  .cf-table tbody,
  .ph-detail-table.cf-mobile-card-table tbody,
  .ph-detail-table tbody,
  .cf-pending-tasks-table.cf-mobile-card-table tbody,
  .cf-upcoming-appointments.cf-mobile-card-table tbody {
    display:table-row-group !important;
  }
  .cf-table.cf-mobile-card-table tr,
  .cf-table tr,
  .ph-detail-table.cf-mobile-card-table tr,
  .ph-detail-table tr,
  .cf-pending-tasks-table.cf-mobile-card-table tbody > tr,
  .cf-upcoming-appointments.cf-mobile-card-table tbody > tr,
  .cf-table.cf-mobile-card-table tbody > tr:not(.ph-detail-row) {
    display:table-row !important;
    width:auto !important;
    margin:0 !important;
    padding:0 !important;
    border-radius:0 !important;
    box-shadow:none !important;
    overflow:visible !important;
    background:inherit !important;
  }
  .cf-table.cf-mobile-card-table th,
  .cf-table.cf-mobile-card-table td,
  .cf-table th,
  .cf-table td,
  .ph-detail-table.cf-mobile-card-table th,
  .ph-detail-table.cf-mobile-card-table td,
  .ph-detail-table th,
  .ph-detail-table td,
  .cf-pending-tasks-table.cf-mobile-card-table tbody > tr > td,
  .cf-upcoming-appointments.cf-mobile-card-table tbody > tr > td,
  .cf-table.cf-mobile-card-table tbody > tr:not(.ph-detail-row) > td {
    display:table-cell !important;
    width:auto !important;
    min-width:110px !important;
    max-width:none !important;
    padding:9px 10px !important;
    border:1px solid #cbd6dc !important;
    vertical-align:middle !important;
    white-space:normal !important;
    overflow-wrap:break-word !important;
    position:static !important;
  }
  .cf-table.cf-mobile-card-table td::before,
  .ph-detail-table.cf-mobile-card-table td::before,
  .cf-pending-tasks-table.cf-mobile-card-table td::before,
  .cf-upcoming-appointments.cf-mobile-card-table td::before,
  .cf-table.cf-mobile-card-table tbody > tr:not(.ph-detail-row) > td::before {
    content:none !important;
    display:none !important;
  }

  /* Keep action controls exactly as a table column, but compact enough for touch. */
  .cf-row-actions,
  .ph-actions,
  .cf-table .cf-row-actions,
  .cf-table .ph-actions {
    display:flex !important;
    flex-wrap:nowrap !important;
    gap:7px !important;
    align-items:center !important;
    justify-content:flex-start !important;
    white-space:nowrap !important;
  }
  .cf-row-actions .cf-btn.small,
  .cf-icon-action { flex:0 0 auto !important; }

  /* Pending tasks stays a real 3-column table like desktop. */
  .cf-pending-tasks-table th:nth-child(1), .cf-pending-tasks-table td:nth-child(1) { min-width:235px !important; }
  .cf-pending-tasks-table th:nth-child(2), .cf-pending-tasks-table td:nth-child(2) { min-width:80px !important; text-align:center !important; }
  .cf-pending-tasks-table th:nth-child(3), .cf-pending-tasks-table td:nth-child(3) { min-width:115px !important; }
  .cf-pending-tasks-table .cf-dashboard-task-action {
    width:auto !important; min-width:82px !important; height:auto !important;
    padding:7px 12px !important; font-size:12px !important;
  }

  /* Upcoming appointments remains a desktop-style table; all fields stay present. */
  .cf-upcoming-appointments th,
  .cf-upcoming-appointments td { min-width:120px !important; }
  .cf-upcoming-appointments th:first-child,
  .cf-upcoming-appointments td:first-child { min-width:145px !important; }
  .cf-upcoming-note { order:initial !important; flex:0 1 auto !important; }
  .cf-dashboard-go { margin-left:auto !important; max-width:none !important; }

  /* Export controls remain visible, same functions, just compact. */
  .cf-panel .cf-export-actions,
  .cf-panel .cf-table-export-actions,
  .cf-panel .cf-export-buttons {
    display:flex !important;
    flex-wrap:nowrap !important;
    gap:8px !important;
    width:auto !important;
    overflow-x:auto !important;
    -webkit-overflow-scrolling:touch !important;
  }
  .cf-panel .cf-export-actions .cf-btn,
  .cf-panel .cf-table-export-actions .cf-btn,
  .cf-panel .cf-export-buttons .cf-btn {
    flex:0 0 auto !important;
    min-width:auto !important;
    width:auto !important;
    padding:8px 12px !important;
    font-size:12px !important;
  }

  /* Preserve every pagination control; allow horizontal scroll instead of hiding buttons. */
  .cf-pagination { flex-wrap:nowrap !important; overflow-x:auto !important; -webkit-overflow-scrolling:touch !important; }
  .cf-page-info { flex:0 0 auto !important; width:auto !important; }
  .cf-page-controls { flex:0 0 auto !important; width:auto !important; flex-wrap:nowrap !important; }
  .cf-page-controls .cf-page-btn[data-page="first"],
  .cf-page-controls .cf-page-btn[data-page="last"] { display:inline-flex !important; }

  /* Filters/forms retain every field; wrap cleanly rather than hiding or collapsing fields. */
  .cf-filter-singleline,
  #cf-top-actions,
  .cf-top-actions {
    display:flex !important;
    flex-wrap:wrap !important;
    align-items:center !important;
    gap:8px !important;
  }
  .cf-filter-singleline .cf-list-filter,
  .cf-filter-singleline .ph-top-filter,
  .cf-filter-singleline .cf-filter-date { flex:1 1 145px !important; min-width:125px !important; }

  /* Smooth horizontal drag feel for all wide content. */
  .cf-table-wrap *, .ph-table-wrap * { -webkit-tap-highlight-color:transparent; }
}

@media (max-width: 420px) {
  /* Do not eliminate any desktop control at very narrow widths. */
  .cf-page-controls .cf-page-btn[data-page="first"],
  .cf-page-controls .cf-page-btn[data-page="last"] { display:inline-flex !important; }
  .cf-table-wrap, .ph-table-wrap { padding-bottom:4px !important; }
}

/* ClinicFlow v3.2.98 - compact mobile filter drawer. Desktop untouched. */
.cf-filter-toggle-label{display:none}
@media (max-width:700px){
  /* Keep Search and Filter on one clean row. */
  #cf-top-actions .cf-filter-primary,
  .cf-top-actions .cf-filter-primary,
  #cf-top-actions .cf-filter-singleline,
  .cf-top-actions .cf-filter-singleline{
    display:flex!important;
    flex-wrap:wrap!important;
    align-items:center!important;
    gap:8px!important;
    width:100%!important;
  }
  #cf-top-actions .cf-list-search,
  .cf-top-actions .cf-list-search{
    flex:1 1 0!important;
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
    height:42px!important;
  }
  #cf-top-actions .cf-filter-toggle,
  .cf-top-actions .cf-filter-toggle{
    display:inline-flex!important;
    flex:0 0 auto!important;
    width:auto!important;
    min-width:92px!important;
    height:42px!important;
    padding:0 13px!important;
    align-items:center!important;
    justify-content:center!important;
    gap:7px!important;
    margin:0!important;
    border:1px solid var(--cf-primary)!important;
    background:#fff!important;
    color:#173042!important;
    border-radius:3px!important;
  }
  #cf-top-actions .cf-filter-toggle:hover,
  .cf-top-actions .cf-filter-toggle:hover,
  #cf-top-actions .cf-filter-shell.open .cf-filter-toggle,
  .cf-top-actions .cf-filter-shell.open .cf-filter-toggle{
    background:var(--cf-primary)!important;
    color:#fff!important;
  }
  .cf-filter-toggle-label{
    display:inline!important;
    font-size:13px!important;
    font-weight:700!important;
    line-height:1!important;
  }
  .cf-filter-toggle-icon{width:16px!important;height:16px!important}
  .cf-filter-toggle-icon svg{width:16px!important;height:16px!important}
  #cf-top-actions .cf-filter-extra,
  .cf-top-actions .cf-filter-extra{
    flex:1 0 100%!important;
    width:100%!important;
    margin-top:2px!important;
    padding:10px!important;
    border:1px solid #d8e1e5!important;
    background:#fff!important;
    box-shadow:0 6px 18px rgba(18,42,55,.08)!important;
    border-radius:4px!important;
    gap:8px!important;
  }
  #cf-top-actions .cf-filter-shell:not(.open) .cf-filter-extra,
  .cf-top-actions .cf-filter-shell:not(.open) .cf-filter-extra{
    display:none!important;
  }
  #cf-top-actions .cf-filter-shell.open .cf-filter-extra,
  .cf-top-actions .cf-filter-shell.open .cf-filter-extra{
    display:grid!important;
    grid-template-columns:1fr!important;
  }
  #cf-top-actions .cf-filter-extra .cf-list-filter,
  #cf-top-actions .cf-filter-extra .cf-filter-date,
  #cf-top-actions .cf-filter-extra .cf-secondary,
  .cf-top-actions .cf-filter-extra .cf-list-filter,
  .cf-top-actions .cf-filter-extra .cf-filter-date,
  .cf-top-actions .cf-filter-extra .cf-secondary{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    margin:0!important;
  }
  #cf-top-actions .cf-filter-extra .cf-filter-date,
  .cf-top-actions .cf-filter-extra .cf-filter-date{
    display:grid!important;
    grid-template-columns:92px minmax(0,1fr)!important;
    align-items:center!important;
    gap:8px!important;
  }
  #cf-top-actions .cf-filter-extra .cf-filter-date input,
  .cf-top-actions .cf-filter-extra .cf-filter-date input{
    width:100%!important;
    min-width:0!important;
  }
}


/* ClinicFlow v3.3.08 - Mobile only: Upcoming Appointments already implies Scheduled, so hide Status. */
@media (max-width: 700px) {
  .cf-upcoming-appointments thead th:last-child,
  .cf-upcoming-appointments tbody td[data-label="Status"] {
    display: none !important;
  }
}

/* ClinicFlow v3.3.09 - Mobile only: hide the redundant View all scheduled button in Upcoming Appointments. */
@media (max-width: 700px) {
  .cf-panel-head .cf-dashboard-go[data-go="scheduled-appointments"] {
    display: none !important;
  }
}


/* ClinicFlow v3.3.10 - Mobile only: move Upcoming Appointments export controls into the top-right header area. */
@media (max-width: 700px) {
  .cf-upcoming-panel {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    column-gap: 8px !important;
    align-items: start !important;
  }

  .cf-upcoming-panel > .cf-panel-head {
    grid-column: 1 !important;
    min-width: 0 !important;
    margin-bottom: 10px !important;
    display: block !important;
  }

  .cf-upcoming-panel > .cf-panel-head h2 {
    margin: 0 0 5px !important;
  }

  .cf-upcoming-panel > .cf-panel-head .cf-upcoming-note {
    display: block !important;
    margin: 0 !important;
  }

  .cf-upcoming-panel > .cf-table-export-bar {
    grid-column: 2 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 5px !important;
    width: auto !important;
    margin: 0 0 10px !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .cf-upcoming-panel > .cf-table-export-bar .cf-btn {
    flex: 0 0 auto !important;
    min-width: 0 !important;
    width: auto !important;
    min-height: 30px !important;
    padding: 6px 9px !important;
    font-size: 0 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  .cf-upcoming-panel > .cf-table-export-bar .cf-universal-export-pdf::after {
    content: "PDF";
    font-size: 11px !important;
  }

  .cf-upcoming-panel > .cf-table-export-bar .cf-universal-export-excel::after {
    content: "Excel";
    font-size: 11px !important;
  }

  .cf-upcoming-panel > .cf-table-wrap,
  .cf-upcoming-panel > .cf-empty {
    grid-column: 1 / -1 !important;
  }
}

/* ClinicFlow v3.3.16 - Mobile only: compact icon-only PDF/Excel export controls across ClinicFlow. */
@media (max-width: 700px) {
  .cf-table-export-bar .cf-export-pdf,
  .cf-table-export-bar .cf-universal-export-pdf,
  .cf-table-export-bar .ph-export-pdf,
  .cf-table-export-bar .cf-export-excel,
  .cf-table-export-bar .cf-universal-export-excel,
  .cf-table-export-bar .ph-export-excel {
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 38px !important;
    font-size: 0 !important;
    line-height: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
  }

  .cf-table-export-bar .cf-export-pdf::before,
  .cf-table-export-bar .cf-universal-export-pdf::before,
  .cf-table-export-bar .ph-export-pdf::before,
  .cf-table-export-bar .cf-export-excel::before,
  .cf-table-export-bar .cf-universal-export-excel::before,
  .cf-table-export-bar .ph-export-excel::before {
    content: "" !important;
    display: block !important;
    width: 20px !important;
    height: 20px !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-size: 20px 20px !important;
    flex: 0 0 20px !important;
  }

  .cf-table-export-bar .cf-export-pdf::before,
  .cf-table-export-bar .cf-universal-export-pdf::before,
  .cf-table-export-bar .ph-export-pdf::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2.75h8l4 4V21.25H6z'/%3E%3Cpath d='M14 2.75v4h4'/%3E%3Cpath d='M8.2 16.7v-5.4h2a1.7 1.7 0 0 1 0 3.4h-2M13 16.7v-5.4h1.4a2.7 2.7 0 0 1 0 5.4H13M18.2 16.7v-5.4h2.7M18.2 14h2.1'/%3E%3C/svg%3E") !important;
  }

  .cf-table-export-bar .cf-export-excel::before,
  .cf-table-export-bar .cf-universal-export-excel::before,
  .cf-table-export-bar .ph-export-excel::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='1.5'/%3E%3Cpath d='M9 3v18M3 9h18M3 15h18'/%3E%3Cpath d='m12.5 11 4 4m0-4-4 4'/%3E%3C/svg%3E") !important;
  }

  /* Remove older mobile text labels such as “PDF” and “Excel”. */
  .cf-table-export-bar .cf-export-pdf::after,
  .cf-table-export-bar .cf-universal-export-pdf::after,
  .cf-table-export-bar .ph-export-pdf::after,
  .cf-table-export-bar .cf-export-excel::after,
  .cf-table-export-bar .cf-universal-export-excel::after,
  .cf-table-export-bar .ph-export-excel::after {
    content: none !important;
    display: none !important;
  }

  .cf-table-export-bar {
    gap: 8px !important;
  }
}

/* ClinicFlow v3.3.17 - Mobile export controls: clearer icons and heading alignment. */
@media (max-width: 700px) {
  /* Dashboard/table panels with their own heading: keep exports beside heading, at top-right. */
  .cf-panel.cf-pending-tasks-panel {
    position: relative !important;
  }
  .cf-panel.cf-pending-tasks-panel > .cf-panel-head {
    min-height: 40px !important;
    padding-right: 92px !important;
    margin-bottom: 15px !important;
  }
  .cf-panel.cf-pending-tasks-panel > .cf-table-export-bar {
    position: absolute !important;
    top: 18px !important;
    right: 18px !important;
    left: auto !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 8px !important;
    z-index: 2 !important;
  }

  /* Fixed compact button box so neither icon can protrude outside it. */
  .cf-table-export-bar .cf-export-pdf,
  .cf-table-export-bar .cf-universal-export-pdf,
  .cf-table-export-bar .ph-export-pdf,
  .cf-table-export-bar .cf-export-excel,
  .cf-table-export-bar .cf-universal-export-excel,
  .cf-table-export-bar .ph-export-excel {
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    padding: 0 !important;
    overflow: hidden !important;
    position: relative !important;
    line-height: 1 !important;
  }

  /* Clear PDF document icon, fully contained in the teal button. */
  .cf-table-export-bar .cf-export-pdf::before,
  .cf-table-export-bar .cf-universal-export-pdf::before,
  .cf-table-export-bar .ph-export-pdf::before {
    content: "PDF" !important;
    box-sizing: border-box !important;
    width: 22px !important;
    height: 25px !important;
    border: 2px solid #fff !important;
    border-radius: 2px !important;
    background: transparent !important;
    color: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: Arial, sans-serif !important;
    font-size: 7px !important;
    line-height: 1 !important;
    font-weight: 800 !important;
    letter-spacing: -.2px !important;
    flex: 0 0 22px !important;
  }

  /* Clear spreadsheet/grid icon, fully contained in the teal button. */
  .cf-table-export-bar .cf-export-excel::before,
  .cf-table-export-bar .cf-universal-export-excel::before,
  .cf-table-export-bar .ph-export-excel::before {
    content: "" !important;
    box-sizing: border-box !important;
    width: 23px !important;
    height: 23px !important;
    border: 2px solid #fff !important;
    border-radius: 2px !important;
    display: block !important;
    background-image:
      linear-gradient(to right, transparent 31%, #fff 31%, #fff 38%, transparent 38%, transparent 64%, #fff 64%, #fff 71%, transparent 71%),
      linear-gradient(to bottom, transparent 31%, #fff 31%, #fff 38%, transparent 38%, transparent 64%, #fff 64%, #fff 71%, transparent 71%) !important;
    background-size: 100% 100% !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    flex: 0 0 23px !important;
  }

  /* Do not allow older pseudo-labels to reappear. */
  .cf-table-export-bar .cf-export-pdf::after,
  .cf-table-export-bar .cf-universal-export-pdf::after,
  .cf-table-export-bar .ph-export-pdf::after,
  .cf-table-export-bar .cf-export-excel::after,
  .cf-table-export-bar .cf-universal-export-excel::after,
  .cf-table-export-bar .ph-export-excel::after {
    content: none !important;
    display: none !important;
  }
}


/* ClinicFlow v3.3.18 - Mobile only: professional PDF and Excel export icons. */
@media (max-width: 700px) {
  /* Keep compact teal export buttons; replace hand-drawn shapes with clean line icons. */
  .cf-table-export-bar .cf-export-pdf::before,
  .cf-table-export-bar .cf-universal-export-pdf::before,
  .cf-table-export-bar .ph-export-pdf::before,
  .cf-table-export-bar .cf-export-excel::before,
  .cf-table-export-bar .cf-universal-export-excel::before,
  .cf-table-export-bar .ph-export-excel::before {
    content: "" !important;
    display: block !important;
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background-color: transparent !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 22px 22px !important;
    flex: 0 0 22px !important;
    font-size: 0 !important;
    line-height: 0 !important;
  }

  /* Professional document/PDF symbol: crisp page outline, folded corner and PDF bars. */
  .cf-table-export-bar .cf-export-pdf::before,
  .cf-table-export-bar .cf-universal-export-pdf::before,
  .cf-table-export-bar .ph-export-pdf::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M7 2.75h7.25L19 7.5v13.75H7a2 2 0 0 1-2-2V4.75a2 2 0 0 1 2-2Z' stroke='white' stroke-width='1.8' stroke-linejoin='round'/%3E%3Cpath d='M14 2.75V8h5' stroke='white' stroke-width='1.8' stroke-linejoin='round'/%3E%3Cpath d='M8 12.25h8M8 15h6.5M8 17.75h5' stroke='white' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") !important;
  }

  /* Professional spreadsheet symbol: clean workbook outline with restrained grid. */
  .cf-table-export-bar .cf-export-excel::before,
  .cf-table-export-bar .cf-universal-export-excel::before,
  .cf-table-export-bar .ph-export-excel::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Crect x='3' y='4' width='18' height='16' rx='2' stroke='white' stroke-width='1.8'/%3E%3Cpath d='M8 4v16M3 9h18M3 14.5h18' stroke='white' stroke-width='1.55'/%3E%3Cpath d='m12.25 11 4.5 5m0-5-4.5 5' stroke='white' stroke-width='1.75' stroke-linecap='round'/%3E%3C/svg%3E") !important;
  }

  /* Subtle mature button treatment; mobile only. */
  .cf-table-export-bar .cf-export-pdf,
  .cf-table-export-bar .cf-universal-export-pdf,
  .cf-table-export-bar .ph-export-pdf,
  .cf-table-export-bar .cf-export-excel,
  .cf-table-export-bar .cf-universal-export-excel,
  .cf-table-export-bar .ph-export-excel {
    border-radius: 5px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}


/* ClinicFlow v3.3.19 - Mobile only: keep Add New, PDF and Excel on the same line. */
@media (max-width: 700px) {
  #cf-top-actions {
    align-items: center !important;
  }

  #cf-top-actions .cf-add-wrap {
    width: auto !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    justify-content: flex-start !important;
    margin: 0 !important;
  }

  #cf-top-actions .cf-add-wrap .cf-btn {
    width: auto !important;
    min-width: 132px !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    white-space: nowrap !important;
  }

  #cf-top-actions .cf-table-export-bar.cf-mobile-inline-export {
    width: auto !important;
    flex: 0 0 auto !important;
    margin: 0 0 0 auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
  }

  #cf-content > .cf-panel > .cf-mobile-export-placeholder {
    display: none !important;
  }
}


/* ClinicFlow v3.3.20 - Mobile only: hidden sentinel prevents duplicate PDF/Excel controls. */
@media (max-width: 700px) {
  .cf-mobile-export-placeholder {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
  }
}

/* ClinicFlow v3.3.21 - Mobile export row: exactly one PDF + one Excel beside Add New. */
@media (max-width: 700px) {
  /* The real buttons stay in the DOM (preventing universal-export duplication) but are not displayed on mobile. */
  .cf-table-export-bar.cf-mobile-export-source {
    display: none !important;
  }

  #cf-top-actions {
    align-items: center !important;
  }

  #cf-top-actions .cf-add-wrap {
    width: auto !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    justify-content: stretch !important;
  }

  #cf-top-actions .cf-add-wrap .cf-btn {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 40px !important;
    white-space: nowrap !important;
  }

  #cf-top-actions .cf-mobile-export-proxy {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex: 0 0 auto !important;
    width: auto !important;
    gap: 8px !important;
    margin: 0 !important;
  }

  #cf-top-actions .cf-mobile-export-pdf,
  #cf-top-actions .cf-mobile-export-excel {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 40px !important;
    border-radius: 5px !important;
    font-size: 0 !important;
    line-height: 0 !important;
    overflow: hidden !important;
  }

  #cf-top-actions .cf-mobile-export-pdf::before,
  #cf-top-actions .cf-mobile-export-excel::before {
    content: "" !important;
    display: block !important;
    width: 22px !important;
    height: 22px !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 22px 22px !important;
  }

  #cf-top-actions .cf-mobile-export-pdf::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M7 2.75h7.25L19 7.5v13.75H7a2 2 0 0 1-2-2V4.75a2 2 0 0 1 2-2Z' stroke='white' stroke-width='1.8' stroke-linejoin='round'/%3E%3Cpath d='M14 2.75V8h5' stroke='white' stroke-width='1.8' stroke-linejoin='round'/%3E%3Cpath d='M8 12.25h8M8 15h6.5M8 17.75h5' stroke='white' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") !important;
  }

  #cf-top-actions .cf-mobile-export-excel::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Crect x='3' y='4' width='18' height='16' rx='2' stroke='white' stroke-width='1.8'/%3E%3Cpath d='M8 4v16M3 9h18M3 14.5h18' stroke='white' stroke-width='1.55'/%3E%3Cpath d='m12.25 11 4.5 5m0-5-4.5 5' stroke='white' stroke-width='1.75' stroke-linecap='round'/%3E%3C/svg%3E") !important;
  }
}


/* ClinicFlow v3.3.22 - Mobile only: every list sorting/filter control is available only through Filter. */
@media (max-width: 700px) {
  /* Core ClinicFlow and Pharmacy use the same mobile Filter behaviour. */
  #cf-top-actions .cf-filter-shell,
  #cf-top-actions .ph-filter-shell,
  .cf-top-actions .cf-filter-shell,
  .cf-top-actions .ph-filter-shell {
    width: 100% !important;
    min-width: 0 !important;
  }

  /* Search + Filter are the only filter-row controls visible before the drawer opens. */
  #cf-top-actions .cf-filter-toggle,
  #cf-top-actions .ph-filter-shell .cf-filter-toggle,
  .cf-top-actions .cf-filter-toggle,
  .cf-top-actions .ph-filter-shell .cf-filter-toggle,
  body.cf-pharmacy-page #cf-top-actions .ph-filter-shell .cf-filter-toggle {
    display: inline-flex !important;
  }

  /* Override older Pharmacy rule that kept all filters permanently visible. */
  #cf-top-actions .cf-filter-shell:not(.open) > * .cf-filter-extra,
  #cf-top-actions .ph-filter-shell:not(.open) > * .cf-filter-extra,
  .cf-top-actions .cf-filter-shell:not(.open) > * .cf-filter-extra,
  .cf-top-actions .ph-filter-shell:not(.open) > * .cf-filter-extra,
  body.cf-pharmacy-page #cf-top-actions .ph-filter-shell:not(.open) .cf-filter-extra {
    display: none !important;
  }

  /* When Filter is opened, show every select/date/reset control inside one vertical drawer. */
  #cf-top-actions .cf-filter-shell.open .cf-filter-extra,
  #cf-top-actions .ph-filter-shell.open .cf-filter-extra,
  .cf-top-actions .cf-filter-shell.open .cf-filter-extra,
  .cf-top-actions .ph-filter-shell.open .cf-filter-extra,
  body.cf-pharmacy-page #cf-top-actions .ph-filter-shell.open .cf-filter-extra {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
    flex: 1 0 100% !important;
    gap: 8px !important;
    margin-top: 2px !important;
    padding: 10px !important;
    border: 1px solid #d8e1e5 !important;
    background: #fff !important;
    box-shadow: 0 6px 18px rgba(18,42,55,.08) !important;
    border-radius: 4px !important;
  }

  #cf-top-actions .cf-filter-extra .cf-list-filter,
  #cf-top-actions .cf-filter-extra .ph-list-filter,
  #cf-top-actions .cf-filter-extra .ph-top-filter,
  #cf-top-actions .cf-filter-extra .cf-filter-date,
  #cf-top-actions .cf-filter-extra .cf-secondary,
  .cf-top-actions .cf-filter-extra .cf-list-filter,
  .cf-top-actions .cf-filter-extra .ph-list-filter,
  .cf-top-actions .cf-filter-extra .ph-top-filter,
  .cf-top-actions .cf-filter-extra .cf-filter-date,
  .cf-top-actions .cf-filter-extra .cf-secondary {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
  }

  /* Date filters remain readable inside the drawer. */
  #cf-top-actions .cf-filter-extra .cf-filter-date,
  .cf-top-actions .cf-filter-extra .cf-filter-date {
    display: grid !important;
    grid-template-columns: 92px minmax(0,1fr) !important;
    align-items: center !important;
    gap: 8px !important;
  }
}

/* ClinicFlow v3.3.24 - Mobile pagination: compact, clean and touch-friendly. */
@media (max-width:700px){
  .cf-pagination,
  body.cf-pharmacy-page #ph-pagination{
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    justify-content:flex-start!important;
    gap:10px!important;
    margin-top:12px!important;
    padding:12px!important;
    border:1px solid #e1e8ec!important;
    border-radius:8px!important;
    background:#fff!important;
    overflow:visible!important;
  }
  .cf-page-info{
    width:100%!important;
    flex:0 0 auto!important;
    font-size:11px!important;
    color:#64748b!important;
  }
  .cf-page-controls{
    width:100%!important;
    flex:0 0 auto!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
    gap:5px!important;
    flex-wrap:nowrap!important;
    overflow-x:auto!important;
    -webkit-overflow-scrolling:touch!important;
    scrollbar-width:none!important;
    padding:1px 0 2px!important;
  }
  .cf-page-controls::-webkit-scrollbar{display:none!important;}
  .cf-page-size-label{
    margin-right:auto!important;
    gap:6px!important;
    font-size:11px!important;
    flex:0 0 auto!important;
  }
  .cf-page-size-label select{
    height:32px!important;
    min-width:58px!important;
    padding:0 22px 0 8px!important;
    font-size:11px!important;
  }
  .cf-page-btn{
    min-width:32px!important;
    width:32px!important;
    height:32px!important;
    flex:0 0 32px!important;
    border-radius:6px!important;
    font-size:13px!important;
  }
}


/* ClinicFlow v3.3.25 - Mobile: remove outer pagination box/border. */
@media (max-width:700px){
  .cf-pagination,
  body.cf-pharmacy-page #ph-pagination{
    border:0!important;
    border-radius:0!important;
    box-shadow:none!important;
    background:transparent!important;
    padding-left:0!important;
    padding-right:0!important;
  }
}

/* ClinicFlow v3.3.27 - Mobile only: fixed 10 rows/page; centered pagination controls. */
@media (max-width:700px){
  /* The mobile list uses the existing fixed 10-row page size. Hide the selector entirely. */
  .cf-page-size-label,
  #cf-pagination .cf-page-size-label,
  #ph-pagination .cf-page-size-label,
  body.cf-pharmacy-page #ph-pagination .cf-page-size-label{
    display:none!important;
  }

  /* Keep only the navigation controls and place them neatly in the horizontal centre. */
  .cf-pagination,
  body.cf-pharmacy-page #ph-pagination{
    align-items:center!important;
    justify-content:center!important;
  }

  .cf-page-controls,
  #cf-pagination .cf-page-controls,
  #ph-pagination .cf-page-controls,
  body.cf-pharmacy-page #ph-pagination .cf-page-controls{
    width:100%!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:8px!important;
    margin:0 auto!important;
    padding:2px 0!important;
    overflow:visible!important;
  }
}


/* ClinicFlow v3.3.28 - definitive mobile pagination: no rows-per-page, centered navigation only. */
@media (max-width:700px){
  #cf-pagination,
  #ph-pagination,
  body.cf-pharmacy-page #ph-pagination{
    display:flex!important;
    width:100%!important;
    flex-direction:row!important;
    align-items:center!important;
    justify-content:center!important;
    margin:12px 0 0!important;
    padding:8px 0 2px!important;
    border:0!important;
    background:transparent!important;
    box-shadow:none!important;
    overflow:visible!important;
  }
  #cf-pagination .cf-page-info,
  #ph-pagination .cf-page-info,
  #cf-pagination .cf-page-size-label,
  #ph-pagination .cf-page-size-label{
    display:none!important;
  }
  #cf-pagination .cf-page-controls,
  #ph-pagination .cf-page-controls,
  body.cf-pharmacy-page #ph-pagination .cf-page-controls{
    width:auto!important;
    flex:0 0 auto!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:8px!important;
    margin:0 auto!important;
    padding:0!important;
    overflow:visible!important;
  }
}


/* ClinicFlow v3.3.32 - Pharmacy mobile layout aligned with the rest of ClinicFlow. */
@media (max-width:700px){
  /* Row 1: Search + Filter share the same line, just like non-pharmacy masters. */
  body.cf-pharmacy-page #cf-top-actions .ph-filter-shell{
    width:100%!important;
    flex:1 0 100%!important;
    min-width:0!important;
    margin:0!important;
  }
  body.cf-pharmacy-page #cf-top-actions .ph-filter-shell .cf-filter-primary,
  body.cf-pharmacy-page #cf-top-actions .ph-filter-shell .cf-filter-singleline{
    display:flex!important;
    width:100%!important;
    min-width:0!important;
    flex-wrap:nowrap!important;
    align-items:center!important;
    gap:8px!important;
  }
  body.cf-pharmacy-page #cf-top-actions .ph-top-search{
    flex:1 1 0!important;
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
    height:42px!important;
    min-height:42px!important;
    margin:0!important;
  }
  body.cf-pharmacy-page #cf-top-actions .ph-filter-toggle{
    display:inline-flex!important;
    flex:0 0 auto!important;
    width:auto!important;
    min-width:92px!important;
    height:42px!important;
    margin:0!important;
  }

  /* Pharmacy sorting/filter fields stay inside the Filter drawer only. */
  body.cf-pharmacy-page #cf-top-actions .ph-filter-shell:not(.open) .cf-filter-extra{
    display:none!important;
  }
  body.cf-pharmacy-page #cf-top-actions .ph-filter-shell.open .cf-filter-extra{
    display:grid!important;
    grid-template-columns:1fr!important;
    flex:1 0 100%!important;
    width:100%!important;
    margin-top:2px!important;
  }

  /* Row 2: Add New on the left, PDF + Excel icons on the right. */
  body.cf-pharmacy-page #cf-top-actions .ph-add-wrap{
    width:auto!important;
    flex:1 1 auto!important;
    min-width:0!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    margin:0!important;
  }
  body.cf-pharmacy-page #cf-top-actions .ph-add-wrap .ph-add-btn{
    width:auto!important;
    min-width:132px!important;
    height:40px!important;
    min-height:40px!important;
    padding:0 14px!important;
    margin:0!important;
    white-space:nowrap!important;
  }
  body.cf-pharmacy-page #cf-top-actions .cf-table-export-bar.cf-mobile-inline-export{
    width:auto!important;
    flex:0 0 auto!important;
    display:inline-flex!important;
    flex-wrap:nowrap!important;
    align-items:center!important;
    justify-content:flex-end!important;
    gap:8px!important;
    margin:0 0 0 auto!important;
    padding:0!important;
  }

  /* Once export controls are moved to Row 2, do not reserve empty space in the table card. */
  body.cf-pharmacy-page .ph-list-panel > .cf-mobile-export-placeholder{
    display:none!important;
  }

  /* Keep heading/table spacing consistent with the main ClinicFlow masters. */
  body.cf-pharmacy-page .ph-page-heading{
    margin-bottom:14px!important;
  }
  body.cf-pharmacy-page .ph-list-panel{
    margin-top:0!important;
  }
}


/* ClinicFlow v3.3.33 - definitive mobile Filter behaviour. */
@media (max-width:700px){
  /* Keep Search and the Filter trigger visible; actual filter/sort fields stay hidden until opened. */
  #cf-top-actions .cf-filter-shell,
  #cf-top-actions .ph-filter-shell{
    width:100%!important;
    min-width:0!important;
    overflow:visible!important;
  }

  #cf-top-actions .cf-filter-shell .cf-filter-primary,
  #cf-top-actions .ph-filter-shell .cf-filter-primary{
    position:relative!important;
    display:flex!important;
    flex-wrap:wrap!important;
    align-items:center!important;
    gap:8px!important;
    width:100%!important;
    min-width:0!important;
    overflow:visible!important;
  }

  #cf-top-actions .cf-filter-shell .cf-list-search,
  #cf-top-actions .ph-filter-shell .ph-top-search{
    flex:1 1 0!important;
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
  }

  #cf-top-actions .cf-filter-shell .cf-filter-toggle,
  #cf-top-actions .ph-filter-shell .ph-filter-toggle{
    flex:0 0 auto!important;
    width:auto!important;
    min-width:92px!important;
    margin:0!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
  }

  #cf-top-actions .cf-filter-shell:not(.open) .cf-filter-extra,
  #cf-top-actions .ph-filter-shell:not(.open) .cf-filter-extra{
    display:none!important;
  }

  #cf-top-actions .cf-filter-shell.open .cf-filter-extra,
  #cf-top-actions .ph-filter-shell.open .cf-filter-extra{
    order:20!important;
    flex:0 0 100%!important;
    width:100%!important;
    min-width:0!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:10px!important;
    box-sizing:border-box!important;
    margin:2px 0 0!important;
    padding:12px!important;
    border:1px solid #d7e2e6!important;
    border-radius:6px!important;
    background:#fff!important;
    box-shadow:0 8px 20px rgba(18,42,55,.10)!important;
    position:relative!important;
    z-index:30!important;
  }

  #cf-top-actions .cf-filter-extra > select,
  #cf-top-actions .cf-filter-extra > input,
  #cf-top-actions .cf-filter-extra > button,
  #cf-top-actions .cf-filter-extra > .cf-filter-date,
  #cf-top-actions .cf-filter-extra .cf-list-filter,
  #cf-top-actions .cf-filter-extra .ph-list-filter,
  #cf-top-actions .cf-filter-extra .ph-top-filter,
  #cf-top-actions .cf-filter-extra .cf-secondary{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    box-sizing:border-box!important;
    margin:0!important;
  }

  #cf-top-actions .cf-filter-extra .cf-filter-date{
    display:grid!important;
    grid-template-columns:80px minmax(0,1fr)!important;
    align-items:center!important;
    gap:8px!important;
  }
}

/* ClinicFlow v3.3.35 - Pharmacy mobile filter drawer layout correction. */
@media (max-width:700px){
  /* Pharmacy top actions must never become wider than the phone viewport. */
  body.cf-pharmacy-page #cf-top-actions{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    flex:1 1 100%!important;
    box-sizing:border-box!important;
    overflow:visible!important;
  }

  body.cf-pharmacy-page #cf-top-actions .ph-filter-shell{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    flex:0 0 100%!important;
    box-sizing:border-box!important;
    overflow:visible!important;
    margin:0!important;
  }

  /* Use a two-column grid: Search | Filter.  The opened drawer occupies the full next row. */
  body.cf-pharmacy-page #cf-top-actions .ph-filter-shell > .cf-filter-primary,
  body.cf-pharmacy-page #cf-top-actions .ph-filter-shell > .cf-filter-singleline{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    grid-auto-flow:row!important;
    align-items:center!important;
    column-gap:8px!important;
    row-gap:10px!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
    overflow:visible!important;
  }

  body.cf-pharmacy-page #cf-top-actions .ph-filter-shell .ph-top-search{
    grid-column:1!important;
    grid-row:1!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    height:42px!important;
    margin:0!important;
    box-sizing:border-box!important;
  }

  body.cf-pharmacy-page #cf-top-actions .ph-filter-shell #ph-filter-toggle,
  body.cf-pharmacy-page #cf-top-actions .ph-filter-shell .cf-filter-toggle{
    grid-column:2!important;
    grid-row:1!important;
    width:auto!important;
    min-width:104px!important;
    height:42px!important;
    margin:0!important;
    box-sizing:border-box!important;
    align-self:stretch!important;
  }

  body.cf-pharmacy-page #cf-top-actions .ph-filter-shell:not(.open) .cf-filter-extra{
    display:none!important;
  }

  body.cf-pharmacy-page #cf-top-actions .ph-filter-shell.open .cf-filter-extra{
    grid-column:1 / -1!important;
    grid-row:2!important;
    position:static!important;
    inset:auto!important;
    transform:none!important;
    float:none!important;
    clear:both!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
    gap:10px!important;
    margin:0!important;
    padding:12px!important;
    border:1px solid #d7e2e6!important;
    border-radius:6px!important;
    background:#fff!important;
    box-shadow:0 6px 18px rgba(18,42,55,.08)!important;
    overflow:visible!important;
    z-index:auto!important;
  }

  body.cf-pharmacy-page #cf-top-actions .ph-filter-shell.open .cf-filter-extra > *,
  body.cf-pharmacy-page #cf-top-actions .ph-filter-shell.open .cf-filter-extra .ph-list-filter,
  body.cf-pharmacy-page #cf-top-actions .ph-filter-shell.open .cf-filter-extra .ph-top-filter,
  body.cf-pharmacy-page #cf-top-actions .ph-filter-shell.open .cf-filter-extra .cf-list-filter,
  body.cf-pharmacy-page #cf-top-actions .ph-filter-shell.open .cf-filter-extra .cf-secondary{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
    margin:0!important;
  }

  body.cf-pharmacy-page #cf-top-actions .ph-filter-shell.open .cf-filter-extra .cf-filter-date{
    display:grid!important;
    grid-template-columns:88px minmax(0,1fr)!important;
    align-items:center!important;
    gap:8px!important;
    width:100%!important;
    min-width:0!important;
    margin:0!important;
  }

  body.cf-pharmacy-page #cf-top-actions .ph-filter-shell.open .cf-filter-extra .cf-filter-date input{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }
}


/* ClinicFlow v3.3.37 - Mobile quotation line items: show a clear label above every value. */
.cf-form-modal-quotations .cf-item-cell { display: contents; }
.cf-form-modal-quotations .cf-mobile-item-label { display: none; }

@media (max-width: 900px) {
  .cf-form-modal-quotations .cf-item-row {
    grid-template-columns: 1fr 1fr !important;
    min-width: 0 !important;
  }

  .cf-form-modal-quotations .cf-item-cell {
    display: flex !important;
    flex-direction: column !important;
    gap: 5px !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .cf-form-modal-quotations .cf-item-cell:first-of-type {
    grid-column: 1 / -1 !important;
  }

  .cf-form-modal-quotations .cf-mobile-item-label {
    display: block !important;
    color: #263746 !important;
    font-size: 11px !important;
    line-height: 1.25 !important;
    font-weight: 700 !important;
    margin: 0 0 1px !important;
  }

  .cf-form-modal-quotations .cf-item-cell > input,
  .cf-form-modal-quotations .cf-item-cell > select,
  .cf-form-modal-quotations .cf-item-cell > .cf-integrated-search-select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .cf-form-modal-quotations .cf-item-action-cell {
    justify-content: flex-end !important;
  }

  .cf-form-modal-quotations .cf-item-action-cell .cf-remove-item {
    width: 100% !important;
    min-height: 40px !important;
  }
}

@media (max-width: 420px) {
  .cf-form-modal-quotations .cf-item-row {
    grid-template-columns: 1fr !important;
  }
  .cf-form-modal-quotations .cf-item-cell:first-of-type {
    grid-column: auto !important;
  }
}


/* ClinicFlow v3.3.40 - Dedicated Session Photos modal; prevents double-page/modal display. */
#cf-session-photos-modal { z-index: 2200 !important; }
#cf-session-photos-modal .cf-modal-card { overflow: hidden; }
#cf-session-photos-body { min-height:0; overflow:auto; -webkit-overflow-scrolling:touch; }
#cf-session-photos-modal .cf-session-photos-close {
  border:0; background:transparent; color:#12263a; font-size:28px; line-height:1;
  width:38px; height:38px; display:inline-flex; align-items:center; justify-content:center; cursor:pointer;
}
@media (max-width: 900px) {
  #cf-session-photos-modal { padding:7px !important; align-items:flex-start !important; overflow:hidden !important; }
  #cf-session-photos-modal .cf-modal-card {
    width:calc(100vw - 14px) !important; max-width:none !important; max-height:calc(100dvh - 14px) !important;
    margin:0 !important; display:flex !important; flex-direction:column !important;
  }
  #cf-session-photos-body { flex:1 1 auto; overflow-y:auto !important; overflow-x:hidden !important; }
}

/* ClinicFlow v3.3.50 - Mobile consent upload */
@media(max-width:700px){.cf-consent-file-card{display:block!important;padding:12px!important}.cf-consent-file-preview,.cf-consent-file-status{margin-bottom:9px!important}.cf-consent-file-actions{display:flex!important;gap:8px!important}.cf-consent-file-actions .cf-btn{flex:1 1 auto!important;min-height:40px!important}.cf-consent-upload-section{margin-top:16px!important}}


/* ClinicFlow v3.3.51 - Mobile: reliable native photo picker directly on the visible button. */
@media (max-width: 768px) {
  #cf-form .cf-photo-upload.cf-photo-native-picker {
    position: relative !important;
    overflow: hidden !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
  }
  #cf-form .cf-photo-upload.cf-photo-native-picker > input.cf-session-photo-input[type="file"] {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 0.001 !important;
    display: block !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 3 !important;
    font-size: 100px !important;
  }
}

/* ClinicFlow v3.3.56 - Session Photos & Consent viewer: keep consent reachable on every viewport. */
#cf-session-photos-modal {
  overflow: hidden !important;
}
#cf-session-photos-modal .cf-modal-card {
  display: flex !important;
  flex-direction: column !important;
  width: min(1380px, calc(100vw - 28px)) !important;
  max-width: 1380px !important;
  max-height: calc(100dvh - 28px) !important;
  overflow: hidden !important;
}
#cf-session-photos-modal .cf-modal-head {
  flex: 0 0 auto !important;
}
#cf-session-photos-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain !important;
  padding-bottom: 28px !important;
}
#cf-session-photos-body .cf-session-consent-view {
  scroll-margin-bottom: 28px !important;
}
#cf-session-photos-body .cf-consent-view-card,
#cf-session-photos-body .cf-consent-view-empty {
  margin-bottom: 12px !important;
}
@media (max-width: 900px) {
  #cf-session-photos-modal .cf-modal-card {
    width: calc(100vw - 14px) !important;
    max-width: none !important;
    max-height: calc(100dvh - 14px) !important;
  }
}


/* ClinicFlow v3.3.79 - Line-item headings: one heading system per viewport.
   Tablet/desktop use the table header only; phones use labels above each field. */
@media (min-width: 701px) {
  .cf-line-items-field .cf-mobile-item-label {
    display: none !important;
  }
  .cf-line-items-field .cf-item-cell {
    display: contents !important;
  }
  .cf-line-items-field .cf-items-head {
    display: grid !important;
  }
}

@media (max-width: 700px) {
  .cf-line-items-field .cf-items-head {
    display: none !important;
  }
  .cf-line-items-field .cf-mobile-item-label {
    display: block !important;
  }
}


/* ClinicFlow v3.3.97 - compact summary above mobile filters. */
@media (max-width:700px){
  #cf-top-actions .cf-top-summary-zone{margin:0 0 4px 0!important;}
  #cf-top-actions .cf-summary-strip{gap:6px 8px!important;font-size:10px!important;}
  #cf-top-actions .cf-summary-strip-item{gap:3px!important;}
  #cf-top-actions .cf-summary-strip-item b{font-size:11px!important;}
  #cf-top-actions .cf-summary-strip-sep{display:none!important;}
}


/* ClinicFlow v3.4.03 - Mobile Filter trigger uses theme background colour. */
@media (max-width: 900px) {
  #cf-top-actions .cf-filter-toggle,
  .cf-top-actions .cf-filter-toggle,
  body.cf-pharmacy-page #cf-top-actions .ph-filter-toggle,
  body.cf-pharmacy-page #cf-top-actions .cf-filter-toggle {
    background: var(--cf-primary) !important;
    border-color: var(--cf-primary) !important;
    color: #fff !important;
  }
  #cf-top-actions .cf-filter-toggle:hover,
  .cf-top-actions .cf-filter-toggle:hover,
  #cf-top-actions .cf-filter-shell.open .cf-filter-toggle,
  .cf-top-actions .cf-filter-shell.open .cf-filter-toggle,
  body.cf-pharmacy-page #cf-top-actions .ph-filter-shell.open .ph-filter-toggle {
    background: var(--cf-primary) !important;
    color: #fff !important;
  }
}


/* ClinicFlow v3.4.08 - Mobile list/master header and compact tools. */
@media (max-width:700px){
  /* One clean header row: menu | view name | Add | PDF | Excel. */
  .cf-main > .cf-topbar{
    display:flex!important;
    flex-direction:row!important;
    align-items:center!important;
    flex-wrap:nowrap!important;
    gap:7px!important;
    min-height:58px!important;
    padding:8px 10px!important;
  }
  .cf-main > .cf-topbar > .cf-menu{
    order:1!important;
    width:38px!important;height:38px!important;flex:0 0 38px!important;
    margin:0!important;
  }
  .cf-main > .cf-topbar > .cf-mobile-view-title{
    order:2!important;
    flex:1 1 auto!important;
    min-width:0!important;
    color:var(--cf-dark,#12263a)!important;
    font-size:17px!important;
    line-height:1.2!important;
    font-weight:700!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  .cf-main > .cf-topbar > .cf-mobile-header-actions{
    order:3!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
    flex:0 0 auto!important;
    gap:6px!important;
    min-width:0!important;
  }
  .cf-mobile-header-actions .cf-add-wrap{
    display:block!important;width:auto!important;flex:0 0 auto!important;margin:0!important;
  }
  .cf-mobile-header-actions #cf-add-record,
  .cf-mobile-header-actions .ph-add-btn{
    position:relative!important;
    width:38px!important;min-width:38px!important;max-width:38px!important;
    height:38px!important;min-height:38px!important;max-height:38px!important;
    padding:0!important;margin:0!important;
    font-size:0!important;line-height:0!important;
    display:inline-flex!important;align-items:center!important;justify-content:center!important;
    border-radius:5px!important;
  }
  .cf-mobile-header-actions #cf-add-record::before,
  .cf-mobile-header-actions .ph-add-btn::before{
    content:"+"!important;color:#fff!important;font-size:25px!important;font-weight:500!important;line-height:1!important;
  }
  .cf-mobile-header-actions .cf-mobile-export-proxy{
    display:flex!important;align-items:center!important;gap:6px!important;margin:0!important;
  }
  .cf-mobile-header-actions .cf-mobile-export-pdf,
  .cf-mobile-header-actions .cf-mobile-export-excel{
    width:38px!important;min-width:38px!important;max-width:38px!important;
    height:38px!important;min-height:38px!important;max-height:38px!important;
    padding:0!important;margin:0!important;border-radius:5px!important;
    display:inline-flex!important;align-items:center!important;justify-content:center!important;
    font-size:0!important;line-height:0!important;background:var(--cf-primary)!important;border-color:var(--cf-primary)!important;
  }
  .cf-mobile-header-actions .cf-mobile-export-pdf::before,
  .cf-mobile-header-actions .cf-mobile-export-excel::before{
    content:""!important;width:21px!important;height:21px!important;display:block!important;
    background-repeat:no-repeat!important;background-position:center!important;background-size:21px 21px!important;
  }
  .cf-mobile-header-actions .cf-mobile-export-pdf::before{
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M7 2.75h7.25L19 7.5v13.75H7a2 2 0 0 1-2-2V4.75a2 2 0 0 1 2-2Z' stroke='white' stroke-width='1.8' stroke-linejoin='round'/%3E%3Cpath d='M14 2.75V8h5' stroke='white' stroke-width='1.8'/%3E%3Cpath d='M8 12.25h8M8 15h6.5M8 17.75h5' stroke='white' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E")!important;
  }
  .cf-mobile-header-actions .cf-mobile-export-excel::before{
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Crect x='3' y='4' width='18' height='16' rx='2' stroke='white' stroke-width='1.8'/%3E%3Cpath d='M8 4v16M3 9h18M3 14.5h18' stroke='white' stroke-width='1.55'/%3E%3Cpath d='m12.25 11 4.5 5m0-5-4.5 5' stroke='white' stroke-width='1.75' stroke-linecap='round'/%3E%3C/svg%3E")!important;
  }

  /* Original top action container becomes invisible once its controls are relocated. */
  .cf-main > .cf-topbar > #cf-top-actions{
    position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;
    clip:rect(0 0 0 0)!important;clip-path:inset(50%)!important;white-space:nowrap!important;
    padding:0!important;margin:0!important;border:0!important;
  }

  /* Remove all summary figures on mobile. */
  #cf-summary-zone,.cf-top-summary-zone,.cf-summary-strip,.cf-summary-cards{display:none!important;}

  /* Hide the duplicate title in the content; the title now lives beside the menu icon. */
  #cf-content > .cf-list-title-bar,
  #cf-content > .cf-page-heading{display:none!important;}

  /* Search + icon-only Filter sit directly above the table. */
  .cf-mobile-table-tools{
    display:block!important;
    width:100%!important;
    margin:0 0 10px!important;
    padding:0!important;
  }
  .cf-mobile-table-tools .cf-filter-shell,
  .cf-mobile-table-tools .ph-filter-shell{
    display:block!important;width:100%!important;margin:0!important;padding:0!important;
  }
  .cf-mobile-table-tools .cf-filter-singleline{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 44px!important;
    gap:8px!important;
    align-items:center!important;
    width:100%!important;
  }
  .cf-mobile-table-tools .cf-list-search,
  .cf-mobile-table-tools .ph-top-search{
    grid-column:1!important;
    width:100%!important;min-width:0!important;max-width:none!important;
    height:42px!important;min-height:42px!important;margin:0!important;
  }
  .cf-mobile-table-tools .cf-filter-toggle,
  .cf-mobile-table-tools .ph-filter-toggle{
    grid-column:2!important;
    width:44px!important;min-width:44px!important;max-width:44px!important;
    height:42px!important;min-height:42px!important;max-height:42px!important;
    padding:0!important;margin:0!important;
    display:inline-flex!important;align-items:center!important;justify-content:center!important;
    background:var(--cf-primary)!important;border-color:var(--cf-primary)!important;color:#fff!important;
  }
  .cf-mobile-table-tools .cf-filter-toggle-label,
  .cf-mobile-table-tools .cf-sr-only{display:none!important;}
  .cf-mobile-table-tools .cf-filter-toggle-icon{display:inline-flex!important;width:19px!important;height:19px!important;}
  .cf-mobile-table-tools .cf-filter-extra{
    grid-column:1 / -1!important;
    width:100%!important;
    margin-top:8px!important;
  }
  .cf-mobile-table-tools .cf-filter-shell:not(.open) .cf-filter-extra,
  .cf-mobile-table-tools .ph-filter-shell:not(.open) .cf-filter-extra{display:none!important;}
  .cf-mobile-table-tools .cf-filter-shell.open .cf-filter-extra,
  .cf-mobile-table-tools .ph-filter-shell.open .cf-filter-extra{
    display:grid!important;grid-template-columns:1fr!important;gap:8px!important;
  }

  /* Hide the source export bar: only the header icons are visible. */
  .cf-mobile-export-source{display:none!important;}
}


/* ClinicFlow v3.4.09 - Mobile: one clear view title in header; no duplicate content title. */
@media (max-width:700px){
  .cf-main > .cf-topbar{
    display:grid!important;
    grid-template-columns:38px minmax(0,1fr) auto!important;
    align-items:center!important;
    column-gap:7px!important;
    width:100%!important;
    min-width:0!important;
    overflow:visible!important;
  }
  .cf-main > .cf-topbar > .cf-menu{
    grid-column:1!important;
    position:relative!important;
    inset:auto!important;
    transform:none!important;
    z-index:2!important;
  }
  .cf-main > .cf-topbar > .cf-mobile-view-title{
    grid-column:2!important;
    position:relative!important;
    inset:auto!important;
    transform:none!important;
    width:auto!important;
    max-width:none!important;
    min-width:0!important;
    margin:0!important;
    padding:0!important;
    z-index:2!important;
    color:var(--cf-dark,#142432)!important;
    font-size:17px!important;
    font-weight:700!important;
    line-height:1.25!important;
    text-align:left!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  .cf-main > .cf-topbar > .cf-mobile-header-actions{
    grid-column:3!important;
    position:relative!important;
    inset:auto!important;
    transform:none!important;
    margin:0!important;
    padding:0!important;
    z-index:2!important;
  }

  /* The header title is the only view name on phones. */
  #cf-content > .cf-list-title-bar,
  #cf-content > .cf-page-heading,
  #cf-content > h1:first-child,
  #cf-content > h2:first-child,
  #cf-content > .cf-view-title,
  #cf-content > .cf-content-title{
    display:none!important;
    margin:0!important;
    padding:0!important;
    height:0!important;
    min-height:0!important;
  }
}


/* ClinicFlow v3.4.10 - Mobile: absolutely suppress duplicate content view title. */
@media (max-width:700px){
  #clinicflow-app #cf-content .cf-list-title-bar,
  #clinicflow-app #cf-content .cf-page-heading,
  #clinicflow-app #cf-content .ph-page-heading,
  #clinicflow-app #cf-content .cf-view-title,
  #clinicflow-app #cf-content .cf-content-title,
  #clinicflow-app #cf-content > h1:first-child,
  #clinicflow-app #cf-content > h2:first-child{
    display:none!important;
    visibility:hidden!important;
    opacity:0!important;
    height:0!important;
    min-height:0!important;
    max-height:0!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    overflow:hidden!important;
  }
}

@media (max-width:700px){
  .cf-mobile-duplicate-title-hidden{display:none!important;visibility:hidden!important;height:0!important;margin:0!important;padding:0!important;}
}


/* ClinicFlow v3.4.11 - Mobile: readable wrapped view title + single search/filter row. */
@media (max-width:700px){
  .cf-main > .cf-topbar > .cf-mobile-view-title{
    font-size:14px!important;
    line-height:1.12!important;
    font-weight:700!important;
    white-space:normal!important;
    overflow:visible!important;
    text-overflow:clip!important;
    overflow-wrap:anywhere!important;
    word-break:normal!important;
    max-height:34px!important;
    display:-webkit-box!important;
    -webkit-line-clamp:2!important;
    -webkit-box-orient:vertical!important;
  }

  /* Only one active Search + Filter shell is allowed above a mobile table. */
  .cf-mobile-table-tools > .cf-filter-shell,
  .cf-mobile-table-tools > .ph-filter-shell{
    width:100%!important;
    margin:0!important;
  }
}


/* ClinicFlow v3.4.20 - Pharmacy mobile header title vertically centered like other views. */
@media (max-width:700px){
  body.cf-pharmacy-page .cf-main > .cf-topbar > .cf-mobile-view-title{
    display:flex!important;
    align-items:center!important;
    align-self:center!important;
    min-height:38px!important;
    margin-top:0!important;
    margin-bottom:0!important;
  }
}


/* ClinicFlow v3.4.21 - Item Categories, Units and Brands use Search only (no Filter). */
@media (max-width:700px){
  .cf-mobile-table-tools .ph-filter-shell.cf-no-extra-filters .cf-filter-singleline{
    grid-template-columns:minmax(0,1fr)!important;
  }
  .cf-mobile-table-tools .ph-filter-shell.cf-no-extra-filters .ph-top-search{
    grid-column:1 / -1!important;
    width:100%!important;
  }
}

/* ClinicFlow v3.4.22 - Pharmacy Categories / Units / Brands: fit all table columns on one mobile screen. */
@media (max-width:700px){
  body.cf-pharmacy-route-pharmacy-categories .ph-list-panel .cf-table-wrap,
  body.cf-pharmacy-route-pharmacy-units .ph-list-panel .cf-table-wrap,
  body.cf-pharmacy-route-pharmacy-brands .ph-list-panel .cf-table-wrap{
    overflow-x:hidden!important;
    width:100%!important;
    max-width:100%!important;
  }

  body.cf-pharmacy-route-pharmacy-categories .ph-list-panel .ph-table,
  body.cf-pharmacy-route-pharmacy-units .ph-list-panel .ph-table,
  body.cf-pharmacy-route-pharmacy-brands .ph-list-panel .ph-table{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    table-layout:fixed!important;
  }

  body.cf-pharmacy-route-pharmacy-categories .ph-list-panel .ph-table th,
  body.cf-pharmacy-route-pharmacy-categories .ph-list-panel .ph-table td,
  body.cf-pharmacy-route-pharmacy-units .ph-list-panel .ph-table th,
  body.cf-pharmacy-route-pharmacy-units .ph-list-panel .ph-table td,
  body.cf-pharmacy-route-pharmacy-brands .ph-list-panel .ph-table th,
  body.cf-pharmacy-route-pharmacy-brands .ph-list-panel .ph-table td{
    min-width:0!important;
    max-width:none!important;
    width:auto!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
    word-break:break-word!important;
    padding:9px 7px!important;
    font-size:12px!important;
    line-height:1.25!important;
    vertical-align:middle!important;
  }

  /* Name gets the largest share; status/action stay compact. */
  body.cf-pharmacy-route-pharmacy-categories .ph-table th:nth-child(1),
  body.cf-pharmacy-route-pharmacy-categories .ph-table td:nth-child(1),
  body.cf-pharmacy-route-pharmacy-brands .ph-table th:nth-child(1),
  body.cf-pharmacy-route-pharmacy-brands .ph-table td:nth-child(1){width:52%!important;}
  body.cf-pharmacy-route-pharmacy-categories .ph-table th:nth-child(2),
  body.cf-pharmacy-route-pharmacy-categories .ph-table td:nth-child(2),
  body.cf-pharmacy-route-pharmacy-brands .ph-table th:nth-child(2),
  body.cf-pharmacy-route-pharmacy-brands .ph-table td:nth-child(2){width:24%!important;}
  body.cf-pharmacy-route-pharmacy-categories .ph-table th:nth-child(3),
  body.cf-pharmacy-route-pharmacy-categories .ph-table td:nth-child(3),
  body.cf-pharmacy-route-pharmacy-brands .ph-table th:nth-child(3),
  body.cf-pharmacy-route-pharmacy-brands .ph-table td:nth-child(3){width:24%!important;}

  body.cf-pharmacy-route-pharmacy-units .ph-table th:nth-child(1),
  body.cf-pharmacy-route-pharmacy-units .ph-table td:nth-child(1){width:34%!important;}
  body.cf-pharmacy-route-pharmacy-units .ph-table th:nth-child(2),
  body.cf-pharmacy-route-pharmacy-units .ph-table td:nth-child(2){width:24%!important;}
  body.cf-pharmacy-route-pharmacy-units .ph-table th:nth-child(3),
  body.cf-pharmacy-route-pharmacy-units .ph-table td:nth-child(3){width:20%!important;}
  body.cf-pharmacy-route-pharmacy-units .ph-table th:nth-child(4),
  body.cf-pharmacy-route-pharmacy-units .ph-table td:nth-child(4){width:22%!important;}

  body.cf-pharmacy-route-pharmacy-categories .ph-actions,
  body.cf-pharmacy-route-pharmacy-units .ph-actions,
  body.cf-pharmacy-route-pharmacy-brands .ph-actions{
    white-space:normal!important;
    text-align:center!important;
  }
  body.cf-pharmacy-route-pharmacy-categories .ph-actions .cf-icon-action,
  body.cf-pharmacy-route-pharmacy-units .ph-actions .cf-icon-action,
  body.cf-pharmacy-route-pharmacy-brands .ph-actions .cf-icon-action{
    margin:2px!important;
  }
}


/* ClinicFlow v3.4.24
   Pharmacy mobile master tables: show every field + Actions on one screen.
   Item Categories / Brands = Name | Active | Actions
   Units = Unit Name | Decimal Allowed | Active | Actions
*/
@media (max-width:700px){
  body.cf-pharmacy-route-pharmacy-categories .ph-list-panel .cf-table-wrap,
  body.cf-pharmacy-route-pharmacy-units .ph-list-panel .cf-table-wrap,
  body.cf-pharmacy-route-pharmacy-brands .ph-list-panel .cf-table-wrap{
    overflow-x:hidden!important;
    width:100%!important;
    max-width:100%!important;
  }

  body.cf-pharmacy-route-pharmacy-categories .ph-list-panel .ph-table,
  body.cf-pharmacy-route-pharmacy-units .ph-list-panel .ph-table,
  body.cf-pharmacy-route-pharmacy-brands .ph-list-panel .ph-table{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    table-layout:fixed!important;
  }

  body.cf-pharmacy-route-pharmacy-categories .ph-table thead,
  body.cf-pharmacy-route-pharmacy-categories .ph-table tbody,
  body.cf-pharmacy-route-pharmacy-units .ph-table thead,
  body.cf-pharmacy-route-pharmacy-units .ph-table tbody,
  body.cf-pharmacy-route-pharmacy-brands .ph-table thead,
  body.cf-pharmacy-route-pharmacy-brands .ph-table tbody{
    display:block!important;
    width:100%!important;
  }

  body.cf-pharmacy-route-pharmacy-categories .ph-table tr,
  body.cf-pharmacy-route-pharmacy-brands .ph-table tr{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 64px 72px!important;
    width:100%!important;
    margin:0!important;
  }

  body.cf-pharmacy-route-pharmacy-units .ph-table tr{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 72px 58px 72px!important;
    width:100%!important;
    margin:0!important;
  }

  body.cf-pharmacy-route-pharmacy-categories .ph-table th,
  body.cf-pharmacy-route-pharmacy-categories .ph-table td,
  body.cf-pharmacy-route-pharmacy-units .ph-table th,
  body.cf-pharmacy-route-pharmacy-units .ph-table td,
  body.cf-pharmacy-route-pharmacy-brands .ph-table th,
  body.cf-pharmacy-route-pharmacy-brands .ph-table td{
    display:block!important;
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
    padding:8px 5px!important;
    font-size:10px!important;
    line-height:1.2!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
    word-break:normal!important;
    border:1px solid #cbd6dc!important;
    border-top:0!important;
    position:static!important;
  }

  body.cf-pharmacy-route-pharmacy-categories .ph-table thead th,
  body.cf-pharmacy-route-pharmacy-units .ph-table thead th,
  body.cf-pharmacy-route-pharmacy-brands .ph-table thead th{
    display:flex!important;
    align-items:center!important;
    background:var(--cf-primary)!important;
    color:#fff!important;
    font-weight:700!important;
    border-top:1px solid #263746!important;
  }

  body.cf-pharmacy-route-pharmacy-categories .ph-table td::before,
  body.cf-pharmacy-route-pharmacy-units .ph-table td::before,
  body.cf-pharmacy-route-pharmacy-brands .ph-table td::before{
    content:none!important;
    display:none!important;
  }

  body.cf-pharmacy-route-pharmacy-categories .ph-actions,
  body.cf-pharmacy-route-pharmacy-units .ph-actions,
  body.cf-pharmacy-route-pharmacy-brands .ph-actions{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:3px!important;
    min-width:0!important;
    padding:5px 2px!important;
  }

  body.cf-pharmacy-route-pharmacy-categories .ph-actions .cf-icon-action,
  body.cf-pharmacy-route-pharmacy-units .ph-actions .cf-icon-action,
  body.cf-pharmacy-route-pharmacy-brands .ph-actions .cf-icon-action{
    width:27px!important;
    min-width:27px!important;
    height:27px!important;
    min-height:27px!important;
    padding:0!important;
    margin:0!important;
    font-size:13px!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
  }
}


/* ClinicFlow v3.4.25
   Definitive mobile layout for Pharmacy Categories / Units / Brands.
   Keep the real table structure and force ALL columns to fit within the phone viewport.
*/
@media (max-width:700px){
  body.cf-pharmacy-route-pharmacy-categories .ph-list-panel .cf-table-wrap,
  body.cf-pharmacy-route-pharmacy-units .ph-list-panel .cf-table-wrap,
  body.cf-pharmacy-route-pharmacy-brands .ph-list-panel .cf-table-wrap{
    overflow-x:hidden!important;
    overflow-y:visible!important;
    width:100%!important;
    max-width:100%!important;
  }

  body.cf-pharmacy-route-pharmacy-categories .ph-list-panel table.ph-table,
  body.cf-pharmacy-route-pharmacy-units .ph-list-panel table.ph-table,
  body.cf-pharmacy-route-pharmacy-brands .ph-list-panel table.ph-table{
    display:table!important;
    width:100%!important;
    min-width:100%!important;
    max-width:100%!important;
    table-layout:fixed!important;
    border-collapse:collapse!important;
  }

  body.cf-pharmacy-route-pharmacy-categories .ph-list-panel table.ph-table thead,
  body.cf-pharmacy-route-pharmacy-units .ph-list-panel table.ph-table thead,
  body.cf-pharmacy-route-pharmacy-brands .ph-list-panel table.ph-table thead{
    display:table-header-group!important;
  }

  body.cf-pharmacy-route-pharmacy-categories .ph-list-panel table.ph-table tbody,
  body.cf-pharmacy-route-pharmacy-units .ph-list-panel table.ph-table tbody,
  body.cf-pharmacy-route-pharmacy-brands .ph-list-panel table.ph-table tbody{
    display:table-row-group!important;
  }

  body.cf-pharmacy-route-pharmacy-categories .ph-list-panel table.ph-table tr,
  body.cf-pharmacy-route-pharmacy-units .ph-list-panel table.ph-table tr,
  body.cf-pharmacy-route-pharmacy-brands .ph-list-panel table.ph-table tr{
    display:table-row!important;
    width:auto!important;
  }

  body.cf-pharmacy-route-pharmacy-categories .ph-list-panel table.ph-table th,
  body.cf-pharmacy-route-pharmacy-categories .ph-list-panel table.ph-table td,
  body.cf-pharmacy-route-pharmacy-units .ph-list-panel table.ph-table th,
  body.cf-pharmacy-route-pharmacy-units .ph-list-panel table.ph-table td,
  body.cf-pharmacy-route-pharmacy-brands .ph-list-panel table.ph-table th,
  body.cf-pharmacy-route-pharmacy-brands .ph-list-panel table.ph-table td{
    display:table-cell!important;
    min-width:0!important;
    max-width:none!important;
    padding:7px 4px!important;
    font-size:9px!important;
    line-height:1.15!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
    word-break:normal!important;
    vertical-align:middle!important;
  }

  /* Categories / Brands: Name | Active | Actions */
  body.cf-pharmacy-route-pharmacy-categories .ph-table th:nth-child(1),
  body.cf-pharmacy-route-pharmacy-categories .ph-table td:nth-child(1),
  body.cf-pharmacy-route-pharmacy-brands .ph-table th:nth-child(1),
  body.cf-pharmacy-route-pharmacy-brands .ph-table td:nth-child(1){
    width:52%!important;
  }
  body.cf-pharmacy-route-pharmacy-categories .ph-table th:nth-child(2),
  body.cf-pharmacy-route-pharmacy-categories .ph-table td:nth-child(2),
  body.cf-pharmacy-route-pharmacy-brands .ph-table th:nth-child(2),
  body.cf-pharmacy-route-pharmacy-brands .ph-table td:nth-child(2){
    width:18%!important;
    text-align:center!important;
  }
  body.cf-pharmacy-route-pharmacy-categories .ph-table th:nth-child(3),
  body.cf-pharmacy-route-pharmacy-categories .ph-table td:nth-child(3),
  body.cf-pharmacy-route-pharmacy-brands .ph-table th:nth-child(3),
  body.cf-pharmacy-route-pharmacy-brands .ph-table td:nth-child(3){
    width:30%!important;
    text-align:center!important;
  }

  /* Units: Unit Name | Decimal Allowed | Active | Actions */
  body.cf-pharmacy-route-pharmacy-units .ph-table th:nth-child(1),
  body.cf-pharmacy-route-pharmacy-units .ph-table td:nth-child(1){
    width:38%!important;
  }
  body.cf-pharmacy-route-pharmacy-units .ph-table th:nth-child(2),
  body.cf-pharmacy-route-pharmacy-units .ph-table td:nth-child(2){
    width:22%!important;
    text-align:center!important;
  }
  body.cf-pharmacy-route-pharmacy-units .ph-table th:nth-child(3),
  body.cf-pharmacy-route-pharmacy-units .ph-table td:nth-child(3){
    width:15%!important;
    text-align:center!important;
  }
  body.cf-pharmacy-route-pharmacy-units .ph-table th:nth-child(4),
  body.cf-pharmacy-route-pharmacy-units .ph-table td:nth-child(4){
    width:25%!important;
    text-align:center!important;
  }

  body.cf-pharmacy-route-pharmacy-categories .ph-actions,
  body.cf-pharmacy-route-pharmacy-units .ph-actions,
  body.cf-pharmacy-route-pharmacy-brands .ph-actions{
    display:table-cell!important;
    white-space:normal!important;
    padding:4px 2px!important;
  }

  body.cf-pharmacy-route-pharmacy-categories .ph-actions .cf-icon-action,
  body.cf-pharmacy-route-pharmacy-units .ph-actions .cf-icon-action,
  body.cf-pharmacy-route-pharmacy-brands .ph-actions .cf-icon-action{
    width:25px!important;
    min-width:25px!important;
    height:25px!important;
    min-height:25px!important;
    padding:0!important;
    margin:1px!important;
    font-size:12px!important;
    vertical-align:middle!important;
  }
}


/* v3.4.35 - Pending payment action remains tappable and non-overlapping on mobile. */
@media (max-width: 768px) {
  body.cf-route-appointments-pending-payment .cf-table th:last-child,
  body.cf-route-appointments-pending-payment .cf-table td:last-child {
    width: 128px !important;
    min-width: 128px !important;
    max-width: 128px !important;
  }
  body.cf-route-appointments-pending-payment .cf-receive-payment-btn {
    min-width: 108px !important;
    font-size: 10px !important;
    padding: 6px 8px !important;
  }
}


/* v3.4.36 - Two icon actions in pending payment view on mobile. */
@media (max-width: 768px) {
  body.cf-route-appointments-pending-payment .cf-table th:last-child,
  body.cf-route-appointments-pending-payment .cf-table td:last-child {
    width: 78px !important;
    min-width: 78px !important;
    max-width: 78px !important;
  }
  body.cf-route-appointments-pending-payment .cf-row-actions .cf-btn {
    width: 28px !important;
    min-width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    padding: 5px !important;
  }
}


@media (max-width:768px) {
  #clinicflow-app[data-route="appointments-pending-payment"] .cf-table th:last-child,
  #clinicflow-app[data-route="appointments-pending-payment"] .cf-table td:last-child {
    width:72px!important;
    min-width:72px!important;
    max-width:72px!important;
  }
}


/* v3.4.41 - Scheduled appointment actions stay within the table on smaller screens. */
@media (max-width:768px) {
  #clinicflow-app[data-route="scheduled-appointments"] table.cf-table[data-module="scheduled-appointments"] {
    min-width:1120px!important;
  }
  #clinicflow-app[data-route="scheduled-appointments"] table.cf-table[data-module="scheduled-appointments"] th:last-child,
  #clinicflow-app[data-route="scheduled-appointments"] table.cf-table[data-module="scheduled-appointments"] td:last-child {
    width:174px!important;
    min-width:174px!important;
    max-width:174px!important;
  }
}


/* v3.4.74 - keep Fee / Advance / Balance visible in Scheduled Appointments on mobile. */
@media (max-width:768px) {
  #clinicflow-app[data-route="scheduled-appointments"] table.cf-table[data-module="scheduled-appointments"] { min-width:1400px!important; }
  #clinicflow-app[data-route="scheduled-appointments"] table.cf-table[data-module="scheduled-appointments"] .cf-scheduled-fee,
  #clinicflow-app[data-route="scheduled-appointments"] table.cf-table[data-module="scheduled-appointments"] .cf-scheduled-advance,
  #clinicflow-app[data-route="scheduled-appointments"] table.cf-table[data-module="scheduled-appointments"] .cf-scheduled-balance {
    display:table-cell!important; visibility:visible!important; min-width:92px!important;
  }
}


/* v3.4.77 - Mobile/tablet: Actions is part of the horizontal scroll, never frozen. */
@media (max-width:900px) {
  #clinicflow-app[data-route="scheduled-appointments"] table.cf-table[data-module="scheduled-appointments"] th:last-child,
  #clinicflow-app[data-route="scheduled-appointments"] table.cf-table[data-module="scheduled-appointments"] td:last-child {
    position:static!important;
    left:auto!important;
    right:auto!important;
    z-index:auto!important;
    box-shadow:none!important;
    width:auto!important;
    min-width:174px!important;
    max-width:none!important;
  }
}


/* v3.4.79 - preserve Scheduled Appointment shortfall highlight after responsive rules. */
#clinicflow-app table.cf-table[data-module="scheduled-appointments"] tbody tr.cf-payment-shortfall-row > td {
  background:#fde8e8 !important;
}
