/* Objectif PN portal: fluid workspace, accessible actions and contained tables. */
body.opn-portal {
  --opn-portal-blue: #1d4ed8;
  --opn-portal-ink: #17233b;
  --opn-portal-line: #dce4ef;
  background: #f4f7fb;
  color: var(--opn-portal-ink);
}
body.opn-portal #page.grid-container,
body.opn-portal .inside-header.grid-container {
  width: calc(100% - 64px);
  max-width: 1680px;
  margin-inline: auto;
  box-sizing: border-box;
}
body.opn-portal #page .site-content { gap: 24px; }
body.opn-portal #page #primary {
  flex: 1 1 0%;
  width: auto;
  min-width: 0;
  padding: 0 !important;
}
body.opn-portal #page :is(#right-sidebar, #left-sidebar) {
  flex: 0 0 248px;
  width: 248px;
  min-width: 0;
}
body.opn-portal #page .site-main {
  min-width: 0;
  margin: 24px 0;
  padding: 0 !important;
}
body.opn-portal #page .inside-article {
  min-width: 0;
  padding: 28px;
  border: 1px solid var(--opn-portal-line);
  border-radius: 18px;
  box-shadow: 0 4px 18px rgba(23,35,59,.035);
}
body.opn-portal #page :is(.entry-content, .wp-block-post-content, .elementor-widget-container) {
  min-width: 0;
  max-width: 100%;
}
body.opn-portal #page .entry-content { margin-top: 24px; }
body.opn-portal #page .entry-header[style*="display: none"] + .entry-content,
body.opn-portal #page .opn-ui-hidden-page-title-wrap + .entry-content { margin-top: 0; }
body.opn-portal #page .entry-title { font-size: clamp(26px, 2.4vw, 36px); line-height: 1.2; }
body.opn-portal #page .inside-right-sidebar { margin-block: 24px; }
body.opn-portal #page .sidebar .widget {
  padding: 18px;
  border: 1px solid var(--opn-portal-line);
  border-radius: 16px;
  font-size: 14px;
}
body.opn-portal #page .sidebar .widget_nav_menu li { margin: 0; }
body.opn-portal #page .sidebar .widget_nav_menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  color: #334e76;
}
body.opn-portal #page .sidebar .widget_nav_menu a:hover,
body.opn-portal #page .sidebar .current-menu-item > a { background: #edf3ff; color: #1d4ed8; }

/* The payment module previously escaped its column with 94vw and translateX. */
body.opn-portal #page #pt-app {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}
body.opn-portal #page .entry-content :is(.opn-ui-wrap,.opn-suite-dashboard,.opn-suite-settings,.pt-wrap,.ei-admin-wrap,.opn-dgac-wrap,.eac-ccav-wrap,.esm-wrap,.tem-wrap,.ets-wrap,.idm-console-wrap,.idm-admin-wrap,.opn-cbt-wrap,.opn-td-wrap,.eac-tfm,.opn-tfm,.tmcad-wrap,.msd-container,.opn-pending-users-wrap,.enroll-manager-base-wrap):not(.opn-ai-floating) {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin-inline: 0 !important;
  padding-inline: 0 !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}
body.opn-portal #page :is(.ei-form-container,.um-register,.um-login) {
  max-width: 860px !important;
  margin-inline: auto !important;
}
body.opn-portal #page :is(.opn-ui-toolbar,.pt-controls,.pt-filters,.pt-card-head,.pt-comm-row,.esm-toolbar,.tmcad-actions,.tmcad-filters) {
  flex-wrap: wrap !important;
  gap: 10px !important;
}
body.opn-portal #page :is(.pt-controls,.pt-filters) > * { min-width: 0; max-width: 100%; }
body.opn-portal #page :is(.opn-ui-hero__content,.pt-hero > div,.pt-card-id) { min-width: 0; }
body.opn-portal #page :is(.pt-hero,.opn-ui-hero,.ei-hero,.eac-tfm-hero) {
  border-radius: 16px !important;
  box-shadow: 0 4px 14px rgba(23,35,59,.10) !important;
}
body.opn-portal #page :is(.opn-ui-panel,.pt-panel,.pt-imp-card,.opn-suite-card) {
  box-shadow: 0 2px 10px rgba(23,35,59,.04) !important;
}

