/*
  FOODOS_WINDOWS_RESPONSIVE_V84_23
  Scope: desktop / Windows sized viewports only.
  Mobile-first UI remains untouched because every rule is inside min-width breakpoints.
*/

@media (min-width: 900px) {
  html,
  body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  body {
    min-height: 100vh !important;
  }

  header.glass {
    flex: 0 0 64px !important;
    min-height: 64px !important;
    padding-inline: clamp(24px, 4vw, 56px) !important;
  }

  header.glass #logo-box {
    width: 38px !important;
    height: 38px !important;
    border-radius: 12px !important;
  }

  header.glass #app-title {
    max-width: min(36vw, 420px) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  main#app-container {
    width: min(100%, 1280px) !important;
    max-width: 1280px !important;
    margin-inline: auto !important;
    padding: 22px 28px 112px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    min-width: 0 !important;
  }

  main#app-container > * {
    min-width: 0 !important;
  }

  nav.glass {
    left: 50% !important;
    right: auto !important;
    bottom: 18px !important;
    width: min(520px, calc(100vw - 56px)) !important;
    height: 68px !important;
    transform: translateX(-50%) !important;
    border-radius: 24px !important;
    border: 1px solid rgba(226, 232, 240, 0.95) !important;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14) !important;
    overflow: hidden !important;
  }

  nav.glass .nav-item {
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
  }

  .category-tabs,
  .modern-tabs,
  .inv-tabs2,
  .pc-om-tabs,
  .pc-filter-tabs,
  .cc-filter-strip,
  .pc-acc-chip-row {
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: thin !important;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)) !important;
    gap: 14px !important;
    align-items: stretch !important;
  }

  .product-card:not(.product-card-admin) {
    height: auto !important;
    min-height: 136px !important;
  }

  .table-wrap,
  .inv-table-wrap,
  .pc-transaction-table-wrap,
  #server-reports-box,
  .pc-om-card,
  .pc-acc-card-panel {
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
  }

  table {
    max-width: 100% !important;
  }

  .modal-overlay,
  #pc-credit-sale-modal.pc-modal-overlay,
  #pc-person-info-modal.pc-modal-overlay,
  #pc-person-settlement-modal.pc-modal-overlay {
    align-items: center !important;
    justify-content: center !important;
    padding: 24px !important;
  }

  .modal-content,
  .pc-person-modal,
  .pc-credit-sale-dialog,
  .pc-om-modal-panel,
  .cc-sheet {
    width: min(560px, calc(100vw - 48px)) !important;
    max-width: min(560px, calc(100vw - 48px)) !important;
    max-height: calc(100vh - 72px) !important;
    border-radius: 24px !important;
    animation: none !important;
    overflow: auto !important;
  }

  #receipt-modal .modal-content {
    width: min(390px, calc(100vw - 48px)) !important;
    max-width: min(390px, calc(100vw - 48px)) !important;
  }

  #pos-modal .modal-content,
  #auth-modal .modal-content {
    width: min(360px, calc(100vw - 48px)) !important;
    max-width: min(360px, calc(100vw - 48px)) !important;
  }

  .toast-stack {
    left: 50% !important;
    right: auto !important;
    bottom: 104px !important;
    width: min(560px, calc(100vw - 56px)) !important;
    transform: translateX(-50%) !important;
  }

  .side-menu-panel {
    width: min(380px, 92vw) !important;
  }

  .pc-module-topbar,
  .pc-acc-topbar,
  .pc-unified-head {
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-radius: 24px !important;
    border-top: 1px solid rgba(226, 232, 240, .9) !important;
    top: 0 !important;
  }

  .pc-module-top-title p,
  .pc-acc-top-title p {
    white-space: normal !important;
    line-height: 1.65 !important;
  }

  .pc-subpage-shell,
  .pc-settings-page,
  .inv-page,
  .repPro-page.pc-subpage-shell,
  .tcA-shell,
  .pc-recipes-page.pc-subpage-shell,
  .pc-persons-page,
  .pc-om-page,
  .cc-shell,
  .pc-accounts-page {
    width: 100% !important;
    max-width: none !important;
    margin-inline: 0 !important;
    min-width: 0 !important;
  }

  .pc-page-toolbar {
    justify-content: space-between !important;
  }

  .pc-page-toolbar-actions,
  .pc-om-actions,
  .pc-courier-actions,
  .cc-inline-actions,
  .pc-acc-btn-row {
    flex-wrap: wrap !important;
  }

  .btn,
  .pc-om-btn,
  .cc-btn,
  .pc-acc-btn,
  .pc-person-btn,
  .comm-btn {
    min-width: 0 !important;
  }
}

