/* Shared responsive layer. Existing desktop declarations remain authoritative. */
.portal-mobile-menu-toggle,
.console-mobile-menu-toggle,
.console-mobile-menu-backdrop { display: none; }

@media (max-width: 720px) {
  body.portal-app { padding: 10px; }
  .portal-app *, .portal-app *::before, .portal-app *::after { box-sizing: border-box; }
  .portal-app > .card { padding: 14px; width: 100%; min-width: 0; }
  #content-area, #result, .console-main, .console-page, #pageBody { min-width: 0; }
  #result p { overflow-wrap: anywhere; }
  .portal-mobile-menu-toggle, .console-mobile-menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; padding: 10px 14px; gap: 8px;
    background: white; color: #111827; border: 1px solid #d1d5db;
    border-radius: 8px; font: inherit; cursor: pointer;
  }
  .portal-mobile-menu-toggle { width: 100%; margin-top: 12px; }
  #portalMenuPanel { display: none; }
  #portalMenuPanel.mobile-menu-open { display: block; }
  #portalMenuPanel .menu-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  #portalMenuPanel .menu-card { width: 100%; min-width: 0; min-height: 105px; padding: 14px 8px; }
  #portalMenuPanel .menu-title { font-size: 14px; overflow-wrap: anywhere; }
  #portalMenuPanel .menu-icon { font-size: 28px; }

  .portal-app #content-area > div,
  #lionParcelDashboard.lion-view-1,
  #codDashboard,
  #content-area .pickup-layout-1,
  #content-area .outgoing-layout-20,
  .shared-finance-style-78,
  .shared-finance-style-93 { max-width: 100%; padding: 14px; }
  .portal-app input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  .portal-app select, .portal-app textarea,
  .console-input, .console-select, .console-search-input {
    max-width: 100%; min-width: 0; font-size: 16px; min-height: 44px;
  }
  .portal-app button, .console-button, .console-menu { min-height: 44px; }
  .portal-app input[type="checkbox"], .portal-app input[type="radio"] { min-height: auto; }
  .shared-dashboard-toolbar, .employee-directory-toolbar,
  .console-form-grid, .console-detail-grid, .console-session-detail-grid,
  .shared-finance-style-1, .shared-finance-style-5, .shared-finance-style-8,
  .shared-finance-style-12, .shared-finance-style-23, .shared-finance-style-44,
  .shared-finance-style-56, .shared-finance-style-94, .shared-finance-style-97,
  .shared-finance-style-105, .shared-finance-style-107, .shared-finance-style-108,
  .shared-finance-style-114, .shared-finance-style-119,
  #transactionFilter .shared-finance-style-94, #globalModal .shared-finance-style-94,
  #globalModal .shared-finance-style-97, #globalModal .shared-finance-style-105,
  #globalModal .shared-finance-style-107, #globalModal .shared-finance-style-108,
  #globalModal .shared-finance-style-114, #globalModal .shared-finance-style-119,
  #codDashboard .cod-layout-1,
  #lionParcelDashboard .lion-view-7, #lionParcelDashboard .lion-view-10,
  #content-area .pickup-layout-2, #content-area .pickup-layout-4,
  #content-area .outgoing-layout-23, #outgoingDetailModal .outgoing-layout-14,
  #outgoingDetailModal .outgoing-layout-27,
  #customerDatabaseDashboard .customer-db-style-3,
  #customerDatabaseDashboard .customer-db-style-7, #globalModal .customer-db-style-7,
  #deliveryMonitoringDashboard .dm-view-10,
  #rankingDashboard .ranking-view-5, #rankingDashboard .ranking-view-8,
  .nz-filters { grid-template-columns: minmax(0,1fr); }
  .shared-finance-style-99 { grid-column: 1 / -1; }
  .shared-dashboard-search { grid-column: auto; }
  .shared-finance-style-5 > *, .shared-finance-style-56 > *,
  #lionParcelFilter > *, .console-toolbar-filters > * { min-width: 0; }
  .console-toolbar, .console-toolbar-left, .console-toolbar-right,
  .console-toolbar-filters, .console-toolbar-actions { flex-wrap: wrap; min-width: 0; max-width: 100%; }
  .console-toolbar-filters > *, .console-toolbar-actions > * { flex: 1 1 160px; max-width: 100%; }
  .console-toolbar { align-items: stretch; flex-direction: column; }
  .shared-dashboard-actions, .shared-finance-style-11, .shared-finance-style-14,
  .shared-finance-style-26, .shared-finance-style-57, .shared-finance-style-77,
  .shared-table-wrapper, .console-table-wrapper, .console-data-grid-table,
  .nz-table-wrap { max-width: 100%; overflow: auto; overscroll-behavior-x: contain; }
  /* Shared table sizing is owned by css/shared-table.css. */
  .shared-table-scroll { max-height: 65dvh; }
  .shared-pagination { flex-direction: column; align-items: stretch; gap: 12px; }
  .shared-pagination-left, .shared-pagination-controls { flex-wrap: wrap; justify-content: center; margin-left: 0; }
  .shared-pagination-controls { width: 100%; }
  .shared-pagination-page-info { min-width: 0; }
  .shared-tabs, .console-tabs { max-width: 100%; overflow-x: auto; }
  .global-modal-overlay { padding: 8px; }
  .global-modal { max-width: 100% !important; max-height: calc(100dvh - 16px); }
  .global-modal-header, .global-modal-body, .global-modal-footer { padding: 14px; min-width: 0; }
  .global-modal-header, .global-modal-footer { flex-shrink: 0; }
  .global-modal-footer { flex-wrap: wrap; }
  .global-modal-footer button { flex: 1 1 120px; }
  .global-modal-close { flex: 0 0 44px; width: 44px; height: 44px; }
  .global-modal-body { min-height: 0; }
  .console-modal-content { max-height: 96dvh; display: flex; flex-direction: column; }
  .console-modal-header, .console-modal-footer { flex-shrink: 0; }
  .console-modal-body { min-height: 0; max-height: none; flex: 1 1 auto; overflow: auto; }
  .attendance-calendar-panel { width: calc(100% - 16px); padding: 10px; max-height: 96dvh; }
  #attendanceCalendarModal .attendance-calendar-grid { gap: 3px; }
  #attendanceCalendarModal .attendance-calendar-day { padding: 3px; min-height: 72px; }
  #attendanceCalendarModal .attendance-calendar-status { font-size: 10px; }
  .payroll-attendance-period, .payroll-attendance-context { min-width: 0; flex-basis: 100%; }

  .console-layout, .console-layout.sidebar-collapsed { grid-template-columns: minmax(0,1fr); }
  #consoleHeader { padding: 12px; gap: 10px; flex-wrap: wrap; }
  #consoleHeader h1 { font-size: 20px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
  .console-account { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
  .console-account-identity { margin-right: auto; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  #consoleContent, .console-layout.sidebar-collapsed #consoleContent { padding: 12px; }
  .console-layout #consoleSidebar,
  .console-layout.sidebar-collapsed #consoleSidebar {
    display: none; position: fixed; inset: 0 auto 0 0; width: min(86vw,320px);
    height: 100dvh; overflow-y: auto; z-index: 10002;
    border-right: 1px solid #e5e7eb; background: #fff;
  }
  .console-layout.mobile-menu-open #consoleSidebar { display: block; }
  .console-layout.mobile-menu-open .console-mobile-menu-backdrop {
    display: block; position: fixed; inset: 0; width: 100%; height: 100%;
    z-index: 10001; background: rgba(15,23,42,.5); border: 0; padding: 0;
  }
  .console-mobile-menu-open { overflow: hidden; }
  .console-layout #consoleSidebar nav, .console-layout.sidebar-collapsed #consoleSidebar nav {
    display: block; padding: 8px 12px; overflow: visible;
  }
  .console-layout.sidebar-collapsed .console-logo,
  .console-layout.sidebar-collapsed .console-group,
  .console-layout.sidebar-collapsed .console-menu-label { display: block; }
  .console-layout #consoleSidebar .console-menu { justify-content: flex-start; margin: 0 0 4px; padding: 10px 12px; font-size: 14px; }
}


