/* CA Portal v1.16.15 — Cross-role Crystal Color Consistency & Readability.
   Scoped to authenticated pages. Presentation only: no hidden items, role changes,
   form interception, dynamic statuses, table reordering or payment logic changes. */
@media screen {
html body.msa-crystal-ui:is(.portal-context-staff,.portal-context-admin,.portal-context-client,.portal-context-associate) {
  --cc-ink:#163f63;
  --cc-subtext:#46657d;
  --cc-blue:#135fa7;
  --cc-teal:#087d75;
  --cc-green:#10744f;
  --cc-amber:#875b12;
  --cc-red:#a42340;
  --cc-line:#d2e2ed;
  --cc-pane:#ffffff;
  --cc-soft:#f3f9fd;
  --cc-shadow:0 8px 26px rgba(22,66,105,.095);
  --cc-focus:#087eaa;
  color:var(--cc-ink);
}
/* Navigation: contrast and consistent interaction across all four workspaces. */
html body.msa-crystal-ui:is(.portal-context-staff,.portal-context-admin,.portal-context-client,.portal-context-associate) .portal-topbar {
  border-bottom:1px solid #cbdce8!important;
  box-shadow:0 4px 16px rgba(20,62,105,.085)!important;
}
html body.msa-crystal-ui .portal-topbar :is(.topnav-link,.topnav-item,.topnav-button) {
  border-radius:12px;
}
html body.msa-crystal-ui .portal-topbar :is(.topnav-link,.topnav-item,.topnav-button):hover {
  background-color:#e8f5fd;
}
html body.msa-crystal-ui .topnav-menu a:hover,
html body.msa-crystal-ui .topnav-menu a:focus-visible {
  background:#e6f6fa!important;color:#144e75!important;
}
/* Low-contrast captions and labels on light document surfaces. */
html body.msa-crystal-ui :is(.muted,.collection-muted,.ep-muted,.pwo-client,.pwo-details,.pwo-footnote,.pwo-heading p,.pwo-empty,.pwo-filter-empty,.cbr-note,.ch-muted,.ch-empty) {
  color:var(--cc-subtext)!important;
}
html body.msa-crystal-ui :is(.card,.form-card,.ep-panel,.ch-panel,.pwo-section,.collection-register,.extra-work-register,.associate-client-card) {
  border-radius:17px;
  box-shadow:var(--cc-shadow);
}
/* Data-first tables: consistent headers, readable amounts, safe horizontal scrolling. */
html body.msa-crystal-ui :is(.table-wrap,.ep-table-scroll,.ep-tracker-table-wrap,.collection-register-scroll,.extra-work-table-wrap,.pwo-table-wrap,.cbr-table-wrap) {
  max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;
  scrollbar-color:#a7c9dc #f1f8fc;scrollbar-width:thin;
}
html body.msa-crystal-ui :is(.portal-fit-table,.collection-register-table,.ep-table,.pwo-table,.extra-work-table) thead th {
  background:linear-gradient(112deg,#e6f4ff,#e9faf4)!important;
  color:#254a64!important;
  border-bottom:1px solid #bfd9e6!important;
  font-weight:800!important;
}
html body.msa-crystal-ui :is(.portal-fit-table,.collection-register-table,.ep-table,.pwo-table,.extra-work-table) tbody tr:hover td {
  background-color:#f0f9fc;
}
html body.msa-crystal-ui :is(.portal-fit-table,.collection-register-table,.ep-table,.pwo-table,.extra-work-table) :is(td,th) {
  line-height:1.45;overflow-wrap:break-word;word-break:normal;
}
/* Executive and staff: 9–11px legacy dashboard captions raised for readability. */
html body.portal-context-staff.msa-crystal-ui .staff-gst-live-top :is(.staff-gst-live-title span,.staff-gst-live-title small) {
  font-size:12px!important;line-height:1.45!important;color:#f0fbff!important;
}
html body.portal-context-staff.msa-crystal-ui .staff-gst-live-grid :is(.gst-live-label,.staff-gst-live-card small) {
  font-size:12px!important;line-height:1.43!important;color:#3f6077!important;
}
html body.portal-context-staff.msa-crystal-ui .staff-gst-live-grid .gst-live-num {
  font-variant-numeric:tabular-nums;
}
html body.portal-context-staff.msa-crystal-ui .staff-crystal-cards .staff-modern-priority-card .priority-copy small {
  font-size:12px!important;line-height:1.5!important;color:#46657d!important;
}
html body.portal-context-staff.msa-crystal-ui .staff-crystal-cards .staff-modern-priority-card .priority-action {
  font-size:12px!important;
}
/* Crystal section headers: retain GST/ITR/Audit semantic colors, improve definition. */
html body.portal-context-staff.msa-crystal-ui :is(.staff-gst-live-top,.staff-modern-hero) {
  border:1px solid rgba(255,255,255,.4);
  box-shadow:0 12px 28px rgba(19,75,119,.15);
}
html body.portal-context-staff.msa-crystal-ui .pwo-section-head,
html body.portal-context-staff.msa-crystal-ui .collection-register-head {
  border-bottom:1px solid #d5e8ef;
}
html body.portal-context-staff.msa-crystal-ui .pwo-section.type-gst .pwo-number{background:#087d66!important}
html body.portal-context-staff.msa-crystal-ui .pwo-section.type-itr .pwo-number{background:#6743a9!important}
html body.portal-context-staff.msa-crystal-ui .pwo-section.type-audit .pwo-number{background:#986010!important}
html body.portal-context-staff.msa-crystal-ui .pwo-work-title{color:#184969!important;font-size:14px!important}
html body.portal-context-staff.msa-crystal-ui .pwo-tag.overdue{background:#ffe8ed!important;color:#9c1835!important}
html body.portal-context-staff.msa-crystal-ui .pwo-tag.waiting{background:#fff1d3!important;color:#85550f!important}
html body.portal-context-staff.msa-crystal-ui .pwo-followup-prev{color:#136650!important}
/* Client GST quick-view: bright but restrained, easy scanning on phones. */
html body.portal-context-client.msa-crystal-ui :is(.cgw-card,.cga-card,.cbr-card,.ch-panel,.ch-business-card,.ch-money-card) {
  border-radius:17px;
  box-shadow:0 7px 22px rgba(19,71,112,.085);
}
html body.portal-context-client.msa-crystal-ui :is(.cgw-label,.cga-label,.cbr-note) {
  color:#395c74!important;
}
html body.portal-context-client.msa-crystal-ui .cbr-card :is(.cbr-source,.cbr-invoice){line-height:1.45}
/* Admin / associate cards: consistent surface treatment without role color changes. */
html body.msa-crystal-ui:is(.portal-context-admin,.portal-context-associate) :is(.stat,.card,.associate-client-card,.assoc-ledger-tile) {
  border-radius:16px;
  box-shadow:0 7px 21px rgba(22,71,109,.085);
}
/* Keep amounts legible and avoid awkward word-by-word wrapping in existing tables. */
html body.msa-crystal-ui :is(.ep-money,.ep-amount,.collection-amount,.staff-modern-priority-card .priority-number) {
  font-variant-numeric:tabular-nums;
}
/* Visible keyboard focus and enough touch target, without changing click handlers. */
html body.msa-crystal-ui :is(a,button,input,select,textarea,summary,[role="button"]):focus-visible {
  outline:3px solid var(--cc-focus)!important;
  outline-offset:3px!important;
}
html body.msa-crystal-ui :is(.btn,.ep-btn,.cbr-btn,.pwo-cta,.pwo-followup summary) {
  border-radius:10px;
  transition:box-shadow .16s ease,filter .16s ease;
}
html body.msa-crystal-ui :is(input,textarea,select):not([type="checkbox"]):not([type="radio"]) {
  border-color:#bdd3e1;
}
html body.msa-crystal-ui :is(input,textarea,select):disabled {
  opacity:.78;cursor:not-allowed;
}
html body.msa-crystal-ui :is(.notice-error,.pwo-message.bad){color:#90253b!important}
html body.msa-crystal-ui :is(.notice-success,.pwo-message.good){color:#0e6647!important}
}
@media screen and (max-width:600px) {
  html body.portal-context-staff.msa-crystal-ui .staff-gst-live-grid .staff-gst-live-card small {
    font-size:11.5px!important;
  }
  html body.msa-crystal-ui :is(.pwo-section,.ep-panel,.ch-panel,.collection-register) {
    border-radius:14px;
  }
  html body.msa-crystal-ui :is(.pwo-tab,.pwo-section-head,.collection-register-head) {
    overflow-wrap:break-word;
  }
}
@media (prefers-reduced-motion:reduce) {
  html body.msa-crystal-ui :is(.btn,.ep-btn,.cbr-btn,.pwo-cta,.pwo-followup summary) {
    transition:none!important;
  }
}