@media (min-width: 900px) {
  body[data-foodos-route="pos"] main#app-container {
    display: block !important;
  }

  body[data-foodos-route="pos"] .category-tabs {
    margin-bottom: 16px !important;
    padding: 2px 2px 12px !important;
  }

  body[data-foodos-route="pos"] .tab-btn {
    min-height: 38px !important;
    padding-inline: 18px !important;
  }

  body[data-foodos-route="pos"] .pos-cart-summary {
    max-width: 720px !important;
    margin-inline: auto !important;
    margin-bottom: 14px !important;
  }

  body[data-foodos-route="pos"] .pos-cart-summary + div {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
    gap: 12px !important;
    overflow: visible !important;
    padding-bottom: 18px !important;
  }

  body[data-foodos-route="pos"] .pos-cart-item {
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 108px !important;
    margin-left: 0 !important;
  }

  body[data-foodos-route="pos"] .pos-cart-item-name,
  body[data-foodos-route="pos"] .pos-product-name {
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
  }
}

@media (min-width: 1100px) {
  body[data-foodos-route="pos"] .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)) !important;
  }
}

@media (min-width: 900px) {
  body[data-foodos-route="orders"] .orders-list-container {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)) !important;
    gap: 14px !important;
    align-items: stretch !important;
  }

  body[data-foodos-route="orders"] .comm-card {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
  }

  body[data-foodos-route="orders"] .comm-body {
    flex: 1 1 auto !important;
  }

  body[data-foodos-route="orders"] .comm-footer,
  body[data-foodos-route="orders"] .pc-online-stage-actions {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important;
    gap: 8px !important;
  }

  body[data-foodos-route="orders"] .modern-tabs {
    max-width: 520px !important;
    margin-inline: auto !important;
  }
}

@media (min-width: 900px) {
  body[data-foodos-route="products"] .pm-products {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)) !important;
    gap: 14px !important;
  }

  body[data-foodos-route="products"] .product-card.product-card-admin.admin-card-fixed {
    width: 100% !important;
    max-width: none !important;
    min-height: 124px !important;
  }

  body[data-foodos-route="products"] .pc-page-toolbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 12px !important;
    align-items: center !important;
  }
}

@media (min-width: 900px) {
  body[data-foodos-route="inventory"] .inv-page .summary-bar,
  body:has(.inv-page) .inv-page .summary-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  body[data-foodos-route="inventory"] .inv-page .ing-grid,
  body:has(.inv-page) .inv-page .ing-grid {
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)) !important;
    gap: 14px !important;
  }

  body[data-foodos-route="inventory"] .inv-grid,
  body:has(.inv-page) .inv-grid {
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)) !important;
    gap: 14px !important;
  }

  body[data-foodos-route="inventory"] .pc-inv-toolbar,
  body:has(.inv-page) .pc-inv-toolbar {
    display: grid !important;
    grid-template-columns: minmax(260px, 1fr) auto !important;
    gap: 12px !important;
    align-items: center !important;
  }

  body[data-foodos-route="inventory"] .pc-inv-chips,
  body:has(.inv-page) .pc-inv-chips {
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
  }
}

@media (min-width: 900px) {
  body[data-foodos-route="recipes"] .pc-recipes-search-wrap,
  body:has(.pc-recipes-page) .pc-recipes-search-wrap {
    max-width: 720px !important;
    margin-inline: auto !important;
  }

  body[data-foodos-route="recipes"] .pc-recipes-list,
  body:has(.pc-recipes-page) .pc-recipes-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)) !important;
    gap: 14px !important;
    align-items: start !important;
  }

  body[data-foodos-route="recipes"] .pc-recipes-top-actions,
  body:has(.pc-recipes-page) .pc-recipes-top-actions {
    display: flex !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
  }
}

@media (min-width: 900px) {
  body[data-foodos-route="reports"] .repPro-kpiGrid,
  body.pc-reports-active .repPro-kpiGrid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  body[data-foodos-route="reports"] .repPro-area,
  body.pc-reports-active .repPro-area {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
  }

  body[data-foodos-route="reports"] .repPro-area > .repPro-head,
  body.pc-reports-active .repPro-area > .repPro-head,
  body[data-foodos-route="reports"] .repPro-area > .repPro-kpiGrid,
  body.pc-reports-active .repPro-area > .repPro-kpiGrid,
  body[data-foodos-route="reports"] .repPro-area > .repPro-actions,
  body.pc-reports-active .repPro-area > .repPro-actions,
  body[data-foodos-route="reports"] .repPro-area > #server-reports-box,
  body.pc-reports-active .repPro-area > #server-reports-box {
    grid-column: 1 / -1 !important;
  }

  body[data-foodos-route="reports"] .dashboard-grid,
  body.pc-reports-active .dashboard-grid,
  body[data-foodos-route="reports"] #dashboard-content-new .repPro-profitGrid,
  body.pc-reports-active #dashboard-content-new .repPro-profitGrid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
  }
}