/* Scroll only the table region, keeping page actions and navigation reachable. */
body.opn-portal #page :is(.opn-ui-table-scroll,.opn-portal-table-scroll,.pt-table-wrap,.ei-table-shell,.eac-tfm-table-wrap,.table-responsive,.wp-list-table-wrapper) {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: auto !important;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #edf2f7;
  box-sizing: border-box;
}
body.opn-portal #page :is(.opn-ui-table-scroll,.opn-portal-table-scroll) > table {
  width: 100%;
  margin-bottom: 0;
}
body.opn-portal #page :is(.opn-ui-table-scroll,.opn-portal-table-scroll):focus-visible {
  outline: 3px solid #3b82f6;
  outline-offset: 3px;
}
body.opn-portal #page :is(input,select,textarea) { box-sizing: border-box; max-width: 100%; }
body.opn-portal #page :is(input[type="text"],input[type="email"],input[type="password"],input[type="search"],input[type="date"],input[type="tel"],input[type="number"],select,textarea):not(.elfinder *) {
  border-radius: 9px;
  border-color: #cbd5e1;
}
body.opn-portal #page #ppc_passcode { width: min(100%, 420px); min-height: 46px; margin-top: 8px; }

/* One consistent button scale; existing action classes keep their meaning. */
body.opn-portal #page #pt-app :is(button,input[type="submit"],input[type="button"],a.button,.btn),
body.opn-portal #page .entry-content :is(button,input[type="submit"],input[type="button"],input[type="reset"],a.button,a.um-button,.btn):not(.elfinder *):not(.opn-ai-launcher):not(.opn-ai-close):not(.ui-dialog-titlebar-close) {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px !important;
  max-width: 100%;
  padding: 10px 16px !important;
  border: 1px solid var(--opn-button-border, var(--opn-button-bg, #1d4ed8)) !important;
  border-radius: 10px !important;
  background: var(--opn-button-bg, #1d4ed8) !important;
  color: var(--opn-button-fg, #fff) !important;
  box-shadow: 0 2px 5px rgba(15,23,42,.10) !important;
  font-family: inherit !important;
  font-size: 14px !important;
  font-weight: 650 !important;
  line-height: 1.35 !important;
  white-space: normal !important;
  text-align: center;
  text-decoration: none !important;
  box-sizing: border-box;
  cursor: pointer;
  transition: background-color .16s ease, box-shadow .16s ease;
}
body.opn-portal #page :is(.opn-ui-action--green,.pt-save,.pt-confirm,.btn-success,[data-ei-accept]) { --opn-button-bg: #15803d; }
body.opn-portal #page :is(.opn-ui-action--red,.button-link-delete,.pt-btn-del,.pt-btn-reset-all,[data-ei-reject],[data-ei-trash]) { --opn-button-bg: #b91c1c; }
body.opn-portal #page :is(.opn-ui-action--orange,.pt-reconcile,.pt-edit) { --opn-button-bg: #b45309; }
body.opn-portal #page :is(.opn-ui-action--purple,.details-btn,.tm-expand-btn,[data-ei-toggle],[data-channel="sms"]) { --opn-button-bg: #6d28d9; }
body.opn-portal #page [data-channel="both"] { --opn-button-bg: #0f766e; }
body.opn-portal #page #pt-app :is(.pt-btn--save,.pt-pay-add-btn,.pt-pay-save) { --opn-button-bg: #15803d; }
body.opn-portal #page #pt-app :is(.pt-btn--danger,.pt-mini--danger) { --opn-button-bg: #b91c1c; }
body.opn-portal #page #pt-app :is(.pt-session-pdf,.pt-session-pdf-detailed,.pt-btn--ghost) { --opn-button-bg: #475569; }
body.opn-portal #page #pt-app .pt-reconcile { --opn-button-bg: #6d28d9; }
body.opn-portal #page #pt-app :is(.pt-imp-preview,.pt-btn--restore,.pt-mini--restore) { --opn-button-bg: #0f766e; }
body.opn-portal #page #pt-app .pt-toggle-trash { --opn-button-bg: #b45309; }
body.opn-portal #page #pt-app .pt-card-head { flex-wrap: wrap !important; }
body.opn-portal #page #pt-app .pt-stats { flex-wrap: wrap !important; max-width: 100%; min-width: 0; }
body.opn-portal #page :is(.opn-ui-action--ghost,.um-alt,.pt-toggle) { --opn-button-bg: #f1f5f9; --opn-button-fg: #334155; --opn-button-border: #cbd5e1; }
body.opn-portal #page .entry-content :is(button,.button,.btn,input[type="submit"],input[type="button"]):hover {
  filter: brightness(.96) !important;
  transform: none !important;
}
body.opn-portal #page .entry-content :is(button,.button,.btn,input,select,textarea):focus-visible,
body.opn-portal .opn-my-cbt-button > a:focus-visible {
  outline: 3px solid #fbbf24 !important;
  outline-offset: 3px;
}
body.opn-portal #page .entry-content :is(button,input,.button):disabled,
body.opn-portal #page .entry-content [aria-disabled="true"] {
  opacity: .55;
  cursor: not-allowed;
  box-shadow: none !important;
}
body.opn-portal #page .entry-content :is(.pt-mini,.pt-toggle,.opn-ui-row-expand-toggle) { padding: 8px 10px !important; min-width: 42px; }

body.opn-portal .inside-header { padding: 24px 0; gap: 24px; flex-wrap: wrap; }
body.opn-portal .site-branding-container { min-width: 0; max-width: 100%; gap: 18px; }
body.opn-portal .site-branding-container .site-logo { margin: 0; }
body.opn-portal .site-branding { min-width: 0; }
body.opn-portal .site-header .header-image { width: 210px; }
body.opn-portal .main-title { font-size: 24px; }
body.opn-portal .main-navigation { border-radius: 12px; }
body.opn-portal .main-navigation .main-nav > ul { flex-wrap: wrap; align-items: center; padding: 6px; }
body.opn-portal .main-navigation .main-nav > ul > li > a {
  line-height: 1.4;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
}
body.opn-portal .main-navigation .main-nav ul ul { width: 260px; border-radius: 10px; }
body.opn-portal .main-navigation .main-nav ul ul li a { overflow-wrap: anywhere; }
body.opn-portal .main-navigation .main-nav .opn-my-cbt-button > a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 2px 4px;
  padding: 10px 18px;
  border: 1px solid #c4b5fd;
  background: #ede9fe;
  color: #4c1d95;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(15,23,42,.10);
}
body.opn-portal .main-navigation .main-nav .opn-my-cbt-button > a:hover { background: #ddd6fe; color: #4c1d95; }

@media (max-width: 1100px) {
  body.opn-portal #page .site-content { flex-wrap: wrap; gap: 0; }
  body.opn-portal #page #primary { flex: 1 0 100%; width: 100%; }
  body.opn-portal #page :is(#right-sidebar,#left-sidebar) { flex: 1 0 100%; width: 100%; }
  body.opn-portal #page .inside-right-sidebar { margin-top: 0; }
}
@media (max-width: 768px) {
  body.opn-portal #page.grid-container,
  body.opn-portal .inside-header.grid-container { width: calc(100% - 24px); }
  body.opn-portal #page .inside-article { padding: 16px; border-radius: 12px; }
  body.opn-portal #page .site-main { margin-block: 16px; }
  body.opn-portal .inside-header { gap: 14px; padding-block: 18px; }
  body.opn-portal .site-branding-container { flex-wrap: wrap; justify-content: center; gap: 12px; width: 100%; }
  body.opn-portal .main-title { font-size: 21px; }
  body.opn-portal .main-navigation { width: 100%; }
  body.opn-portal .main-navigation .main-nav > ul { padding: 6px; }
  body.opn-portal .main-navigation .main-nav ul ul { width: auto; }
  body.opn-portal .main-navigation .main-nav .opn-my-cbt-button > a { margin: 8px; }
  body.opn-portal #page :is(.pt-hero,.opn-ui-hero,.ei-hero) { padding: 18px !important; }
  body.opn-portal #page .pt-hero { flex-wrap: wrap !important; gap: 16px !important; }
  body.opn-portal #page :is(.pt-controls,.pt-filters) > label { flex: 1 1 100%; width: 100%; }
  body.opn-portal #page .entry-content :is(.opn-ui-hero__title,.pt-hero h1,.pt-hero h2) { font-size: 24px !important; overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) {
  body.opn-portal #page .entry-content :is(button,.button,.btn) { transition: none !important; }
}
@media print {
  body.opn-portal #page.grid-container { width: 100%; max-width: none; }
  body.opn-portal #page :is(.opn-ui-table-scroll,.opn-portal-table-scroll) { overflow: visible !important; }
}
