/* CMD P17.1-H2 — compact mobile Dashboard, work queue and request lists. */

body.cmd-p17-mobile {
  --cmd-mobile-row-gap: 8px;
  --cmd-mobile-panel-padding: 12px;
  --cmd-mobile-row-padding: 9px;
}

body.cmd-p17-mobile :is(#dashboardView, #requestsView) {
  color: var(--cmd-color-text);
}

body.cmd-p17-mobile :is(#dashboardView, #requestsView) .panel {
  margin-top: 10px;
  border-radius: 13px;
}

body.cmd-p17-mobile :is(#dashboardView, #requestsView) .panel-header {
  min-height: 0;
  padding: 11px var(--cmd-mobile-panel-padding);
  gap: 8px;
}

body.cmd-p17-mobile :is(#dashboardView, #requestsView) .panel-header h3 {
  font-size: .9rem;
  line-height: 1.25;
}

body.cmd-p17-mobile :is(#dashboardView, #requestsView) :is(small, .muted) {
  font-size: var(--cmd-mobile-caption-font);
  line-height: 1.35;
}

body.cmd-p17-mobile #dashboardView .v7-page-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

body.cmd-p17-mobile #dashboardView .v7-page-intro h3 {
  margin: 0;
  font-size: 1rem;
}

body.cmd-p17-mobile #dashboardView .v7-page-intro p {
  margin: 3px 0 0;
  font-size: var(--cmd-mobile-caption-font);
  line-height: 1.35;
}

body.cmd-p17-mobile #dashboardView .v7-page-intro > .btn {
  max-width: 142px;
  padding-inline: 10px;
}

body.cmd-p17-mobile #dashboardView .stats-grid.v7-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--cmd-mobile-row-gap);
  margin-bottom: 10px;
}

body.cmd-p17-mobile #dashboardView .stats-grid.v7-stats .stat-card {
  display: grid;
  align-content: space-between;
  min-height: 74px;
  padding: 10px 11px;
}

body.cmd-p17-mobile #dashboardView .stats-grid.v7-stats .stat-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

body.cmd-p17-mobile #dashboardView .stats-grid.v7-stats .stat-card small {
  max-width: 100%;
  color: var(--cmd-color-muted);
}

body.cmd-p17-mobile #dashboardView .stats-grid.v7-stats .stat-card strong,
body.cmd-p17-mobile #dashboardView .stats-grid.v7-stats .stat-card strong[style] {
  font-size: .98rem !important;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

body.cmd-p17-mobile #dashboardView .cmd-online-work-center-p11 {
  margin: 10px 0;
}

body.cmd-p17-mobile #dashboardView .cmd-work-summary-p11 {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: thin;
}

body.cmd-p17-mobile #dashboardView :is(.cmd-work-total-p11, .cmd-work-department-p11, .cmd-work-entity-p11) {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 5px 8px;
  font-size: .72rem;
}

body.cmd-p17-mobile #dashboardView :is(.cmd-work-total-p11, .cmd-work-department-p11, .cmd-work-entity-p11) strong {
  font-size: .8rem;
}

body.cmd-p17-mobile #dashboardView .cmd-work-item-p11 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(104px, auto);
  gap: 6px 10px;
  align-items: center;
  padding: var(--cmd-mobile-row-padding) var(--cmd-mobile-panel-padding);
}

body.cmd-p17-mobile #dashboardView .cmd-work-stage-p11 {
  grid-column: 1;
}

body.cmd-p17-mobile #dashboardView .cmd-work-record-p11,
body.cmd-p17-mobile #dashboardView .cmd-work-message-p11 {
  grid-column: 1;
  gap: 2px;
}

body.cmd-p17-mobile #dashboardView .cmd-work-item-p11 > button {
  grid-column: 2;
  grid-row: 1 / 4;
  width: 100%;
  min-width: 104px;
  padding-inline: 8px;
}

body.cmd-p17-mobile #dashboardView .cmd-work-stage-p11 span {
  padding: 3px 7px;
  font-size: .68rem;
}

body.cmd-p17-mobile #dashboardView :is(.cmd-work-record-p11 strong, .cmd-work-message-p11 span) {
  font-size: .8rem;
  line-height: 1.3;
}

body.cmd-p17-mobile #requestsView .v75-module-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 8px;
  /*
   * M50-C H10 mobile gesture boundary:
   * this is a horizontal tab rail only.  Without an explicit y-axis policy,
   * mobile browsers may promote it to a vertical scroll responder and retain
   * an upward swipe inside the rail.  Keep native horizontal tab scrolling,
   * while native vertical panning remains available to the document above it.
   * No JavaScript event cancellation is used here.
   */
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  touch-action: pan-x pan-y;
  flex-wrap: nowrap;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

body.cmd-p17-mobile #requestsView .v75-module-tab {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: .78rem;
  scroll-snap-align: start;
}

body.cmd-p17-mobile #requestsView .v75-module-tab span {
  min-width: 20px;
  height: 20px;
  font-size: .68rem;
}

body.cmd-p17-mobile :is(#dashboardView, #requestsView) .qscm-filter-toolbar-b28 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  gap: 7px;
}

body.cmd-p17-mobile :is(#dashboardView, #requestsView) .qscm-filter-toolbar-b28 > .btn {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 7px 8px !important;
  white-space: normal;
}

body.cmd-p17-mobile :is(#dashboardView, #requestsView) .qscm-filter-toolbar-b28 > .qscm-filter-toggle-b28 {
  order: 1;
}

body.cmd-p17-mobile :is(#dashboardView, #requestsView) .qscm-filter-toolbar-b28 > .qscm-filter-clear-b28 {
  order: 2;
}