@media (min-width: 900px) {
  body[data-foodos-route="settings"] .pc-settings-grid,
  body.pc-settings-active .pc-settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-foodos-route="settings"] .pc-settings-grid > .pc-settings-data-card,
  body.pc-settings-active .pc-settings-grid > .pc-settings-data-card,
  body[data-foodos-route="settings"] .pc-settings-grid > .full,
  body.pc-settings-active .pc-settings-grid > .full {
    grid-column: 1 / -1 !important;
  }

  body[data-foodos-route="settings"] .pc-settings-actions-grid,
  body.pc-settings-active .pc-settings-actions-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  body[data-foodos-route="settings"] .pc-settings-actions-grid .full,
  body.pc-settings-active .pc-settings-actions-grid .full {
    grid-column: 1 / -1 !important;
  }
}

@media (min-width: 900px) {
  body[data-foodos-route="terminal"] .tcA-grid,
  body.pc-terminal-active .tcA-grid {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)) !important;
  }

  body[data-foodos-route="terminal"] .tcA-summary,
  body.pc-terminal-active .tcA-summary {
    max-width: 720px !important;
    margin-inline: auto !important;
  }
}

@media (min-width: 900px) {
  body[data-foodos-route="online-menu"] .pc-om-grid,
  body.pc-online-menu-settings-active .pc-om-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-foodos-route="online-menu"] .pc-om-kpis,
  body.pc-online-menu-settings-active .pc-om-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  body[data-foodos-route="online-menu"] .pc-om-product,
  body.pc-online-menu-settings-active .pc-om-product,
  body[data-foodos-route="online-menu"] .pc-om-table,
  body.pc-online-menu-settings-active .pc-om-table {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 12px !important;
    align-items: center !important;
  }

  body[data-foodos-route="online-menu"] .pc-om-category-accordion,
  body.pc-online-menu-settings-active .pc-om-category-accordion {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)) !important;
  }

  body[data-foodos-route="online-menu"] .pc-om-slide-card__body,
  body.pc-online-menu-settings-active .pc-om-slide-card__body {
    grid-template-columns: 220px minmax(0, 1fr) !important;
  }

  body[data-foodos-route="online-menu"] .pc-om-slide-fields,
  body.pc-online-menu-settings-active .pc-om-slide-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 900px) {
  body[data-foodos-route="persons"] .pc-person-summary,
  body:has(.pc-persons-page) .pc-person-summary {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }

  body[data-foodos-route="persons"] .pc-person-toolbar,
  body:has(.pc-persons-page) .pc-person-toolbar {
    display: grid !important;
    grid-template-columns: minmax(320px, 1fr) auto !important;
    gap: 12px !important;
    align-items: center !important;
  }

  body[data-foodos-route="persons"] .pc-person-list,
  body[data-foodos-route="persons"] .pc-transaction-list,
  body:has(.pc-persons-page) .pc-person-list,
  body:has(.pc-persons-page) .pc-transaction-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)) !important;
    gap: 14px !important;
  }

  body[data-foodos-route="persons"] .pc-person-detail-grid,
  body:has(.pc-persons-page) .pc-person-detail-grid,
  body[data-foodos-route="persons"] .pc-form-grid,
  body:has(.pc-persons-page) .pc-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-foodos-route="persons"] .pc-form-field.full,
  body:has(.pc-persons-page) .pc-form-field.full {
    grid-column: 1 / -1 !important;
  }
}

