/* 2026-12-01: mobile layout fixes for Digitmax Finance (admin + freelancer portal). Desktop is unchanged. */

/* Admin: the main column could not shrink below its widest table, so the whole page became ~750px wide on phones. */
.shell-frame { max-width: 100vw; }
.shell-main { min-width: 0; }
/* Wide tables scroll sideways inside their own box instead of widening the page. */
main div:has(> table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 640px) {
  /* Admin top bar */
  .shell-header { padding-left: 12px; padding-right: 12px; }
  .shell-header > div:last-child { gap: 10px; }
  .health-pill { display: none !important; }
  main { padding: 12px !important; padding-bottom: 32px !important; }
  .panel-card { padding: 16px !important; }

  /* Freelancer portal top bar: everything stays on one line inside the screen */
  header.px-6.py-4 { padding: 10px 12px !important; gap: 8px; }
  header.px-6.py-4 > div:first-child { min-width: 0; gap: 8px; }
  header.px-6.py-4 > div:first-child > div:first-child { flex-shrink: 0; width: 34px; height: 34px; }
  header.px-6.py-4 > div:first-child > div:last-child { min-width: 0; }
  header.px-6.py-4 h1, header.px-6.py-4 p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  header.px-6.py-4 h1 { font-size: 15px; }
  header.px-6.py-4 > div:last-child { gap: 8px !important; flex-shrink: 0; }
  header.px-6.py-4 > div:last-child > button:first-child { padding: 6px 10px; }
  header.px-6.py-4 button.hover\:text-rose-400 { font-size: 0; gap: 0; } /* Sign Out: icon only */

  /* Freelancer ticket counters: 3 per row instead of 5 full-width cards */
  .grid.sm\:grid-cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px !important; }
  .grid.sm\:grid-cols-5 > div { padding: 10px !important; }

  /* 16px inputs stop iPhone from zooming into a field */
  input, select, textarea { font-size: 16px !important; }

  /* Room at the bottom so the chat bubble does not cover the last buttons */
  body { padding-bottom: 72px; }
}