body.cmd-p17-mobile :is(#dashboardView, #requestsView) .qscm-filter-toolbar-b28 > .cmd-mobile-filter-primary-p17 {
  order: 3;
  align-self: stretch;
}

body.cmd-p17-mobile :is(#dashboardView, #requestsView) .cmd-mobile-equal-primary-actions-p17 > .cmd-mobile-filter-primary-p17 {
  min-height: 58px;
}

body.cmd-p17-mobile #requestsView .qscm-shared-list-head {
  gap: 8px;
  padding: 9px 10px;
}

body.cmd-p17-mobile #requestsView .qscm-h6-list-actions {
  gap: 7px;
}

body.cmd-p17-mobile #requestsView .qscm-h6-list-actions select {
  min-height: 40px;
  padding-block: 7px;
  font-size: .78rem;
}

@media (max-width: 760px) {
  body.cmd-p17-mobile :is(#dashboardView, #requestsView) .table-wrap:has(> table.cmd-mobile-document-list-p17),
  body.cmd-p17-mobile #dashboardView .table-wrap:has(> table.cmd-mobile-risk-list-p17) {
    overflow: visible;
  }

  body.cmd-p17-mobile table.cmd-mobile-document-list-p17,
  body.cmd-p17-mobile table.cmd-mobile-document-list-p17 tbody,
  body.cmd-p17-mobile table.cmd-mobile-risk-list-p17,
  body.cmd-p17-mobile table.cmd-mobile-risk-list-p17 tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }

  body.cmd-p17-mobile :is(table.cmd-mobile-document-list-p17, table.cmd-mobile-risk-list-p17) thead {
    display: none;
  }

  body.cmd-p17-mobile :is(table.cmd-mobile-document-list-p17, table.cmd-mobile-risk-list-p17) tbody {
    padding: 8px;
  }

  body.cmd-p17-mobile :is(table.cmd-mobile-document-list-p17, table.cmd-mobile-risk-list-p17) tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 10px;
    margin-bottom: 8px;
    padding: 7px 9px;
    border: 1px solid var(--cmd-color-border);
    border-radius: 12px;
    background: var(--cmd-color-surface);
    box-shadow: 0 3px 12px rgba(15, 23, 42, .04);
  }

  body.cmd-p17-mobile :is(table.cmd-mobile-document-list-p17, table.cmd-mobile-risk-list-p17) tbody tr:last-child {
    margin-bottom: 0;
  }

  body.cmd-p17-mobile :is(table.cmd-mobile-document-list-p17, table.cmd-mobile-risk-list-p17) td {
    display: grid;
    align-content: start;
    min-width: 0;
    padding: 5px 0;
    border: 0;
    font-size: .78rem;
    line-height: 1.32;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  body.cmd-p17-mobile :is(table.cmd-mobile-document-list-p17, table.cmd-mobile-risk-list-p17) td::before {
    content: attr(data-label);
    margin-bottom: 2px;
    color: var(--cmd-color-muted);
    font-size: .65rem;
    font-weight: 800;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: .035em;
  }

  body.cmd-p17-mobile table.cmd-mobile-document-list-p17 td:nth-child(1),
  body.cmd-p17-mobile table.cmd-mobile-document-list-p17 td:nth-child(5),
  body.cmd-p17-mobile table.cmd-mobile-risk-list-p17 td:nth-child(1),
  body.cmd-p17-mobile table.cmd-mobile-risk-list-p17 td:last-child {
    grid-column: 1 / -1;
  }

  body.cmd-p17-mobile table.cmd-mobile-document-list-p17 td:last-child {
    align-content: end;
  }

  body.cmd-p17-mobile :is(table.cmd-mobile-document-list-p17, table.cmd-mobile-risk-list-p17) td:empty {
    display: none;
  }

  body.cmd-p17-mobile table.cmd-mobile-document-list-p17 .qscm-request-date-column {
    display: grid !important;
  }

  body.cmd-p17-mobile table.cmd-mobile-document-list-p17 .qscm-request-date-mobile {
    display: none !important;
  }
}

@media (orientation: landscape) and (max-height: 600px) and (max-width: 980px) {
  body.cmd-p17-mobile #dashboardView .stats-grid.v7-stats {
    grid-template-columns: repeat(5, minmax(132px, 1fr));
    overflow-x: auto;
    padding-bottom: 4px;
  }

  body.cmd-p17-mobile #dashboardView .stats-grid.v7-stats .stat-card:last-child:nth-child(odd) {
    grid-column: auto;
  }

  body.cmd-p17-mobile :is(#dashboardView, #requestsView) table.cmd-mobile-document-list-p17 {
    min-width: 980px;
    table-layout: auto;
  }

  body.cmd-p17-mobile #dashboardView table.cmd-mobile-risk-list-p17 {
    min-width: 760px;
  }

  body.cmd-p17-mobile :is(#dashboardView, #requestsView) :is(th, td) {
    padding: 7px 8px;
    font-size: .75rem;
    line-height: 1.3;
  }
}

@media (max-width: 374px) {
  body.cmd-p17-mobile #dashboardView .v7-page-intro {
    grid-template-columns: 1fr;
  }

  body.cmd-p17-mobile #dashboardView .v7-page-intro > .btn {
    width: 100%;
    max-width: none;
  }

  body.cmd-p17-mobile #dashboardView .cmd-work-item-p11 {
    grid-template-columns: 1fr;
  }

  body.cmd-p17-mobile #dashboardView .cmd-work-item-p11 > button {
    grid-column: 1;
    grid-row: auto;
  }
}