@media (min-width: 900px) {
  body[data-foodos-route="accounts"] main#app-container,
  body:has(.pc-accounts-page) main#app-container {
    max-width: 1180px !important;
  }

  body[data-foodos-route="accounts"] .pc-acc-summary-3,
  body:has(.pc-accounts-page) .pc-acc-summary-3,
  body[data-foodos-route="accounts"] .pc-acc-insight-grid,
  body:has(.pc-accounts-page) .pc-acc-insight-grid,
  body[data-foodos-route="accounts"] .pc-acc-quick-grid,
  body:has(.pc-accounts-page) .pc-acc-quick-grid,
  body[data-foodos-route="accounts"] .pc-acc-metric-grid,
  body:has(.pc-accounts-page) .pc-acc-metric-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  }

  body[data-foodos-route="accounts"] .pc-acc-carousel,
  body:has(.pc-accounts-page) .pc-acc-carousel {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 14px !important;
    overflow: visible !important;
  }

  body[data-foodos-route="accounts"] .pc-acc-list,
  body:has(.pc-accounts-page) .pc-acc-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)) !important;
    gap: 14px !important;
  }

  body[data-foodos-route="accounts"] .pc-acc-bottom-nav,
  body:has(.pc-accounts-page) .pc-acc-bottom-nav {
    left: 50% !important;
    right: auto !important;
    bottom: 92px !important;
    width: min(620px, calc(100vw - 56px)) !important;
    transform: translateX(-50%) !important;
    border-radius: 24px !important;
  }
}

@media (min-width: 900px) {
  body[data-foodos-route="couriers"] .pc-courier-grid,
  body:has(.pc-couriers-page) .pc-courier-grid,
  body[data-foodos-route="couriers"] .pc-courier-list,
  body:has(.pc-couriers-page) .pc-courier-list,
  body[data-foodos-route="couriers"] .pc-courier-orders,
  body:has(.pc-couriers-page) .pc-courier-orders {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)) !important;
    gap: 14px !important;
  }

  body[data-foodos-route="couriers"] .pc-courier-stats,
  body:has(.pc-couriers-page) .pc-courier-stats {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  }
}

@media (min-width: 900px) {
  body[data-foodos-route="customer-club"] .cc-action-hero,
  body:has(.cc-shell) .cc-action-hero {
    grid-template-columns: minmax(0, 1.5fr) minmax(220px, .65fr) !important;
  }

  body[data-foodos-route="customer-club"] .cc-kpi-grid,
  body:has(.cc-shell) .cc-kpi-grid,
  body[data-foodos-route="customer-club"] .cc-report-grid,
  body:has(.cc-shell) .cc-report-grid,
  body[data-foodos-route="customer-club"] .cc-finance-grid,
  body:has(.cc-shell) .cc-finance-grid,
  body[data-foodos-route="customer-club"] .cc-quick-grid,
  body:has(.cc-shell) .cc-quick-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
  }

  body[data-foodos-route="customer-club"] .cc-customer-list,
  body:has(.cc-shell) .cc-customer-list,
  body[data-foodos-route="customer-club"] .cc-row-list,
  body:has(.cc-shell) .cc-row-list,
  body[data-foodos-route="customer-club"] .cc-report-list,
  body:has(.cc-shell) .cc-report-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)) !important;
    gap: 14px !important;
  }

  body[data-foodos-route="customer-club"] .cc-form-shell,
  body:has(.cc-shell) .cc-form-shell {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(280px, .55fr) !important;
    gap: 14px !important;
  }

  body[data-foodos-route="customer-club"] .cc-inline-two,
  body:has(.cc-shell) .cc-inline-two,
  body[data-foodos-route="customer-club"] .cc-form-grid,
  body:has(.cc-shell) .cc-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 1400px) {
  main#app-container {
    max-width: 1380px !important;
  }

  body[data-foodos-route="pos"] .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)) !important;
  }

  body[data-foodos-route="orders"] .orders-list-container,
  body[data-foodos-route="persons"] .pc-person-list,
  body:has(.pc-persons-page) .pc-person-list,
  body[data-foodos-route="accounts"] .pc-acc-list,
  body:has(.pc-accounts-page) .pc-acc-list {
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)) !important;
  }
}

@media (min-width: 900px) and (max-width: 1180px) {
  main#app-container {
    padding-inline: 20px !important;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
  }

  body[data-foodos-route="reports"] .repPro-area,
  body.pc-reports-active .repPro-area,
  body[data-foodos-route="settings"] .pc-settings-grid,
  body.pc-settings-active .pc-settings-grid,
  body[data-foodos-route="online-menu"] .pc-om-grid,
  body.pc-online-menu-settings-active .pc-om-grid {
    grid-template-columns: 1fr !important;
  }

  body[data-foodos-route="persons"] .pc-person-summary,
  body:has(.pc-persons-page) .pc-person-summary,
  body[data-foodos-route="reports"] .repPro-kpiGrid,
  body.pc-reports-active .repPro-kpiGrid,
  body[data-foodos-route="online-menu"] .pc-om-kpis,
  body.pc-online-menu-settings-active .pc-om-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 899px) {
  /* Intentional no-op: mobile keeps the original Food OS UI. */
}
