/* Cache-busted mobile override for the production static host. */
@media (max-width: 980px) {
  html, body { width: 100%; max-width: 100%; overflow-x: clip; }
  .app-shell { width: 100%; min-width: 0; grid-template-columns: minmax(0, 1fr); padding: 0 0 calc(104px + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .main-shell { width: 100%; min-width: 0; min-height: 100dvh; margin: 0; padding: 28px 24px; overflow: hidden; }
  .admin-page, .page-stack, .admin-page > *, .page-stack > * { min-width: 0; }
  .admin-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .admin-metric, .admin-metric:first-child { min-width: 0; padding: 0; border-left: 0; }
  .admin-grid-two, .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .admin-table { width: 100%; max-width: 100%; overscroll-behavior-inline: contain; }
  .mobile-more-button { display: grid; font: inherit; }
  .mobile-menu-backdrop { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; padding: 12px 12px max(12px, env(safe-area-inset-bottom)); background: rgba(5, 12, 8, .46); backdrop-filter: blur(4px); }
  .mobile-more-menu { width: 100%; max-height: min(78dvh, 620px); border: 1px solid var(--border); border-radius: 10px; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; color: var(--text); background: var(--card); box-shadow: 0 18px 48px rgba(0, 0, 0, .22); }
  .mobile-more-menu > header { min-height: 64px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 14px; }
  .mobile-more-menu > header div { min-width: 0; display: grid; gap: 2px; }
  .mobile-more-menu > header strong, .mobile-more-menu > header span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-more-menu > header strong { font-size: 15px; }
  .mobile-more-menu > header span { color: var(--muted); font-size: 11px; }
  .mobile-more-menu > header button { width: 38px; height: 38px; border: 0; border-radius: 7px; display: grid; place-items: center; color: var(--text); background: var(--row); }
  .mobile-more-menu > nav { min-height: 0; display: grid; align-content: start; gap: 4px; padding: 10px; overflow-y: auto; }
  .mobile-more-menu > nav a, .mobile-more-menu > footer button { min-height: 46px; border: 0; border-radius: 7px; display: flex; align-items: center; gap: 12px; padding: 0 12px; color: var(--text); background: transparent; font-size: 13px; font-weight: 650; text-align: left; }
  .mobile-more-menu > nav a.active { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
  .mobile-more-menu > footer { border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px; }
  .mobile-more-menu > footer button { background: var(--row); }
  .mobile-more-menu > footer button.danger { color: var(--exit-red); }
}

@media (max-width: 760px) {
  .main-shell { padding: 20px 16px 24px; }
  .admin-page { gap: 20px; }
  .admin-header { width: 100%; align-items: stretch; flex-direction: column; gap: 16px; padding-bottom: 18px; }
  .admin-header h1 { font-size: 28px; }
  .admin-header p { margin-top: 5px; font-size: 13px; }
  .admin-header-actions { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .admin-header-actions .admin-search { width: 100%; }
  .admin-header-actions .admin-add-button { width: 100%; grid-column: 1 / -1; }
  .admin-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; background: var(--card); }
  .admin-metric, .admin-metric:first-child { min-height: 108px; padding: 14px; border: 0; border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
  .admin-metric:nth-child(-n + 2) { border-top: 0; }
  .admin-metric:nth-child(odd) { border-left: 0; }
  .admin-metric span { font-size: 9px; line-height: 1.25; }
  .admin-metric strong { font-size: 25px; }
  .admin-metric p { font-size: 10px; line-height: 1.35; }
  .admin-block, .admin-panel { width: 100%; min-width: 0; padding: 16px; }
  .admin-section-header, .ops-list-heading { width: 100%; align-items: flex-start; flex-direction: column; gap: 8px; margin-bottom: 14px; }
  .admin-section-header h2, .admin-panel h2 { font-size: 17px; }
  .admin-grid-two { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .admin-filters { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .admin-filters > *, .admin-filters label, .admin-filter-select, .week-switcher { width: 100%; max-width: none; }
  .week-switcher { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; }
  .shifts-table { overflow: visible; }
  .shifts-table .admin-table-head { display: none; }
  .shifts-table .admin-table-row { min-width: 0; min-height: 0; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 14px; padding: 14px 0; }
  .shifts-table .admin-table-row > :first-child { grid-column: 1 / -1; }
  .shifts-table .admin-table-row > :nth-child(2)::before, .shifts-table .admin-table-row > :nth-child(3)::before, .shifts-table .admin-table-row > :nth-child(4)::before { display: block; margin-bottom: 3px; color: var(--muted); font-size: 9px; font-weight: 700; }
  .shifts-table .admin-table-row > :nth-child(2)::before { content: "ZAKÁZKA"; }
  .shifts-table .admin-table-row > :nth-child(3)::before { content: "PŘÍCHOD"; }
  .shifts-table .admin-table-row > :nth-child(4)::before { content: "DOBA"; }
  .shifts-table .empty-state, .empty-state { width: 100%; min-width: 0; }
  .empty-state p, .empty-state strong, .recent-row strong, .recent-row span { white-space: normal; overflow-wrap: anywhere; }
  .progress-list, .recent-list { margin-top: 14px; }
  .mobile-nav { left: 8px; right: 8px; bottom: max(8px, env(safe-area-inset-bottom)); width: auto; min-width: 0; min-height: 68px; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 6px 4px; border-radius: 8px; }
  .mobile-nav-item { min-width: 0; gap: 3px; font-size: 9px; line-height: 1.15; text-align: center; }
  .mobile-nav-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .voice-fab { width: 52px; height: 52px; }
  .voice-fab svg { width: 25px; height: 25px; }
  .missing-checkout-row { min-width: 0; }
}

@media (max-width: 380px) {
  .main-shell { padding-inline: 12px; }
  .admin-header-actions { grid-template-columns: minmax(0, 1fr) 40px; }
  .admin-metric { padding: 12px; }
  .mobile-nav-item { font-size: 8px; }
}
