/* MPMS additions. MPRM's supplied app and sidebar styles are loaded first. */
.mpms-body { min-width: 320px; }
.mpms-body .app-main { min-width: 0; }
.mpms-body .sidebar-mobile-scroll { display: flex; flex-direction: column; flex: 1; }
.mpms-body .sidebar-nav { flex: 0 0 auto; }
.mpms-sidebar-note { display: flex; gap: 12px; margin: 26px 5px; padding: 20px 8px; border-top: 1px solid #ffffff1c; color: #b6cfdf; font-size: 12px; }
.mpms-sidebar-note small, .mpms-sidebar-footer small { display: block; margin-top: 7px; font-size: 11px; font-weight: 400; }
.mpms-sidebar-note svg { width: 22px; flex-shrink: 0; }
.mpms-sidebar-footer { padding: 15px 9px; color: #a6bed0; font-size: 10px; letter-spacing: .06em; }
.mpms-demo { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 1px solid #e8d8a3; border-radius: 12px; background: #fff9e9; color: #6e541b; font-size: 12px; }
.mpms-demo strong { margin-right: 8px; font-size: 10px; letter-spacing: .08em; }
.mpms-demo svg { width: 18px; flex-shrink: 0; }
.mpms-body .accounting-hero h2 { font-size: clamp(24px, 2.2vw, 32px); }
.mpms-body .accounting-hero { grid-template-columns: minmax(0,1.15fr) minmax(290px,.85fr); }
.mpms-body .accounting-hero p { font-size: 13px; }
.mpms-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mpms-summary article { display: flex; gap: 16px; align-items: center; padding: 22px; margin: 0; }
.mpms-summary small { display: block; color: #66768c; font-size: 12px; }
.mpms-summary strong { display: block; color: #132c49; font-size: clamp(22px, 2.2vw, 30px); margin: 5px 0; }
.mpms-stat-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: #eaf2fd; color: #2563eb; flex-shrink: 0; }
.mpms-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.mpms-section-heading h2 { margin: 0; font-size: 21px; color: #132c49; }
.mpms-section-heading p { margin: 6px 0 0; color: #687b90; font-size: 12px; }
.mpms-body .accounting-po-card { grid-template-columns: 130px minmax(0,1fr) auto; gap: 16px; }
.mpms-body .accounting-po-meta { grid-column: 2; grid-row: 2; flex-direction: row; flex-wrap: wrap; gap: 12px; }
.mpms-body .accounting-po-number { grid-row: 1 / 3; }
.mpms-body .accounting-po-actions { grid-column: 3; grid-row: 1 / 3; }
.mpms-body .accounting-po-details { grid-template-columns: .7fr 1.4fr .8fr 1fr; }
.mpms-body .accounting-po-details b { white-space: normal; overflow-wrap: anywhere; }
.mpms-body .btn svg { width: 15px; height: 15px; }
.mpms-body .accounting-filter.mpms-filter { display: grid; grid-template-columns: minmax(150px,1fr) 185px 100px auto auto; gap: 10px; }
.mpms-filter .filter-search { min-width: 0; }
.mpms-filter input { min-width: 0; }
.mpms-filter svg { width: 18px; flex-shrink: 0; }
.mpms-filter .filter-search > svg { display: none; }
.mpms-refresh { display: flex; gap: 7px; align-items: center; color: #2563eb; text-decoration: none; font-size: 12px; font-weight: 700; }
.mpms-refresh svg { width: 15px; }
.mpms-pagination { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #63758b; }
.mpms-pagination div { display: flex; gap: 8px; }
.mpms-panel { padding: 26px; margin: 0; }
.mpms-panel h2 { margin-top: 0; font-size: 22px; }
.mpms-panel p { line-height: 1.7; color: #63758b; font-size: 14px; }
.mpms-detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px; margin-top: 26px; }
.mpms-detail-grid small { display: block; color: #728198; font-size: 11px; margin-bottom: 7px; }
.mpms-detail-grid strong { color: #203750; font-size: 14px; font-weight: 600; white-space: pre-line; overflow-wrap: anywhere; }
.mpms-po-heading { font-size: 30px !important; margin-top: 6px !important; }
.mpms-table-wrap { overflow: auto; }
.mpms-table-wrap table { width: 100%; min-width: 580px; }
.mpms-table-wrap td, .mpms-table-wrap th { padding: 12px; font-size: 13px; }
.mpms-table-wrap td { overflow-wrap: anywhere; max-width: 420px; }
.mpms-numeric { text-align: right !important; white-space: nowrap; }
/* Keep item column headings and native table semantics at every breakpoint.
   MPRM converts generic modern-table rows to unlabeled cards on small screens. */
html body.mpms-body .mpms-table-wrap .modern-table { display: table !important; min-width: 650px !important; table-layout: auto !important; }
html body.mpms-body .mpms-table-wrap .modern-table thead { display: table-header-group !important; }
html body.mpms-body .mpms-table-wrap .modern-table tbody { display: table-row-group !important; width: auto !important; }
html body.mpms-body .mpms-table-wrap .modern-table tr { display: table-row !important; width: auto !important; }
html body.mpms-body .mpms-table-wrap .modern-table td,
html body.mpms-body .mpms-table-wrap .modern-table th { display: table-cell !important; width: auto !important; min-width: 0 !important; padding: 12px !important; }
html body.mpms-body .mpms-table-wrap .modern-table td { text-align: left !important; }
html body.mpms-body .mpms-table-wrap .modern-table td.mpms-numeric { text-align: right !important; }
html body.mpms-body .mpms-table-wrap .modern-table td::before { display: none !important; }
.mpms-totals { max-width: 320px; margin: 24px 0 0 auto; }
.mpms-totals div { display: flex; justify-content: space-between; gap: 20px; padding: 10px; font-size: 13px; }
.mpms-totals dd { margin: 0; font-weight: 600; }
.mpms-totals div:last-child { border-top: 1px solid #dce5ef; font-size: 17px; color: #13456c; background: #f1f6fb; }
.mpms-caption { font-size: 12px !important; }
.mpms-flow { display: flex; justify-content: space-around; align-items: center; gap: 18px; margin-top: 24px; background: #f4f7fb; border-radius: 14px; padding: 24px; color: #497396; }
.mpms-flow div { text-align: center; }
.mpms-flow svg { display: block; margin: 0 auto 10px; }
.mpms-flow strong { display: block; font-size: 13px; }
.mpms-flow small { display: block; margin-top: 6px; font-size: 11px; color: #728198; }
.mpms-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; color: #7b8ca0; font-size: 10px; padding: 8px 0 20px; }
.mpms-skip { position: fixed; left: 10px; top: -80px; z-index: 9999; padding: 12px; background: white; color: #123656; }
.mpms-skip:focus { top: 10px; }
.mpms-body a:focus-visible, .mpms-body button:focus-visible, .mpms-body select:focus-visible, .mpms-body input:focus-visible { outline: 3px solid #169bbc; outline-offset: 3px; }
@media(max-width:1250px) {
  .mpms-body .accounting-hero { grid-template-columns: 1fr; }
  .mpms-body .accounting-hero-stats article { min-height: 72px; }
  .mpms-body .accounting-po-card { grid-template-columns: 115px minmax(0,1fr); }
  .mpms-body .accounting-po-actions { grid-column: 2; grid-row: 3; justify-content: flex-start; }
  .mpms-body .accounting-filter.mpms-filter { grid-template-columns: 1fr 1fr auto; }
  .mpms-filter .filter-search { grid-column: 1 / -1; }
}
@media(max-width:600px) {
  html body.mpms-body .page-content { padding: 16px !important; }
  .mpms-body .header-tools { display: none; }
  .mpms-body .page-header h1 { font-size: 27px; }
  .mpms-summary { grid-template-columns: 1fr; }
  .mpms-body .accounting-hero { padding: 22px; }
  .mpms-body .accounting-po-card { grid-template-columns: 1fr; padding: 18px; }
  .mpms-body .accounting-po-number { grid-row: auto; }
  .mpms-body .accounting-po-details { grid-template-columns: 1fr 1fr; }
  .mpms-body .accounting-po-meta, .mpms-body .accounting-po-actions { grid-row: auto; grid-column: 1; }
  .mpms-body .accounting-filter.mpms-filter { grid-template-columns: 1fr 1fr; }
  .mpms-section-heading { align-items: flex-start; flex-direction: column; }
  .mpms-detail-grid { grid-template-columns: 1fr; }
  .mpms-panel { padding: 20px; }
  .mpms-flow { flex-direction: column; }
  .mpms-flow > span { transform: rotate(90deg); }
}

/* MPMS shell compatibility: keep the exact MPRM sidebar/drawer visual system. */
.mpms-body .mpms-sidebar-logout-form { margin: 0; padding: 0; width: 100%; }
.mpms-body .mpms-sidebar-logout-form .sidebar-logout { appearance: none; -webkit-appearance: none; font: inherit; cursor: pointer; }
.mpms-body .sidebar-brand-logo { object-fit: cover; }
@media (max-width: 900px) {
  .mpms-body .page-header { padding-left: 20px; padding-right: 20px; }
}
